summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-08-11 22:50:24 +0200
committerTao Bao <tbao@google.com>2017-08-13 20:24:56 +0200
commitf2be3bd74ac430a31ca4beb0db321d146283db2b (patch)
tree1986c06d4d1e948a0709c008cac7a78f6c2a88d1
parentAllow customizing WearRecoveryUI via Makefile variables. (diff)
downloadandroid_bootable_recovery-f2be3bd74ac430a31ca4beb0db321d146283db2b.tar
android_bootable_recovery-f2be3bd74ac430a31ca4beb0db321d146283db2b.tar.gz
android_bootable_recovery-f2be3bd74ac430a31ca4beb0db321d146283db2b.tar.bz2
android_bootable_recovery-f2be3bd74ac430a31ca4beb0db321d146283db2b.tar.lz
android_bootable_recovery-f2be3bd74ac430a31ca4beb0db321d146283db2b.tar.xz
android_bootable_recovery-f2be3bd74ac430a31ca4beb0db321d146283db2b.tar.zst
android_bootable_recovery-f2be3bd74ac430a31ca4beb0db321d146283db2b.zip
Diffstat (limited to '')
-rw-r--r--Android.mk6
-rw-r--r--wear_ui.cpp7
-rw-r--r--wear_ui.h2
3 files changed, 11 insertions, 4 deletions
diff --git a/Android.mk b/Android.mk
index b1ee2440b..776e6ea19 100644
--- a/Android.mk
+++ b/Android.mk
@@ -131,6 +131,12 @@ else
LOCAL_CFLAGS += -DRECOVERY_UI_ANIMATION_FPS=30
endif
+ifneq ($(TARGET_RECOVERY_UI_MENU_UNUSABLE_ROWS),)
+LOCAL_CFLAGS += -DRECOVERY_UI_MENU_UNUSABLE_ROWS=$(TARGET_RECOVERY_UI_MENU_UNUSABLE_ROWS)
+else
+LOCAL_CFLAGS += -DRECOVERY_UI_MENU_UNUSABLE_ROWS=9
+endif
+
ifneq ($(TARGET_RECOVERY_UI_VR_STEREO_OFFSET),)
LOCAL_CFLAGS += -DRECOVERY_UI_VR_STEREO_OFFSET=$(TARGET_RECOVERY_UI_VR_STEREO_OFFSET)
else
diff --git a/wear_ui.cpp b/wear_ui.cpp
index b8801a0b3..169ef20e1 100644
--- a/wear_ui.cpp
+++ b/wear_ui.cpp
@@ -51,8 +51,9 @@ static double now() {
}
WearRecoveryUI::WearRecoveryUI()
- : kProgressBarBaseline(RECOVERY_UI_PROGRESS_BAR_BASELINE), menu_unusable_rows(9) {
- // TODO: menu_unusable_rows should be computed based on the lines in draw_screen_locked().
+ : kProgressBarBaseline(RECOVERY_UI_PROGRESS_BAR_BASELINE),
+ kMenuUnusableRows(RECOVERY_UI_MENU_UNUSABLE_ROWS) {
+ // TODO: kMenuUnusableRows should be computed based on the lines in draw_screen_locked().
// TODO: The following three variables are likely not needed. The first two are detected
// automatically in ScreenRecoveryUI::LoadAnimation(), based on the actual files seen on device.
@@ -268,7 +269,7 @@ void WearRecoveryUI::StartMenu(const char* const* headers, const char* const* it
show_menu = true;
menu_sel = initial_selection;
menu_start = 0;
- menu_end = visible_text_rows - 1 - menu_unusable_rows;
+ menu_end = visible_text_rows - 1 - kMenuUnusableRows;
if (menu_items <= menu_end) menu_end = menu_items;
update_screen_locked();
}
diff --git a/wear_ui.h b/wear_ui.h
index c2bbdb66e..3bd90b699 100644
--- a/wear_ui.h
+++ b/wear_ui.h
@@ -46,7 +46,7 @@ class WearRecoveryUI : public ScreenRecoveryUI {
// Unusable rows when displaying the recovery menu, including the lines for headers (Android
// Recovery, build id and etc) and the bottom lines that may otherwise go out of the screen.
- int menu_unusable_rows;
+ const int kMenuUnusableRows;
int GetProgressBaseline() const override;