Merge "Move device.cpp into librecovery_ui." am: db6dc14bff am: fb8636f48f
am: 81726e4430

Change-Id: I9e9651052e6d9ab8573b13164e4fdcfd84104613
diff --git a/Android.mk b/Android.mk
index c1a79bb..2fa9d53 100644
--- a/Android.mk
+++ b/Android.mk
@@ -23,6 +23,11 @@
 # librecovery_ui_default, which uses ScreenRecoveryUI.
 TARGET_RECOVERY_UI_LIB ?= librecovery_ui_default
 
+recovery_common_cflags := \
+    -Wall \
+    -Werror \
+    -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
+
 # librecovery (static library)
 # ===============================
 include $(CLEAR_VARS)
@@ -30,8 +35,7 @@
 LOCAL_SRC_FILES := \
     install.cpp
 
-LOCAL_CFLAGS := -Wall -Werror
-LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
+LOCAL_CFLAGS := $(recovery_common_cflags)
 
 ifeq ($(AB_OTA_UPDATER),true)
     LOCAL_CFLAGS += -DAB_OTA_UPDATER=1
@@ -54,13 +58,12 @@
 # ===============================
 include $(CLEAR_VARS)
 LOCAL_SRC_FILES := \
+    device.cpp \
     screen_ui.cpp \
     ui.cpp \
     vr_ui.cpp \
     wear_ui.cpp
 
-LOCAL_CFLAGS := -Wall -Werror
-
 LOCAL_MODULE := librecovery_ui
 
 LOCAL_STATIC_LIBRARIES := \
@@ -68,6 +71,8 @@
     libotautil \
     libbase
 
+LOCAL_CFLAGS := $(recovery_common_cflags)
+
 ifneq ($(TARGET_RECOVERY_UI_MARGIN_HEIGHT),)
 LOCAL_CFLAGS += -DRECOVERY_UI_MARGIN_HEIGHT=$(TARGET_RECOVERY_UI_MARGIN_HEIGHT)
 else
@@ -124,7 +129,6 @@
 
 LOCAL_SRC_FILES := \
     adb_install.cpp \
-    device.cpp \
     fuse_sdcard_provider.cpp \
     logging.cpp \
     recovery.cpp \
@@ -147,8 +151,7 @@
 endif
 endif
 
-LOCAL_CFLAGS += -DRECOVERY_API_VERSION=$(RECOVERY_API_VERSION)
-LOCAL_CFLAGS += -Wall -Werror
+LOCAL_CFLAGS := $(recovery_common_cflags)
 
 LOCAL_C_INCLUDES += \
     system/vold \