diff options
Diffstat (limited to 'libs/hwui/renderthread/RenderThread.cpp')
-rw-r--r-- | libs/hwui/renderthread/RenderThread.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp index 3b37c83a6acc..1f24f0e64eab 100644 --- a/libs/hwui/renderthread/RenderThread.cpp +++ b/libs/hwui/renderthread/RenderThread.cpp @@ -56,7 +56,7 @@ static const nsecs_t DISPATCH_FRAME_CALLBACKS_DELAY = milliseconds_to_nanosecond static bool gHasRenderThreadInstance = false; -static void (*gOnStartHook)() = nullptr; +static JVMAttachHook gOnStartHook = nullptr; class DisplayEventReceiverWrapper : public VsyncSource { public: @@ -111,11 +111,15 @@ bool RenderThread::hasInstance() { return gHasRenderThreadInstance; } -void RenderThread::setOnStartHook(void (*onStartHook)()) { +void RenderThread::setOnStartHook(JVMAttachHook onStartHook) { LOG_ALWAYS_FATAL_IF(hasInstance(), "can't set an onStartHook after we've started..."); gOnStartHook = onStartHook; } +JVMAttachHook RenderThread::getOnStartHook() { + return gOnStartHook; +} + RenderThread& RenderThread::getInstance() { // This is a pointer because otherwise __cxa_finalize // will try to delete it like a Good Citizen but that causes us to crash |