diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index b76548b510b..b238f03c159 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -5658,11 +5658,6 @@ public final class com/facebook/react/uimanager/common/ViewUtil { public static final fun isRootTag (I)Z } -public abstract interface class com/facebook/react/uimanager/debug/NotThreadSafeViewHierarchyUpdateDebugListener { - public abstract fun onViewHierarchyUpdateEnqueued ()V - public abstract fun onViewHierarchyUpdateFinished ()V -} - public abstract interface class com/facebook/react/uimanager/events/BatchEventDispatchedListener { public abstract fun onBatchEventDispatched ()V } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java index 401e8b26a30..afa1d3a968d 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java @@ -774,6 +774,8 @@ public class UIImplementation { mViewManagers.invalidate(); } + // NOTE: When converted to Kotlin this method should be `internal` due to + // visibility restriction for `NotThreadSafeViewHierarchyUpdateDebugListener` public void setViewHierarchyUpdateDebugListener( @Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) { mOperationsQueue.setViewHierarchyUpdateDebugListener(listener); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java index 9ecad6f5d88..7a3cfc55ae6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java @@ -687,6 +687,8 @@ public class UIManagerModule extends ReactContextBaseJavaModule } } + // NOTE: When converted to Kotlin this method should be `internal` due to + // visibility restriction for `NotThreadSafeViewHierarchyUpdateDebugListener` public void setViewHierarchyUpdateDebugListener( @Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) { mUIImplementation.setViewHierarchyUpdateDebugListener(listener); diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java index 383d02d0a70..3e284122ca6 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java @@ -609,6 +609,8 @@ public class UIViewOperationQueue { return mNativeViewHierarchyManager; } + // NOTE: When converted to Kotlin this method should be `internal` due to + // visibility restriction for `NotThreadSafeViewHierarchyUpdateDebugListener` public void setViewHierarchyUpdateDebugListener( @Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) { mViewHierarchyUpdateDebugListener = listener; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/debug/NotThreadSafeViewHierarchyUpdateDebugListener.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/debug/NotThreadSafeViewHierarchyUpdateDebugListener.kt similarity index 57% rename from packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/debug/NotThreadSafeViewHierarchyUpdateDebugListener.java rename to packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/debug/NotThreadSafeViewHierarchyUpdateDebugListener.kt index 9a6b65eba79..9027ed465e1 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/debug/NotThreadSafeViewHierarchyUpdateDebugListener.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/debug/NotThreadSafeViewHierarchyUpdateDebugListener.kt @@ -5,26 +5,22 @@ * LICENSE file in the root directory of this source tree. */ -package com.facebook.react.uimanager.debug; +package com.facebook.react.uimanager.debug -import com.facebook.react.common.annotations.DeprecatedInNewArchitecture; -import com.facebook.react.uimanager.UIManagerModule; +import com.facebook.react.common.annotations.DeprecatedInNewArchitecture /** * A listener that is notified about view hierarchy update events. This listener should only be used * for debug purposes and should not affect application state. * - *

NB: while onViewHierarchyUpdateFinished will always be called from the UI thread, there are no + * NB: while [onViewHierarchyUpdateFinished] will always be called from the UI thread, there are no * guarantees what thread onViewHierarchyUpdateEnqueued is called on. */ @DeprecatedInNewArchitecture -public interface NotThreadSafeViewHierarchyUpdateDebugListener { - - /** - * Called when {@link UIManagerModule} enqueues a UI batch to be dispatched to the main thread. - */ - void onViewHierarchyUpdateEnqueued(); +internal interface NotThreadSafeViewHierarchyUpdateDebugListener { + /** Called when `UIManagerModule` enqueues a UI batch to be dispatched to the main thread. */ + fun onViewHierarchyUpdateEnqueued() /** Called from the main thread after a UI batch has been applied to all root views. */ - void onViewHierarchyUpdateFinished(); + fun onViewHierarchyUpdateFinished() }