Specify a default module for TARGET_RECOVERY_UI_LIB.
This aligns the logic between {default,wear,vr}_device.cpp. They all
implement their default make_device() functions, but using different
RecoveryUI variants.
This CL creates a new module librecovery_ui_default that uses
ScreenRecoveryUI, which serves as the default value for
TARGET_RECOVERY_UI_LIB.
Test: lunch aosp_{angler,marlin,dragon,walleye}-userdebug;
`mmma -j bootable/recovery` respectively.
Change-Id: I6755b09d96e4809bb1c17142895fe1cad95e5a02
(cherry picked from commit 73fd036be8c7563423be0c3adbd4205c4f1bc2f5)
diff --git a/Android.mk b/Android.mk
index 0499a6d..7359c9f 100644
--- a/Android.mk
+++ b/Android.mk
@@ -18,6 +18,11 @@
RECOVERY_API_VERSION := 3
RECOVERY_FSTAB_VERSION := 2
+# TARGET_RECOVERY_UI_LIB should be one of librecovery_ui_{default,wear,vr} or a device-specific
+# module that defines make_device() and the exact RecoveryUI class for the target. It defaults to
+# librecovery_ui_default, which uses ScreenRecoveryUI.
+TARGET_RECOVERY_UI_LIB ?= librecovery_ui_default
+
# libmounts (static library)
# ===============================
include $(CLEAR_VARS)
@@ -32,8 +37,10 @@
# librecovery (static library)
# ===============================
include $(CLEAR_VARS)
+
LOCAL_SRC_FILES := \
install.cpp
+
LOCAL_CFLAGS := -Wall -Werror
LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
@@ -131,7 +138,6 @@
roots.cpp \
rotate_logs.cpp \
-
LOCAL_MODULE := recovery
LOCAL_FORCE_STATIC_EXECUTABLE := true
@@ -163,17 +169,9 @@
libvndksupport \
libbatterymonitor
-LOCAL_STATIC_LIBRARIES += librecovery
-
-# If $(TARGET_RECOVERY_UI_LIB) is defined, the recovery calls make_device() from the
-# $(TARGET_RECOVERY_UI_LIB), which depends on the librecovery_ui.
-ifeq ($(TARGET_RECOVERY_UI_LIB),)
- LOCAL_SRC_FILES += default_device.cpp
-else
- LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UI_LIB)
-endif
-
LOCAL_STATIC_LIBRARIES += \
+ librecovery \
+ $(TARGET_RECOVERY_UI_LIB) \
libverifier \
libbootloader_message \
libfs_mgr \
@@ -254,6 +252,16 @@
LOCAL_CFLAGS := -Wall -Werror
include $(BUILD_STATIC_LIBRARY)
+# Generic device that uses ScreenRecoveryUI.
+# ===============================
+include $(CLEAR_VARS)
+LOCAL_SRC_FILES := default_device.cpp
+LOCAL_CFLAGS := -Wall -Werror
+
+LOCAL_MODULE := librecovery_ui_default
+
+include $(BUILD_STATIC_LIBRARY)
+
# Wear default device
# ===============================
include $(CLEAR_VARS)