diff options
author | Jimmy Shiu <jimmyshiu@google.com> | 2023-02-25 08:44:31 +0800 |
---|---|---|
committer | Jimmy Shiu <jimmyshiu@google.com> | 2023-03-08 09:00:49 +0000 |
commit | 716cdd450519795a00720df66928b0802967e0ef (patch) | |
tree | aa9017919b7288a8a1179eb911e846017b6361ef /power-libperfmgr/aidl/PowerHintSession.cpp | |
parent | bcd846dcba14eb4df5eedf7a48fb8d78051fa99a (diff) |
ADPF: support sending power hint
Send a hint only when the system can support the hint.
Bug: 243025173
Test: PtsUiBench & CUJ
Change-Id: If56d0c22f8dd61f5fe27ba79f08f2963269abe41
Merged-In: If56d0c22f8dd61f5fe27ba79f08f2963269abe41
Diffstat (limited to 'power-libperfmgr/aidl/PowerHintSession.cpp')
-rw-r--r-- | power-libperfmgr/aidl/PowerHintSession.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/power-libperfmgr/aidl/PowerHintSession.cpp b/power-libperfmgr/aidl/PowerHintSession.cpp index 14cbf01..0b10bf3 100644 --- a/power-libperfmgr/aidl/PowerHintSession.cpp +++ b/power-libperfmgr/aidl/PowerHintSession.cpp @@ -191,6 +191,15 @@ void PowerHintSession::updateUniveralBoostMode() { } } +void PowerHintSession::tryToSendPowerHint(std::string hint) { + if (!mSupportedHints[hint].has_value()) { + mSupportedHints[hint] = HintManager::GetInstance()->IsHintSupported(hint); + } + if (mSupportedHints[hint].value()) { + HintManager::GetInstance()->DoHint(hint); + } +} + int PowerHintSession::setSessionUclampMin(int32_t min) { { std::lock_guard<std::mutex> guard(mSessionLock); |