lights: Reprioritize events

attention > notification > battery

Change-Id: I0cac6ced4248990b7339223d6860106f94cf3693
cm-14.0
Ricardo Cerqueira 11 years ago committed by Ethan Chen
parent 362b87b5af
commit 4101c66b95

@ -138,6 +138,16 @@ set_speaker_light_locked(struct light_device_t* dev,
return -1;
}
if (state == NULL) {
write_int(RED_LED_FILE, 0);
write_int(GREEN_LED_FILE, 0);
write_int(BLUE_LED_FILE, 0);
write_int(RED_BLINK_FILE, 0);
write_int(GREEN_BLINK_FILE, 0);
write_int(BLUE_BLINK_FILE, 0);
return 0;
}
switch (state->flashMode) {
case LIGHT_FLASH_TIMED:
onMS = state->flashOnMS;
@ -192,10 +202,13 @@ set_speaker_light_locked(struct light_device_t* dev,
static void
handle_speaker_battery_locked(struct light_device_t* dev)
{
if (is_lit(&g_battery)) {
set_speaker_light_locked(dev, &g_battery);
} else {
set_speaker_light_locked(dev, NULL);
if (is_lit(&g_attention)) {
set_speaker_light_locked(dev, &g_attention);
} else if (is_lit(&g_notification)) {
set_speaker_light_locked(dev, &g_notification);
} else {
set_speaker_light_locked(dev, &g_battery);
}
}

Loading…
Cancel
Save