summaryrefslogtreecommitdiffstats
path: root/ui.h
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-08-03 20:49:09 +0200
committerandroid-build-merger <android-build-merger@google.com>2017-08-03 20:49:09 +0200
commitf589396b0e5c507d732948a65402d80b41384774 (patch)
treef6a5f5c031c52d94df14edf1e750a0348c665670 /ui.h
parentMerge "Refactor the imgdiff" am: f411f3dcfb am: 6c1a6c389b am: e500bc3e15 (diff)
parentMerge "ui: Move the support for touch inputs into RecoveryUI." am: faa5b1f773 am: 5daa000068 (diff)
downloadandroid_bootable_recovery-f589396b0e5c507d732948a65402d80b41384774.tar
android_bootable_recovery-f589396b0e5c507d732948a65402d80b41384774.tar.gz
android_bootable_recovery-f589396b0e5c507d732948a65402d80b41384774.tar.bz2
android_bootable_recovery-f589396b0e5c507d732948a65402d80b41384774.tar.lz
android_bootable_recovery-f589396b0e5c507d732948a65402d80b41384774.tar.xz
android_bootable_recovery-f589396b0e5c507d732948a65402d80b41384774.tar.zst
android_bootable_recovery-f589396b0e5c507d732948a65402d80b41384774.zip
Diffstat (limited to '')
-rw-r--r--ui.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/ui.h b/ui.h
index 7eb04aec8..5cda7af0f 100644
--- a/ui.h
+++ b/ui.h
@@ -82,6 +82,12 @@ class RecoveryUI {
// otherwise.
virtual bool HasThreeButtons();
+ // Returns true if it has a power key.
+ virtual bool HasPowerKey() const;
+
+ // Returns true if it supports touch inputs.
+ virtual bool HasTouchScreen() const;
+
// Erases any queued-up keys.
virtual void FlushKeys();
@@ -129,7 +135,14 @@ class RecoveryUI {
unsigned int brightness_normal_;
unsigned int brightness_dimmed_;
+ // Whether we should listen for touch inputs (default: false).
+ bool touch_screen_allowed_;
+
private:
+ // The sensitivity when detecting a swipe.
+ const int kTouchLowThreshold;
+ const int kTouchHighThreshold;
+
// Key event input queue
pthread_mutex_t key_queue_mutex;
pthread_cond_t key_queue_cond;
@@ -147,6 +160,16 @@ class RecoveryUI {
bool has_power_key;
bool has_up_key;
bool has_down_key;
+ bool has_touch_screen;
+
+ // Touch event related variables. See the comments in RecoveryUI::OnInputEvent().
+ int touch_slot_;
+ int touch_X_;
+ int touch_Y_;
+ int touch_start_X_;
+ int touch_start_Y_;
+ bool touch_finger_down_;
+ bool touch_swiping_;
struct key_timer_t {
RecoveryUI* ui;
@@ -157,6 +180,7 @@ class RecoveryUI {
pthread_t input_thread_;
void OnKeyDetected(int key_code);
+ void OnTouchDetected(int dx, int dy);
int OnInputEvent(int fd, uint32_t epevents);
void ProcessKey(int key_code, int updown);