From 0470ceea381775b09eee931858c3320be88cc637 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 2 Aug 2017 17:11:04 -0700 Subject: Allow customizing WearRecoveryUI via Makefile variables. With the following Makefile variables, we can reduce the work of writing (copy/pasting) device-specific WearRecoveryUI classes. The list of Makefile variables (the ones useful for Wear devices): - TARGET_RECOVERY_UI_MARGIN_HEIGHT (default: 0) - TARGET_RECOVERY_UI_MARGIN_WIDTH (default: 0) Specify the margin space that we don't want to display texts. They replace the former outer_width and outer_height. - TARGET_RECOVERY_UI_TOUCH_LOW_THRESHOLD (default: 50) - TARGET_RECOVERY_UI_TOUCH_HIGH_THRESHOLD (default: 90) Specify the sensitivity of recognizing a swipe. Devices give absolute positions, so for some devices we need to adjust the thresholds. - TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE Specify the progress bar vertical position, which should be adjusted to the actual height of a device. It replaces the former progress_bar_y. - TARGET_RECOVERY_UI_ANIMATION_FPS (default: 30) Specify the animation FPS if using device-specific animation images. It replaces the former animation_fps. Devices can specify "TARGET_RECOVERY_UI_LIB := librecovery_ui_wear", with optionally defined Makefile vars above, in BoardConfig.mk to customize their WearRecoveryUI. Also remove the obsolete wear_touch.{cpp,h}, which has been merged into ui.cpp in commit 5f8dd9951d986b65d98d6a9ea38003427e9e46df. Bug: 64307776 Test: Change the device BoardConfig.mk and test recovery image. Change-Id: Id0fb2d4e3977ab5ddd31e71f9535470cab70e41b --- Android.mk | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'Android.mk') diff --git a/Android.mk b/Android.mk index 967b9dfbe..b1ee2440b 100644 --- a/Android.mk +++ b/Android.mk @@ -79,7 +79,6 @@ LOCAL_SRC_FILES := \ ui.cpp \ vr_ui.cpp \ wear_ui.cpp \ - wear_touch.cpp \ LOCAL_MODULE := recovery @@ -120,6 +119,18 @@ else LOCAL_CFLAGS += -DRECOVERY_UI_TOUCH_HIGH_THRESHOLD=90 endif +ifneq ($(TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE),) +LOCAL_CFLAGS += -DRECOVERY_UI_PROGRESS_BAR_BASELINE=$(TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE) +else +LOCAL_CFLAGS += -DRECOVERY_UI_PROGRESS_BAR_BASELINE=259 +endif + +ifneq ($(TARGET_RECOVERY_UI_ANIMATION_FPS),) +LOCAL_CFLAGS += -DRECOVERY_UI_ANIMATION_FPS=$(TARGET_RECOVERY_UI_ANIMATION_FPS) +else +LOCAL_CFLAGS += -DRECOVERY_UI_ANIMATION_FPS=30 +endif + ifneq ($(TARGET_RECOVERY_UI_VR_STEREO_OFFSET),) LOCAL_CFLAGS += -DRECOVERY_UI_VR_STEREO_OFFSET=$(TARGET_RECOVERY_UI_VR_STEREO_OFFSET) else @@ -216,6 +227,16 @@ LOCAL_STATIC_LIBRARIES := \ LOCAL_CFLAGS := -Werror include $(BUILD_STATIC_LIBRARY) +# Wear default device +# =============================== +include $(CLEAR_VARS) +LOCAL_SRC_FILES := wear_device.cpp + +# Should match TARGET_RECOVERY_UI_LIB in BoardConfig.mk. +LOCAL_MODULE := librecovery_ui_wear + +include $(BUILD_STATIC_LIBRARY) + # vr headset default device # =============================== include $(CLEAR_VARS) -- cgit v1.2.3 From eea3af3f911d36ac1a82a9fb95d24912cc07e3b1 Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Fri, 11 Aug 2017 13:50:24 -0700 Subject: wear_ui: Expose menu_unusable_rows via Makefile var. This variable is useful on small screens (e.g. on watches) to handle long menus. We should have better way to handle this value smartly. Prior to that, expose the value to be overridable by using the generic wearable UI module (librecovery_ui_wear). Bug: 64307776 Test: Define the variable, build and boot into recovery image and check the UI menu. Change-Id: I5d7a6baa8bb4cc852bfcc2a7b3cc9686c1c8817e --- Android.mk | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Android.mk') 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 -- cgit v1.2.3