From ec009e8cd45fafab8ba9458791f28d62d711d137 Mon Sep 17 00:00:00 2001 From: Matt Mower Date: Fri, 30 Jan 2015 13:00:49 -0600 Subject: Allow devices to override USB init This enables devices to provide their own USB configuration. The contents of init.recovery.usb.rc can most simply be modified and included in a device's init.recovery.${ro.hardware}.rc. Use option: TW_EXCLUDE_DEFAULT_USB_INIT := true Rationale: Some devices handle USB pid switching in the kernel. In this case, USB init provides switching functions which differ from the standard on property:sys.usb.config=xyz. Other devices should not see USB attempt mtp,adb mode when TW_EXCLUDE_MTP is set. Cherry-picked from android-5.0 Change-Id: Ief0fcaf46a1782102166fc1b733a34b1a1ba0802 --- Android.mk | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'Android.mk') diff --git a/Android.mk b/Android.mk index 0f923a8cb..664c487e8 100644 --- a/Android.mk +++ b/Android.mk @@ -308,6 +308,9 @@ endif ifneq ($(wildcard bionic/libc/include/sys/capability.h),) LOCAL_CFLAGS += -DHAVE_CAPABILITIES endif +ifneq ($(TARGET_RECOVERY_INITRC),) + TW_EXCLUDE_DEFAULT_USB_INIT := true +endif LOCAL_ADDITIONAL_DEPENDENCIES := \ dump_image \ @@ -370,6 +373,9 @@ endif ifeq ($(TW_INCLUDE_INJECTTWRP), true) LOCAL_ADDITIONAL_DEPENDENCIES += injecttwrp endif +ifneq ($(TW_EXCLUDE_DEFAULT_USB_INIT), true) + LOCAL_ADDITIONAL_DEPENDENCIES += init.recovery.usb.rc +endif # Allow devices to specify device-specific recovery dependencies ifneq ($(TARGET_RECOVERY_DEVICE_MODULES),) LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_RECOVERY_DEVICE_MODULES) @@ -503,7 +509,8 @@ include $(commands_recovery_local_path)/injecttwrp/Android.mk \ $(commands_recovery_local_path)/twrpTarMain/Android.mk \ $(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)/dosfstools/Android.mk \ + $(commands_recovery_local_path)/etc/Android.mk ifeq ($(TW_INCLUDE_CRYPTO), true) include $(commands_recovery_local_path)/crypto/lollipop/Android.mk -- cgit v1.2.3