From 04053365b27a5c7eb99866eb0d4a63ad6df60582 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Sun, 19 Sep 2021 18:09:57 +0200 Subject: [PATCH] powershare: Make WIRELESS_TX_ENABLE_PATH configurable via Soong flag Change-Id: I73a42f167c9d332f05e23bd00db19c0a1f9fe672 --- hidl/powershare/Android.bp | 22 +++++++++++++++++++++- hidl/powershare/PowerShare.cpp | 2 -- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/hidl/powershare/Android.bp b/hidl/powershare/Android.bp index 1bb5963..1f47ea1 100644 --- a/hidl/powershare/Android.bp +++ b/hidl/powershare/Android.bp @@ -4,9 +4,29 @@ // SPDX-License-Identifier: Apache-2.0 // +soong_config_module_type { + name: "xiaomi_powershare_hal_cc_defaults", + module_type: "cc_defaults", + config_namespace: "XIAOMI_POWERSHARE", + value_variables: ["WIRELESS_TX_ENABLE_PATH"], + properties: ["cppflags"], +} + +xiaomi_powershare_hal_cc_defaults { + name: "xiaomi_powershare_hal_defaults", + soong_config_variables: { + WIRELESS_TX_ENABLE_PATH: { + cppflags: ["-DWIRELESS_TX_ENABLE_PATH=\"%s\""], + }, + }, +} + cc_binary { name: "vendor.lineage.powershare@1.0-service.xiaomi", - defaults: ["hidl_defaults"], + defaults: [ + "hidl_defaults", + "xiaomi_powershare_hal_defaults", + ], relative_install_path: "hw", init_rc: ["vendor.lineage.powershare@1.0-service.xiaomi.rc"], vintf_fragments: ["vendor.lineage.powershare@1.0-service.xiaomi.xml"], diff --git a/hidl/powershare/PowerShare.cpp b/hidl/powershare/PowerShare.cpp index 178904c..06ba88f 100644 --- a/hidl/powershare/PowerShare.cpp +++ b/hidl/powershare/PowerShare.cpp @@ -16,8 +16,6 @@ namespace powershare { namespace V1_0 { namespace implementation { -#define WIRELESS_TX_ENABLE_PATH "/proc/wireless/enable_tx" - /* * Write value to path and close file. */