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

Commit cf22ed22 authored by Thomas Stuart's avatar Thomas Stuart
Browse files

add flag for CS aduio flicker

b/290847206 was merged to V without a flag to gate the new logic.
This CL gates all the changes in b/290847206 and updates 2 tests.

Fixes: 309540769
Bug: 290847206 (original bug)
Test: updated 2 unit tests
Change-Id: I05dfa70e06154f3f8a114455432e04b0e77b3a56
parent eb6d1f4b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -29,10 +29,11 @@ aconfig_declarations {
      "telecom_incallservice_flags.aconfig",
      "telecom_default_phone_account_flags.aconfig",
      "telecom_callaudioroutestatemachine_flags.aconfig",
      "telecom_calls_manager_flags.aconfig",
      "telecom_anomaly_report_flags.aconfig",
      "telecom_callaudiomodestatemachine_flags.aconfig",
      "telecom_calllog_flags.aconfig",
      "telecom_resolve_hidden_dependencies.aconfig"
      "telecom_resolve_hidden_dependencies.aconfig",
    ],
}
+8 −0
Original line number Diff line number Diff line
package: "com.android.server.telecom.flags"

flag {
  name: "fix_audio_flicker_for_outgoing_calls"
  namespace: "telecom"
  description: "This fix ensures the MO calls won't switch from Active to Quite b/c setDialing was not called"
  bug: "309540769"
}
+14 −5
Original line number Diff line number Diff line
@@ -767,6 +767,10 @@ public class CallsManager extends Call.ListenerBase
        call.setPostCallPackageName(getRoleManagerAdapter().getDefaultCallScreeningApp(
                call.getAssociatedUser()));

        if (!mFeatureFlags.fixAudioFlickerForOutgoingCalls()) {
            setCallState(call, callState, "successful outgoing call");
        }

        if (!mCalls.contains(call)) {
            // Call was not added previously in startOutgoingCall due to it being a potential MMI
            // code, so add it now.
@@ -778,14 +782,19 @@ public class CallsManager extends Call.ListenerBase
            listener.onConnectionServiceChanged(call, null, call.getConnectionService());
        }

        // Allow the ConnectionService to start the call in the active state. This case is helpful
        // for conference calls or meetings that can skip the dialing stage.
        if (mFeatureFlags.fixAudioFlickerForOutgoingCalls()) {
            // Allow the ConnectionService to start the call in the active state. This case is
            // helpful for conference calls or meetings that can skip the dialing stage.
            if (callState == CallState.ACTIVE) {
                setCallState(call, callState, "skipping the dialing state and setting active");
            } else {
                markCallAsDialing(call);
            }
        }
        else{
            markCallAsDialing(call);
        }
    }

    @Override
    public void onFailedOutgoingCall(Call call, DisconnectCause disconnectCause) {
+2 −0
Original line number Diff line number Diff line
@@ -2559,6 +2559,7 @@ public class CallsManagerTest extends TelecomTestCase {
    @SmallTest
    @Test
    public void testOutgoingCallStateIsSetToAPreviousStateAndIgnored() {
        when(mFeatureFlags.fixAudioFlickerForOutgoingCalls()).thenReturn(true);
        Call outgoingCall = addSpyCall(CallState.CONNECTING);
        mCallsManager.onSuccessfulOutgoingCall(outgoingCall, CallState.NEW);
        verify(outgoingCall, never()).setState(eq(CallState.NEW), any());
@@ -2571,6 +2572,7 @@ public class CallsManagerTest extends TelecomTestCase {
    @SmallTest
    @Test
    public void testOutgoingCallStateCanAvoidDialingAndGoStraightToActive() {
        when(mFeatureFlags.fixAudioFlickerForOutgoingCalls()).thenReturn(true);
        Call outgoingCall = addSpyCall(CallState.CONNECTING);
        mCallsManager.onSuccessfulOutgoingCall(outgoingCall, CallState.ACTIVE);
        verify(outgoingCall, never()).setState(eq(CallState.DIALING), any());