mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Create MC to gate execution of JS Responder in Fabric Android
Summary: Create MC to gate execution of JS Responder in Fabric Android MC.react_fabric.enable_js_responder_fabric_android is enabled by default in the server changelog: [internal] internal Reviewed By: JoshuaGross Differential Revision: D26905296 fbshipit-source-id: 82504174394d1e10fd017435cccd38952404fda0
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1163599989
commit
fddac5908c
@@ -62,4 +62,7 @@ public class ReactFeatureFlags {
|
||||
|
||||
/** Enables setting layout params to empty to fix a crash */
|
||||
public static boolean enableSettingEmptyLayoutParams = false;
|
||||
|
||||
/** Enables JS Responder in Fabric */
|
||||
public static boolean enableJSResponder = false;
|
||||
}
|
||||
|
||||
@@ -1108,26 +1108,28 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
|
||||
final int reactTag,
|
||||
final int initialReactTag,
|
||||
final boolean blockNativeResponder) {
|
||||
addMountItem(
|
||||
new MountItem() {
|
||||
@Override
|
||||
public void execute(MountingManager mountingManager) {
|
||||
SurfaceMountingManager surfaceMountingManager =
|
||||
mountingManager.getSurfaceManager(surfaceId);
|
||||
if (surfaceMountingManager != null) {
|
||||
surfaceMountingManager.setJSResponder(
|
||||
reactTag, initialReactTag, blockNativeResponder);
|
||||
} else {
|
||||
FLog.e(
|
||||
TAG, "setJSResponder skipped, surface no longer available [" + surfaceId + "]");
|
||||
if (ReactFeatureFlags.enableJSResponder) {
|
||||
addMountItem(
|
||||
new MountItem() {
|
||||
@Override
|
||||
public void execute(MountingManager mountingManager) {
|
||||
SurfaceMountingManager surfaceMountingManager =
|
||||
mountingManager.getSurfaceManager(surfaceId);
|
||||
if (surfaceMountingManager != null) {
|
||||
surfaceMountingManager.setJSResponder(
|
||||
reactTag, initialReactTag, blockNativeResponder);
|
||||
} else {
|
||||
FLog.e(
|
||||
TAG, "setJSResponder skipped, surface no longer available [" + surfaceId + "]");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSurfaceId() {
|
||||
return surfaceId;
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public int getSurfaceId() {
|
||||
return surfaceId;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1136,18 +1138,20 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
|
||||
*/
|
||||
@DoNotStrip
|
||||
public void clearJSResponder() {
|
||||
addMountItem(
|
||||
new MountItem() {
|
||||
@Override
|
||||
public void execute(MountingManager mountingManager) {
|
||||
mountingManager.clearJSResponder();
|
||||
}
|
||||
if (ReactFeatureFlags.enableJSResponder) {
|
||||
addMountItem(
|
||||
new MountItem() {
|
||||
@Override
|
||||
public void execute(MountingManager mountingManager) {
|
||||
mountingManager.clearJSResponder();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSurfaceId() {
|
||||
return View.NO_ID;
|
||||
}
|
||||
});
|
||||
@Override
|
||||
public int getSurfaceId() {
|
||||
return View.NO_ID;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user