diff options
author | Tao Bao <tbao@google.com> | 2017-01-20 08:55:20 -0800 |
---|---|---|
committer | Tao Bao <tbao@google.com> | 2017-01-20 09:04:26 -0800 |
commit | ebc30888c113ea82a7913c7eb73fb49f4fea274d (patch) | |
tree | a0e8b16351912ac5d2c257c1625a6a76798dae9e /slideshow | |
parent | 7f56eee60c66062acaa72fb212037a62a7e7f62d (diff) | |
download | extras-ebc30888c113ea82a7913c7eb73fb49f4fea274d.tar.gz |
slideshow: Track the minui callback API change.
Needs the matching change in bootable/recovery.
Test: mmma system/extra/slideshow
Change-Id: Id82bee220b69b154fa1816766f58dbde4d718e8c
Diffstat (limited to 'slideshow')
-rw-r--r-- | slideshow/Android.mk | 1 | ||||
-rw-r--r-- | slideshow/slideshow.cpp | 11 |
2 files changed, 7 insertions, 5 deletions
diff --git a/slideshow/Android.mk b/slideshow/Android.mk index 8c782c30..f5d85a2f 100644 --- a/slideshow/Android.mk +++ b/slideshow/Android.mk @@ -11,6 +11,5 @@ LOCAL_MODULE_PATH := $(TARGET_ROOT_OUT_SBIN) LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_SBIN_UNSTRIPPED) LOCAL_CFLAGS := -D__STDC_LIMIT_MACROS -Werror -LOCAL_C_INCLUDES := bootable/recovery LOCAL_STATIC_LIBRARIES := libminui libpng libz libutils libstdc++ libcutils liblog libm libc include $(BUILD_EXECUTABLE) diff --git a/slideshow/slideshow.cpp b/slideshow/slideshow.cpp index 15824f83..d3e9f831 100644 --- a/slideshow/slideshow.cpp +++ b/slideshow/slideshow.cpp @@ -19,19 +19,21 @@ #include <limits.h> #include <time.h> #include <linux/input.h> + +#include <functional> + #include <cutils/klog.h> +#include <minui/minui.h> #include <utils/SystemClock.h> -#include "minui/minui.h" #define NEXT_TIMEOUT_MS 5000 #define LAST_TIMEOUT_MS 30000 #define LOGE(x...) do { KLOG_ERROR("slideshow", x); } while (0) -static int input_cb(int fd, unsigned int epevents, void *data) +static int input_cb(int fd, unsigned int epevents, int *key_code) { struct input_event ev; - int *key_code = (int *)data; *key_code = -1; @@ -108,7 +110,8 @@ int main(int argc, char **argv) return usage(); } - if (gr_init() == -1 || ev_init(input_cb, &key_code) == -1) { + if (gr_init() == -1 || ev_init(std::bind(&input_cb, std::placeholders::_1, + std::placeholders::_2, &key_code)) == -1) { LOGE("failed to initialize minui\n"); return EXIT_FAILURE; } |