From f2228a093ea28e78b8652486644380018730456e Mon Sep 17 00:00:00 2001 From: roynatech2544 Date: Wed, 9 Nov 2022 18:55:35 +0900 Subject: [PATCH] universal7885: parts-aidl: Run clang-format on smartcharge impl --- .../aidl-support/parts/default/SmartCharge.cpp | 17 ++++++++++------- .../aidl-support/parts/default/SmartCharge.h | 5 +++-- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/universal7885-common/apps/aidl-support/parts/default/SmartCharge.cpp b/universal7885-common/apps/aidl-support/parts/default/SmartCharge.cpp index 2a692b8..565e96c 100644 --- a/universal7885-common/apps/aidl-support/parts/default/SmartCharge.cpp +++ b/universal7885-common/apps/aidl-support/parts/default/SmartCharge.cpp @@ -14,9 +14,9 @@ #include "SmartCharge.h" -#include -#include #include "BatteryConstants.h" +#include +#include namespace aidl::vendor::eureka::hardware::parts { @@ -24,20 +24,23 @@ 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: + sleep: std::this_thread::sleep_for(std::chrono::seconds(5)); } } @@ -48,7 +51,7 @@ sleep: EX_ILLEGAL_ARGUMENT, "Start called without configuring."); kShouldRun = true; - monitor_th = new std::thread([this] {battery_monitor();}); + monitor_th = new std::thread([this] { battery_monitor(); }); return ::ndk::ScopedAStatus::ok(); } diff --git a/universal7885-common/apps/aidl-support/parts/default/SmartCharge.h b/universal7885-common/apps/aidl-support/parts/default/SmartCharge.h index 5786118..1419897 100644 --- a/universal7885-common/apps/aidl-support/parts/default/SmartCharge.h +++ b/universal7885-common/apps/aidl-support/parts/default/SmartCharge.h @@ -20,7 +20,7 @@ namespace aidl::vendor::eureka::hardware::parts { struct SmartCharge : public BnSmartCharge { - public: +public: // Methods from ::aidl::vendor::eureka::hardware::parts::ISmartCharge // follow. ::ndk::ScopedAStatus start(void); @@ -28,7 +28,8 @@ 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: + +private: int limit; int restart; int limit_stat;