Avoid unexpected state changes for enhanced preferences
Assigning current call state to mCallState right before registering PhoneStateListener so that the preferences have correct state before first onCallStateChanged() by initial registration even. Bug: 166307650 Test: Check the preferences state when onStop() -> onStart() Change-Id: I861a687497ba4da7a845540fd92ae2b865392d60 Signed-off-by: Taesu Lee <taesu82.lee@samsung.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user