Merge "[Settings] Replacing SubscriptionManager#addOnSubscriptionsChangedListener API" into rvc-dev am: 9a0f633600
Change-Id: I42831f5540acd25bc6129ca14ad42b1717cf9e98
This commit is contained in:
@@ -268,7 +268,8 @@ public class SimStatusDialogController implements LifecycleObserver, OnResume, O
|
||||
PhoneStateListener.LISTEN_DATA_CONNECTION_STATE
|
||||
| PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
|
||||
| PhoneStateListener.LISTEN_SERVICE_STATE);
|
||||
mSubscriptionManager.addOnSubscriptionsChangedListener(mOnSubscriptionsChangedListener);
|
||||
mSubscriptionManager.addOnSubscriptionsChangedListener(
|
||||
mContext.getMainExecutor(), mOnSubscriptionsChangedListener);
|
||||
registerImsRegistrationCallback(mSubscriptionInfo.getSubscriptionId());
|
||||
|
||||
if (mShowLatestAreaInfo) {
|
||||
|
||||
@@ -266,6 +266,12 @@ public abstract class ActiveSubsciptionsListener
|
||||
mCachedActiveSubscriptionInfo = null;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
void registerForSubscriptionsChange() {
|
||||
getSubscriptionManager().addOnSubscriptionsChangedListener(
|
||||
mContext.getMainExecutor(), this);
|
||||
}
|
||||
|
||||
private void monitorSubscriptionsChange(boolean on) {
|
||||
if (on) {
|
||||
if (!mCacheState.compareAndSet(STATE_NOT_LISTENING, STATE_PREPARING)) {
|
||||
@@ -277,7 +283,7 @@ public abstract class ActiveSubsciptionsListener
|
||||
}
|
||||
mContext.registerReceiver(mSubscriptionChangeReceiver,
|
||||
mSubscriptionChangeIntentFilter, null, new Handler(mLooper));
|
||||
getSubscriptionManager().addOnSubscriptionsChangedListener(this);
|
||||
registerForSubscriptionsChange();
|
||||
mCacheState.compareAndSet(STATE_PREPARING, STATE_LISTENING);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -67,7 +67,8 @@ public class SubscriptionsChangeListener extends ContentObserver {
|
||||
}
|
||||
|
||||
public void start() {
|
||||
mSubscriptionManager.addOnSubscriptionsChangedListener(mSubscriptionsChangedListener);
|
||||
mSubscriptionManager.addOnSubscriptionsChangedListener(
|
||||
mContext.getMainExecutor(), mSubscriptionsChangedListener);
|
||||
mContext.getContentResolver()
|
||||
.registerContentObserver(mAirplaneModeSettingUri, false, this);
|
||||
final IntentFilter radioTechnologyChangedFilter = new IntentFilter(
|
||||
|
||||
Reference in New Issue
Block a user