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

Commit 35b709d8 authored by Pranav Madapurmath's avatar Pranav Madapurmath
Browse files

Bypass hold in ECC dial for same phone accounts

Ensure that we don't send a hold request in Telecom when the live call
and emergency call phone accounts are the same. We will let this be
handled in Telephony instead. Samsung was reporting an issue with the
ECC not dialing out because Telecom's hold request was interefering with
Telephony's internal handling.

Bug: 419729271
Flag: com.android.server.telecom.flags.bypass_hold_for_ecc_dial
Test: atest CallSequencingTests
Test: Manual test with normal call + ECC
Test: Manual test with backup calling + ECC to verify ECC is placed

Change-Id: I5d9b2eb180e41b35d3aa5742f0ea5338eb96f199
parent cab60804
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -76,6 +76,17 @@ flag {
    }
}

# OWNER=pmadapurmath TARGET=25Q4
flag {
  name: "bypass_hold_for_ecc_dial"
  namespace: "telecom"
  description: "When making room for an outgoing emergency call, don't send a hold request when the live call and emergency call phone accounts are the same. We will let this be handled in Telephony instead."
  bug: "419729271"
  metadata {
      purpose: PURPOSE_BUGFIX
    }
}

# OWNER=tgunn TARGET=25Q3
flag {
  name: "voip_dnd_focus"
+14 −0
Original line number Diff line number Diff line
@@ -705,6 +705,20 @@ public class CallSequencingController {
            }
        }

        // If we are trying to make an emergency call with the same package name as the live call,
        // then allow it so that the connection service can make its own decision
        // about how to handle the new call relative to the current one.
        // By default, for telephony, it will try to hold the existing call before placing the new
        // emergency call except for if the carrier does not support holding calls for emergency.
        // In this case, telephony will disconnect the call.
        if (mFeatureFlags.bypassHoldForEccDial() && PhoneAccountHandle.areFromSamePackage(
                liveCallPhoneAccount, emergencyCall.getTargetPhoneAccount())) {
            Log.i(this, "makeRoomForOutgoingEmergencyCall: phoneAccount matches.");
            emergencyCall.getAnalytics().setCallIsAdditional(true);
            liveCall.getAnalytics().setCallIsInterrupted(true);
            return transactionFuture;
        }

        // At this point, if we still have an active call, then it supports holding for emergency
        // and is a managed call. It may not support holding but we will still try to hold anyway
        // (i.e. swap for Verizon). Note that there will only be one call at this stage which is
+4 −1
Original line number Diff line number Diff line
@@ -514,6 +514,7 @@ public class CallSequencingTests extends TelecomTestCase {
    @SmallTest
    @Test
    public void testMakeRoomForOutgoingEmergencyCall_SamePkg() {
        when(mFeatureFlags.bypassHoldForEccDial()).thenReturn(true);
        // Ensure that the live call and emergency call are from the same pkg.
        when(mActiveCall.getTargetPhoneAccount()).thenReturn(mHandle1);
        when(mNewCall.getTargetPhoneAccount()).thenReturn(mHandle1);
@@ -523,7 +524,9 @@ public class CallSequencingTests extends TelecomTestCase {
        CompletableFuture<Boolean> future = mController.makeRoomForOutgoingCall(true, mNewCall);
        verify(mRingingCall, timeout(SEQUENCING_TIMEOUT_MS))
                .reject(anyBoolean(), eq(null), anyString());
        verify(mActiveCall, timeout(SEQUENCING_TIMEOUT_MS)).hold(anyString());
        // Verify we don't send the hold request when the normal call and ECC are from the same
        // phone accounts (this task is left up to Telephony to handle).
        verify(mActiveCall, timeout(SEQUENCING_TIMEOUT_MS).times(0)).hold(anyString());
        assertTrue(waitForFutureResult(future, false));
    }