sm6375-common: power-libperfmgr: ADPF: Fix updateHintBoost blocks the binder thread

post the task into a looper thread.

Bug: 232992641
Test: Manually playing UIBench -> Transitions -> ActivityTransition
Change-Id: Ibd241834f904b4c87a51363e766e110d2818d496
This commit is contained in:
jimmyshiu 2024-07-18 12:56:42 +05:30 committed by Anand S
commit 9b5fab4177
No known key found for this signature in database
GPG key ID: 3B2983FA448B3D61
6 changed files with 43 additions and 16 deletions

View file

@ -77,7 +77,10 @@ Power::Power()
ndk::ScopedAStatus Power::setMode(Mode type, bool enabled) {
LOG(DEBUG) << "Power setMode: " << toString(type) << " to: " << enabled;
PowerSessionManager::getInstance()->updateHintMode(toString(type), enabled);
if (HintManager::GetInstance()->GetAdpfProfile() &&
HintManager::GetInstance()->GetAdpfProfile()->mReportingRateLimitNs > 0) {
PowerSessionManager::getInstance()->updateHintMode(toString(type), enabled);
}
switch (type) {
#ifdef TAP_TO_WAKE_NODE
case Mode::DOUBLE_TAP_TO_WAKE:
@ -137,7 +140,10 @@ ndk::ScopedAStatus Power::isModeSupported(Mode type, bool *_aidl_return) {
ndk::ScopedAStatus Power::setBoost(Boost type, int32_t durationMs) {
LOG(DEBUG) << "Power setBoost: " << toString(type) << " duration: " << durationMs;
PowerSessionManager::getInstance()->updateHintBoost(toString(type), durationMs);
if (HintManager::GetInstance()->GetAdpfProfile() &&
HintManager::GetInstance()->GetAdpfProfile()->mReportingRateLimitNs > 0) {
PowerSessionManager::getInstance()->updateHintBoost(toString(type), durationMs);
}
switch (type) {
case Boost::INTERACTION:
if (mSustainedPerfModeOn) {