Merge "Avoid unexpected state changes for enhanced preferences" am: 7f6271364b am: 6891dd4590 am: 423f9801e9 am: 2532a70ba1

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/1425491

Change-Id: I89308bbe2a0305f1d2a1a06da9f936e21c8bf6cd
This commit is contained in:
Treehugger Robot
2020-09-28 03:07:24 +00:00
committed by Automerger Merge Worker
3 changed files with 9 additions and 0 deletions

View File

@@ -225,6 +225,9 @@ public class Enhanced4gBasePreferenceController extends TelephonyTogglePreferenc
if (SubscriptionManager.isValidSubscriptionId(subId)) {
mTelephonyManager = mTelephonyManager.createForSubscriptionId(subId);
}
// assign current call state so that it helps to show correct preference state even
// before first onCallStateChanged() by initial registration.
mCallState = mTelephonyManager.getCallState(subId);
mTelephonyManager.listen(this, PhoneStateListener.LISTEN_CALL_STATE);
final long supportedRadioBitmask = mTelephonyManager.getSupportedRadioAccessFamily();

View File

@@ -182,6 +182,9 @@ public class VideoCallingPreferenceController extends TelephonyTogglePreferenceC
if (SubscriptionManager.isValidSubscriptionId(subId)) {
mTelephonyManager = mTelephonyManager.createForSubscriptionId(subId);
}
// assign current call state so that it helps to show correct preference state even
// before first onCallStateChanged() by initial registration.
mCallState = mTelephonyManager.getCallState(subId);
mTelephonyManager.listen(this, PhoneStateListener.LISTEN_CALL_STATE);
}

View File

@@ -210,6 +210,9 @@ public class WifiCallingPreferenceController extends TelephonyBasePreferenceCont
public void register(Context context, int subId) {
mTelephonyManager = getTelephonyManager(context, subId);
// assign current call state so that it helps to show correct preference state even
// before first onCallStateChanged() by initial registration.
mCallState = mTelephonyManager.getCallState(subId);
mTelephonyManager.listen(this, PhoneStateListener.LISTEN_CALL_STATE);
}