From 8a05be348b29fef945ed2f7410185000c3f60672 Mon Sep 17 00:00:00 2001 From: LuK1337 Date: Sun, 19 Sep 2021 18:10:18 +0200 Subject: [PATCH] powershare: Treat non-zero value as enabled On SM8350, we use trx_online to determine whether PowerShare is enabled. Change-Id: I62d7448e6337696867a264cfd521379b53fe61f9 --- hidl/powershare/PowerShare.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hidl/powershare/PowerShare.cpp b/hidl/powershare/PowerShare.cpp index 06ba88f..9033e26 100644 --- a/hidl/powershare/PowerShare.cpp +++ b/hidl/powershare/PowerShare.cpp @@ -35,7 +35,8 @@ static T get(const std::string& path, const T& def) { } Return PowerShare::isEnabled() { - return get(WIRELESS_TX_ENABLE_PATH, "disable") != "disable"; + const auto value = get(WIRELESS_TX_ENABLE_PATH, ""); + return !(value == "disable" || value == "0"); } Return PowerShare::setEnabled(bool enable) {