sm8350-common: vibrator: Make the usage of effect stream optional

Change-Id: I45f15112b16b04a9a012bf26e366aaebaa3a3bef
This commit is contained in:
Arian 2022-02-24 18:40:09 +01:00
parent 8463e24d5c
commit cab4afd2f1
2 changed files with 32 additions and 1 deletions

View File

@ -180,6 +180,12 @@ BOARD_PLAT_PRIVATE_SEPOLICY_DIR += $(COMMON_PATH)/sepolicy/private
BOARD_PLAT_PUBLIC_SEPOLICY_DIR += $(COMMON_PATH)/sepolicy/public BOARD_PLAT_PUBLIC_SEPOLICY_DIR += $(COMMON_PATH)/sepolicy/public
BOARD_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/vendor BOARD_SEPOLICY_DIRS += $(COMMON_PATH)/sepolicy/vendor
# Soong
SOONG_CONFIG_NAMESPACES += xiaomiSm8350Vars
SOONG_CONFIG_xiaomiSm8350Vars += \
vibrator_use_effect_stream
SOONG_CONFIG_xiaomiSm8350Vars_vibrator_use_effect_stream ?= false
# Verified Boot # Verified Boot
BOARD_AVB_ENABLE := true BOARD_AVB_ENABLE := true
BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3 BOARD_AVB_MAKE_VBMETA_IMAGE_ARGS += --flags 3

View File

@ -1,8 +1,34 @@
Common_CFlags = ["-Wall"] Common_CFlags = ["-Wall"]
Common_CFlags += ["-Werror"] Common_CFlags += ["-Werror"]
soong_config_module_type {
name: "vibrator_effect_stream",
module_type: "cc_defaults",
config_namespace: "xiaomiSm8350Vars",
bool_variables: ["vibrator_use_effect_stream"],
properties: [
"cflags",
"shared_libs",
],
}
vibrator_effect_stream {
name: "vibrator_effect_stream_defaults",
soong_config_variables: {
vibrator_use_effect_stream: {
cflags: ["-DUSE_EFFECT_STREAM"],
shared_libs: [
"libqtivibratoreffect",
],
},
},
}
cc_library_shared { cc_library_shared {
name: "vendor.qti.hardware.vibrator.impl.xiaomi_sm8350", name: "vendor.qti.hardware.vibrator.impl.xiaomi_sm8350",
defaults: [
"vibrator_effect_stream_defaults",
],
vendor: true, vendor: true,
cflags: Common_CFlags, cflags: Common_CFlags,
srcs: [ srcs: [
@ -12,7 +38,6 @@ cc_library_shared {
"libcutils", "libcutils",
"libutils", "libutils",
"liblog", "liblog",
"libqtivibratoreffect",
"libbinder_ndk", "libbinder_ndk",
"android.hardware.vibrator-ndk_platform", "android.hardware.vibrator-ndk_platform",
], ],