summaryrefslogtreecommitdiffstats
path: root/wear_ui.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-08-05 05:06:23 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-08-05 05:06:23 +0200
commit6b7037a5c8b81f43d68af1343024bde0d4f60fde (patch)
tree28037d5a1099e2bdcc5c0b1bb91a02f4e1769d2f /wear_ui.cpp
parentSnap for 4927259 from 67b66c019ac5760b5e6d9e1280f2d36cec509956 to qt-release (diff)
parentMerge "minui: Use runtime properties instead of build time vars." am: ebc04d1e7a am: ce0409a560 am: 8f545f4c8c (diff)
downloadandroid_bootable_recovery-6b7037a5c8b81f43d68af1343024bde0d4f60fde.tar
android_bootable_recovery-6b7037a5c8b81f43d68af1343024bde0d4f60fde.tar.gz
android_bootable_recovery-6b7037a5c8b81f43d68af1343024bde0d4f60fde.tar.bz2
android_bootable_recovery-6b7037a5c8b81f43d68af1343024bde0d4f60fde.tar.lz
android_bootable_recovery-6b7037a5c8b81f43d68af1343024bde0d4f60fde.tar.xz
android_bootable_recovery-6b7037a5c8b81f43d68af1343024bde0d4f60fde.tar.zst
android_bootable_recovery-6b7037a5c8b81f43d68af1343024bde0d4f60fde.zip
Diffstat (limited to 'wear_ui.cpp')
-rw-r--r--wear_ui.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/wear_ui.cpp b/wear_ui.cpp
index f50823688..3b057b761 100644
--- a/wear_ui.cpp
+++ b/wear_ui.cpp
@@ -25,17 +25,22 @@
#include <android-base/strings.h>
#include <minui/minui.h>
+constexpr int kDefaultProgressBarBaseline = 259;
+constexpr int kDefaultMenuUnusableRows = 9;
+
WearRecoveryUI::WearRecoveryUI()
: ScreenRecoveryUI(true),
- 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().
+ progress_bar_baseline_(android::base::GetIntProperty("ro.recovery.ui.progress_bar_baseline",
+ kDefaultProgressBarBaseline)),
+ menu_unusable_rows_(android::base::GetIntProperty("ro.recovery.ui.menu_unusable_rows",
+ kDefaultMenuUnusableRows)) {
+ // TODO: menu_unusable_rows_ should be computed based on the lines in draw_screen_locked().
touch_screen_allowed_ = true;
}
int WearRecoveryUI::GetProgressBaseline() const {
- return kProgressBarBaseline;
+ return progress_bar_baseline_;
}
// Draw background frame on the screen. Does not flip pages.
@@ -94,7 +99,7 @@ void WearRecoveryUI::StartMenu(const std::vector<std::string>& headers,
const std::vector<std::string>& items, size_t initial_selection) {
std::lock_guard<std::mutex> lg(updateMutex);
if (text_rows_ > 0 && text_cols_ > 0) {
- menu_ = std::make_unique<Menu>(scrollable_menu_, text_rows_ - kMenuUnusableRows - 1,
+ menu_ = std::make_unique<Menu>(scrollable_menu_, text_rows_ - menu_unusable_rows_ - 1,
text_cols_ - 1, headers, items, initial_selection);
update_screen_locked();
}