diff options
| author | 2017-02-01 20:03:48 +0000 | |
|---|---|---|
| committer | 2017-02-01 20:03:52 +0000 | |
| commit | 27f4f4a57a0cd5ff37cb46291bec2c7623cbae15 (patch) | |
| tree | c95ad30517bdf97a29b489aeba48eda1f514d156 | |
| parent | 58c4d503b528657320da0960ce8fba8b7b2654c7 (diff) | |
| parent | 033a4120a8ed78c2b97a5ff9ce2f52de7a1a662d (diff) | |
Merge "Remove unneeded callbacks to systemui."
| -rw-r--r-- | services/core/java/com/android/server/notification/NotificationManagerService.java | 26 | ||||
| -rw-r--r-- | services/tests/notification/src/com/android/server/notification/BuzzBeepBlinkTest.java | 8 |
2 files changed, 4 insertions, 30 deletions
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java index a83597672cc9..e55720395c8b 100644 --- a/services/core/java/com/android/server/notification/NotificationManagerService.java +++ b/services/core/java/com/android/server/notification/NotificationManagerService.java @@ -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 @@ -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) { @@ -963,14 +951,10 @@ public class NotificationManagerService extends SystemService { } @VisibleForTesting - void setStatusBarManager(StatusBarManagerInternal statusBar) { - mStatusBar = statusBar; - } - - @VisibleForTesting void setLights(Light light) { mNotificationLight = light; mAttentionLight = light; + mNotificationPulseEnabled = true; } @VisibleForTesting @@ -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); } } } @@ -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; @@ -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); - } } } diff --git a/services/tests/notification/src/com/android/server/notification/BuzzBeepBlinkTest.java b/services/tests/notification/src/com/android/server/notification/BuzzBeepBlinkTest.java index b8655607f295..d91e8dfe1887 100644 --- a/services/tests/notification/src/com/android/server/notification/BuzzBeepBlinkTest.java +++ b/services/tests/notification/src/com/android/server/notification/BuzzBeepBlinkTest.java @@ -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; @@ -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); @@ -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() { |