AChoreographer: update the global state when unregistering
Bug: 193945763
Test: atest ChoreographerNativeTest
Change-Id: I7fb38f0edc49830decbe408cfd4816948df3f41c
diff --git a/libs/nativedisplay/AChoreographer.cpp b/libs/nativedisplay/AChoreographer.cpp
index 6a14d4f..ba71960 100644
--- a/libs/nativedisplay/AChoreographer.cpp
+++ b/libs/nativedisplay/AChoreographer.cpp
@@ -192,6 +192,7 @@
// Only poke DisplayManagerGlobal to unregister if we previously registered
// callbacks.
if (gChoreographers.ptrs.empty() && gChoreographers.registeredToDisplayManager) {
+ gChoreographers.registeredToDisplayManager = false;
JNIEnv* env = getJniEnv();
if (env == nullptr) {
ALOGW("JNI environment is unavailable, skipping choreographer cleanup");