use of androidx.lifecycle.OnLifecycleEvent in project android_packages_apps_Settings by omnirom.
the class SmartAutoRotateController method onStart.
@OnLifecycleEvent(ON_START)
public void onStart() {
mContext.registerReceiver(mReceiver, new IntentFilter(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED));
if (mRotationPolicyListener == null) {
mRotationPolicyListener = new RotationPolicy.RotationPolicyListener() {
@Override
public void onChange() {
updateState(mPreference);
}
};
}
RotationPolicy.registerRotationPolicyListener(mContext, mRotationPolicyListener);
}
use of androidx.lifecycle.OnLifecycleEvent in project android_packages_apps_Settings by omnirom.
the class CategoryMixin method onResume.
/**
* Resume Lifecycle event
*/
@OnLifecycleEvent(ON_RESUME)
public void onResume() {
final IntentFilter filter = new IntentFilter(Intent.ACTION_PACKAGE_ADDED);
filter.addAction(Intent.ACTION_PACKAGE_REMOVED);
filter.addAction(Intent.ACTION_PACKAGE_CHANGED);
filter.addAction(Intent.ACTION_PACKAGE_REPLACED);
filter.addDataScheme(DATA_SCHEME_PKG);
mContext.registerReceiver(mPackageReceiver, filter);
updateCategories();
}
use of androidx.lifecycle.OnLifecycleEvent in project android_packages_apps_Settings by omnirom.
the class SimStatusDialogController method onResume.
/**
* OnResume lifecycle event, resume listening for phone state or subscription changes.
*/
@OnLifecycleEvent(Event.ON_RESUME)
public void onResume() {
if (mSubscriptionInfo == null) {
return;
}
mTelephonyManager = mTelephonyManager.createForSubscriptionId(mSubscriptionInfo.getSubscriptionId());
mTelephonyManager.registerTelephonyCallback(mContext.getMainExecutor(), mTelephonyCallback);
mSubscriptionManager.addOnSubscriptionsChangedListener(mContext.getMainExecutor(), mOnSubscriptionsChangedListener);
registerImsRegistrationCallback(mSubscriptionInfo.getSubscriptionId());
if (mShowLatestAreaInfo) {
updateAreaInfoText();
mContext.registerReceiver(mAreaInfoReceiver, new IntentFilter(CellBroadcastIntents.ACTION_AREA_INFO_UPDATED));
}
mIsRegisteredListener = true;
}
use of androidx.lifecycle.OnLifecycleEvent in project android_packages_apps_Settings by omnirom.
the class NetworkProviderSimListController 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 Resurrection_packages_apps_Settings by ResurrectionRemix.
the class AccessibilityHearingAidPreferenceController method onResume.
@OnLifecycleEvent(Event.ON_RESUME)
public void onResume() {
if (mHearingAidProfileSupported) {
IntentFilter filter = new IntentFilter();
filter.addAction(BluetoothHearingAid.ACTION_CONNECTION_STATE_CHANGED);
filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
mContext.registerReceiver(mHearingAidChangedReceiver, filter);
}
}
Aggregations