summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDanny Baumann <dannybaumann@web.de>2013-06-28 10:23:49 +0200
committerDanny Baumann <dannybaumann@web.de>2013-06-28 10:24:24 +0200
commitf370e6298cc423bb3b103e075e32349f0647d98f (patch)
tree4020d6a39bbe28823b2d0cf94462d3b74fb21e47 /services
parentb077138e0279a1fa76eb9e12f59ce40c3b6576ee (diff)
downloadframeworks_base-f370e6298cc423bb3b103e075e32349f0647d98f.zip
frameworks_base-f370e6298cc423bb3b103e075e32349f0647d98f.tar.gz
frameworks_base-f370e6298cc423bb3b103e075e32349f0647d98f.tar.bz2
Keep on notification LED while dreaming.
Change-Id: I407e34f9c60d3140f78abca133b4fda5dd45f311 JIRA:CYAN-689
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/NotificationManagerService.java18
1 files changed, 16 insertions, 2 deletions
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java
index 06a8615..8a02380 100644
--- a/services/java/com/android/server/NotificationManagerService.java
+++ b/services/java/com/android/server/NotificationManagerService.java
@@ -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;
@@ -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));
@@ -598,7 +607,9 @@ public class NotificationManagerService extends INotificationManager.Stub
}
} else if (action.equals(Intent.ACTION_USER_PRESENT)) {
// turn off LED when user passes through lock screen
- mNotificationLight.turnOff();
+ if (!mDreaming) {
+ mNotificationLight.turnOff();
+ }
}
}
};
@@ -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);
@@ -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;