Merge up to AOSP marshmallow-release
In order to maintain compatibility with older trees, we now have
minadbd.old and minui.old. I had to use a TARGET_GLOBAL_CFLAG to
handle ifdef issues in minui/minui.d because healthd includes
minui/minui.h and there was no other alternative to make minui.h
compatible with older trees without having to modify healthd rules
which is outside of TWRP.
Note that the new minui does not currently have support for qcom
overlay graphics. Support for this graphics mode will likely be
added in a later patch set. If you are building in a 6.0 tree and
have a device that needs qcom overlay graphics, be warned, as off
mode charging may not work properly. A dead battery in this case
could potentially brick your device if it is unable to charge as
healthd handles charging duties.
Update rules for building toolbox and add rules for making toybox
Use permissive.sh in init.rc which will follow symlinks so we do
not have to worry about what binary is supplying the setenforce
functionality (toolbox, toybox, or busybox).
Fix a few warnings in the main recovery binary source code.
Fix a few includes that were missing that prevented compiling in
6.0
Change-Id: Ia67aa2107d260883da5e365475a19bea538e8b97
diff --git a/Android.mk b/Android.mk
index c1365e7..ed32528 100644
--- a/Android.mk
+++ b/Android.mk
@@ -88,14 +88,25 @@
# libm \
# libc
+LOCAL_C_INCLUDES += \
+ system/vold \
+ system/extras/ext4_utils \
+ system/core/adb \
+
LOCAL_C_INCLUDES += bionic external/stlport/stlport external/openssl/include $(LOCAL_PATH)/libmincrypt/includes
LOCAL_STATIC_LIBRARIES :=
LOCAL_SHARED_LIBRARIES :=
LOCAL_STATIC_LIBRARIES += libguitwrp
-LOCAL_SHARED_LIBRARIES += libz libc libstlport libcutils libstdc++ libtar libblkid libminuitwrp libminadbd libmtdutils libminzip libaosprecovery
-LOCAL_SHARED_LIBRARIES += libgccdemangle libcrecovery
+LOCAL_SHARED_LIBRARIES += libz libc libcutils libstdc++ libtar libblkid libminuitwrp libminadbd libmtdutils libminzip libaosprecovery
+LOCAL_SHARED_LIBRARIES += libcrecovery
+
+ifneq ($(wildcard external/stlport/Android.mk),)
+ LOCAL_SHARED_LIBRARIES += libstlport
+else
+ LOCAL_SHARED_LIBRARIES += libc++
+endif
ifneq ($(wildcard system/core/libsparse/Android.mk),)
LOCAL_SHARED_LIBRARIES += libsparse
@@ -113,7 +124,7 @@
LOCAL_C_INCLUDES += system/extras/ext4_utils
LOCAL_SHARED_LIBRARIES += libext4_utils
ifneq ($(wildcard external/lz4/Android.mk),)
- LOCAL_STATIC_LIBRARIES += liblz4-static
+ #LOCAL_STATIC_LIBRARIES += liblz4-static
endif
endif
ifneq ($(wildcard external/libselinux/Android.mk),)
@@ -138,14 +149,10 @@
endif
endif
-# This binary is in the recovery ramdisk, which is otherwise a copy of root.
-# It gets copied there in config/Makefile. LOCAL_MODULE_TAGS suppresses
-# a (redundant) copy of the binary in /system/bin for user builds.
-# TODO: Build the ramdisk image in a more principled way.
-LOCAL_MODULE_TAGS := eng
+LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
#ifeq ($(TARGET_RECOVERY_UI_LIB),)
- LOCAL_SRC_FILES += default_device.cpp
+# LOCAL_SRC_FILES += default_device.cpp
#else
# LOCAL_STATIC_LIBRARIES += $(TARGET_RECOVERY_UI_LIB)
#endif
@@ -271,6 +278,7 @@
ifeq ($(TW_INCLUDE_CRYPTO), true)
LOCAL_CFLAGS += -DTW_INCLUDE_CRYPTO
LOCAL_SHARED_LIBRARIES += libcryptfslollipop
+ LOCAL_C_INCLUDES += external/boringssl/src/include
endif
ifeq ($(TW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID), true)
LOCAL_CFLAGS += -DTW_USE_MODEL_HARDWARE_ID_FOR_DEVICE_ID
@@ -311,6 +319,9 @@
ifneq ($(TARGET_RECOVERY_INITRC),)
TW_EXCLUDE_DEFAULT_USB_INIT := true
endif
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 22; echo $$?),0)
+ LOCAL_CFLAGS += -DTW_USE_NEW_MINADBD
+endif
LOCAL_ADDITIONAL_DEPENDENCIES := \
dump_image \
@@ -339,6 +350,10 @@
endif
ifneq ($(TW_USE_TOOLBOX), true)
LOCAL_ADDITIONAL_DEPENDENCIES += busybox_symlinks
+else
+ ifneq ($(wildcard external/toybox/Android.mk),)
+ LOCAL_ADDITIONAL_DEPENDENCIES += toybox_symlinks
+ endif
endif
ifneq ($(TW_NO_EXFAT), true)
LOCAL_ADDITIONAL_DEPENDENCIES += mkexfatfs
@@ -483,9 +498,7 @@
include $(BUILD_SHARED_LIBRARY)
commands_recovery_local_path := $(LOCAL_PATH)
-include $(LOCAL_PATH)/minui/Android.mk \
- $(LOCAL_PATH)/minadbd/Android.mk \
- $(LOCAL_PATH)/tests/Android.mk \
+include $(LOCAL_PATH)/tests/Android.mk \
$(LOCAL_PATH)/tools/Android.mk \
$(LOCAL_PATH)/edify/Android.mk \
$(LOCAL_PATH)/updater/Android.mk \
@@ -495,6 +508,15 @@
include $(commands_recovery_local_path)/uncrypt/Android.mk
endif
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -gt 22; echo $$?),0)
+ include $(commands_recovery_local_path)/minadbd/Android.mk \
+ $(commands_recovery_local_path)/minui/Android.mk
+else
+ TARGET_GLOBAL_CFLAGS += -DTW_USE_OLD_MINUI_H
+ include $(commands_recovery_local_path)/minadbd.old/Android.mk \
+ $(commands_recovery_local_path)/minui.old/Android.mk
+endif
+
#includes for TWRP
include $(commands_recovery_local_path)/injecttwrp/Android.mk \
$(commands_recovery_local_path)/htcdumlock/Android.mk \
@@ -516,7 +538,9 @@
$(commands_recovery_local_path)/mtp/Android.mk \
$(commands_recovery_local_path)/minzip/Android.mk \
$(commands_recovery_local_path)/dosfstools/Android.mk \
- $(commands_recovery_local_path)/etc/Android.mk
+ $(commands_recovery_local_path)/etc/Android.mk \
+ $(commands_recovery_local_path)/toybox/Android.mk \
+ $(commands_recovery_local_path)/libpixelflinger/Android.mk
ifeq ($(TW_INCLUDE_CRYPTO), true)
include $(commands_recovery_local_path)/crypto/lollipop/Android.mk