diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java index ed507fd3e..f26a295ee 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java @@ -46,7 +46,7 @@ public class UIViewOperationQueue { /** * A mutation or animation operation on the view hierarchy. */ - private interface UIOperation { + protected interface UIOperation { void execute(); } @@ -440,7 +440,7 @@ public class UIViewOperationQueue { private @Nullable NotThreadSafeViewHierarchyUpdateDebugListener mViewHierarchyUpdateDebugListener; - /* package */ UIViewOperationQueue( + protected UIViewOperationQueue( ReactApplicationContext reactContext, NativeViewHierarchyManager nativeViewHierarchyManager) { mNativeViewHierarchyManager = nativeViewHierarchyManager; @@ -484,6 +484,14 @@ public class UIViewOperationQueue { } } + /** + * Enqueues a UIOperation to be executed in UI thread. This method should only be used by a + * subclass to support UIOperations not provided by UIViewOperationQueue. + */ + protected void enqueueUIOperation(UIOperation operation) { + mOperations.add(operation); + } + public void enqueueRemoveRootView(int rootViewTag) { mOperations.add(new RemoveRootViewOperation(rootViewTag)); }