From 60aee1c46b52852e140f05748f69e38f4e3de36e Mon Sep 17 00:00:00 2001 From: Alec Mouri Date: Mon, 28 Oct 2019 16:18:59 -0700 Subject: [AChoreographer] Add refresh rate callback. This will augment the NDK to respond to display events where the display refresh rate changes. Consumers of this api will include: * HWUI, for implementing a policy for determining whether to use render-ahead, * Swappy, to potentially replace jumping into Java from native code to respond to display evnets there. * Any other native app that would rely on the up-to-date display refresh rate. Currently however this is not yet exposed to NDK as CTS is not yet written. Once CTS is written then this will be formally exposed to NDK. For now we'll leave these as APEX apis to represent incremental progress. Bug: 136262896 Test: builds Change-Id: I66d393f93eb5d681547411e330ef1b8950a35c5d --- libs/gui/DisplayEventReceiver.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libs/gui/DisplayEventReceiver.cpp') diff --git a/libs/gui/DisplayEventReceiver.cpp b/libs/gui/DisplayEventReceiver.cpp index b8faa2df4c..fd6aaf8b46 100644 --- a/libs/gui/DisplayEventReceiver.cpp +++ b/libs/gui/DisplayEventReceiver.cpp @@ -79,6 +79,14 @@ status_t DisplayEventReceiver::requestNextVsync() { return NO_INIT; } +status_t DisplayEventReceiver::toggleConfigEvents( + ISurfaceComposer::ConfigChanged configChangeFlag) { + if (mEventConnection != nullptr) { + mEventConnection->toggleConfigEvents(configChangeFlag); + return NO_ERROR; + } + return NO_INIT; +} ssize_t DisplayEventReceiver::getEvents(DisplayEventReceiver::Event* events, size_t count) { -- cgit v1.2.3-59-g8ed1b