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

Commit 46d9ab33 authored by Hall Liu's avatar Hall Liu Committed by android-build-merger
Browse files

Fix tests

am: 74fbaa53

Change-Id: I2f58460b149379e1c62c1f785ba8cb85f0d0413d
parents a56af755 74fbaa53
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import java.util.Arrays;
import java.util.Objects;

import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.atLeast;
@@ -130,6 +131,8 @@ public class BluetoothRouteManagerTest extends TelecomTestCase {
        when(mDeviceManager.getNumConnectedDevices()).thenReturn(devices.length);
        when(mDeviceManager.getConnectedDevices()).thenReturn(Arrays.asList(devices));
        when(mHeadsetProxy.getConnectedDevices()).thenReturn(Arrays.asList(devices));
        when(mHeadsetProxy.getAudioState(any(BluetoothDevice.class)))
                .thenReturn(BluetoothHeadset.STATE_AUDIO_DISCONNECTED);
        if (activeDevice != null) {
            when(mHeadsetProxy.getAudioState(eq(activeDevice)))
                    .thenReturn(BluetoothHeadset.STATE_AUDIO_CONNECTED);
+3 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ import static com.android.server.telecom.tests.BluetoothRouteManagerTest.DEVICE2
import static com.android.server.telecom.tests.BluetoothRouteManagerTest.DEVICE3;
import static com.android.server.telecom.tests.BluetoothRouteManagerTest.executeRoutingAction;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Mockito.doAnswer;
@@ -306,6 +307,8 @@ public class BluetoothRouteTransitionTests extends TelecomTestCase {
        when(mDeviceManager.getConnectedDevices()).thenReturn(Arrays.asList(devices));
        when(mHeadsetProxy.getConnectedDevices()).thenReturn(Arrays.asList(devices));
        when(mHeadsetProxy.getActiveDevice()).thenReturn(activeDevice);
        when(mHeadsetProxy.getAudioState(any(BluetoothDevice.class)))
                .thenReturn(BluetoothHeadset.STATE_AUDIO_DISCONNECTED);
        if (audioOnDevice != null) {
            when(mHeadsetProxy.getAudioState(eq(audioOnDevice)))
                    .thenReturn(BluetoothHeadset.STATE_AUDIO_CONNECTED);