Loading core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -1425,6 +1425,14 @@ public final class Settings { */ public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse"; /** * Whether the notification LED color should be blended with all * active notifications. * The value is boolean (1 or 0). * @hide */ public static final String NOTIFICATION_PULSE_BLEND = "notification_light_pulse_blend"; /** * Whether to pulse the notification LED while the screen is on. The value is * boolean (1 or 0). Loading services/java/com/android/server/NotificationManagerService.java +16 −7 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ class NotificationManagerService extends INotificationManager.Stub private boolean mScreenOn = true; private boolean mNotificationScreenOn; private boolean mNotificationPulseEnabled; private boolean mNotificationPulseBlend; private boolean mPulseBreathingLight; private int mBreathingLightColor; Loading Loading @@ -386,6 +387,12 @@ class NotificationManagerService extends INotificationManager.Stub mNotificationPulseEnabled = pulseEnabled; updateNotificationPulse(); } boolean pulseBlend = Settings.System.getInt(resolver, Settings.System.NOTIFICATION_PULSE_BLEND, 0) != 0; if (mNotificationPulseBlend != pulseBlend) { mNotificationPulseBlend = pulseBlend; updateNotificationPulse(); } boolean screenOn = Settings.System.getInt(resolver, Settings.System.NOTIFICATION_SCREEN_ON, 0) != 0; if (mNotificationScreenOn != screenOn) { Loading Loading @@ -1041,13 +1048,6 @@ class NotificationManagerService extends INotificationManager.Stub } } // Blend all the colors together int ledARGB = 0; if (mLedNotification != null) ledARGB = mLedNotification.notification.ledARGB; for (int n=0; n < mLights.size(); n++) { ledARGB |= mLights.get(n).notification.ledARGB; } // we only flash if screen is off and persistent pulsing is enabled if (mLedNotification == null || (mScreenOn && !mNotificationScreenOn) || !mNotificationPulseEnabled) { if (mPulseBreathingLight) { Loading @@ -1056,6 +1056,15 @@ class NotificationManagerService extends INotificationManager.Stub mHardware.setLightOff_UNCHECKED(HardwareService.LIGHT_ID_NOTIFICATIONS); } } else { int ledARGB = mLedNotification.notification.ledARGB; if (mNotificationPulseBlend) { // Blend all the colors together for (int n=0; n < mLights.size(); n++) { ledARGB |= mLights.get(n).notification.ledARGB; } } mHardware.setLightFlashing_UNCHECKED( HardwareService.LIGHT_ID_NOTIFICATIONS, ledARGB, Loading Loading
core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -1425,6 +1425,14 @@ public final class Settings { */ public static final String NOTIFICATION_LIGHT_PULSE = "notification_light_pulse"; /** * Whether the notification LED color should be blended with all * active notifications. * The value is boolean (1 or 0). * @hide */ public static final String NOTIFICATION_PULSE_BLEND = "notification_light_pulse_blend"; /** * Whether to pulse the notification LED while the screen is on. The value is * boolean (1 or 0). Loading
services/java/com/android/server/NotificationManagerService.java +16 −7 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ class NotificationManagerService extends INotificationManager.Stub private boolean mScreenOn = true; private boolean mNotificationScreenOn; private boolean mNotificationPulseEnabled; private boolean mNotificationPulseBlend; private boolean mPulseBreathingLight; private int mBreathingLightColor; Loading Loading @@ -386,6 +387,12 @@ class NotificationManagerService extends INotificationManager.Stub mNotificationPulseEnabled = pulseEnabled; updateNotificationPulse(); } boolean pulseBlend = Settings.System.getInt(resolver, Settings.System.NOTIFICATION_PULSE_BLEND, 0) != 0; if (mNotificationPulseBlend != pulseBlend) { mNotificationPulseBlend = pulseBlend; updateNotificationPulse(); } boolean screenOn = Settings.System.getInt(resolver, Settings.System.NOTIFICATION_SCREEN_ON, 0) != 0; if (mNotificationScreenOn != screenOn) { Loading Loading @@ -1041,13 +1048,6 @@ class NotificationManagerService extends INotificationManager.Stub } } // Blend all the colors together int ledARGB = 0; if (mLedNotification != null) ledARGB = mLedNotification.notification.ledARGB; for (int n=0; n < mLights.size(); n++) { ledARGB |= mLights.get(n).notification.ledARGB; } // we only flash if screen is off and persistent pulsing is enabled if (mLedNotification == null || (mScreenOn && !mNotificationScreenOn) || !mNotificationPulseEnabled) { if (mPulseBreathingLight) { Loading @@ -1056,6 +1056,15 @@ class NotificationManagerService extends INotificationManager.Stub mHardware.setLightOff_UNCHECKED(HardwareService.LIGHT_ID_NOTIFICATIONS); } } else { int ledARGB = mLedNotification.notification.ledARGB; if (mNotificationPulseBlend) { // Blend all the colors together for (int n=0; n < mLights.size(); n++) { ledARGB |= mLights.get(n).notification.ledARGB; } } mHardware.setLightFlashing_UNCHECKED( HardwareService.LIGHT_ID_NOTIFICATIONS, ledARGB, Loading