diff options
| author | Jean-Baptiste Queru <jbq@google.com> | 2010-08-17 07:48:50 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2010-08-17 07:48:50 -0700 |
| commit | 5085848ddbadaafa088ed85753156adc2e54554d (patch) | |
| tree | 349d52df3fd350d8212f172851cf0263dc401d0a /services/java | |
| parent | 234325b832136dcdbed0c86fdcefa95fb04451a4 (diff) | |
| parent | 209e651805dd40ea87df7ff67f2755605be9308c (diff) | |
| download | frameworks_base-5085848ddbadaafa088ed85753156adc2e54554d.zip frameworks_base-5085848ddbadaafa088ed85753156adc2e54554d.tar.gz frameworks_base-5085848ddbadaafa088ed85753156adc2e54554d.tar.bz2 | |
am 209e6518: Merge "Make the LED colors when charging customizable by the vendor"
Merge commit '209e651805dd40ea87df7ff67f2755605be9308c' into gingerbread-plus-aosp
* commit '209e651805dd40ea87df7ff67f2755605be9308c':
Make the LED colors when charging customizable by the vendor
Diffstat (limited to 'services/java')
| -rwxr-xr-x | services/java/com/android/server/NotificationManagerService.java | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/services/java/com/android/server/NotificationManagerService.java b/services/java/com/android/server/NotificationManagerService.java index 63325dd..ed8b90b 100755 --- a/services/java/com/android/server/NotificationManagerService.java +++ b/services/java/com/android/server/NotificationManagerService.java @@ -129,11 +129,11 @@ public class NotificationManagerService extends INotificationManager.Stub private boolean mBatteryFull; private NotificationRecord mLedNotification; - private static final int BATTERY_LOW_ARGB = 0xFFFF0000; // Charging Low - red solid on - private static final int BATTERY_MEDIUM_ARGB = 0xFFFFFF00; // Charging - orange solid on - private static final int BATTERY_FULL_ARGB = 0xFF00FF00; // Charging Full - green solid on - private static final int BATTERY_BLINK_ON = 125; - private static final int BATTERY_BLINK_OFF = 2875; + private static int mBatteryLowARGB; + private static int mBatteryMediumARGB; + private static int mBatteryFullARGB; + private static int mBatteryLedOn; + private static int mBatteryLedOff; private static String idDebugString(Context baseContext, String packageName, int id) { Context c = null; @@ -448,6 +448,17 @@ public class NotificationManagerService extends INotificationManager.Stub mDefaultNotificationLedOff = resources.getInteger( com.android.internal.R.integer.config_defaultNotificationLedOff); + mBatteryLowARGB = mContext.getResources().getInteger( + com.android.internal.R.integer.config_notificationsBatteryLowARGB); + mBatteryMediumARGB = mContext.getResources().getInteger( + com.android.internal.R.integer.config_notificationsBatteryMediumARGB); + mBatteryFullARGB = mContext.getResources().getInteger( + com.android.internal.R.integer.config_notificationsBatteryFullARGB); + mBatteryLedOn = mContext.getResources().getInteger( + com.android.internal.R.integer.config_notificationsBatteryLedOn); + mBatteryLedOff = mContext.getResources().getInteger( + com.android.internal.R.integer.config_notificationsBatteryLedOff); + // 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 @@ -1066,17 +1077,17 @@ public class NotificationManagerService extends INotificationManager.Stub // Battery low always shows, other states only show if charging. if (mBatteryLow) { if (mBatteryCharging) { - mBatteryLight.setColor(BATTERY_LOW_ARGB); + mBatteryLight.setColor(mBatteryLowARGB); } else { // Flash when battery is low and not charging - mBatteryLight.setFlashing(BATTERY_LOW_ARGB, LightsService.LIGHT_FLASH_TIMED, - BATTERY_BLINK_ON, BATTERY_BLINK_OFF); + mBatteryLight.setFlashing(mBatteryLowARGB, LightsService.LIGHT_FLASH_TIMED, + mBatteryLedOn, mBatteryLedOff); } } else if (mBatteryCharging) { if (mBatteryFull) { - mBatteryLight.setColor(BATTERY_FULL_ARGB); + mBatteryLight.setColor(mBatteryFullARGB); } else { - mBatteryLight.setColor(BATTERY_MEDIUM_ARGB); + mBatteryLight.setColor(mBatteryMediumARGB); } } else { mBatteryLight.turnOff(); |
