Loading services/core/java/com/android/server/notification/NotificationManagerService.java +1 −25 Original line number Diff line number Diff line Loading @@ -854,9 +854,6 @@ public class NotificationManagerService extends SystemService { } else if (action.equals(Intent.ACTION_USER_PRESENT)) { // turn off LED when user passes through lock screen mNotificationLight.turnOff(); if (mStatusBar != null) { mStatusBar.notificationLightOff(); } } else if (action.equals(Intent.ACTION_USER_SWITCHED)) { final int user = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, UserHandle.USER_NULL); // reload per-user settings Loading Loading @@ -925,15 +922,6 @@ public class NotificationManagerService extends SystemService { private SettingsObserver mSettingsObserver; private ZenModeHelper mZenModeHelper; private final Runnable mBuzzBeepBlinked = new Runnable() { @Override public void run() { if (mStatusBar != null) { mStatusBar.buzzBeepBlinked(); } } }; static long[] getLongArray(Resources r, int resid, int maxlen, long[] def) { int[] ar = r.getIntArray(resid); if (ar == null) { Loading Loading @@ -962,15 +950,11 @@ public class NotificationManagerService extends SystemService { mVibrator = vibrator; } @VisibleForTesting void setStatusBarManager(StatusBarManagerInternal statusBar) { mStatusBar = statusBar; } @VisibleForTesting void setLights(Light light) { mNotificationLight = light; mAttentionLight = light; mNotificationPulseEnabled = true; } @VisibleForTesting Loading Loading @@ -3468,7 +3452,6 @@ public class NotificationManagerService extends SystemService { .setSubtype((buzz ? 1 : 0) | (beep ? 2 : 0) | (blink ? 4 : 0))); EventLogTags.writeNotificationAlert(key, buzz ? 1 : 0, beep ? 1 : 0, blink ? 1 : 0); mHandler.post(mBuzzBeepBlinked); } } } Loading Loading @@ -4253,9 +4236,6 @@ public class NotificationManagerService extends SystemService { // Don't flash while we are in a call or screen is on if (ledNotification == null || mInCall || mScreenOn) { mNotificationLight.turnOff(); if (mStatusBar != null) { mStatusBar.notificationLightOff(); } } else { final Notification ledno = ledNotification.sbn.getNotification(); int ledARGB = ledno.ledARGB; Loading @@ -4272,10 +4252,6 @@ public class NotificationManagerService extends SystemService { mNotificationLight.setFlashing(ledARGB, Light.LIGHT_FLASH_TIMED, ledOnMS, ledOffMS); } if (mStatusBar != null) { // let SystemUI make an independent decision mStatusBar.notificationLightPulse(ledARGB, ledOnMS, ledOffMS); } } } Loading services/tests/notification/src/com/android/server/notification/BuzzBeepBlinkTest.java +3 −5 Original line number Diff line number Diff line Loading @@ -67,7 +67,6 @@ public class BuzzBeepBlinkTest { @Mock AudioManager mAudioManager; @Mock Vibrator mVibrator; @Mock android.media.IRingtonePlayer mRingtonePlayer; @Mock StatusBarManagerInternal mStatusBar; @Mock Light mLight; @Mock Handler mHandler; Loading Loading @@ -108,7 +107,6 @@ public class BuzzBeepBlinkTest { mService.setVibrator(mVibrator); mService.setSystemReady(true); mService.setHandler(mHandler); mService.setStatusBarManager(mStatusBar); mService.setLights(mLight); mService.setScreenOn(false); mService.setFallbackVibrationPattern(FALLBACK_VIBRATION); Loading Loading @@ -298,12 +296,12 @@ public class BuzzBeepBlinkTest { } private void verifyLights() { verify(mStatusBar, times(1)).notificationLightPulse(anyInt(), anyInt(), anyInt()); verify(mLight, times(1)).setFlashing(anyInt(), anyInt(), anyInt(), anyInt()); } private void verifyCustomLights() { verify(mStatusBar, times(1)).notificationLightPulse( eq(CUSTOM_LIGHT_COLOR), eq(CUSTOM_LIGHT_ON), eq(CUSTOM_LIGHT_OFF)); verify(mLight, times(1)).setFlashing( eq(CUSTOM_LIGHT_COLOR), anyInt(), eq(CUSTOM_LIGHT_ON), eq(CUSTOM_LIGHT_OFF)); } private Context getContext() { Loading Loading
services/core/java/com/android/server/notification/NotificationManagerService.java +1 −25 Original line number Diff line number Diff line Loading @@ -854,9 +854,6 @@ public class NotificationManagerService extends SystemService { } else if (action.equals(Intent.ACTION_USER_PRESENT)) { // turn off LED when user passes through lock screen mNotificationLight.turnOff(); if (mStatusBar != null) { mStatusBar.notificationLightOff(); } } else if (action.equals(Intent.ACTION_USER_SWITCHED)) { final int user = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, UserHandle.USER_NULL); // reload per-user settings Loading Loading @@ -925,15 +922,6 @@ public class NotificationManagerService extends SystemService { private SettingsObserver mSettingsObserver; private ZenModeHelper mZenModeHelper; private final Runnable mBuzzBeepBlinked = new Runnable() { @Override public void run() { if (mStatusBar != null) { mStatusBar.buzzBeepBlinked(); } } }; static long[] getLongArray(Resources r, int resid, int maxlen, long[] def) { int[] ar = r.getIntArray(resid); if (ar == null) { Loading Loading @@ -962,15 +950,11 @@ public class NotificationManagerService extends SystemService { mVibrator = vibrator; } @VisibleForTesting void setStatusBarManager(StatusBarManagerInternal statusBar) { mStatusBar = statusBar; } @VisibleForTesting void setLights(Light light) { mNotificationLight = light; mAttentionLight = light; mNotificationPulseEnabled = true; } @VisibleForTesting Loading Loading @@ -3468,7 +3452,6 @@ public class NotificationManagerService extends SystemService { .setSubtype((buzz ? 1 : 0) | (beep ? 2 : 0) | (blink ? 4 : 0))); EventLogTags.writeNotificationAlert(key, buzz ? 1 : 0, beep ? 1 : 0, blink ? 1 : 0); mHandler.post(mBuzzBeepBlinked); } } } Loading Loading @@ -4253,9 +4236,6 @@ public class NotificationManagerService extends SystemService { // Don't flash while we are in a call or screen is on if (ledNotification == null || mInCall || mScreenOn) { mNotificationLight.turnOff(); if (mStatusBar != null) { mStatusBar.notificationLightOff(); } } else { final Notification ledno = ledNotification.sbn.getNotification(); int ledARGB = ledno.ledARGB; Loading @@ -4272,10 +4252,6 @@ public class NotificationManagerService extends SystemService { mNotificationLight.setFlashing(ledARGB, Light.LIGHT_FLASH_TIMED, ledOnMS, ledOffMS); } if (mStatusBar != null) { // let SystemUI make an independent decision mStatusBar.notificationLightPulse(ledARGB, ledOnMS, ledOffMS); } } } Loading
services/tests/notification/src/com/android/server/notification/BuzzBeepBlinkTest.java +3 −5 Original line number Diff line number Diff line Loading @@ -67,7 +67,6 @@ public class BuzzBeepBlinkTest { @Mock AudioManager mAudioManager; @Mock Vibrator mVibrator; @Mock android.media.IRingtonePlayer mRingtonePlayer; @Mock StatusBarManagerInternal mStatusBar; @Mock Light mLight; @Mock Handler mHandler; Loading Loading @@ -108,7 +107,6 @@ public class BuzzBeepBlinkTest { mService.setVibrator(mVibrator); mService.setSystemReady(true); mService.setHandler(mHandler); mService.setStatusBarManager(mStatusBar); mService.setLights(mLight); mService.setScreenOn(false); mService.setFallbackVibrationPattern(FALLBACK_VIBRATION); Loading Loading @@ -298,12 +296,12 @@ public class BuzzBeepBlinkTest { } private void verifyLights() { verify(mStatusBar, times(1)).notificationLightPulse(anyInt(), anyInt(), anyInt()); verify(mLight, times(1)).setFlashing(anyInt(), anyInt(), anyInt(), anyInt()); } private void verifyCustomLights() { verify(mStatusBar, times(1)).notificationLightPulse( eq(CUSTOM_LIGHT_COLOR), eq(CUSTOM_LIGHT_ON), eq(CUSTOM_LIGHT_OFF)); verify(mLight, times(1)).setFlashing( eq(CUSTOM_LIGHT_COLOR), anyInt(), eq(CUSTOM_LIGHT_ON), eq(CUSTOM_LIGHT_OFF)); } private Context getContext() { Loading