Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -2622,7 +2622,6 @@ public class com/facebook/react/fabric/FabricUIManager : com/facebook/react/brid
public fun resolveView (I)Landroid/view/View;
public fun sendAccessibilityEvent (II)V
public fun sendAccessibilityEventFromJS (IILjava/lang/String;)V
public fun setBinding (Lcom/facebook/react/fabric/FabricUIManagerBinding;)V
public fun setJSResponder (IIIZ)V
public fun startSurface (Landroid/view/View;Ljava/lang/String;Lcom/facebook/react/bridge/WritableMap;II)I
public fun startSurface (Lcom/facebook/react/interfaces/fabric/SurfaceHandler;Landroid/content/Context;Landroid/view/View;)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,7 @@ private long measureMapBuffer(
* padding used by RN Android TextInput.
* @return if theme data is available in the output parameters.
*/
@SuppressWarnings("unused")
public boolean getThemeData(int surfaceId, float[] defaultTextInputPadding) {
SurfaceMountingManager surfaceMountingManager = mMountingManager.getSurfaceManager(surfaceId);
Context context = surfaceMountingManager != null ? surfaceMountingManager.getContext() : null;
Expand Down Expand Up @@ -868,7 +869,7 @@ public void experimental_prefetchResource(
mReactApplicationContext, componentName, surfaceId, reactTag, params);
}

public void setBinding(FabricUIManagerBinding binding) {
void setBinding(FabricUIManagerBinding binding) {
mBinding = binding;
}

Expand Down Expand Up @@ -985,7 +986,7 @@ public void receiveEvent(
EventEmitterWrapper eventEmitter = mMountingManager.getEventEmitter(surfaceId, reactTag);
if (eventEmitter == null) {
if (mMountingManager.getViewExists(reactTag)) {
// The view is preallocated and created. However, it hasn't been mounted yet. We will have
// The view is pre-allocated and created. However, it hasn't been mounted yet. We will have
// access to the event emitter later when the view is mounted. For now just save the event
// in the view state and trigger it later.
mMountingManager.enqueuePendingEvent(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,11 @@ public void clearJSResponder() {
@AnyThread
@ThreadConfined(ANY)
public @Nullable EventEmitterWrapper getEventEmitter(int surfaceId, int reactTag) {
SurfaceMountingManager surfaceMountingManager =
(surfaceId == ViewUtil.NO_SURFACE_ID
? getSurfaceManagerForView(reactTag)
: getSurfaceManager(surfaceId));
if (surfaceMountingManager == null) {
SurfaceMountingManager smm = getSurfaceMountingManager(surfaceId, reactTag);
if (smm == null) {
return null;
}
return surfaceMountingManager.getEventEmitter(reactTag);
return smm.getEventEmitter(reactTag);
}

/**
Expand Down Expand Up @@ -458,11 +455,15 @@ public void enqueuePendingEvent(
boolean canCoalesceEvent,
@Nullable WritableMap params,
@EventCategoryDef int eventCategory) {
@Nullable SurfaceMountingManager smm = getSurfaceManager(surfaceId);
if (smm == null) {
// Cannot queue event without valid surface mountng manager. Do nothing here.
return;
}
SurfaceMountingManager smm = getSurfaceMountingManager(surfaceId, reactTag);
// Cannot queue event without valid surface mounting manager. Do nothing here.
if (smm == null) return;
smm.enqueuePendingEvent(reactTag, eventName, canCoalesceEvent, params, eventCategory);
}

private @Nullable SurfaceMountingManager getSurfaceMountingManager(int surfaceId, int reactTag) {
return (surfaceId == ViewUtil.NO_SURFACE_ID
? getSurfaceManagerForView(reactTag)
: getSurfaceManager(surfaceId));
}
}
Loading