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
diff --git a/native/android/performance_hint.cpp b/native/android/performance_hint.cpp
index 40eb507..95b7513 100644
--- a/native/android/performance_hint.cpp
+++ b/native/android/performance_hint.cpp
@@ -263,14 +263,14 @@
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;