summaryrefslogtreecommitdiffstats
path: root/recovery_ui/ui.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2019-06-15 00:35:31 +0200
committerTianjie Xu <xunchang@google.com>2019-07-10 01:47:07 +0200
commitb8a959b00fe57fc431034f9bea3c7b3380d4b6a5 (patch)
treedbe96a31cb6b275b6c56c16872ec1acd5b1592d9 /recovery_ui/ui.cpp
parentMerge "minadbd: delete unnecessary fdevent.h include." (diff)
downloadandroid_bootable_recovery-b8a959b00fe57fc431034f9bea3c7b3380d4b6a5.tar
android_bootable_recovery-b8a959b00fe57fc431034f9bea3c7b3380d4b6a5.tar.gz
android_bootable_recovery-b8a959b00fe57fc431034f9bea3c7b3380d4b6a5.tar.bz2
android_bootable_recovery-b8a959b00fe57fc431034f9bea3c7b3380d4b6a5.tar.lz
android_bootable_recovery-b8a959b00fe57fc431034f9bea3c7b3380d4b6a5.tar.xz
android_bootable_recovery-b8a959b00fe57fc431034f9bea3c7b3380d4b6a5.tar.zst
android_bootable_recovery-b8a959b00fe57fc431034f9bea3c7b3380d4b6a5.zip
Diffstat (limited to 'recovery_ui/ui.cpp')
-rw-r--r--recovery_ui/ui.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/recovery_ui/ui.cpp b/recovery_ui/ui.cpp
index cf0d3b563..51ad169c5 100644
--- a/recovery_ui/ui.cpp
+++ b/recovery_ui/ui.cpp
@@ -346,7 +346,7 @@ void RecoveryUI::ProcessKey(int key_code, int updown) {
bool long_press = false;
{
- std::lock_guard<std::mutex> lg(key_queue_mutex);
+ std::lock_guard<std::mutex> lg(key_press_mutex);
key_pressed[key_code] = updown;
if (updown) {
++key_down_count;
@@ -393,7 +393,7 @@ void RecoveryUI::TimeKey(int key_code, int count) {
std::this_thread::sleep_for(750ms); // 750 ms == "long"
bool long_press = false;
{
- std::lock_guard<std::mutex> lg(key_queue_mutex);
+ std::lock_guard<std::mutex> lg(key_press_mutex);
if (key_last_down == key_code && key_down_count == count) {
long_press = key_long_press = true;
}
@@ -518,13 +518,13 @@ bool RecoveryUI::IsUsbConnected() {
}
bool RecoveryUI::IsKeyPressed(int key) {
- std::lock_guard<std::mutex> lg(key_queue_mutex);
+ std::lock_guard<std::mutex> lg(key_press_mutex);
int pressed = key_pressed[key];
return pressed;
}
bool RecoveryUI::IsLongPress() {
- std::lock_guard<std::mutex> lg(key_queue_mutex);
+ std::lock_guard<std::mutex> lg(key_press_mutex);
bool result = key_long_press;
return result;
}
@@ -548,7 +548,7 @@ void RecoveryUI::FlushKeys() {
RecoveryUI::KeyAction RecoveryUI::CheckKey(int key, bool is_long_press) {
{
- std::lock_guard<std::mutex> lg(key_queue_mutex);
+ std::lock_guard<std::mutex> lg(key_press_mutex);
key_long_press = false;
}
@@ -592,6 +592,6 @@ RecoveryUI::KeyAction RecoveryUI::CheckKey(int key, bool is_long_press) {
void RecoveryUI::KeyLongPress(int) {}
void RecoveryUI::SetEnableReboot(bool enabled) {
- std::lock_guard<std::mutex> lg(key_queue_mutex);
+ std::lock_guard<std::mutex> lg(key_press_mutex);
enable_reboot = enabled;
}