Skip to content

Commit

Permalink
For T62192299, log on AppRegistry.runApplication
Browse files Browse the repository at this point in the history
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
  • Loading branch information
JoshuaGross authored and facebook-github-bot committed Feb 21, 2020
1 parent bf869d9 commit 6239ace
Showing 1 changed file with 11 additions and 19 deletions.
30 changes: 11 additions & 19 deletions ReactAndroid/src/main/java/com/facebook/react/ReactRootView.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
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;
Expand Down Expand Up @@ -76,6 +75,7 @@ public interface ReactRootViewEventListener {
void onAttachedToReactInstance(ReactRootView rootView);
}

private static final String TAG = "ReactRootView";
private @Nullable ReactInstanceManager mReactInstanceManager;
private @Nullable String mJSModuleName;
private @Nullable Bundle mAppProperties;
Expand Down Expand Up @@ -195,14 +195,11 @@ public void onChildStartedNativeGesture(MotionEvent androidEvent) {
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();
Expand Down Expand Up @@ -242,9 +239,7 @@ public boolean dispatchKeyEvent(KeyEvent ev) {
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);
Expand All @@ -257,7 +252,7 @@ protected void onFocusChanged(boolean gainFocus, int direction, Rect previouslyF
|| !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;
Expand All @@ -272,7 +267,7 @@ public void requestChildFocus(View child, View focused) {
|| !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;
Expand All @@ -285,14 +280,11 @@ private void dispatchJSTouchEvent(MotionEvent event) {
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();
Expand Down Expand Up @@ -435,9 +427,7 @@ public String getSurfaceID() {

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();
Expand Down Expand Up @@ -594,6 +584,8 @@ public void runApplication() {

mShouldLogContentAppeared = true;

// TODO T62192299: remove this
FLog.e(TAG, "runApplication: call AppRegistry.runApplication");
catalystInstance.getJSModule(AppRegistry.class).runApplication(jsAppModuleName, appParams);
}
} finally {
Expand Down

0 comments on commit 6239ace

Please sign in to comment.