Add some diagnostics to aid in debugging ReactViewGroup.dispatchDraw crashes

Summary:
I want to see if the child count changes before/after this method execute; that would help pinpoint the cause of these crashes.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24510064

fbshipit-source-id: 11b4baf15bc5e0beb23d65546605b378d84d1b20
This commit is contained in:
Joshua Gross
2020-10-23 19:46:15 -07:00
committed by Facebook GitHub Bot
parent edb6fa7979
commit d527e03842
@@ -672,6 +672,9 @@ 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);
@@ -685,8 +688,10 @@ public class ReactViewGroup extends ViewGroup
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 < getChildCount(); i++) {
for (int i = 0; i < childCount; i++) {
View child = getChildAt(i);
FLog.e(
TAG,