summaryrefslogtreecommitdiffstats
path: root/core/java
diff options
context:
space:
mode:
authorRicardo Cerqueira <android@cerqueira.org>2016-11-10 12:15:00 +0000
committerGerrit Code Review <gerrit@cyanogenmod.org>2016-11-10 04:30:11 -0800
commitc15736bb1034f8aca5429ca336a2ab7126fe7a57 (patch)
tree4c8babb1a95b16dfffc1964e549f5313c8c40446 /core/java
parentc7d2fb722fcf528e465bc3274bbb436edc9aeb2e (diff)
downloadframeworks_base-c15736bb1034f8aca5429ca336a2ab7126fe7a57.zip
frameworks_base-c15736bb1034f8aca5429ca336a2ab7126fe7a57.tar.gz
frameworks_base-c15736bb1034f8aca5429ca336a2ab7126fe7a57.tar.bz2
NotificationManager: Concentrate LED light capabilities at a single location
We had(have) a bunch of individual boolean toggles for various LED behaviors and combinations, which end up getting used as a similarly sprawling bunch of getResource() calls across various locations. And they keep piling up... So... create a new overlayable array of LED capabilities (config_deviceLightCapabilities) where we can throw everything (and expand in the future). Also, create a helper to abstract usage of the old (multi-resource) and new (single resource array) formats to avoid breaking any deployed devices. Change-Id: I7d627914b058861048071fc15776031c4152157f
Diffstat (limited to 'core/java')
-rw-r--r--core/java/android/app/INotificationManager.aidl2
-rw-r--r--core/java/android/app/NotificationManager.java28
2 files changed, 30 insertions, 0 deletions
diff --git a/core/java/android/app/INotificationManager.aidl b/core/java/android/app/INotificationManager.aidl
index 59ff413..06c064f 100644
--- a/core/java/android/app/INotificationManager.aidl
+++ b/core/java/android/app/INotificationManager.aidl
@@ -103,4 +103,6 @@ interface INotificationManager
void applyRestore(in byte[] payload, int user);
ParceledListSlice getAppActiveNotifications(String callingPkg, int userId);
+
+ boolean deviceLightsCan(int lightCapability);
}
diff --git a/core/java/android/app/NotificationManager.java b/core/java/android/app/NotificationManager.java
index d84eee2..eae2599 100644
--- a/core/java/android/app/NotificationManager.java
+++ b/core/java/android/app/NotificationManager.java
@@ -765,4 +765,32 @@ public class NotificationManager
default: return defValue;
}
}
+
+ /** @hide */
+ public static final int LIGHTS_RGB_NOTIFICATION = 0;
+ /** @hide */
+ public static final int LIGHTS_RGB_BATTERY = 1 ;
+ /** @hide */
+ public static final int LIGHTS_MULTIPLE_LED = 2;
+ /** @hide */
+ public static final int LIGHTS_LED_PULSE = 3;
+ /** @hide */
+ public static final int LIGHTS_SEGMENTED_BATTERY_LIGHTS = 4;
+ /** @hide */
+ public static final int LIGHTS_ADJUSTABLE_NOTIFICATION_BRIGHTNESS = 5;
+
+ /** @hide */
+ public boolean deviceLightsCan(int lightCapability) {
+ INotificationManager service = getService();
+ try {
+ return service.deviceLightsCan(lightCapability);
+ } catch (RemoteException e) {
+ return true;
+ } catch (NullPointerException e) {
+ return true;
+ }
+ // If the service isn't up yet, assume everything is possible
+ }
+
+
}