diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java b/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java index 326c9df4cf5..b40196b11e3 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java @@ -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: - * - *
ReactRootView.onMeasure -> ReactRootView.updateRootLayoutSpecs -> - * FabricUIManager.updateRootLayoutSpecs -> Binding.setConstraints -> (C++) commit new tree -> - * (C++ Android binding) diff tree, schedule mount items -> FabricUIManager.scheduleMountItem - * - *
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. - * - *
Use this method to disable immediate execution of mount items. - * - *
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 diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManager.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManager.java index 450f81ad6e1..89ef6a71720 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/UIManager.java @@ -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. - * - *
This should only be called on the UI thread. - * - * @param flag - */ - @UiThread - @ThreadConfined(UI) - void setAllowImmediateUIOperationExecution(boolean flag); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java index dfb268bdc68..bbe1952220b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +++ b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java @@ -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. diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java index eea6ba5abdd..6e8a1984647 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/FabricUIManager.java @@ -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 diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java index 0c50f3b5810..2000e6f7212 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java @@ -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.