sm8350-common: powershare: Update TX enable node
Change-Id: I0c9b384b2debdb2f83016d7d51eff45122bb594e
This commit is contained in:
parent
62dffdd580
commit
444f982c63
3 changed files with 8 additions and 2 deletions
|
@ -26,7 +26,7 @@ namespace powershare {
|
||||||
namespace V1_0 {
|
namespace V1_0 {
|
||||||
namespace implementation {
|
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.
|
* 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<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) {
|
Return<bool> PowerShare::setEnabled(bool enable) {
|
||||||
|
|
|
@ -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
|
service vendor.powershare-hal-1-0 /vendor/bin/hw/vendor.lineage.powershare@1.0-service.oneplus_lahaina
|
||||||
class hal
|
class hal
|
||||||
user system
|
user system
|
||||||
|
|
2
sepolicy/vendor/hal_lineage_powershare_default.te
vendored
Normal file
2
sepolicy/vendor/hal_lineage_powershare_default.te
vendored
Normal 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;
|
Loading…
Reference in a new issue