aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoonhunshin <joonhunshin@google.com>2023-12-05 15:25:44 +0000
committerjoonhunshin <joonhunshin@google.com>2023-12-07 02:53:17 +0000
commitacbd1ee4f25512cf2b0dd8adb099590bcd034fe8 (patch)
treee678efa5356ce0d68dd2388571d5fd25a7407f84
parentc48d918afff5fce92d112bc08313c2e4ebc84a3b (diff)
downloadtelephony-acbd1ee4f25512cf2b0dd8adb099590bcd034fe8.tar.gz
Fix video Call goes on hold instead of terminating when accepting 2nd video call as audio only
Make video call from A to B Answer the call on the B as a video call Make video call from C to A Answer the video call as a voice call on the A. The video call between the A and B must end Bug: 309548300 Test: atest ImsCallingTest Change-Id: I9887ad5e80fa0ccb775a3268e94e4c248e521311
-rw-r--r--src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java20
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);