rootdir: Drop chown fastcharge sysfs to system

Also fix errors of aidl
This commit is contained in:
roynatech2544 2022-10-08 00:04:29 +09:00
commit 4296d27bea
4 changed files with 3 additions and 13 deletions

View file

@ -32,7 +32,7 @@ class Battery {
return mBattery.getBatteryStats(BatterySys.CHARGE) == 0
}
set(k) {
mBattery.setBatteryWritable(BatterySys.CHARGE, k)
mBattery.setBatteryWritable(BatterySys.CHARGE, !k)
}
var FastCharge: Boolean

View file

@ -58,12 +58,13 @@ constexpr const char *FM_FREQ_SEEK =
break;
case GetType::GET_TYPE_FM_SYSFS_IF:
*_aidl_return = access("/sys/devices/virtual/s610_radio/s610_radio/", F_OK);
break;
default:
break;
};
return ndk::ScopedAStatus::ok();
}
:ndk::ScopedAStatus FMSupport::setValue(SetType type, int value) {
::ndk::ScopedAStatus FMSupport::setValue(SetType type, int value) {
switch (type) {
case SetType::SET_TYPE_FM_FREQ:
FileIO::writeline(FM_FREQ_CTL, freq * 1000);

View file

@ -49,15 +49,7 @@ static inline const char *BatterySysToPath(BatterySys type) {
::ndk::ScopedAStatus BatteryStats::setBatteryWritable(BatterySys stats,
bool value) {
bool FastCharge = false;
if (FastCharge)
seteuid(ANDROID_SYSTEM_UID);
FileIO::writeline(BatterySysToPath(stats), value ? 1 : 0);
if (FastCharge)
seteuid(ANDROID_ROOT_UID);
return ::ndk::ScopedAStatus::ok();
}

View file

@ -8,9 +8,6 @@ on early-init
on init
start watchdogd
# Fastcharge
chown system radio /sys/class/sec/switch/afc_disable
write /proc/sys/vm/swappiness 160
# ZRAM setup