sm8350-common: powershare: Update TX enable node

Change-Id: I0c9b384b2debdb2f83016d7d51eff45122bb594e
This commit is contained in:
LuK1337 2021-05-31 21:05:05 +02:00 committed by Łukasz Patron
parent 62dffdd580
commit 444f982c63
3 changed files with 8 additions and 2 deletions

View file

@ -26,7 +26,7 @@ namespace powershare {
namespace V1_0 {
namespace implementation {
#define WIRELESS_TX_ENABLE_PATH "/proc/wireless/enable_tx"
#define WIRELESS_TX_ENABLE_PATH "/sys/class/oplus_chg/wireless/trx_online"
/*
* Write value to path and close file.
@ -47,7 +47,7 @@ static T get(const std::string& path, const T& def) {
}
Return<bool> PowerShare::isEnabled() {
return get<std::string>(WIRELESS_TX_ENABLE_PATH, "disable") != "disable";
return get<int>(WIRELESS_TX_ENABLE_PATH, 0) >= 1;
}
Return<bool> PowerShare::setEnabled(bool enable) {

View file

@ -1,3 +1,7 @@
on init
chown system system /sys/class/oplus_chg/wireless/trx_online
chmod 0644 /sys/class/oplus_chg/wireless/trx_online
service vendor.powershare-hal-1-0 /vendor/bin/hw/vendor.lineage.powershare@1.0-service.oneplus_lahaina
class hal
user system

View file

@ -0,0 +1,2 @@
allow hal_lineage_powershare_default vendor_sysfs_battery_supply:dir search;
allow hal_lineage_powershare_default vendor_sysfs_battery_supply:file rw_file_perms;