Do NOT disable IMS settings for non-call SIM during a call
For non-call SIM, since IMS setting preferences in Mobile network
settings and Wi-Fi calling settings are not disabled during a call,
unify the behavior of Call settings.
Test: manual - Checked that IMS settings for non-call SIM are not
disabled in Call settings
Bug: 128873810
Change-Id: Ia546bbc1d385512bc503d739b21664688c4647f0
diff --git a/src/com/android/phone/CallFeaturesSetting.java b/src/com/android/phone/CallFeaturesSetting.java
index 29df8b8..17a1734 100644
--- a/src/com/android/phone/CallFeaturesSetting.java
+++ b/src/com/android/phone/CallFeaturesSetting.java
@@ -229,8 +229,8 @@
}
private void listenPhoneState(boolean listen) {
- TelephonyManager telephonyManager =
- (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
+ TelephonyManager telephonyManager = getSystemService(TelephonyManager.class)
+ .createForSubscriptionId(mPhone.getSubId());
telephonyManager.listen(mPhoneStateListener, listen
? PhoneStateListener.LISTEN_CALL_STATE : PhoneStateListener.LISTEN_NONE);
}
@@ -239,10 +239,7 @@
@Override
public void onCallStateChanged(int state, String incomingNumber) {
if (DBG) log("PhoneStateListener onCallStateChanged: state is " + state);
- // Use TelecomManager#getCallStete instead of 'state' parameter because it needs
- // to check the current state of all phone calls.
- boolean isCallStateIdle =
- mTelecomManager.getCallState() == TelephonyManager.CALL_STATE_IDLE;
+ boolean isCallStateIdle = state == TelephonyManager.CALL_STATE_IDLE;
if (mEnableVideoCalling != null) {
mEnableVideoCalling.setEnabled(isCallStateIdle);
}