diff options
Diffstat (limited to 'power-libperfmgr/aidl/PowerExt.cpp')
-rw-r--r-- | power-libperfmgr/aidl/PowerExt.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/power-libperfmgr/aidl/PowerExt.cpp b/power-libperfmgr/aidl/PowerExt.cpp index 751e5e82..1d91d9b2 100644 --- a/power-libperfmgr/aidl/PowerExt.cpp +++ b/power-libperfmgr/aidl/PowerExt.cpp @@ -47,7 +47,10 @@ ndk::ScopedAStatus PowerExt::setMode(const std::string &mode, bool enabled) { } else { HintManager::GetInstance()->EndHint(mode); } - PowerSessionManager::getInstance()->updateHintMode(mode, enabled); + if (HintManager::GetInstance()->GetAdpfProfile() && + HintManager::GetInstance()->GetAdpfProfile()->mReportingRateLimitNs > 0) { + PowerSessionManager::getInstance()->updateHintMode(mode, enabled); + } if (mode == AdaptiveCpu::HINT_NAME) { LOG(DEBUG) << "AdaptiveCpu intercepted hint"; @@ -66,7 +69,10 @@ ndk::ScopedAStatus PowerExt::isModeSupported(const std::string &mode, bool *_aid ndk::ScopedAStatus PowerExt::setBoost(const std::string &boost, int32_t durationMs) { LOG(DEBUG) << "PowerExt setBoost: " << boost << " duration: " << durationMs; - PowerSessionManager::getInstance()->updateHintBoost(boost, durationMs); + if (HintManager::GetInstance()->GetAdpfProfile() && + HintManager::GetInstance()->GetAdpfProfile()->mReportingRateLimitNs > 0) { + PowerSessionManager::getInstance()->updateHintBoost(boost, durationMs); + } if (durationMs > 0) { HintManager::GetInstance()->DoHint(boost, std::chrono::milliseconds(durationMs)); |