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);
}
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);
}
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();
}
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));
}
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);
}
Aggregations