diff options
author | Tao Bao <tbao@google.com> | 2017-01-25 00:49:47 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-01-25 00:49:48 +0000 |
commit | e6fb950818d144d5866bc0eec989b40cfc30bbc5 (patch) | |
tree | 9e3fbd4bc8c59bd4b1761a3361246d66d3017da7 | |
parent | 2083cfad2c796dcb7e7b8a64b19c7240ec17e4a8 (diff) | |
parent | ebc30888c113ea82a7913c7eb73fb49f4fea274d (diff) | |
download | extras-e6fb950818d144d5866bc0eec989b40cfc30bbc5.tar.gz |
Merge "slideshow: Track the minui callback API change."
-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; } |