Gate fix for T54997838 with a feature flag

Summary:
Gating fix for T54997838 behind a feature flag for experimentation.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18534767

fbshipit-source-id: 5c0191c454fba6dd4a36d6e179959651ec197cac
This commit is contained in:
Joshua Gross
2019-11-15 17:01:03 -08:00
committed by Facebook Github Bot
parent cc6b430c3a
commit 76f41a0578
2 changed files with 16 additions and 2 deletions
@@ -70,4 +70,12 @@ public class ReactFeatureFlags {
* and the CatalystInstance will always be destroyed in some future release.
*/
public static boolean nullifyCatalystInstanceOnDestroy = false;
/**
* Temporary flag that should be removed soon. See FabricUIManager: if this flag is disabled,
* mountItems scheduled on the UI thread will *always* be executed synchronously. If this flag is
* enabled, users of FabricUIManager may disable immediate execution of scheduled mount items.
* TODO T54997838: remove as followup
*/
public static boolean allowDisablingImmediateExecutionOfScheduleMountItems = false;
}
@@ -533,8 +533,14 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
mMountItems.add(mountItem);
}
if (mImmediatelyExecutedMountItemsOnUI && UiThreadUtil.isOnUiThread()) {
dispatchMountItems();
if (UiThreadUtil.isOnUiThread()) {
// We only read these flags on the UI thread.
boolean immediateExecutionEnabled =
!ReactFeatureFlags.allowDisablingImmediateExecutionOfScheduleMountItems
|| mImmediatelyExecutedMountItemsOnUI;
if (immediateExecutionEnabled) {
dispatchMountItems();
}
}
// Post markers outside of lock and after sync mounting finishes its execution