summaryrefslogtreecommitdiff
path: root/native
diff options
context:
space:
mode:
authorBo Liu <boliu@google.com>2021-07-26 14:48:41 -0400
committerBo Liu <boliu@google.com>2021-07-26 14:49:54 -0400
commitd6a096006a2377bb48f561d2b0dc0989b4932391 (patch)
treeab7e5074d70b1410d3cb6053a0c620c230c6c9a1 /native
parent7db2ece5c7c923ce6ca1169383fa1f598aa81d63 (diff)
ADPF: Handle preferred interval on unsupported device
The original java implementation just passed along whatever the server returns which is -1 on unsupported devices. So do that here as well. Test: PerformanceHintManagerTest passes on unsupported device Bug: 194691581 Change-Id: I8ac07737e6ce52debf55478880d71f038f258056
Diffstat (limited to 'native')
-rw-r--r--native/android/performance_hint.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/native/android/performance_hint.cpp b/native/android/performance_hint.cpp
index 95a2da9226d9..51a0c99af66e 100644
--- a/native/android/performance_hint.cpp
+++ b/native/android/performance_hint.cpp
@@ -111,8 +111,7 @@ APerformanceHintManager* APerformanceHintManager::create(sp<IHintManager> manage
return nullptr;
}
if (preferredRateNanos <= 0) {
- ALOGE("%s: PerformanceHint invalid preferred rate.", __FUNCTION__);
- return nullptr;
+ preferredRateNanos = -1L;
}
return new APerformanceHintManager(std::move(manager), preferredRateNanos);
}