Loading src/com/android/server/telecom/Ringer.java +11 −2 Original line number Diff line number Diff line Loading @@ -735,8 +735,17 @@ public class Ringer { AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); // Use AudioManager#getRingerMode for more accurate result, instead of // AudioManager#getRingerModeInternal which only useful for volume controllers boolean zenModeOn = mNotificationManager != null boolean zenModeOn; if (mFlags.resolveHiddenDependenciesTwo()) { // See NotificationManager#zenModeToInterruptionFilter; INTERRUPTION_FILTER_ALL is // equivalent to the former ZEN_MODE_OFF. zenModeOn = mNotificationManager != null && mNotificationManager.getCurrentInterruptionFilter() != NotificationManager.INTERRUPTION_FILTER_ALL; } else { zenModeOn = mNotificationManager != null && mNotificationManager.getZenMode() != ZEN_MODE_OFF; } maybeGenAnomReportForGetRingerMode(zenModeOn, audioManager); return mVibrator.hasVibrator() && mSystemSettingsUtil.isRingVibrationEnabled(context) Loading tests/src/com/android/server/telecom/tests/RingerTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -647,6 +647,8 @@ public class RingerTest extends TelecomTestCase { mRingerUnderTest.startCallWaiting(mockCall1); Ringtone mockRingtone = ensureRingtoneMocked(); when(mockNotificationManager.getZenMode()).thenReturn(ZEN_MODE_IMPORTANT_INTERRUPTIONS); when(mockNotificationManager.getCurrentInterruptionFilter()).thenReturn( NotificationManager.INTERRUPTION_FILTER_PRIORITY); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_SILENT); when(mockAudioManager.getStreamVolume(AudioManager.STREAM_RING)).thenReturn(100); enableVibrationWhenRinging(); Loading Loading
src/com/android/server/telecom/Ringer.java +11 −2 Original line number Diff line number Diff line Loading @@ -735,8 +735,17 @@ public class Ringer { AudioManager audioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE); // Use AudioManager#getRingerMode for more accurate result, instead of // AudioManager#getRingerModeInternal which only useful for volume controllers boolean zenModeOn = mNotificationManager != null boolean zenModeOn; if (mFlags.resolveHiddenDependenciesTwo()) { // See NotificationManager#zenModeToInterruptionFilter; INTERRUPTION_FILTER_ALL is // equivalent to the former ZEN_MODE_OFF. zenModeOn = mNotificationManager != null && mNotificationManager.getCurrentInterruptionFilter() != NotificationManager.INTERRUPTION_FILTER_ALL; } else { zenModeOn = mNotificationManager != null && mNotificationManager.getZenMode() != ZEN_MODE_OFF; } maybeGenAnomReportForGetRingerMode(zenModeOn, audioManager); return mVibrator.hasVibrator() && mSystemSettingsUtil.isRingVibrationEnabled(context) Loading
tests/src/com/android/server/telecom/tests/RingerTest.java +2 −0 Original line number Diff line number Diff line Loading @@ -647,6 +647,8 @@ public class RingerTest extends TelecomTestCase { mRingerUnderTest.startCallWaiting(mockCall1); Ringtone mockRingtone = ensureRingtoneMocked(); when(mockNotificationManager.getZenMode()).thenReturn(ZEN_MODE_IMPORTANT_INTERRUPTIONS); when(mockNotificationManager.getCurrentInterruptionFilter()).thenReturn( NotificationManager.INTERRUPTION_FILTER_PRIORITY); when(mockAudioManager.getRingerMode()).thenReturn(AudioManager.RINGER_MODE_SILENT); when(mockAudioManager.getStreamVolume(AudioManager.STREAM_RING)).thenReturn(100); enableVibrationWhenRinging(); Loading