Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df35ff6a authored by Joonhun Shin's avatar Joonhun Shin Committed by Android (Google) Code Review
Browse files

Merge "Revert "Fix video Call goes on hold instead of terminating when...

Merge "Revert "Fix video Call goes on hold instead of terminating when accepting 2nd video call as audio only"" into main
parents 964afa32 81e1ea8c
Loading
Loading
Loading
Loading
+4 −16
Original line number Diff line number Diff line
@@ -312,11 +312,8 @@ 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,
                                        VideoProfile.STATE_BIDIRECTIONAL);
                                shouldDisconnectActiveCallOnAnswer(activeCall, imsCall);
                        conn.setActiveCallDisconnectedOnAnswer(answeringWillDisconnect);
                    }
                }
@@ -2223,7 +2220,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
            ImsCall ringingCall = mRingingCall.getImsCall();
            if (mForegroundCall.hasConnections() && mRingingCall.hasConnections()) {
                answeringWillDisconnect =
                        shouldDisconnectActiveCallOnAnswer(activeCall, ringingCall, videoState);
                        shouldDisconnectActiveCallOnAnswer(activeCall, ringingCall);
            }

            // Cache video state for pending MT call.
@@ -5535,13 +5532,11 @@ 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, int incomingCallVideoState) {
            ImsCall incomingCall) {

        if (activeCall == null || incomingCall == null) {
            return false;
@@ -5556,14 +5551,7 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall {
        boolean isActiveCallOnWifi = activeCall.isWifiCall();
        boolean isVoWifiEnabled = mImsManager.isWfcEnabledByPlatform()
                && mImsManager.isWfcEnabledByUser();
        boolean isIncomingCallAudio = true;
        if (!mFeatureFlags.terminateActiveVideoCallWhenAcceptingSecondVideoCallAsAudioOnly()) {
            isIncomingCallAudio = !incomingCall.isVideoCall();
        } else {
            isIncomingCallAudio = !incomingCall.isVideoCall()
                    || incomingCallVideoState == VideoProfile.STATE_AUDIO_ONLY;
        }

        boolean isIncomingCallAudio = !incomingCall.isVideoCall();
        log("shouldDisconnectActiveCallOnAnswer : isActiveCallVideo=" + isActiveCallVideo +
                " isActiveCallOnWifi=" + isActiveCallOnWifi + " isIncomingCallAudio=" +
                isIncomingCallAudio + " isVowifiEnabled=" + isVoWifiEnabled);