Remove allowDisablingImmediateExecutionOfScheduleMountItems feature flag

Summary:
No longer needed.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D20747684

fbshipit-source-id: a8077519b7670d72e23267b1c1423556ec97be3f
This commit is contained in:
Joshua Gross
2020-03-30 16:50:41 -07:00
committed by Facebook GitHub Bot
parent f21f922c83
commit b8664182da
5 changed files with 1 additions and 89 deletions
@@ -127,11 +127,9 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
// TODO: T60453649 - Add test automation to verify behavior of onMeasure
setAllowImmediateUIOperationExecution(false);
if (mUseSurface) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
setAllowImmediateUIOperationExecution(true);
return;
}
@@ -185,7 +183,6 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
mLastHeight = height;
} finally {
setAllowImmediateUIOperationExecution(true);
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
}
}
@@ -443,43 +440,6 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot {
}
}
/**
* In Fabric, it is possible for MountItems to be scheduled during onMeasure calls, specifically:
*
* <p>ReactRootView.onMeasure -> ReactRootView.updateRootLayoutSpecs ->
* FabricUIManager.updateRootLayoutSpecs -> Binding.setConstraints -> (C++) commit new tree ->
* (C++ Android binding) diff tree, schedule mount items -> FabricUIManager.scheduleMountItem
*
* <p>If called on the main thread, `scheduleMountItem` will execute MountItems synchronously,
* causing all ShadowNode updates to be flushed to the view hierarchy, on the main thread, during
* an onMeasure call.
*
* <p>Use this method to disable immediate execution of mount items.
*
* <p>This is a noop outside in pre-Fabric React Native.
*/
private void setAllowImmediateUIOperationExecution(boolean flag) {
final ReactInstanceManager reactInstanceManager = mReactInstanceManager;
if (reactInstanceManager == null) {
return;
}
final ReactContext reactApplicationContext = reactInstanceManager.getCurrentReactContext();
if (reactApplicationContext == null) {
return;
}
@Nullable
UIManager uiManager = UIManagerHelper.getUIManager(reactApplicationContext, getUIManagerType());
// Ignore calling setAllowImmediateUIOperationExecution if UIManager is not properly
// initialized.
if (uiManager != null) {
uiManager.setAllowImmediateUIOperationExecution(flag);
}
}
/**
* Unmount the react application at this root view, reclaiming any JS memory associated with that
* application. If {@link #startReactApplication} is called, this method must be called before the
@@ -81,16 +81,4 @@ public interface UIManager extends JSIModule, PerformanceCounter {
* @param eventType
*/
void sendAccessibilityEvent(int reactTag, int eventType);
/**
* When mounting instructions are scheduled on the UI thread, should they be executed immediately?
* For Fabric. Should noop in pre-Fabric.
*
* <p>This should only be called on the UI thread.
*
* @param flag
*/
@UiThread
@ThreadConfined(UI)
void setAllowImmediateUIOperationExecution(boolean flag);
}
@@ -71,14 +71,6 @@ public class ReactFeatureFlags {
*/
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;
/**
* Temporary flag. See UIImplementation: if this flag is enabled, ViewCommands will be queued and
* executed before any other types of UI operations.
@@ -135,13 +135,6 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
@NonNull
private final DispatchUIFrameCallback mDispatchUIFrameCallback;
/**
* Whether or not to immediately, synchronously execute mountItems when they are scheduled on the
* UI thread.
*/
@ThreadConfined(UI)
private boolean mImmediatelyExecutedMountItemsOnUI = true;
/**
* This is used to keep track of whether or not the FabricUIManager has been destroyed. Once the
* Catalyst instance is being destroyed, we should cease all operation here.
@@ -508,17 +501,6 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
}
}
/**
* When mounting instructions are scheduled on the UI thread, should they be executed immediately?
* *
*/
@Override
@UiThread
@ThreadConfined(UI)
public void setAllowImmediateUIOperationExecution(boolean flag) {
mImmediatelyExecutedMountItemsOnUI = flag;
}
/**
* This method enqueues UI operations directly to the UI thread. This might change in the future
* to enforce execution order using {@link ReactChoreographer#CallbackType}.
@@ -557,12 +539,7 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
if (UiThreadUtil.isOnUiThread()) {
// We only read these flags on the UI thread.
boolean immediateExecutionEnabled =
!ReactFeatureFlags.allowDisablingImmediateExecutionOfScheduleMountItems
|| mImmediatelyExecutedMountItemsOnUI;
if (immediateExecutionEnabled) {
tryDispatchMountItems();
}
tryDispatchMountItems();
}
// Post markers outside of lock and after sync mounting finishes its execution
@@ -825,11 +825,6 @@ public class UIManagerModule extends ReactContextBaseJavaModule
}
}
@Override
public void setAllowImmediateUIOperationExecution(boolean flag) {
// Noop outside of Fabric, call directly on FabricUIManager
}
/**
* Schedule a block to be executed on the UI thread. Useful if you need to execute view logic
* after all currently queued view updates have completed.