Remove enable_delayed_view_state_deletion_android feature flag

Summary: changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D40299970

fbshipit-source-id: 2569b55450cdb06952316c97a8f77b97ead6ebf4
This commit is contained in:
Samuel Susla
2022-10-13 10:19:28 -07:00
committed by Facebook GitHub Bot
parent 60869d0885
commit d6f9adeaec
3 changed files with 5 additions and 49 deletions
@@ -95,8 +95,6 @@ public class ReactFeatureFlags {
public static boolean insertZReorderBarriersOnViewGroupChildren = true;
/** Feature Flag for mitigatin concurrent root crashes */
public static boolean enableDelayedViewStateDeletion = false;
public static boolean disablePreallocationOnClone = false;
public static boolean shouldRememberAllocatedViews = false;
@@ -93,14 +93,6 @@ public class SurfaceMountingManager {
// This is null *until* StopSurface is called.
private Set<Integer> mTagSetForStoppedSurface;
// C++ layer checks for prop revision and doesn't
// dispatch createView mount item if view pre-allocation mount item was dispatched.
// This leads to missing createView and pre-mature deletion of ViewState.
// To work around this issue, ViewState deletion is delayed until subsequent commit.
// If the subsequent commit accesses ViewState, it won't be deleted.
private Set<Integer> mSoftDeletedViewStateTags;
private Set<Integer> mScheduledForDeletionViewStateTags;
private final int mSurfaceId;
public SurfaceMountingManager(
@@ -117,11 +109,6 @@ public class SurfaceMountingManager {
mRootViewManager = rootViewManager;
mMountItemExecutor = mountItemExecutor;
mThemedReactContext = reactContext;
if (ReactFeatureFlags.enableDelayedViewStateDeletion) {
mSoftDeletedViewStateTags = new HashSet();
mScheduledForDeletionViewStateTags = new HashSet();
}
}
public boolean isStopped() {
@@ -1188,23 +1175,6 @@ public class SurfaceMountingManager {
}
}
@UiThread
public void didUpdateViews() {
if (ReactFeatureFlags.enableDelayedViewStateDeletion) {
for (Integer reactTag : mScheduledForDeletionViewStateTags) {
// To delete we simply remove the tag from the registry.
// We want to rely on the correct set of MountInstructions being sent to the platform,
// or StopSurface being called, so we do not handle deleting descendents of the View.
ViewState viewState = mTagToViewState.remove(reactTag);
if (viewState != null) {
onViewStateDeleted(viewState);
}
}
mScheduledForDeletionViewStateTags = mSoftDeletedViewStateTags;
mSoftDeletedViewStateTags = new HashSet();
}
}
@UiThread
public void deleteView(int reactTag) {
UiThreadUtil.assertOnUiThread();
@@ -1222,16 +1192,12 @@ public class SurfaceMountingManager {
return;
}
if (ReactFeatureFlags.enableDelayedViewStateDeletion) {
mSoftDeletedViewStateTags.add(reactTag);
} else {
// To delete we simply remove the tag from the registry.
// We want to rely on the correct set of MountInstructions being sent to the platform,
// or StopSurface being called, so we do not handle deleting descendents of the View.
mTagToViewState.remove(reactTag);
// To delete we simply remove the tag from the registry.
// We want to rely on the correct set of MountInstructions being sent to the platform,
// or StopSurface being called, so we do not handle deleting descendents of the View.
mTagToViewState.remove(reactTag);
onViewStateDeleted(viewState);
}
onViewStateDeleted(viewState);
}
@UiThread
@@ -1281,9 +1247,6 @@ public class SurfaceMountingManager {
throw new RetryableMountingLayerException(
"Unable to find viewState for tag " + tag + ". Surface stopped: " + isStopped());
}
if (ReactFeatureFlags.enableDelayedViewStateDeletion) {
mScheduledForDeletionViewStateTags.remove(tag);
}
return viewState;
}
@@ -1292,9 +1255,6 @@ public class SurfaceMountingManager {
if (viewStates == null) {
return null;
}
if (ReactFeatureFlags.enableDelayedViewStateDeletion) {
mScheduledForDeletionViewStateTags.remove(tag);
}
return viewStates.get(tag);
}
@@ -193,8 +193,6 @@ public class IntBufferBatchMountItem implements MountItem {
}
}
surfaceMountingManager.didUpdateViews();
endMarkers();
}