diff options
author | Joonhun Shin <joonhunshin@google.com> | 2023-12-08 00:02:07 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2023-12-08 00:02:07 +0000 |
commit | 52c435fd31e9231281baa4626715a1290fc21bfc (patch) | |
tree | d7105712e17b8e2199717b60899e279fe8c51bb2 | |
parent | 6a7e1d77b8ed973a222d1933b4e57f5ba4c96d7b (diff) | |
parent | acbd1ee4f25512cf2b0dd8adb099590bcd034fe8 (diff) | |
download | telephony-52c435fd31e9231281baa4626715a1290fc21bfc.tar.gz |
Merge "Fix video Call goes on hold instead of terminating when accepting 2nd video call as audio only" into main
-rw-r--r-- | src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java b/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java index 4f9b69d7d4..e95433c2ee 100644 --- a/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +++ b/src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java @@ -311,8 +311,11 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { // activeCall could be null if the foreground call is in a disconnected // state. If either of the calls is null there is no need to check if // one will be disconnected on answer. + // Use VideoProfile.STATE_BIDIRECTIONAL to not affect existing + // implementation. Video state of user response is handled in acceptCall(). boolean answeringWillDisconnect = - shouldDisconnectActiveCallOnAnswer(activeCall, imsCall); + shouldDisconnectActiveCallOnAnswer(activeCall, imsCall, + VideoProfile.STATE_BIDIRECTIONAL); conn.setActiveCallDisconnectedOnAnswer(answeringWillDisconnect); } } @@ -2215,7 +2218,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { ImsCall ringingCall = mRingingCall.getImsCall(); if (mForegroundCall.hasConnections() && mRingingCall.hasConnections()) { answeringWillDisconnect = - shouldDisconnectActiveCallOnAnswer(activeCall, ringingCall); + shouldDisconnectActiveCallOnAnswer(activeCall, ringingCall, videoState); } // Cache video state for pending MT call. @@ -5499,11 +5502,13 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { * * @param activeCall The active call. * @param incomingCall The incoming call. + * @param incomingCallVideoState The media type of incoming call acceptance. + * {@link VideoProfile.VideoState} * @return {@code true} if answering the incoming call will cause the active call to be * disconnected, {@code false} otherwise. */ private boolean shouldDisconnectActiveCallOnAnswer(ImsCall activeCall, - ImsCall incomingCall) { + ImsCall incomingCall, int incomingCallVideoState) { if (activeCall == null || incomingCall == null) { return false; @@ -5518,7 +5523,14 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { boolean isActiveCallOnWifi = activeCall.isWifiCall(); boolean isVoWifiEnabled = mImsManager.isWfcEnabledByPlatform() && mImsManager.isWfcEnabledByUser(); - boolean isIncomingCallAudio = !incomingCall.isVideoCall(); + boolean isIncomingCallAudio = true; + if (!mFeatureFlags.terminateActiveVideoCallWhenAcceptingSecondVideoCallAsAudioOnly()) { + isIncomingCallAudio = !incomingCall.isVideoCall(); + } else { + isIncomingCallAudio = !incomingCall.isVideoCall() + || incomingCallVideoState == VideoProfile.STATE_AUDIO_ONLY; + } + log("shouldDisconnectActiveCallOnAnswer : isActiveCallVideo=" + isActiveCallVideo + " isActiveCallOnWifi=" + isActiveCallOnWifi + " isIncomingCallAudio=" + isIncomingCallAudio + " isVowifiEnabled=" + isVoWifiEnabled); |