From 6239ace5a30fd66c62c3c8212202b6cbf2f212f8 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Thu, 20 Feb 2020 17:49:28 -0800 Subject: [PATCH] For T62192299, log on AppRegistry.runApplication Summary: Fabric debugging. I also have an agenda of removing all instances of `ReactConstants.TAG`, because it's overly broad and not helpful during debugging. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D20016401 fbshipit-source-id: 91e5cd7e8eb662b1a4a887c1e4e66a31ec741b46 --- .../com/facebook/react/ReactRootView.java | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java b/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java index 4c6ffcf1376..326c9df4cf5 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java @@ -38,7 +38,6 @@ import com.facebook.react.bridge.UIManager; import com.facebook.react.bridge.UiThreadUtil; import com.facebook.react.bridge.WritableMap; import com.facebook.react.bridge.WritableNativeMap; -import com.facebook.react.common.ReactConstants; import com.facebook.react.common.annotations.VisibleForTesting; import com.facebook.react.modules.appregistry.AppRegistry; import com.facebook.react.modules.core.DeviceEventManagerModule; @@ -76,6 +75,7 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot { void onAttachedToReactInstance(ReactRootView rootView); } + private static final String TAG = "ReactRootView"; private @Nullable ReactInstanceManager mReactInstanceManager; private @Nullable String mJSModuleName; private @Nullable Bundle mAppProperties; @@ -195,14 +195,11 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot { if (mReactInstanceManager == null || !mIsAttachedToInstance || mReactInstanceManager.getCurrentReactContext() == null) { - FLog.w( - ReactConstants.TAG, - "Unable to dispatch touch to JS as the catalyst instance has not been attached"); + FLog.w(TAG, "Unable to dispatch touch to JS as the catalyst instance has not been attached"); return; } if (mJSTouchDispatcher == null) { - FLog.w( - ReactConstants.TAG, "Unable to dispatch touch to JS before the dispatcher is available"); + FLog.w(TAG, "Unable to dispatch touch to JS before the dispatcher is available"); return; } ReactContext reactContext = mReactInstanceManager.getCurrentReactContext(); @@ -242,9 +239,7 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot { if (mReactInstanceManager == null || !mIsAttachedToInstance || mReactInstanceManager.getCurrentReactContext() == null) { - FLog.w( - ReactConstants.TAG, - "Unable to handle key event as the catalyst instance has not been attached"); + FLog.w(TAG, "Unable to handle key event as the catalyst instance has not been attached"); return super.dispatchKeyEvent(ev); } mAndroidHWInputDeviceHelper.handleKeyEvent(ev); @@ -257,7 +252,7 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot { || !mIsAttachedToInstance || mReactInstanceManager.getCurrentReactContext() == null) { FLog.w( - ReactConstants.TAG, + TAG, "Unable to handle focus changed event as the catalyst instance has not been attached"); super.onFocusChanged(gainFocus, direction, previouslyFocusedRect); return; @@ -272,7 +267,7 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot { || !mIsAttachedToInstance || mReactInstanceManager.getCurrentReactContext() == null) { FLog.w( - ReactConstants.TAG, + TAG, "Unable to handle child focus changed event as the catalyst instance has not been attached"); super.requestChildFocus(child, focused); return; @@ -285,14 +280,11 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot { if (mReactInstanceManager == null || !mIsAttachedToInstance || mReactInstanceManager.getCurrentReactContext() == null) { - FLog.w( - ReactConstants.TAG, - "Unable to dispatch touch to JS as the catalyst instance has not been attached"); + FLog.w(TAG, "Unable to dispatch touch to JS as the catalyst instance has not been attached"); return; } if (mJSTouchDispatcher == null) { - FLog.w( - ReactConstants.TAG, "Unable to dispatch touch to JS before the dispatcher is available"); + FLog.w(TAG, "Unable to dispatch touch to JS before the dispatcher is available"); return; } ReactContext reactContext = mReactInstanceManager.getCurrentReactContext(); @@ -435,9 +427,7 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot { private void updateRootLayoutSpecs(final int widthMeasureSpec, final int heightMeasureSpec) { if (mReactInstanceManager == null) { - FLog.w( - ReactConstants.TAG, - "Unable to update root layout specs for uninitialized ReactInstanceManager"); + FLog.w(TAG, "Unable to update root layout specs for uninitialized ReactInstanceManager"); return; } final ReactContext reactApplicationContext = mReactInstanceManager.getCurrentReactContext(); @@ -594,6 +584,8 @@ public class ReactRootView extends FrameLayout implements RootView, ReactRoot { mShouldLogContentAppeared = true; + // TODO T62192299: remove this + FLog.e(TAG, "runApplication: call AppRegistry.runApplication"); catalystInstance.getJSModule(AppRegistry.class).runApplication(jsAppModuleName, appParams); } } finally {