Skip to content

Commit 3c4d761

Browse files
rubennorteTitozzz
authored andcommitted
Back out "Revert D58459930: [react-native][PR] Add ReactMarkerConstants.CONTENT_APPEARED support on Android"
Summary: Changelog: [ANDROID] [ADDED] - Add the ReactMarkerConstants.CONTENT_APPEARED support on Android in bridgeless mode. This re-applies #43620 which was reverted because a CI job started failing because we forgot to update `packages/react-native/ReactAndroid/api/ReactAndroid.api`. Reviewed By: cortinico Differential Revision: D58535868 fbshipit-source-id: 9eec33c5e798850a7434a6c391abf2fc3fc9d0a6
1 parent bdf6583 commit 3c4d761

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -432,10 +432,8 @@ public void run() {
432432

433433
if (mShouldLogContentAppeared) {
434434
mShouldLogContentAppeared = false;
435-
436-
if (mJSModuleName != null) {
437-
ReactMarker.logMarker(ReactMarkerConstants.CONTENT_APPEARED, mJSModuleName, mRootViewTag);
438-
}
435+
String jsModuleName = getJSModuleName();
436+
ReactMarker.logMarker(ReactMarkerConstants.CONTENT_APPEARED, jsModuleName, mRootViewTag);
439437
}
440438
}
441439

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactHostImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,9 @@ public DevSupportManager getDevSupportManager() {
378378
public ReactSurface createSurface(
379379
Context context, String moduleName, @Nullable Bundle initialProps) {
380380
ReactSurfaceImpl surface = new ReactSurfaceImpl(context, moduleName, initialProps);
381-
surface.attachView(new ReactSurfaceView(context, surface));
381+
ReactSurfaceView surfaceView = new ReactSurfaceView(context, surface);
382+
surfaceView.setShouldLogContentAppeared(true);
383+
surface.attachView(surfaceView);
382384
surface.attach(this);
383385
return surface;
384386
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/ReactSurfaceView.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ public void setIsFabric(boolean isFabric) {
189189
return UIManagerType.FABRIC;
190190
}
191191

192+
@Override
193+
public String getJSModuleName() {
194+
return mSurface.moduleName;
195+
}
196+
192197
@Override
193198
protected void dispatchJSTouchEvent(MotionEvent event) {
194199
if (mJSTouchDispatcher == null) {

0 commit comments

Comments
 (0)