diff options
author | Tao Bao <tbao@google.com> | 2017-01-25 00:59:02 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-01-25 00:59:02 +0000 |
commit | 3d34631dbe0feb137f87549728acddf36b4939b0 (patch) | |
tree | 43cdf115a2cb95f9cf9b6db4bab98e336953d6ba /healthd | |
parent | 387abed12941264c5e33f655fec2370fe69d82f8 (diff) | |
parent | a2285a6a3ef15470c0bb32ff71c09aa0c585caab (diff) | |
download | core-3d34631dbe0feb137f87549728acddf36b4939b0.tar.gz core-3d34631dbe0feb137f87549728acddf36b4939b0.tar.bz2 core-3d34631dbe0feb137f87549728acddf36b4939b0.zip |
Merge "healthd: Track the API change of minui/minui.h." am: fb8c70cf4b am: 93e35655c4 am: bf90005832
am: a2285a6a3e
Change-Id: I6573b527bd7d405203d2e8fd063358ad031065a1
Diffstat (limited to 'healthd')
-rw-r--r-- | healthd/healthd_mode_charger.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/healthd/healthd_mode_charger.cpp b/healthd/healthd_mode_charger.cpp index ec3de34cd..91774c6bc 100644 --- a/healthd/healthd_mode_charger.cpp +++ b/healthd/healthd_mode_charger.cpp @@ -30,6 +30,8 @@ #include <time.h> #include <unistd.h> +#include <functional> + #include <android-base/file.h> #include <android-base/stringprintf.h> @@ -42,6 +44,7 @@ #include <cutils/misc.h> #include <cutils/uevent.h> #include <cutils/properties.h> +#include <minui/minui.h> #ifdef CHARGER_ENABLE_SUSPEND #include <suspend/autosuspend.h> @@ -49,7 +52,6 @@ #include "animation.h" #include "AnimationParser.h" -#include "minui/minui.h" #include <healthd/healthd.h> @@ -568,9 +570,8 @@ static void update_screen_state(struct charger *charger, int64_t now) } } -static int set_key_callback(int code, int value, void *data) +static int set_key_callback(struct charger *charger, int code, int value) { - struct charger *charger = (struct charger *)data; int64_t now = curr_time_ms(); int down = !!value; @@ -605,7 +606,7 @@ static void update_input_state(struct charger *charger, { if (ev->type != EV_KEY) return; - set_key_callback(ev->code, ev->value, charger); + set_key_callback(charger, ev->code, ev->value); } static void set_next_key_check(struct charger *charger, @@ -762,9 +763,8 @@ int healthd_mode_charger_preparetowait(void) return (int)timeout; } -static int input_callback(int fd, unsigned int epevents, void *data) +static int input_callback(struct charger *charger, int fd, unsigned int epevents) { - struct charger *charger = (struct charger *)data; struct input_event ev; int ret; @@ -841,7 +841,8 @@ void healthd_mode_charger_init(struct healthd_config* config) LOGW("--------------- STARTING CHARGER MODE ---------------\n"); - ret = ev_init(input_callback, charger); + ret = ev_init(std::bind(&input_callback, charger, std::placeholders::_1, + std::placeholders::_2)); if (!ret) { epollfd = ev_get_epollfd(); healthd_register_event(epollfd, charger_event_handler, EVENT_WAKEUP_FD); @@ -880,7 +881,8 @@ void healthd_mode_charger_init(struct healthd_config* config) anim->frames[i].surface = scale_frames[i]; } } - ev_sync_key_state(set_key_callback, charger); + ev_sync_key_state(std::bind(&set_key_callback, charger, std::placeholders::_1, + std::placeholders::_2)); charger->next_screen_transition = -1; charger->next_key_check = -1; |