Skip to content

Commit

Permalink
Resume LockFreeEventDispatcher from onHostResume
Browse files Browse the repository at this point in the history
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
  • Loading branch information
javache authored and facebook-github-bot committed Feb 15, 2022
1 parent 7b2d817 commit 90b98ef
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -125,7 +125,8 @@ public void removeBatchEventDispatchedListener(BatchEventDispatchedListener list

@Override
public void onHostResume() {
maybePostFrameCallbackFromNonUI();
UiThreadUtil.assertOnUiThread();
mCurrentFrameCallback.resume();
}

@Override
Expand Down Expand Up @@ -183,6 +184,11 @@ public void doFrame(long frameTimeNanos) {
driveEventBeats();
}

public void resume() {
mShouldStop = false;
maybePost();
}

public void stop() {
mShouldStop = true;
}
Expand Down

0 comments on commit 90b98ef

Please sign in to comment.