Identify cast mode properly in audio switch

- Use STREAM_MUSIC to idetify cast mode

- Use STREAM_MUSIC to detect wired headset

Bug: 78141750
Test: make RunSettingsRoboTests
ROBOTEST_FILTER="MediaOutputPreferenceControllerTest" -j40

Change-Id: I92273d41d3debfc3d6327c4ca09143a2dd9b1cb6
This commit is contained in:
ryanywlin
2018-04-17 18:25:38 +08:00
committed by Ryan Lin
parent a46dd4bd4b
commit 7be15cdd23
2 changed files with 6 additions and 14 deletions

View File

@@ -17,6 +17,7 @@
package com.android.settings.sound;
import static android.media.AudioSystem.DEVICE_OUT_REMOTE_SUBMIX;
import static android.media.AudioSystem.DEVICE_OUT_USB_HEADSET;
import static com.google.common.truth.Truth.assertThat;
@@ -198,7 +199,7 @@ public class MediaOutputPreferenceControllerTest {
*/
@Test
public void updateState_mediaStreamIsCapturedByCast_shouldDisableAndSetDefaultSummary() {
mShadowAudioManager.setMusicActiveRemotely(true);
mShadowAudioManager.setStream(DEVICE_OUT_REMOTE_SUBMIX);
mController.updateState(mPreference);