diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/app/INotificationManager.aidl | 2 | ||||
-rw-r--r-- | core/java/android/app/NotificationManager.java | 28 | ||||
-rw-r--r-- | core/res/res/values/cm_symbols.xml | 3 | ||||
-rw-r--r-- | core/res/res/values/config.xml | 23 |
4 files changed, 56 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 + } + + } diff --git a/core/res/res/values/cm_symbols.xml b/core/res/res/values/cm_symbols.xml index 81f33cb..a56e5ac 100644 --- a/core/res/res/values/cm_symbols.xml +++ b/core/res/res/values/cm_symbols.xml @@ -145,4 +145,7 @@ <!--Exposed style for power menu --> <java-symbol type="style" name="Theme.Power.Dialog" /> + + <!-- On-device lights (LED) capabilities --> + <java-symbol type="array" name="config_deviceLightCapabilities" /> </resources> diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 79bf24e..8b49227 100644 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -2575,4 +2575,27 @@ <!-- Whether to persist the notification for when a usb drive device is plugged in --> <bool name="config_persistUsbDriveNotification">false</bool> + + <!-- What can the LEDs on this device do? If defined, this overrides all of the + older settings: + + com.android.internal.R.bool.config_multiColorNotificationLed + com.android.internal.R.bool.config_multiColorBatteryLed + org.cyanogenmod.platform.internal.R.bool.config_multipleNotificationLeds + com.android.internal.R.bool.config_ledCanPulse + org.cyanogenmod.platform.internal.R.bool.config_useSegmentedBatteryLed + org.cyanogenmod.platform.internal.R.bool.config_adjustableNotificationLedBrightness + + Use the following values from NotificationManager: + LIGHTS_RGB_NOTIFICATION = 0 + LIGHTS_RGB_BATTERY = 1 + LIGHTS_MULTIPLE_LED = 2 + LIGHTS_LED_PULSE = 3 + LIGHTS_SEGMENTED_BATTERY_LIGHTS = 4 + LIGHTS_ADJUSTABLE_NOTIFICATION_BRIGHTNESS = 5 + --> + + <integer-array translatable="false" name="config_deviceLightCapabilities"> + </integer-array> + </resources> |