diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-29 10:07:53 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-04-29 10:07:53 +0000 |
commit | 98af3dda7f9a48fd64d547736adf150dc5961952 (patch) | |
tree | fd6da35c5e4299fe45f23dedaec94d117c0db76f | |
parent | 025c6282a0c147f935ff96965ee054e44a22edab (diff) | |
parent | a8e2fca93bb2567400a8c94a930dd61fecc14aa6 (diff) |
Snap for 8516262 from a8e2fca93bb2567400a8c94a930dd61fecc14aa6 to s-keystone-qcom-release
Change-Id: I04b60e42dafc65991fc8027b7a87ec7ee7d4cf30
-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); } |