Loading src/com/android/settings/wifi/calling/WifiCallingSettingsForSub.java +7 −21 Original line number Diff line number Diff line Loading @@ -94,7 +94,6 @@ public class WifiCallingSettingsForSub extends SettingsPreferenceFragment private ListWithEntrySummaryPreference mButtonWfcRoamingMode; private Preference mUpdateAddress; private boolean mValidListener = false; private boolean mEditableWfcMode = true; private boolean mEditableWfcRoamingMode = true; private boolean mUseWfcHomeModeForRoaming = false; Loading @@ -104,7 +103,7 @@ public class WifiCallingSettingsForSub extends SettingsPreferenceFragment private ProvisioningManager mProvisioningManager; private TelephonyManager mTelephonyManager; private final PhoneTelephonyCallback mTelephonyCallback = new PhoneTelephonyCallback(); private PhoneTelephonyCallback mTelephonyCallback; private class PhoneTelephonyCallback extends TelephonyCallback implements TelephonyCallback.CallStateListener { Loading Loading @@ -418,27 +417,20 @@ public class WifiCallingSettingsForSub extends SettingsPreferenceFragment @Override public void onResume() { super.onResume(); updateBody(); final Context context = getActivity(); if (queryImsState(mSubId).isWifiCallingSupported()) { Context context = getActivity(); if (mTelephonyCallback == null && queryImsState(mSubId).isWifiCallingSupported()) { mTelephonyCallback = new PhoneTelephonyCallback(); getTelephonyManagerForSub(mSubId).registerTelephonyCallback( context.getMainExecutor(), mTelephonyCallback); mSwitchBar.addOnSwitchChangeListener(this); mValidListener = true; } context.registerReceiver(mIntentReceiver, mIntentFilter, Context.RECEIVER_EXPORTED_UNAUDITED); final Intent intent = getActivity().getIntent(); if (intent.getBooleanExtra(Phone.EXTRA_KEY_ALERT_SHOW, false)) { showAlert(intent); } // Register callback for provisioning changes. registerProvisioningChangedCallback(); } Loading @@ -446,19 +438,13 @@ public class WifiCallingSettingsForSub extends SettingsPreferenceFragment @Override public void onPause() { super.onPause(); final Context context = getActivity(); if (mValidListener) { mValidListener = false; Context context = getActivity(); if (mTelephonyCallback != null) { getTelephonyManagerForSub(mSubId).unregisterTelephonyCallback(mTelephonyCallback); mTelephonyCallback = null; mSwitchBar.removeOnSwitchChangeListener(this); } context.unregisterReceiver(mIntentReceiver); // Remove callback for provisioning changes. unregisterProvisioningChangedCallback(); } Loading Loading
src/com/android/settings/wifi/calling/WifiCallingSettingsForSub.java +7 −21 Original line number Diff line number Diff line Loading @@ -94,7 +94,6 @@ public class WifiCallingSettingsForSub extends SettingsPreferenceFragment private ListWithEntrySummaryPreference mButtonWfcRoamingMode; private Preference mUpdateAddress; private boolean mValidListener = false; private boolean mEditableWfcMode = true; private boolean mEditableWfcRoamingMode = true; private boolean mUseWfcHomeModeForRoaming = false; Loading @@ -104,7 +103,7 @@ public class WifiCallingSettingsForSub extends SettingsPreferenceFragment private ProvisioningManager mProvisioningManager; private TelephonyManager mTelephonyManager; private final PhoneTelephonyCallback mTelephonyCallback = new PhoneTelephonyCallback(); private PhoneTelephonyCallback mTelephonyCallback; private class PhoneTelephonyCallback extends TelephonyCallback implements TelephonyCallback.CallStateListener { Loading Loading @@ -418,27 +417,20 @@ public class WifiCallingSettingsForSub extends SettingsPreferenceFragment @Override public void onResume() { super.onResume(); updateBody(); final Context context = getActivity(); if (queryImsState(mSubId).isWifiCallingSupported()) { Context context = getActivity(); if (mTelephonyCallback == null && queryImsState(mSubId).isWifiCallingSupported()) { mTelephonyCallback = new PhoneTelephonyCallback(); getTelephonyManagerForSub(mSubId).registerTelephonyCallback( context.getMainExecutor(), mTelephonyCallback); mSwitchBar.addOnSwitchChangeListener(this); mValidListener = true; } context.registerReceiver(mIntentReceiver, mIntentFilter, Context.RECEIVER_EXPORTED_UNAUDITED); final Intent intent = getActivity().getIntent(); if (intent.getBooleanExtra(Phone.EXTRA_KEY_ALERT_SHOW, false)) { showAlert(intent); } // Register callback for provisioning changes. registerProvisioningChangedCallback(); } Loading @@ -446,19 +438,13 @@ public class WifiCallingSettingsForSub extends SettingsPreferenceFragment @Override public void onPause() { super.onPause(); final Context context = getActivity(); if (mValidListener) { mValidListener = false; Context context = getActivity(); if (mTelephonyCallback != null) { getTelephonyManagerForSub(mSubId).unregisterTelephonyCallback(mTelephonyCallback); mTelephonyCallback = null; mSwitchBar.removeOnSwitchChangeListener(this); } context.unregisterReceiver(mIntentReceiver); // Remove callback for provisioning changes. unregisterProvisioningChangedCallback(); } Loading