diff options
author | Doug Zongker <dougz@android.com> | 2014-03-11 21:55:56 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-03-11 21:55:56 +0000 |
commit | cb0bb7c5f48d4441902282a1ceaf32c5defd10db (patch) | |
tree | 3aae210f1b4f79acb29194293a5f69f57f44006f | |
parent | 443904746301e4d519e51075487ea4c8b9a860e3 (diff) | |
parent | 0280f278f6e2d095e6579deba61fe96bfa649d4f (diff) | |
download | system_core-cb0bb7c5f48d4441902282a1ceaf32c5defd10db.zip system_core-cb0bb7c5f48d4441902282a1ceaf32c5defd10db.tar.gz system_core-cb0bb7c5f48d4441902282a1ceaf32c5defd10db.tar.bz2 |
Merge "remove pixelflinger from healthd"
-rw-r--r-- | charger/Android.mk | 2 | ||||
-rw-r--r-- | charger/charger.c | 42 | ||||
-rw-r--r-- | charger/images/battery_0.png | bin | 1295 -> 0 bytes | |||
-rw-r--r-- | charger/images/battery_1.png | bin | 1290 -> 0 bytes | |||
-rw-r--r-- | charger/images/battery_2.png | bin | 1289 -> 0 bytes | |||
-rw-r--r-- | charger/images/battery_3.png | bin | 1291 -> 0 bytes | |||
-rw-r--r-- | charger/images/battery_4.png | bin | 1288 -> 0 bytes | |||
-rw-r--r-- | charger/images/battery_5.png | bin | 1267 -> 0 bytes | |||
-rw-r--r-- | charger/images/battery_charge.png | bin | 2475 -> 0 bytes | |||
-rw-r--r-- | charger/images/battery_fail.png | bin | 1805 -> 1368 bytes | |||
-rw-r--r-- | charger/images/battery_scale.png | bin | 0 -> 463 bytes |
11 files changed, 22 insertions, 22 deletions
diff --git a/charger/Android.mk b/charger/Android.mk index b9d3473..40c7d78 100644 --- a/charger/Android.mk +++ b/charger/Android.mk @@ -24,7 +24,7 @@ LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED) LOCAL_C_INCLUDES := bootable/recovery -LOCAL_STATIC_LIBRARIES := libminui libpixelflinger_static libpng +LOCAL_STATIC_LIBRARIES := libminui libpng ifeq ($(strip $(BOARD_CHARGER_ENABLE_SUSPEND)),true) LOCAL_STATIC_LIBRARIES += libsuspend endif diff --git a/charger/charger.c b/charger/charger.c index 8f9169d..402d0e8 100644 --- a/charger/charger.c +++ b/charger/charger.c @@ -91,7 +91,6 @@ struct power_supply { }; struct frame { - const char *name; int disp_time; int min_capacity; bool level_only; @@ -142,33 +141,27 @@ struct uevent { static struct frame batt_anim_frames[] = { { - .name = "charger/battery_0", .disp_time = 750, .min_capacity = 0, }, { - .name = "charger/battery_1", .disp_time = 750, .min_capacity = 20, }, { - .name = "charger/battery_2", .disp_time = 750, .min_capacity = 40, }, { - .name = "charger/battery_3", .disp_time = 750, .min_capacity = 60, }, { - .name = "charger/battery_4", .disp_time = 750, .min_capacity = 80, .level_only = true, }, { - .name = "charger/battery_5", .disp_time = 750, .min_capacity = BATTERY_FULL_THRESH, }, @@ -198,8 +191,8 @@ static int64_t curr_time_ms(void) static void clear_screen(void) { gr_color(0, 0, 0, 255); - gr_fill(0, 0, gr_fb_width(), gr_fb_height()); -}; + gr_clear(); +} #define MAX_KLOG_WRITE_BUF_SZ 256 @@ -659,8 +652,8 @@ static void draw_battery(struct charger *charger) if (batt_anim->num_frames != 0) { draw_surface_centered(charger, frame->surface); - LOGV("drawing frame #%d name=%s min_cap=%d time=%d\n", - batt_anim->cur_frame, frame->name, frame->min_capacity, + LOGV("drawing frame #%d min_cap=%d time=%d\n", + batt_anim->cur_frame, frame->min_capacity, frame->disp_time); } } @@ -982,20 +975,27 @@ int main(int argc, char **argv) ret = res_create_surface("charger/battery_fail", &charger->surf_unknown); if (ret < 0) { - LOGE("Cannot load image\n"); + LOGE("Cannot load battery_fail image\n"); charger->surf_unknown = NULL; } - for (i = 0; i < charger->batt_anim->num_frames; i++) { - struct frame *frame = &charger->batt_anim->frames[i]; + charger->batt_anim = &battery_animation; - ret = res_create_surface(frame->name, &frame->surface); - if (ret < 0) { - LOGE("Cannot load image %s\n", frame->name); - /* TODO: free the already allocated surfaces... */ - charger->batt_anim->num_frames = 0; - charger->batt_anim->num_cycles = 1; - break; + gr_surface* scale_frames; + int scale_count; + ret = res_create_multi_surface("charger/battery_scale", &scale_count, &scale_frames); + if (ret < 0) { + LOGE("Cannot load battery_scale image\n"); + charger->batt_anim->num_frames = 0; + charger->batt_anim->num_cycles = 1; + } else if (scale_count != charger->batt_anim->num_frames) { + LOGE("battery_scale image has unexpected frame count (%d, expected %d)\n", + scale_count, charger->batt_anim->num_frames); + charger->batt_anim->num_frames = 0; + charger->batt_anim->num_cycles = 1; + } else { + for (i = 0; i < charger->batt_anim->num_frames; i++) { + charger->batt_anim->frames[i].surface = scale_frames[i]; } } diff --git a/charger/images/battery_0.png b/charger/images/battery_0.png Binary files differdeleted file mode 100644 index 2347074..0000000 --- a/charger/images/battery_0.png +++ /dev/null diff --git a/charger/images/battery_1.png b/charger/images/battery_1.png Binary files differdeleted file mode 100644 index cd34620..0000000 --- a/charger/images/battery_1.png +++ /dev/null diff --git a/charger/images/battery_2.png b/charger/images/battery_2.png Binary files differdeleted file mode 100644 index 3e4095e..0000000 --- a/charger/images/battery_2.png +++ /dev/null diff --git a/charger/images/battery_3.png b/charger/images/battery_3.png Binary files differdeleted file mode 100644 index 08c1551..0000000 --- a/charger/images/battery_3.png +++ /dev/null diff --git a/charger/images/battery_4.png b/charger/images/battery_4.png Binary files differdeleted file mode 100644 index 3a678da..0000000 --- a/charger/images/battery_4.png +++ /dev/null diff --git a/charger/images/battery_5.png b/charger/images/battery_5.png Binary files differdeleted file mode 100644 index d8dc40e..0000000 --- a/charger/images/battery_5.png +++ /dev/null diff --git a/charger/images/battery_charge.png b/charger/images/battery_charge.png Binary files differdeleted file mode 100644 index b501933..0000000 --- a/charger/images/battery_charge.png +++ /dev/null diff --git a/charger/images/battery_fail.png b/charger/images/battery_fail.png Binary files differindex 36fc254..aded88a 100644 --- a/charger/images/battery_fail.png +++ b/charger/images/battery_fail.png diff --git a/charger/images/battery_scale.png b/charger/images/battery_scale.png Binary files differnew file mode 100644 index 0000000..2ae8f0f --- /dev/null +++ b/charger/images/battery_scale.png |