@@ -127,11 +127,11 @@ class NotificationManagerService extends INotificationManager.Stub
127127 private boolean mBatteryFull ;
128128 private NotificationRecord mLedNotification ;
129129
130- private static final int BATTERY_LOW_ARGB = 0xFFFF0000 ; // Charging Low - red solid on
131- private static final int BATTERY_MEDIUM_ARGB = 0xFFFFFF00 ; // Charging - orange solid on
132- private static final int BATTERY_FULL_ARGB = 0xFF00FF00 ; // Charging Full - green solid on
133- private static final int BATTERY_BLINK_ON = 125 ;
134- private static final int BATTERY_BLINK_OFF = 2875 ;
130+ private static int mBatteryLowARGB ;
131+ private static int mBatteryMediumARGB ;
132+ private static int mBatteryFullARGB ;
133+ private static int mBatteryLedOn ;
134+ private static int mBatteryLedOff ;
135135
136136 private static String idDebugString (Context baseContext , String packageName , int id ) {
137137 Context c = null ;
@@ -432,6 +432,17 @@ public void update() {
432432 mDefaultNotificationLedOff = resources .getInteger (
433433 com .android .internal .R .integer .config_defaultNotificationLedOff );
434434
435+ mBatteryLowARGB = mContext .getResources ().getInteger (
436+ com .android .internal .R .integer .config_notificationsBatteryLowARGB );
437+ mBatteryMediumARGB = mContext .getResources ().getInteger (
438+ com .android .internal .R .integer .config_notificationsBatteryMediumARGB );
439+ mBatteryFullARGB = mContext .getResources ().getInteger (
440+ com .android .internal .R .integer .config_notificationsBatteryFullARGB );
441+ mBatteryLedOn = mContext .getResources ().getInteger (
442+ com .android .internal .R .integer .config_notificationsBatteryLedOn );
443+ mBatteryLedOff = mContext .getResources ().getInteger (
444+ com .android .internal .R .integer .config_notificationsBatteryLedOff );
445+
435446 // Don't start allowing notifications until the setup wizard has run once.
436447 // After that, including subsequent boots, init with notifications turned on.
437448 // This works on the first boot because the setup wizard will toggle this
@@ -1043,17 +1054,17 @@ private void updateLightsLocked()
10431054 // Battery low always shows, other states only show if charging.
10441055 if (mBatteryLow ) {
10451056 if (mBatteryCharging ) {
1046- mBatteryLight .setColor (BATTERY_LOW_ARGB );
1057+ mBatteryLight .setColor (mBatteryLowARGB );
10471058 } else {
10481059 // Flash when battery is low and not charging
1049- mBatteryLight .setFlashing (BATTERY_LOW_ARGB , LightsService .LIGHT_FLASH_TIMED ,
1050- BATTERY_BLINK_ON , BATTERY_BLINK_OFF );
1060+ mBatteryLight .setFlashing (mBatteryLowARGB , LightsService .LIGHT_FLASH_TIMED ,
1061+ mBatteryLedOn , mBatteryLedOff );
10511062 }
10521063 } else if (mBatteryCharging ) {
10531064 if (mBatteryFull ) {
1054- mBatteryLight .setColor (BATTERY_FULL_ARGB );
1065+ mBatteryLight .setColor (mBatteryFullARGB );
10551066 } else {
1056- mBatteryLight .setColor (BATTERY_MEDIUM_ARGB );
1067+ mBatteryLight .setColor (mBatteryMediumARGB );
10571068 }
10581069 } else {
10591070 mBatteryLight .turnOff ();
0 commit comments