Fix TextInlineViews when UIImplementation processes two roots at the same time

Summary:
This diff cleans the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited right after all the view updates for a rootShadowNode have been processed by the UIImplementation class.

This intends to fix the bug reported in the task: T61185028, which root cause seems related to the fact that the variable NativeViewHierarchyOptimizer.mTagsWithLayoutVisited is not cleaned up when updating multiple rootShadowNodes as part of the same batch

changelog: [Android][internal] internal bug fix

Reviewed By: JoshuaGross

Differential Revision: D20812921

fbshipit-source-id: 28067ee29a931d7a9e9c33c90aceb4e3512dac1a
This commit is contained in:
David Vacca
2020-04-02 14:07:29 -07:00
committed by Facebook GitHub Bot
parent 46f41099e7
commit 21eb540d6e
2 changed files with 11 additions and 0 deletions
@@ -446,4 +446,14 @@ public class NativeViewHierarchyOptimizer {
}
return true;
}
/**
* Called when all the view updates of {@link ReactShadowNode} received as a parameter were
* processed.
*/
void onViewUpdatesCompleted(ReactShadowNode cssNode) {
// cssNode is not being used, but it is passed as a parameter in case this is required in the
// future.
mTagsWithLayoutVisited.clear();
}
}
@@ -920,6 +920,7 @@ public class UIImplementation {
}
}
cssNode.markUpdateSeen();
mNativeViewHierarchyOptimizer.onViewUpdatesCompleted(cssNode);
}
public void addUIBlock(UIBlock block) {