summaryrefslogtreecommitdiffstats
path: root/ui.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-01-25 01:49:47 +0100
committerGerrit Code Review <noreply-gerritcodereview@google.com>2017-01-25 01:49:48 +0100
commita47631271467248fd90fe1a628bb9249151c7e32 (patch)
tree12ac49a577a66cf61ef1d38f70d63e9cedd559b6 /ui.cpp
parentMerge "update_verifier: Move property_get() to android::base::GetProperty()." (diff)
parentminui: Move callback functions to std::function. (diff)
downloadandroid_bootable_recovery-a47631271467248fd90fe1a628bb9249151c7e32.tar
android_bootable_recovery-a47631271467248fd90fe1a628bb9249151c7e32.tar.gz
android_bootable_recovery-a47631271467248fd90fe1a628bb9249151c7e32.tar.bz2
android_bootable_recovery-a47631271467248fd90fe1a628bb9249151c7e32.tar.lz
android_bootable_recovery-a47631271467248fd90fe1a628bb9249151c7e32.tar.xz
android_bootable_recovery-a47631271467248fd90fe1a628bb9249151c7e32.tar.zst
android_bootable_recovery-a47631271467248fd90fe1a628bb9249151c7e32.zip
Diffstat (limited to 'ui.cpp')
-rw-r--r--ui.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/ui.cpp b/ui.cpp
index f31660db4..a0f741e57 100644
--- a/ui.cpp
+++ b/ui.cpp
@@ -34,11 +34,11 @@
#include <android-base/properties.h>
#include <cutils/android_reboot.h>
+#include <minui/minui.h>
#include "common.h"
#include "roots.h"
#include "device.h"
-#include "minui/minui.h"
#define UI_WAIT_KEY_TIMEOUT_SEC 120
@@ -70,10 +70,6 @@ void RecoveryUI::OnKeyDetected(int key_code) {
}
}
-int RecoveryUI::InputCallback(int fd, uint32_t epevents, void* data) {
- return reinterpret_cast<RecoveryUI*>(data)->OnInputEvent(fd, epevents);
-}
-
// Reads input events, handles special hot keys, and adds to the key queue.
static void* InputThreadLoop(void*) {
while (true) {
@@ -88,7 +84,7 @@ bool RecoveryUI::Init(const std::string& locale) {
// Set up the locale info.
SetLocale(locale);
- ev_init(InputCallback, this);
+ ev_init(std::bind(&RecoveryUI::OnInputEvent, this, std::placeholders::_1, std::placeholders::_2));
ev_iterate_available_keys(std::bind(&RecoveryUI::OnKeyDetected, this, std::placeholders::_1));