From 70858ea40bfa7d77037638f5e9fa0f17e6993575 Mon Sep 17 00:00:00 2001 From: jiabin Date: Fri, 15 Nov 2019 09:55:04 -0800 Subject: [PATCH] Remove DEVICE_OUT_ALL_SCO. Due to the refactor of audio device type, DEVICE_OUT_ALL_SCO has been removed. Use DEVICE_OUT_BLUETOOTH_SCO_HEADSET for the test instead. Bug: 135621476 Test: make RunSettingsRoboTests ROBOTEST_FILTER="AudioOutputSwitchPreferenceControllerTest" Change-Id: Ib32f4c313c5d318b6f99e1f0591c98c4c7c82ade Merged-In: Ib32f4c313c5d318b6f99e1f0591c98c4c7c82ade --- .../sound/AudioOutputSwitchPreferenceControllerTest.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/robotests/src/com/android/settings/sound/AudioOutputSwitchPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/sound/AudioOutputSwitchPreferenceControllerTest.java index 5b7c8631901..9c916028c1e 100644 --- a/tests/robotests/src/com/android/settings/sound/AudioOutputSwitchPreferenceControllerTest.java +++ b/tests/robotests/src/com/android/settings/sound/AudioOutputSwitchPreferenceControllerTest.java @@ -16,7 +16,6 @@ package com.android.settings.sound; -import static android.media.AudioSystem.DEVICE_OUT_ALL_SCO; import static android.media.AudioSystem.DEVICE_OUT_BLUETOOTH_SCO_HEADSET; import static android.media.AudioSystem.STREAM_MUSIC; @@ -45,7 +44,6 @@ import androidx.preference.ListPreference; import androidx.preference.PreferenceManager; import androidx.preference.PreferenceScreen; -import com.android.settings.R; import com.android.settings.bluetooth.Utils; import com.android.settings.core.FeatureFlags; import com.android.settings.testutils.shadow.ShadowAudioManager; @@ -66,7 +64,6 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.robolectric.RobolectricTestRunner; import org.robolectric.RuntimeEnvironment; -import org.robolectric.Shadows; import org.robolectric.annotation.Config; import org.robolectric.shadow.api.Shadow; import org.robolectric.shadows.ShadowBluetoothDevice; @@ -246,7 +243,8 @@ public class AudioOutputSwitchPreferenceControllerTest { public void isStreamFromOutputDevice_outputDeviceIsBtScoHeadset_shouldReturnTrue() { mShadowAudioManager.setOutputDevice(DEVICE_OUT_BLUETOOTH_SCO_HEADSET); - assertThat(mController.isStreamFromOutputDevice(STREAM_MUSIC, DEVICE_OUT_ALL_SCO)).isTrue(); + assertThat(mController.isStreamFromOutputDevice( + STREAM_MUSIC, DEVICE_OUT_BLUETOOTH_SCO_HEADSET)).isTrue(); } /** @@ -407,4 +405,4 @@ public class AudioOutputSwitchPreferenceControllerTest { return TEST_KEY; } } -} \ No newline at end of file +}