diff options
author | 2022-12-06 23:44:45 +0000 | |
---|---|---|
committer | 2022-12-15 18:14:52 +0000 | |
commit | 61726a38043baea5627019d947cd83029c11e616 (patch) | |
tree | c8873e9667074db813bfe9b417d7e78d52a06b08 /native | |
parent | 7c5817e876c62f3237a2b94622c55b21340e846e (diff) |
Make sendHint private in platform
* Convert PerformanceHintManager sendHint to a private API
* Have HWUI depend on private implementation
Bug: b/261640114
Test: atest PerformanceHintNativeTestCases
Test: atest FrameworksCoreTests:android.os.PerformanceHintManagerTest
Change-Id: Ic65eef1fbd1c26040e86ddf3cf7c59581fee4374
Diffstat (limited to 'native')
-rw-r--r-- | native/android/libandroid.map.txt | 2 | ||||
-rw-r--r-- | native/android/performance_hint.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/native/android/libandroid.map.txt b/native/android/libandroid.map.txt index 9b0f0203f42b..4e6a0c540f49 100644 --- a/native/android/libandroid.map.txt +++ b/native/android/libandroid.map.txt @@ -330,7 +330,6 @@ LIBANDROID { APerformanceHint_updateTargetWorkDuration; # introduced=Tiramisu APerformanceHint_reportActualWorkDuration; # introduced=Tiramisu APerformanceHint_closeSession; # introduced=Tiramisu - APerformanceHint_sendHint; # introduced=UpsideDownCake local: *; }; @@ -338,6 +337,7 @@ LIBANDROID { LIBANDROID_PLATFORM { global: APerformanceHint_setIHintManagerForTesting; + APerformanceHint_sendHint; extern "C++" { ASurfaceControl_registerSurfaceStatsListener*; ASurfaceControl_unregisterSurfaceStatsListener*; diff --git a/native/android/performance_hint.cpp b/native/android/performance_hint.cpp index 40eb507a5213..95b7513caa30 100644 --- a/native/android/performance_hint.cpp +++ b/native/android/performance_hint.cpp @@ -263,14 +263,14 @@ int APerformanceHint_reportActualWorkDuration(APerformanceHintSession* session, return session->reportActualWorkDuration(actualDurationNanos); } -int APerformanceHint_sendHint(APerformanceHintSession* session, int32_t hint) { - return session->sendHint(hint); -} - void APerformanceHint_closeSession(APerformanceHintSession* session) { delete session; } +int APerformanceHint_sendHint(void* session, int32_t hint) { + return reinterpret_cast<APerformanceHintSession*>(session)->sendHint(hint); +} + void APerformanceHint_setIHintManagerForTesting(void* iManager) { delete gHintManagerForTesting; gHintManagerForTesting = nullptr; |