power-mediatek: Run clang-format

Change-Id: I76ff3c8e6e541113d538d44a0b6810e3adfc445b
Signed-off-by: bengris32 <bengris32@protonmail.ch>
This commit is contained in:
bengris32
2023-10-26 22:39:41 +01:00
parent c6cb2c536d
commit 032a76561d
4 changed files with 19 additions and 19 deletions

1
.clang-format Symbolic link
View File

@@ -0,0 +1 @@
../../build/soong/scripts/system-clang-format

View File

@@ -123,26 +123,24 @@ ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) {
#endif
switch (type) {
#ifdef TAP_TO_WAKE_NODE
case Mode::DOUBLE_TAP_TO_WAKE:
{
case Mode::DOUBLE_TAP_TO_WAKE: {
::android::base::WriteStringToFile(enabled ? "1" : "0", TAP_TO_WAKE_NODE, true);
break;
}
#endif
case Mode::LAUNCH:
{
case Mode::LAUNCH: {
if (mLaunchHandle > 0) {
mPerf->LockRel(mLaunchHandle);
mLaunchHandle = 0;
}
if (enabled) {
mLaunchHandle = mPerf->CusLockHint(MTKPOWER_HINT_LAUNCH, kLaunchBoostDuration, getpid());
mLaunchHandle =
mPerf->CusLockHint(MTKPOWER_HINT_LAUNCH, kLaunchBoostDuration, getpid());
}
break;
}
case Mode::INTERACTIVE:
{
case Mode::INTERACTIVE: {
if (enabled) {
// Device is now in an interactive state,
// resume all previously performing hints.

View File

@@ -36,6 +36,7 @@ public:
int64_t durationNanos,
std::shared_ptr<IPowerHintSession>* _aidl_return) override;
ndk::ScopedAStatus getHintSessionPreferredRate(int64_t* outNanoseconds) override;
private:
static long long calcTimespanUs(struct timespec start, struct timespec end);
void handleInteractionHint(int32_t targetDuration);