soong: Add TARGET_TRUST_USB_CONTROL_{PATH,ENABLE,DISABLE}
Change-Id: Ib245114588fd14c83069e4365f9ca3e9e9536ba9
Signed-off-by: Jis G Jacob <studiokeys@blissroms.org>
diff --git a/build/soong/Android.bp b/build/soong/Android.bp
index 8fc4011..e36988c 100644
--- a/build/soong/Android.bp
+++ b/build/soong/Android.bp
@@ -212,6 +212,33 @@
}
soong_config_module_type {
+ name: "trust_usb_control",
+ module_type: "cc_defaults",
+ config_namespace: "blissGlobalVars",
+ value_variables: [
+ "target_trust_usb_control_path",
+ "target_trust_usb_control_enable",
+ "target_trust_usb_control_disable",
+ ],
+ properties: ["cppflags"],
+}
+
+trust_usb_control {
+ name: "trust_usb_control_defaults",
+ soong_config_variables: {
+ target_trust_usb_control_path: {
+ cppflags: ["-DUSB_CONTROL_PATH=\"%s\""],
+ },
+ target_trust_usb_control_enable: {
+ cppflags: ["-DUSB_CONTROL_ENABLE=\"%s\""],
+ },
+ target_trust_usb_control_disable: {
+ cppflags: ["-DUSB_CONTROL_DISABLE=\"%s\""],
+ },
+ },
+}
+
+soong_config_module_type {
name: "needs_camera_boottime",
module_type: "cc_defaults",
config_namespace: "blissGlobalVars",
diff --git a/config/BoardConfigSoong.mk b/config/BoardConfigSoong.mk
index b4134a0..14527f5 100644
--- a/config/BoardConfigSoong.mk
+++ b/config/BoardConfigSoong.mk
@@ -36,6 +36,9 @@
target_inputdispatcher_skip_event_key \
target_ld_shim_libs \
target_surfaceflinger_udfps_lib \
+ target_trust_usb_control_path \
+ target_trust_usb_control_enable \
+ target_trust_usb_control_disable \
uses_egl_display_array \
camera_override_format_from_reserved \
gralloc_handle_has_custom_content_md_reserved_size \
@@ -109,6 +112,9 @@
TARGET_INPUTDISPATCHER_SKIP_EVENT_KEY ?= 0
TARGET_QTI_VIBRATOR_EFFECT_LIB ?= libqtivibratoreffect
TARGET_SURFACEFLINGER_UDFPS_LIB ?= surfaceflinger_udfps_lib
+TARGET_TRUST_USB_CONTROL_PATH ?= /proc/sys/kernel/deny_new_usb
+TARGET_TRUST_USB_CONTROL_ENABLE ?= 1
+TARGET_TRUST_USB_CONTROL_DISABLE ?= 0
# Soong value variables
SOONG_CONFIG_blissGlobalVars_aapt_version_code := $(shell date -u +%Y%m%d)
@@ -124,6 +130,9 @@
SOONG_CONFIG_blissGlobalVars_target_init_vendor_lib := $(TARGET_INIT_VENDOR_LIB)
SOONG_CONFIG_blissGlobalVars_target_ld_shim_libs := $(subst $(space),:,$(TARGET_LD_SHIM_LIBS))
SOONG_CONFIG_blissGlobalVars_target_surfaceflinger_udfps_lib := $(TARGET_SURFACEFLINGER_UDFPS_LIB)
+SOONG_CONFIG_blissGlobalVars_target_trust_usb_control_path := $(TARGET_TRUST_USB_CONTROL_PATH)
+SOONG_CONFIG_blissGlobalVars_target_trust_usb_control_enable := $(TARGET_TRUST_USB_CONTROL_ENABLE)
+SOONG_CONFIG_blissGlobalVars_target_trust_usb_control_disable := $(TARGET_TRUST_USB_CONTROL_DISABLE)
SOONG_CONFIG_blissGlobalVars_target_inputdispatcher_skip_event_key := $(TARGET_INPUTDISPATCHER_SKIP_EVENT_KEY)
ifneq ($(filter $(QSSI_SUPPORTED_PLATFORMS),$(TARGET_BOARD_PLATFORM)),)