mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-23 04:25:33 -04:00
universal7885: parts-aidl: Charging is enabled on 0 disabled on 1
This commit is contained in:
parent
5b75120653
commit
e29ee0a60e
1 changed files with 3 additions and 3 deletions
|
|
@ -25,12 +25,12 @@ void SmartCharge::battery_monitor(void) {
|
||||||
auto batt = FileIO::readline(BATTERY_CAPACITY_CURRENT);
|
auto batt = FileIO::readline(BATTERY_CAPACITY_CURRENT);
|
||||||
if (batt >= limit) {
|
if (batt >= limit) {
|
||||||
if (kTookAction) goto sleep;
|
if (kTookAction) goto sleep;
|
||||||
FileIO::writeline(BATTERY_CHARGE, 0);
|
FileIO::writeline(BATTERY_CHARGE, 1);
|
||||||
kTookAction = true;
|
kTookAction = true;
|
||||||
limit_stat += 1;
|
limit_stat += 1;
|
||||||
} else if (batt <= restart) {
|
} else if (batt <= restart) {
|
||||||
if (kTookAction) goto sleep;
|
if (kTookAction) goto sleep;
|
||||||
FileIO::writeline(BATTERY_CHARGE, 1);
|
FileIO::writeline(BATTERY_CHARGE, 0);
|
||||||
kTookAction = true;
|
kTookAction = true;
|
||||||
restart_stat += 1;
|
restart_stat += 1;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -56,7 +56,7 @@ sleep:
|
||||||
if (monitor_th != nullptr) {
|
if (monitor_th != nullptr) {
|
||||||
monitor_th = nullptr;
|
monitor_th = nullptr;
|
||||||
}
|
}
|
||||||
FileIO::writeline(BATTERY_CHARGE, 1);
|
FileIO::writeline(BATTERY_CHARGE, 0);
|
||||||
return ::ndk::ScopedAStatus::ok();
|
return ::ndk::ScopedAStatus::ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue