Mute new assistant stream in total silence mode

Test: atest
Fixes: 149220546
Change-Id: I4e263717c9d4e8187376e141927d2b5616a14eb3
This commit is contained in:
Julia Reynolds
2020-03-09 11:26:19 -04:00
parent a80e32178b
commit a6b653f2d8
2 changed files with 9 additions and 3 deletions

View File

@@ -1278,13 +1278,16 @@ public class ZenModeHelper {
(1 << AudioSystem.STREAM_SYSTEM);
if (mZenMode == Global.ZEN_MODE_NO_INTERRUPTIONS) {
// alarm and music streams affected by ringer mode (cannot be adjusted) when in
// alarm and music and streams affected by ringer mode (cannot be adjusted) when in
// total silence
streams |= (1 << AudioSystem.STREAM_ALARM) |
(1 << AudioSystem.STREAM_MUSIC);
(1 << AudioSystem.STREAM_MUSIC) |
(1 << AudioSystem.STREAM_ASSISTANT);
} else {
streams &= ~((1 << AudioSystem.STREAM_ALARM) |
(1 << AudioSystem.STREAM_MUSIC));
(1 << AudioSystem.STREAM_MUSIC) |
(1 << AudioSystem.STREAM_ASSISTANT)
);
}
return streams;
}

View File

@@ -559,6 +559,7 @@ public class ZenModeHelperTest extends UiServiceTestCase {
assertTrue((ringerModeAffectedStreams & (1 << AudioSystem.STREAM_SYSTEM)) != 0);
assertTrue((ringerModeAffectedStreams & (1 << AudioSystem.STREAM_ALARM)) != 0);
assertTrue((ringerModeAffectedStreams & (1 << AudioSystem.STREAM_MUSIC)) != 0);
assertTrue((ringerModeAffectedStreams & (1 << AudioSystem.STREAM_ASSISTANT)) != 0);
}
@Test
@@ -579,6 +580,7 @@ public class ZenModeHelperTest extends UiServiceTestCase {
assertTrue((ringerModeAffectedStreams & (1 << AudioSystem.STREAM_SYSTEM)) != 0);
assertTrue((ringerModeAffectedStreams & (1 << AudioSystem.STREAM_ALARM)) == 0);
assertTrue((ringerModeAffectedStreams & (1 << AudioSystem.STREAM_MUSIC)) == 0);
assertTrue((ringerModeAffectedStreams & (1 << AudioSystem.STREAM_ASSISTANT)) == 0);
// even when ringer is muted (since all ringer sounds cannot bypass DND),
// system stream is still affected by ringer mode
@@ -601,6 +603,7 @@ public class ZenModeHelperTest extends UiServiceTestCase {
!= 0);
assertTrue((ringerMutedRingerModeAffectedStreams & (1 << AudioSystem.STREAM_ALARM)) == 0);
assertTrue((ringerMutedRingerModeAffectedStreams & (1 << AudioSystem.STREAM_MUSIC)) == 0);
assertTrue((ringerModeAffectedStreams & (1 << AudioSystem.STREAM_ASSISTANT)) == 0);
}
@Test