Suppress warning on the use of deprecated APIs
AChoreographer_postFrameworkCallback[Delayed] are deprecated since 29.
So far, calling the deprecated APIs didn't cause any warning because
compiler didn't know that they are deprecated.
As we correctly annotate the deprecation using the availability
attribute, the compiler starts to emit warning which by default is
considered as an error.
The use of the API inside the platform is considered okay because the
platform need to support the APIs for backwards compatibility.
Therefore, the errors are explicitly suppressed.
Bug: 163288375
Test: m
Change-Id: Ic9f6338e32bc6744c50ef627fbdc3f4e4afc7363
diff --git a/libs/nativedisplay/AChoreographer.cpp b/libs/nativedisplay/AChoreographer.cpp
index e458b2e..b7fccdd 100644
--- a/libs/nativedisplay/AChoreographer.cpp
+++ b/libs/nativedisplay/AChoreographer.cpp
@@ -449,12 +449,18 @@
}
void AChoreographer_routePostFrameCallback(AChoreographer* choreographer,
AChoreographer_frameCallback callback, void* data) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
return AChoreographer_postFrameCallback(choreographer, callback, data);
+#pragma clang diagnostic pop
}
void AChoreographer_routePostFrameCallbackDelayed(AChoreographer* choreographer,
AChoreographer_frameCallback callback, void* data,
long delayMillis) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
return AChoreographer_postFrameCallbackDelayed(choreographer, callback, data, delayMillis);
+#pragma clang diagnostic pop
}
void AChoreographer_routePostFrameCallback64(AChoreographer* choreographer,
AChoreographer_frameCallback64 callback, void* data) {