mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-24 04:45:32 -04:00
universal7885: parts-aidl: Run clang-format on smartcharge impl
This commit is contained in:
parent
5aab0c64ed
commit
f2228a093e
2 changed files with 13 additions and 9 deletions
|
|
@ -14,9 +14,9 @@
|
|||
|
||||
#include "SmartCharge.h"
|
||||
|
||||
#include <chrono>
|
||||
#include <FileIO.h>
|
||||
#include "BatteryConstants.h"
|
||||
#include <FileIO.h>
|
||||
#include <chrono>
|
||||
|
||||
namespace aidl::vendor::eureka::hardware::parts {
|
||||
|
||||
|
|
@ -24,17 +24,20 @@ void SmartCharge::battery_monitor(void) {
|
|||
while (kShouldRun) {
|
||||
auto batt = FileIO::readline(BATTERY_CAPACITY_CURRENT);
|
||||
if (batt >= limit) {
|
||||
if (kTookAction) goto sleep;
|
||||
if (kTookAction)
|
||||
goto sleep;
|
||||
FileIO::writeline(BATTERY_CHARGE, 1);
|
||||
kTookAction = true;
|
||||
limit_stat += 1;
|
||||
} else if (batt <= restart) {
|
||||
if (kTookAction) goto sleep;
|
||||
if (kTookAction)
|
||||
goto sleep;
|
||||
FileIO::writeline(BATTERY_CHARGE, 0);
|
||||
kTookAction = true;
|
||||
restart_stat += 1;
|
||||
} else {
|
||||
if (!kTookAction) goto sleep;
|
||||
if (!kTookAction)
|
||||
goto sleep;
|
||||
kTookAction = false;
|
||||
}
|
||||
sleep:
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ struct SmartCharge : public BnSmartCharge {
|
|||
::ndk::ScopedAStatus setConfig(int32_t limit, int32_t restart);
|
||||
::ndk::ScopedAStatus getLimitCnt(int32_t *_aidl_return);
|
||||
::ndk::ScopedAStatus getRestartCnt(int32_t *_aidl_return);
|
||||
|
||||
private:
|
||||
int limit;
|
||||
int restart;
|
||||
|
|
|
|||
Loading…
Reference in a new issue