diff options
author | 2024-12-04 21:01:41 +0000 | |
---|---|---|
committer | 2024-12-04 21:28:04 +0000 | |
commit | d43b2ffb563dac59fccfced17826ac84e66f03e7 (patch) | |
tree | 509e9b93af538b1960a2f148b486cf258f9286b7 | |
parent | a68ddb3b5b53c1d49a5c856f4a90364622c22fcb (diff) |
Fix PerformanceHints budget calculation
Bug: 382055833
Change-Id: Icfeec0f6c5f32608054f623e53437b9d79e5bd6a
Test: atest PerformanceHintNativeTestCases
Flag: EXEMPT ndk
-rw-r--r-- | native/android/performance_hint.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/native/android/performance_hint.cpp b/native/android/performance_hint.cpp index 608c01caee96..5dbb8a996867 100644 --- a/native/android/performance_hint.cpp +++ b/native/android/performance_hint.cpp @@ -328,7 +328,7 @@ APerformanceHintManager* APerformanceHintManager::create(std::shared_ptr<IHintMa bool APerformanceHintManager::canSendLoadHints(std::vector<hal::SessionHint>& hints, int64_t now) { mHintBudget = - std::max(kMaxLoadHintsPerInterval, + std::min(kMaxLoadHintsPerInterval, mHintBudget + static_cast<double>(now - mLastBudgetReplenish) * kReplenishRate); mLastBudgetReplenish = now; |