Resume LockFreeEventDispatcher from onHostResume

Summary:
Found that after backgrounding `mShouldStop` would always remain true, which prevents events from being dispatched / scheduled.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D34247567

fbshipit-source-id: 63876986dc0cee5e2a73cb4f8a35d90379d9f8ea
This commit is contained in:
Pieter De Baets
2022-02-15 13:05:38 -08:00
committed by Facebook GitHub Bot
parent 7b2d8178b1
commit 90b98efa73
@@ -125,7 +125,8 @@ public class LockFreeEventDispatcherImpl implements EventDispatcher, LifecycleEv
@Override
public void onHostResume() {
maybePostFrameCallbackFromNonUI();
UiThreadUtil.assertOnUiThread();
mCurrentFrameCallback.resume();
}
@Override
@@ -183,6 +184,11 @@ public class LockFreeEventDispatcherImpl implements EventDispatcher, LifecycleEv
driveEventBeats();
}
public void resume() {
mShouldStop = false;
maybePost();
}
public void stop() {
mShouldStop = true;
}