Loading packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java +6 −3 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.systemui.volume; import static android.accessibilityservice.AccessibilityServiceInfo.FEEDBACK_ALL_MASK; import static android.accessibilityservice.AccessibilityServiceInfo.FEEDBACK_GENERIC; import static android.media.AudioManager.RINGER_MODE_MAX; import static android.media.AudioManager.RINGER_MODE_NORMAL; import static android.media.AudioManager.RINGER_MODE_SILENT; import static android.media.AudioManager.RINGER_MODE_VIBRATE; Loading Loading @@ -570,7 +569,11 @@ public class VolumeDialogImpl implements VolumeDialog { return; } enableRingerViewsH(mState.zenMode == Global.ZEN_MODE_OFF || !mState.disallowRinger); boolean isZenMuted = mState.zenMode == Global.ZEN_MODE_ALARMS || mState.zenMode == Global.ZEN_MODE_NO_INTERRUPTIONS || (mState.zenMode == Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS && mState.disallowRinger); enableRingerViewsH(!isZenMuted); switch (mState.ringerModeInternal) { case AudioManager.RINGER_MODE_VIBRATE: mRingerIcon.setImageResource(R.drawable.ic_volume_ringer_vibrate); Loading @@ -586,7 +589,7 @@ public class VolumeDialogImpl implements VolumeDialog { case AudioManager.RINGER_MODE_NORMAL: default: boolean muted = (mAutomute && ss.level == 0) || ss.muted; if (muted) { if (!isZenMuted && muted) { mRingerIcon.setImageResource(R.drawable.ic_volume_ringer_mute); mRingerIcon.setContentDescription(mContext.getString( R.string.volume_stream_content_description_unmute, Loading services/core/java/com/android/server/notification/ZenModeHelper.java +1 −5 Original line number Diff line number Diff line Loading @@ -933,11 +933,7 @@ public class ZenModeHelper { } break; case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS: if (ZenModeConfig.areAllPriorityOnlyNotificationZenSoundsMuted(mConfig) && ringerModeInternal != AudioManager.RINGER_MODE_SILENT) { setPreviousRingerModeSetting(ringerModeInternal); newRingerModeInternal = AudioManager.RINGER_MODE_SILENT; } // do not apply zen to ringer, streams zen muted in AudioService break; case Global.ZEN_MODE_OFF: if (ringerModeInternal == AudioManager.RINGER_MODE_SILENT) { Loading services/tests/uiservicestests/src/com/android/server/notification/ZenModeHelperTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -329,12 +329,12 @@ public class ZenModeHelperTest extends UiServiceTestCase { mZenModeHelperSpy.mConfig.allowEvents = false; mZenModeHelperSpy.mConfig.allowRepeatCallers= false; // 2. apply priority only zen - verify ringer is set to silent // 2. apply priority only zen - verify ringer is unchanged mZenModeHelperSpy.applyZenToRingerMode(); verify(mAudioManager, atLeastOnce()).setRingerModeInternal(AudioManager.RINGER_MODE_SILENT, verify(mAudioManager, never()).setRingerModeInternal(AudioManager.RINGER_MODE_SILENT, mZenModeHelperSpy.TAG); // 3. apply zen off - verify zen is set to prevoius ringer (normal) // 3. apply zen off - verify zen is set to previous ringer (normal) when(mAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_SILENT); mZenModeHelperSpy.mZenMode = Global.ZEN_MODE_OFF; mZenModeHelperSpy.applyZenToRingerMode(); Loading Loading
packages/SystemUI/src/com/android/systemui/volume/VolumeDialogImpl.java +6 −3 Original line number Diff line number Diff line Loading @@ -18,7 +18,6 @@ package com.android.systemui.volume; import static android.accessibilityservice.AccessibilityServiceInfo.FEEDBACK_ALL_MASK; import static android.accessibilityservice.AccessibilityServiceInfo.FEEDBACK_GENERIC; import static android.media.AudioManager.RINGER_MODE_MAX; import static android.media.AudioManager.RINGER_MODE_NORMAL; import static android.media.AudioManager.RINGER_MODE_SILENT; import static android.media.AudioManager.RINGER_MODE_VIBRATE; Loading Loading @@ -570,7 +569,11 @@ public class VolumeDialogImpl implements VolumeDialog { return; } enableRingerViewsH(mState.zenMode == Global.ZEN_MODE_OFF || !mState.disallowRinger); boolean isZenMuted = mState.zenMode == Global.ZEN_MODE_ALARMS || mState.zenMode == Global.ZEN_MODE_NO_INTERRUPTIONS || (mState.zenMode == Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS && mState.disallowRinger); enableRingerViewsH(!isZenMuted); switch (mState.ringerModeInternal) { case AudioManager.RINGER_MODE_VIBRATE: mRingerIcon.setImageResource(R.drawable.ic_volume_ringer_vibrate); Loading @@ -586,7 +589,7 @@ public class VolumeDialogImpl implements VolumeDialog { case AudioManager.RINGER_MODE_NORMAL: default: boolean muted = (mAutomute && ss.level == 0) || ss.muted; if (muted) { if (!isZenMuted && muted) { mRingerIcon.setImageResource(R.drawable.ic_volume_ringer_mute); mRingerIcon.setContentDescription(mContext.getString( R.string.volume_stream_content_description_unmute, Loading
services/core/java/com/android/server/notification/ZenModeHelper.java +1 −5 Original line number Diff line number Diff line Loading @@ -933,11 +933,7 @@ public class ZenModeHelper { } break; case Global.ZEN_MODE_IMPORTANT_INTERRUPTIONS: if (ZenModeConfig.areAllPriorityOnlyNotificationZenSoundsMuted(mConfig) && ringerModeInternal != AudioManager.RINGER_MODE_SILENT) { setPreviousRingerModeSetting(ringerModeInternal); newRingerModeInternal = AudioManager.RINGER_MODE_SILENT; } // do not apply zen to ringer, streams zen muted in AudioService break; case Global.ZEN_MODE_OFF: if (ringerModeInternal == AudioManager.RINGER_MODE_SILENT) { Loading
services/tests/uiservicestests/src/com/android/server/notification/ZenModeHelperTest.java +3 −3 Original line number Diff line number Diff line Loading @@ -329,12 +329,12 @@ public class ZenModeHelperTest extends UiServiceTestCase { mZenModeHelperSpy.mConfig.allowEvents = false; mZenModeHelperSpy.mConfig.allowRepeatCallers= false; // 2. apply priority only zen - verify ringer is set to silent // 2. apply priority only zen - verify ringer is unchanged mZenModeHelperSpy.applyZenToRingerMode(); verify(mAudioManager, atLeastOnce()).setRingerModeInternal(AudioManager.RINGER_MODE_SILENT, verify(mAudioManager, never()).setRingerModeInternal(AudioManager.RINGER_MODE_SILENT, mZenModeHelperSpy.TAG); // 3. apply zen off - verify zen is set to prevoius ringer (normal) // 3. apply zen off - verify zen is set to previous ringer (normal) when(mAudioManager.getRingerModeInternal()).thenReturn(AudioManager.RINGER_MODE_SILENT); mZenModeHelperSpy.mZenMode = Global.ZEN_MODE_OFF; mZenModeHelperSpy.applyZenToRingerMode(); Loading