From 4bc40bf8e6f545f316c42bbfc02f2580ef222c47 Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Wed, 9 Dec 2020 21:14:52 -0800 Subject: [PATCH] Remove code no longer needed for debugging T78035906 Summary: This code was useful for debugging T78035906 but is no longer needed. I'm a bit conflicted about removing it, since such issues could crop up again in the future - but they're very rare, and hopefully now we know how to avoid them. tl;dr: Make sure that mount instructions are not executed *during* a draw or measure. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D25450846 fbshipit-source-id: e261f13db252d22773e373a5de744ecc8c380a43 --- .../react/views/view/ReactViewGroup.java | 39 ------------------- 1 file changed, 39 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java index c11d912308a..cef9b5a3dfb 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java @@ -23,7 +23,6 @@ import android.os.Build; import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; -import android.view.ViewParent; import android.view.ViewStructure; import android.view.animation.Animation; import androidx.annotation.Nullable; @@ -713,48 +712,10 @@ public class ReactViewGroup extends ViewGroup @Override protected void dispatchDraw(Canvas canvas) { - // TODO T78035906: delete this if we find the root-cause - int initialChildCount = getChildCount(); - try { dispatchOverflowDraw(canvas); super.dispatchDraw(canvas); } catch (NullPointerException | StackOverflowError e) { - // Catch errors and log additional diagnostics to logcat for debugging - FLog.e( - TAG, - "Exception thrown when executing ReactViewGroup.dispatchDraw method on ReactViewGroup[" - + getId() - + "]", - e); - - // Log all children of view, if any - int childCount = getChildCount(); - FLog.e(TAG, "Initial Child Count: %d / final: %d", initialChildCount, childCount); - FLog.e(TAG, "Child List:"); - for (int i = 0; i < childCount; i++) { - View child = getChildAt(i); - FLog.e( - TAG, - "Child #" - + i - + ": " - + (child != null ? child.getId() : -1337) - + " - " - + (child != null ? child.toString() : "")); - } - - // Log all ancestors of view - ViewParent viewParent = getParent(); - FLog.e(TAG, "Ancestor List:"); - while (viewParent != null) { - ViewGroup parentViewGroup = - (viewParent instanceof ViewGroup ? (ViewGroup) viewParent : null); - int parentViewGroupId = (parentViewGroup != null ? parentViewGroup.getId() : -1337); - FLog.e(TAG, "Ancestor[" + parentViewGroupId + "]: " + viewParent.toString()); - viewParent = viewParent.getParent(); - } - // Adding special exception management for StackOverflowError for logging purposes. // This will be removed in the future. RootView rootView = RootViewUtil.getRootView(ReactViewGroup.this);