power-libperfmgr: ADPF: support sending power hint

Send a hint only when the system can support the hint.

Bug: 243025173
Test: PtsUiBench & CUJ
Original-Change-Id: If56d0c22f8dd61f5fe27ba79f08f2963269abe41
Change-Id: I2c190ac357aa8c5b5da52e3e1566f4f62c388ba6
This commit is contained in:
Jimmy Shiu 2023-02-25 08:44:31 +08:00 committed by Michael Bestas
parent e4b318db52
commit 720054de96
No known key found for this signature in database
GPG key ID: CC95044519BE6669

View file

@ -364,7 +364,7 @@ ndk::ScopedAStatus PowerHintSession::sendHint(SessionHint hint) {
ALOGE("Error: hint is invalid");
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
setCpuLoadChangeHint(toString(hint));
tryToSendPowerHint(toString(hint));
mLastUpdatedTime.store(std::chrono::steady_clock::now());
if (ATRACE_ENABLED()) {
mLastHintSent = static_cast<int>(hint);