Search in sources :

Example 6 with OnLifecycleEvent

use of androidx.lifecycle.OnLifecycleEvent in project Resurrection_packages_apps_Settings by ResurrectionRemix.

the class HideNonSystemOverlayMixin method onStop.

@OnLifecycleEvent(ON_STOP)
public void onStop() {
    if (mActivity == null || !isEnabled()) {
        return;
    }
    final Window window = mActivity.getWindow();
    final WindowManager.LayoutParams attrs = window.getAttributes();
    attrs.privateFlags &= ~SYSTEM_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS;
    window.setAttributes(attrs);
}
Also used : Window(android.view.Window) WindowManager(android.view.WindowManager) OnLifecycleEvent(androidx.lifecycle.OnLifecycleEvent)

Example 7 with OnLifecycleEvent

use of androidx.lifecycle.OnLifecycleEvent in project android_packages_apps_Settings by omnirom.

the class VolumePanel method onResume.

/**
 * Invoked when the panel is resumed.
 */
@OnLifecycleEvent(ON_RESUME)
public void onResume() {
    final IntentFilter filter = new IntentFilter();
    filter.addAction(MediaOutputConstants.ACTION_CLOSE_PANEL);
    mContext.registerReceiver(mReceiver, filter);
}
Also used : IntentFilter(android.content.IntentFilter) OnLifecycleEvent(androidx.lifecycle.OnLifecycleEvent)

Example 8 with OnLifecycleEvent

use of androidx.lifecycle.OnLifecycleEvent in project android_packages_apps_Settings by omnirom.

the class NetworkProviderDownloadedSimListController method onResume.

@OnLifecycleEvent(ON_RESUME)
public void onResume() {
    mChangeListener.start();
    IntentFilter filter = new IntentFilter();
    filter.addAction(TelephonyManager.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED);
    mContext.registerReceiver(mDataSubscriptionChangedReceiver, filter);
    update();
}
Also used : IntentFilter(android.content.IntentFilter) OnLifecycleEvent(androidx.lifecycle.OnLifecycleEvent)

Example 9 with OnLifecycleEvent

use of androidx.lifecycle.OnLifecycleEvent in project android_packages_apps_Settings by omnirom.

the class BluetoothTetherPreferenceController method onStart.

@OnLifecycleEvent(Lifecycle.Event.ON_START)
public void onStart() {
    mBluetoothState = BluetoothAdapter.getDefaultAdapter().getState();
    mContext.registerReceiver(mBluetoothChangeReceiver, new IntentFilter(BluetoothAdapter.ACTION_STATE_CHANGED));
}
Also used : IntentFilter(android.content.IntentFilter) OnLifecycleEvent(androidx.lifecycle.OnLifecycleEvent)

Example 10 with OnLifecycleEvent

use of androidx.lifecycle.OnLifecycleEvent in project android_packages_apps_Settings by omnirom.

the class TetherEnabler method onStart.

@OnLifecycleEvent(Lifecycle.Event.ON_START)
public void onStart() {
    mDataSaverBackend.addListener(this);
    mSwitchWidgetController.setListener(this);
    mSwitchWidgetController.startListening();
    final IntentFilter filter = new IntentFilter(TetheringManager.ACTION_TETHER_STATE_CHANGED);
    filter.addAction(WifiManager.WIFI_AP_STATE_CHANGED_ACTION);
    filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
    mContext.registerReceiver(mTetherChangeReceiver, filter);
    mTetheringEventCallback = new TetheringManager.TetheringEventCallback() {

        @Override
        public void onTetheredInterfacesChanged(List<String> interfaces) {
            updateState(interfaces.toArray(new String[interfaces.size()]));
        }
    };
    mTetheringManager.registerTetheringEventCallback(new HandlerExecutor(mMainThreadHandler), mTetheringEventCallback);
    mOnStartTetheringCallback = new OnStartTetheringCallback(this);
    updateState(null);
}
Also used : IntentFilter(android.content.IntentFilter) HandlerExecutor(android.os.HandlerExecutor) TetheringManager(android.net.TetheringManager) OnLifecycleEvent(androidx.lifecycle.OnLifecycleEvent)

Aggregations

OnLifecycleEvent (androidx.lifecycle.OnLifecycleEvent)12 IntentFilter (android.content.IntentFilter)10 TetheringManager (android.net.TetheringManager)1 Handler (android.os.Handler)1 HandlerExecutor (android.os.HandlerExecutor)1 Window (android.view.Window)1 WindowManager (android.view.WindowManager)1 RotationPolicy (com.android.internal.view.RotationPolicy)1 MobileDataContentObserver (com.android.settings.network.MobileDataContentObserver)1 SubscriptionsChangeListener (com.android.settings.network.SubscriptionsChangeListener)1