Skip to content

Commit 287e200

Browse files
cortinicofacebook-github-bot
authored andcommitted
Stable API - Convert to Kotlin and make internal NotThreadSafeViewHierarchyUpdateDebugListener (#47371)
Summary: Pull Request resolved: #47371 This interface should have not been exposed in the first place. I'm converting it to Kotlin + making it `internal`. I found no meaningful usage in OSS so I expect no breakages. Changelog: [Android] [Breaking] - Stable API - Convert to Kotlin and make internal `NotThreadSafeViewHierarchyUpdateDebugListener` Reviewed By: javache Differential Revision: D65420912 fbshipit-source-id: 5afdb013f588a5698b4e7467a7f1096c24d1733e
1 parent 1f62529 commit 287e200

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5658,11 +5658,6 @@ public final class com/facebook/react/uimanager/common/ViewUtil {
56585658
public static final fun isRootTag (I)Z
56595659
}
56605660

5661-
public abstract interface class com/facebook/react/uimanager/debug/NotThreadSafeViewHierarchyUpdateDebugListener {
5662-
public abstract fun onViewHierarchyUpdateEnqueued ()V
5663-
public abstract fun onViewHierarchyUpdateFinished ()V
5664-
}
5665-
56665661
public abstract interface class com/facebook/react/uimanager/events/BatchEventDispatchedListener {
56675662
public abstract fun onBatchEventDispatched ()V
56685663
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIImplementation.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,8 @@ public void onCatalystInstanceDestroyed() {
774774
mViewManagers.invalidate();
775775
}
776776

777+
// NOTE: When converted to Kotlin this method should be `internal` due to
778+
// visibility restriction for `NotThreadSafeViewHierarchyUpdateDebugListener`
777779
public void setViewHierarchyUpdateDebugListener(
778780
@Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) {
779781
mOperationsQueue.setViewHierarchyUpdateDebugListener(listener);

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,8 @@ public void onBatchComplete() {
687687
}
688688
}
689689

690+
// NOTE: When converted to Kotlin this method should be `internal` due to
691+
// visibility restriction for `NotThreadSafeViewHierarchyUpdateDebugListener`
690692
public void setViewHierarchyUpdateDebugListener(
691693
@Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) {
692694
mUIImplementation.setViewHierarchyUpdateDebugListener(listener);

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIViewOperationQueue.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,8 @@ public UIViewOperationQueue(
609609
return mNativeViewHierarchyManager;
610610
}
611611

612+
// NOTE: When converted to Kotlin this method should be `internal` due to
613+
// visibility restriction for `NotThreadSafeViewHierarchyUpdateDebugListener`
612614
public void setViewHierarchyUpdateDebugListener(
613615
@Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) {
614616
mViewHierarchyUpdateDebugListener = listener;
Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,22 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
package com.facebook.react.uimanager.debug;
8+
package com.facebook.react.uimanager.debug
99

10-
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture;
11-
import com.facebook.react.uimanager.UIManagerModule;
10+
import com.facebook.react.common.annotations.DeprecatedInNewArchitecture
1211

1312
/**
1413
* A listener that is notified about view hierarchy update events. This listener should only be used
1514
* for debug purposes and should not affect application state.
1615
*
17-
* <p>NB: while onViewHierarchyUpdateFinished will always be called from the UI thread, there are no
16+
* NB: while [onViewHierarchyUpdateFinished] will always be called from the UI thread, there are no
1817
* guarantees what thread onViewHierarchyUpdateEnqueued is called on.
1918
*/
2019
@DeprecatedInNewArchitecture
21-
public interface NotThreadSafeViewHierarchyUpdateDebugListener {
22-
23-
/**
24-
* Called when {@link UIManagerModule} enqueues a UI batch to be dispatched to the main thread.
25-
*/
26-
void onViewHierarchyUpdateEnqueued();
20+
internal interface NotThreadSafeViewHierarchyUpdateDebugListener {
21+
/** Called when `UIManagerModule` enqueues a UI batch to be dispatched to the main thread. */
22+
fun onViewHierarchyUpdateEnqueued()
2723

2824
/** Called from the main thread after a UI batch has been applied to all root views. */
29-
void onViewHierarchyUpdateFinished();
25+
fun onViewHierarchyUpdateFinished()
3026
}

0 commit comments

Comments
 (0)