mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Ship setJSResponder in code
Summary: setJSResponder/clearJSResponder have been in use in prod for a while and are stable. Ship them in code. Changelog: [Internal] Reviewed By: sammy-SC Differential Revision: D28889894 fbshipit-source-id: 1c42526cd890d528062eeb50761fc49cc6109d76
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a18a2de4b4
commit
3ba815228e
@@ -47,9 +47,6 @@ public class ReactFeatureFlags {
|
||||
/** Enables a more aggressive cleanup during destruction of ReactContext */
|
||||
public static boolean enableReactContextCleanupFix = false;
|
||||
|
||||
/** Enables JS Responder in Fabric */
|
||||
public static boolean enableJSResponder = false;
|
||||
|
||||
/** Feature flag to configure eager initialization of MapBuffer So file */
|
||||
public static boolean enableEagerInitializeMapBufferSoFile = false;
|
||||
|
||||
|
||||
@@ -927,28 +927,26 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
|
||||
final int reactTag,
|
||||
final int initialReactTag,
|
||||
final boolean blockNativeResponder) {
|
||||
if (ReactFeatureFlags.enableJSResponder) {
|
||||
mMountItemDispatcher.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 + "]");
|
||||
}
|
||||
mMountItemDispatcher.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;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -956,20 +954,18 @@ public class FabricUIManager implements UIManager, LifecycleEventListener {
|
||||
* the touch events are going to be handled by JS.
|
||||
*/
|
||||
public void clearJSResponder() {
|
||||
if (ReactFeatureFlags.enableJSResponder) {
|
||||
mMountItemDispatcher.addMountItem(
|
||||
new MountItem() {
|
||||
@Override
|
||||
public void execute(MountingManager mountingManager) {
|
||||
mountingManager.clearJSResponder();
|
||||
}
|
||||
mMountItemDispatcher.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