diff options
author | pengfeix <quic_pengfeix@quicinc.com> | 2022-04-26 15:12:56 +0800 |
---|---|---|
committer | Pengfei <quic_pengfeix@quicinc.com> | 2022-04-27 09:38:52 +0800 |
commit | a8e2fca93bb2567400a8c94a930dd61fecc14aa6 (patch) | |
tree | fd6da35c5e4299fe45f23dedaec94d117c0db76f | |
parent | 84a9b1371f12497dd981b51d95da226232cdde58 (diff) |
IMS: Handle incoming call properly after exiting DSDA
- In DSDA, accepting an incoming call will not disconnect
calls on other SUBs, so when the incoming call first
arrives, the EXTRA_ANSWERING_DROPS_FG_CALL is not set.
When exiting from DSDA, with current logic accepting
incoming call will disconnect calls on other SUB, however
call end confirmation is not waited for before answering
incoming on other sub. it's not expected from media and
result in media rejects the request, finally incoming call
is dropped.
- Add intent filter to receive MSIM_VOICE_CAPABILITY_CHANGED
and used to update EXTRA_ANSWERING_DROPS_FG_CALL if required.
Change-Id: Ie9b107eb04570e7f529d83643595e651966b84a6
CRs-Fixed: 3180269
-rw-r--r-- | src/com/android/services/telephony/TelephonyConnectionService.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/com/android/services/telephony/TelephonyConnectionService.java b/src/com/android/services/telephony/TelephonyConnectionService.java index a2beb7ddea..543e9340be 100644 --- a/src/com/android/services/telephony/TelephonyConnectionService.java +++ b/src/com/android/services/telephony/TelephonyConnectionService.java @@ -136,7 +136,7 @@ public class TelephonyConnectionService extends ConnectionService { } }; - private final BroadcastReceiver mTtyBroadcastReceiver = new BroadcastReceiver() { + private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction(); @@ -149,6 +149,14 @@ public class TelephonyConnectionService extends ConnectionService { if (isTtyNowEnabled != mIsTtyEnabled) { handleTtyModeChange(isTtyNowEnabled); } + } else if (ACTION_MSIM_VOICE_CAPABILITY_CHANGED.equals(action)) { + // Add extra to call if answering this incoming call would cause an in progress + // call on another subscription to be disconnected. + Connection ringingConnection = getRingingConnection(); + if (ringingConnection != null) { + maybeIndicateAnsweringWillDisconnect((TelephonyConnection)ringingConnection, + ringingConnection.getPhoneAccountHandle()); + } } } }; @@ -179,6 +187,8 @@ public class TelephonyConnectionService extends ConnectionService { @VisibleForTesting public Pair<WeakReference<TelephonyConnection>, Queue<Phone>> mEmergencyRetryCache; private DeviceState mDeviceState = new DeviceState(); + private final String ACTION_MSIM_VOICE_CAPABILITY_CHANGED = + "org.codeaurora.intent.action.MSIM_VOICE_CAPABILITY_CHANGED"; /** * Keeps track of the status of a SIM slot. @@ -605,13 +615,14 @@ public class TelephonyConnectionService extends ConnectionService { IntentFilter intentFilter = new IntentFilter( TelecomManager.ACTION_TTY_PREFERRED_MODE_CHANGED); - registerReceiver(mTtyBroadcastReceiver, intentFilter, + intentFilter.addAction(ACTION_MSIM_VOICE_CAPABILITY_CHANGED); + registerReceiver(mBroadcastReceiver, intentFilter, android.Manifest.permission.MODIFY_PHONE_STATE, null); } @Override public boolean onUnbind(Intent intent) { - unregisterReceiver(mTtyBroadcastReceiver); + unregisterReceiver(mBroadcastReceiver); return super.onUnbind(intent); } |