Loading services/java/com/android/server/NotificationManagerService.java +16 −2 Original line number Diff line number Diff line Loading @@ -149,6 +149,7 @@ public class NotificationManagerService extends INotificationManager.Stub // for enabling and disabling notification pulse behaviour private boolean mScreenOn = true; private boolean mDreaming = false; private boolean mInCall = false; private boolean mNotificationPulseEnabled; private HashMap<String, NotificationLedValues> mNotificationPulseCustomLedValues; Loading Loading @@ -587,6 +588,14 @@ public class NotificationManagerService extends INotificationManager.Stub } else if (action.equals(Intent.ACTION_SCREEN_OFF)) { mScreenOn = false; updateNotificationPulse(); } else if (action.equals(Intent.ACTION_DREAMING_STARTED)) { mDreaming = true; updateNotificationPulse(); } else if (action.equals(Intent.ACTION_DREAMING_STOPPED)) { mDreaming = false; if (mScreenOn) { mNotificationLight.turnOff(); } } else if (action.equals(TelephonyManager.ACTION_PHONE_STATE_CHANGED)) { mInCall = (intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals( TelephonyManager.EXTRA_STATE_OFFHOOK)); Loading @@ -598,9 +607,11 @@ public class NotificationManagerService extends INotificationManager.Stub } } else if (action.equals(Intent.ACTION_USER_PRESENT)) { // turn off LED when user passes through lock screen if (!mDreaming) { mNotificationLight.turnOff(); } } } }; class LEDSettingsObserver extends ContentObserver { Loading Loading @@ -780,6 +791,8 @@ public class NotificationManagerService extends INotificationManager.Stub filter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED); filter.addAction(Intent.ACTION_USER_PRESENT); filter.addAction(Intent.ACTION_USER_STOPPED); filter.addAction(Intent.ACTION_DREAMING_STARTED); filter.addAction(Intent.ACTION_DREAMING_STOPPED); mContext.registerReceiver(mIntentReceiver, filter); IntentFilter pkgFilter = new IntentFilter(); pkgFilter.addAction(Intent.ACTION_PACKAGE_REMOVED); Loading Loading @@ -1592,7 +1605,8 @@ public class NotificationManagerService extends INotificationManager.Stub } // Don't flash while we are in a call, screen is on or we are in quiet hours with light dimmed if (mLedNotification == null || mInCall || mScreenOn || (inQuietHours() && mQuietHoursDim)) { if (mLedNotification == null || mInCall || (mScreenOn && !mDreaming) || (inQuietHours() && mQuietHoursDim)) { mNotificationLight.turnOff(); } else { int ledARGB; Loading Loading
services/java/com/android/server/NotificationManagerService.java +16 −2 Original line number Diff line number Diff line Loading @@ -149,6 +149,7 @@ public class NotificationManagerService extends INotificationManager.Stub // for enabling and disabling notification pulse behaviour private boolean mScreenOn = true; private boolean mDreaming = false; private boolean mInCall = false; private boolean mNotificationPulseEnabled; private HashMap<String, NotificationLedValues> mNotificationPulseCustomLedValues; Loading Loading @@ -587,6 +588,14 @@ public class NotificationManagerService extends INotificationManager.Stub } else if (action.equals(Intent.ACTION_SCREEN_OFF)) { mScreenOn = false; updateNotificationPulse(); } else if (action.equals(Intent.ACTION_DREAMING_STARTED)) { mDreaming = true; updateNotificationPulse(); } else if (action.equals(Intent.ACTION_DREAMING_STOPPED)) { mDreaming = false; if (mScreenOn) { mNotificationLight.turnOff(); } } else if (action.equals(TelephonyManager.ACTION_PHONE_STATE_CHANGED)) { mInCall = (intent.getStringExtra(TelephonyManager.EXTRA_STATE).equals( TelephonyManager.EXTRA_STATE_OFFHOOK)); Loading @@ -598,9 +607,11 @@ public class NotificationManagerService extends INotificationManager.Stub } } else if (action.equals(Intent.ACTION_USER_PRESENT)) { // turn off LED when user passes through lock screen if (!mDreaming) { mNotificationLight.turnOff(); } } } }; class LEDSettingsObserver extends ContentObserver { Loading Loading @@ -780,6 +791,8 @@ public class NotificationManagerService extends INotificationManager.Stub filter.addAction(TelephonyManager.ACTION_PHONE_STATE_CHANGED); filter.addAction(Intent.ACTION_USER_PRESENT); filter.addAction(Intent.ACTION_USER_STOPPED); filter.addAction(Intent.ACTION_DREAMING_STARTED); filter.addAction(Intent.ACTION_DREAMING_STOPPED); mContext.registerReceiver(mIntentReceiver, filter); IntentFilter pkgFilter = new IntentFilter(); pkgFilter.addAction(Intent.ACTION_PACKAGE_REMOVED); Loading Loading @@ -1592,7 +1605,8 @@ public class NotificationManagerService extends INotificationManager.Stub } // Don't flash while we are in a call, screen is on or we are in quiet hours with light dimmed if (mLedNotification == null || mInCall || mScreenOn || (inQuietHours() && mQuietHoursDim)) { if (mLedNotification == null || mInCall || (mScreenOn && !mDreaming) || (inQuietHours() && mQuietHoursDim)) { mNotificationLight.turnOff(); } else { int ledARGB; Loading