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

Commit 5f0781db authored by Tyler Gunn's avatar Tyler Gunn Committed by Android (Google) Code Review
Browse files

Merge "Remove flag onlyClearCommunicationDeviceOnInactive." into main

parents 5a0be47b 2aea6fa9
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -57,17 +57,6 @@ flag {
  bug: "301695370"
}

# OWNER=tgunn TARGET=25Q2
flag {
  name: "only_clear_communication_device_on_inactive"
  namespace: "telecom"
  description: "Only clear the communication device when transitioning to an inactive route."
  bug: "376781369"
  metadata {
    purpose: PURPOSE_BUGFIX
  }
}

# OWNER=tgunn TARGET=25Q2
flag {
  name: "check_device_type_on_route_change"
+1 −4
Original line number Diff line number Diff line
@@ -451,10 +451,7 @@ public class AudioRoute {
        }
        // Only clear communication device if the destination route will be inactive; route to
        // route transitions do not require clearing the communication device.
        boolean onlyClearCommunicationDeviceOnInactive =
                pendingAudioRoute.getFeatureFlags().onlyClearCommunicationDeviceOnInactive();
        if ((!onlyClearCommunicationDeviceOnInactive && !shouldDisconnectSco)
                || !pendingAudioRoute.isActive()) {
        if (!pendingAudioRoute.isActive()) {
            Log.i(this,
                    "clearCommunicationDevice: AudioManager#clearCommunicationDevice, type=%s",
                    DEVICE_TYPE_STRINGS.get(pendingAudioRoute.getCommunicationDeviceType()));
+7 −34
Original line number Diff line number Diff line
@@ -864,13 +864,6 @@ public class CallAudioRouteControllerTest extends TelecomTestCase {
        verifyDisconnectBluetoothDevice(AudioRoute.TYPE_BLUETOOTH_SCO);
    }

    @SmallTest
    @Test
    public void testConnectDisconnectScoDuringCallNoClear() {
        when(mFeatureFlags.onlyClearCommunicationDeviceOnInactive()).thenReturn(true);
        verifyConnectBluetoothDevice(AudioRoute.TYPE_BLUETOOTH_SCO);
        verifyDisconnectBluetoothDevice(AudioRoute.TYPE_BLUETOOTH_SCO);
    }

    @SmallTest
    @Test
@@ -881,15 +874,6 @@ public class CallAudioRouteControllerTest extends TelecomTestCase {
        verifyDisconnectBluetoothDevice(AudioRoute.TYPE_BLUETOOTH_LE);
    }

    @SmallTest
    @Test
    public void testConnectAndDisconnectLeDeviceDuringCallNoClear() {
        when(mFeatureFlags.onlyClearCommunicationDeviceOnInactive()).thenReturn(true);
        when(mBluetoothLeAudio.getConnectedGroupLeadDevice(anyInt()))
                .thenReturn(BLUETOOTH_DEVICE_1);
        verifyConnectBluetoothDevice(AudioRoute.TYPE_BLUETOOTH_LE);
        verifyDisconnectBluetoothDevice(AudioRoute.TYPE_BLUETOOTH_LE);
    }

    @SmallTest
    @Test
@@ -898,13 +882,6 @@ public class CallAudioRouteControllerTest extends TelecomTestCase {
        verifyDisconnectBluetoothDevice(AudioRoute.TYPE_BLUETOOTH_HA);
    }

    @SmallTest
    @Test
    public void testConnectAndDisconnectHearingAidDuringCallNoClear() {
        when(mFeatureFlags.onlyClearCommunicationDeviceOnInactive()).thenReturn(true);
        verifyConnectBluetoothDevice(AudioRoute.TYPE_BLUETOOTH_HA);
        verifyDisconnectBluetoothDevice(AudioRoute.TYPE_BLUETOOTH_HA);
    }

    @SmallTest
    @Test
@@ -1531,7 +1508,6 @@ public class CallAudioRouteControllerTest extends TelecomTestCase {
        if (audioType == AudioRoute.TYPE_BLUETOOTH_SCO) {
            verify(mBluetoothDeviceManager, timeout(TEST_TIMEOUT)).disconnectSco();
        } else {
            if (mFeatureFlags.onlyClearCommunicationDeviceOnInactive()) {
            verify(mAudioManager, timeout(TEST_TIMEOUT).times(2))
                    .setCommunicationDevice(any(AudioDeviceInfo.class));
            // Don't use a timeout here because that will cause the test to pause for a long
@@ -1539,9 +1515,6 @@ public class CallAudioRouteControllerTest extends TelecomTestCase {
            // have already waited for any AudioManager invocations to take place.  Any
            // potential clear would have happened by now.
            verify(mAudioManager, never()).clearCommunicationDevice();
            } else {
                verify(mAudioManager, timeout(TEST_TIMEOUT)).clearCommunicationDevice();
            }
        }
        verify(mCallsManager, timeout(TEST_TIMEOUT)).onCallAudioStateChanged(
                any(CallAudioState.class), eq(expectedState));