summaryrefslogtreecommitdiffstats
path: root/ui.h
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-08-06 10:12:49 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-08-06 10:12:49 +0200
commit41a15d40ef01929a05befbd9665c95469ade6b7d (patch)
treeecce5209a54b80e47fcdf959672755dcc5e32fee /ui.h
parentrelease-request-d4f45cf4-9d73-4828-baa4-f73aa4280cd0-for-git_pi-release-4241208 snap-temp-L10800000088711883 (diff)
parentImport translations. DO NOT MERGE am: 5c2bc51bf2 -s ours (diff)
downloadandroid_bootable_recovery-41a15d40ef01929a05befbd9665c95469ade6b7d.tar
android_bootable_recovery-41a15d40ef01929a05befbd9665c95469ade6b7d.tar.gz
android_bootable_recovery-41a15d40ef01929a05befbd9665c95469ade6b7d.tar.bz2
android_bootable_recovery-41a15d40ef01929a05befbd9665c95469ade6b7d.tar.lz
android_bootable_recovery-41a15d40ef01929a05befbd9665c95469ade6b7d.tar.xz
android_bootable_recovery-41a15d40ef01929a05befbd9665c95469ade6b7d.tar.zst
android_bootable_recovery-41a15d40ef01929a05befbd9665c95469ade6b7d.zip
Diffstat (limited to 'ui.h')
-rw-r--r--ui.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/ui.h b/ui.h
index 7eb04aec8..3d9afece0 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,17 @@ 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_;
+ bool is_bootreason_recovery_ui_;
struct key_timer_t {
RecoveryUI* ui;
@@ -157,6 +181,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);