summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/res/res/values/config.xml3
-rw-r--r--core/res/res/values/symbols.xml1
-rw-r--r--services/core/java/com/android/server/notification/NotificationManagerService.java7
3 files changed, 10 insertions, 1 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 8af45db43124..865d92a8f37e 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -364,6 +364,9 @@
<!-- If this is true, the screen will come on when you unplug usb/power/whatever. -->
<bool name="config_unplugTurnsOnScreen">false</bool>
+ <!-- Set this true only if the device has separate attention and notification lights. -->
+ <bool name="config_useAttentionLight">false</bool>
+
<!-- If this is true, the screen will fade off. -->
<bool name="config_animateScreenLights">true</bool>
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 6a032e2a12b6..61b6a0d92c76 100644
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1456,6 +1456,7 @@
<java-symbol type="array" name="config_defaultNotificationVibePattern" />
<java-symbol type="array" name="config_notificationFallbackVibePattern" />
<java-symbol type="array" name="config_onlySingleDcAllowed" />
+ <java-symbol type="bool" name="config_useAttentionLight" />
<java-symbol type="bool" name="config_animateScreenLights" />
<java-symbol type="bool" name="config_automatic_brightness_available" />
<java-symbol type="bool" name="config_enableFusedLocationOverlay" />
diff --git a/services/core/java/com/android/server/notification/NotificationManagerService.java b/services/core/java/com/android/server/notification/NotificationManagerService.java
index 027b669857fc..386402b83ed9 100644
--- a/services/core/java/com/android/server/notification/NotificationManagerService.java
+++ b/services/core/java/com/android/server/notification/NotificationManagerService.java
@@ -163,6 +163,7 @@ public class NotificationManagerService extends SystemService {
private long[] mDefaultVibrationPattern;
private long[] mFallbackVibrationPattern;
+ private boolean mUseAttentionLight;
boolean mSystemReady;
private boolean mDisableNotificationAlerts;
@@ -797,6 +798,8 @@ public class NotificationManagerService extends SystemService {
VIBRATE_PATTERN_MAXLEN,
DEFAULT_VIBRATE_PATTERN);
+ mUseAttentionLight = resources.getBoolean(R.bool.config_useAttentionLight);
+
// Don't start allowing notifications until the setup wizard has run once.
// After that, including subsequent boots, init with notifications turned on.
// This works on the first boot because the setup wizard will toggle this
@@ -1742,7 +1745,9 @@ public class NotificationManagerService extends SystemService {
if ((notification.flags & Notification.FLAG_SHOW_LIGHTS) != 0 && canInterrupt) {
mLights.add(record.getKey());
updateLightsLocked();
- mAttentionLight.pulse();
+ if (mUseAttentionLight) {
+ mAttentionLight.pulse();
+ }
} else if (wasShowLights) {
updateLightsLocked();
}