touch: Make HIGH_TOUCH_POLLING_PATH configurable via Soong flag

Change-Id: I7649e084b2604c46f47c07c355913720935e1298
This commit is contained in:
luk1337 2022-04-26 23:51:37 +00:00 committed by Sebastiano Barezzi
parent b1f26c0899
commit 8a55af6b3c
No known key found for this signature in database
GPG Key ID: 47760583F393BC44
2 changed files with 21 additions and 3 deletions

View File

@ -4,11 +4,31 @@
// SPDX-License-Identifier: Apache-2.0
//
soong_config_module_type {
name: "xiaomi_touch_hal_cc_defaults",
module_type: "cc_defaults",
config_namespace: "XIAOMI_TOUCH",
value_variables: ["HIGH_TOUCH_POLLING_PATH"],
properties: ["cppflags"],
}
xiaomi_touch_hal_cc_defaults {
name: "xiaomi_touch_hal_defaults",
soong_config_variables: {
HIGH_TOUCH_POLLING_PATH: {
cppflags: ["-DHIGH_TOUCH_POLLING_PATH=\"%s\""],
},
},
}
cc_binary {
name: "vendor.lineage.touch@1.0-service.xiaomi",
vintf_fragments: ["vendor.lineage.touch@1.0-service.xiaomi.xml"],
init_rc: ["vendor.lineage.touch@1.0-service.xiaomi.rc"],
defaults: ["hidl_defaults"],
defaults: [
"hidl_defaults",
"xiaomi_touch_hal_defaults",
],
relative_install_path: "hw",
proprietary: true,
srcs: [

View File

@ -16,8 +16,6 @@ namespace touch {
namespace V1_0 {
namespace implementation {
#define HIGH_TOUCH_POLLING_PATH = "/sys/devices/virtual/touch/touch_dev/bump_sample_rate"
Return<bool> HighTouchPollingRate::isEnabled() {
std::ifstream file(HIGH_TOUCH_POLLING_PATH);
int enabled;