From dc8c2f676edf4968d67bc3c858a932586c819044 Mon Sep 17 00:00:00 2001 From: David Vacca Date: Tue, 12 Nov 2024 23:20:52 -0800 Subject: [PATCH] Annotate BridgeReactContext as VisibleForTesting (#47579) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/47579 BridgeReactContext is public only for testing. I'm annotating it with VisibileForTesting to make it explicit changelog: [internal] internal Reviewed By: javache Differential Revision: D65705093 fbshipit-source-id: d4d7c4195926e2d0397e805b4c49b0710a82a7eb --- .../ReactAndroid/api/ReactAndroid.api | 22 ------------------- .../react/bridge/BridgeReactContext.java | 2 ++ 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index bf197be2bc6ea9..f23e2d5bdd2a90 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -605,28 +605,6 @@ public abstract class com/facebook/react/bridge/BaseJavaModule : com/facebook/re public fun invalidate ()V } -public class com/facebook/react/bridge/BridgeReactContext : com/facebook/react/bridge/ReactApplicationContext { - public fun (Landroid/content/Context;)V - public fun destroy ()V - public fun getCatalystInstance ()Lcom/facebook/react/bridge/CatalystInstance; - public fun getFabricUIManager ()Lcom/facebook/react/bridge/UIManager; - public fun getJSCallInvokerHolder ()Lcom/facebook/react/turbomodule/core/interfaces/CallInvokerHolder; - public fun getJSModule (Ljava/lang/Class;)Lcom/facebook/react/bridge/JavaScriptModule; - public fun getNativeModule (Ljava/lang/Class;)Lcom/facebook/react/bridge/NativeModule; - public fun getNativeModule (Ljava/lang/String;)Lcom/facebook/react/bridge/NativeModule; - public fun getNativeModules ()Ljava/util/Collection; - public fun getSourceURL ()Ljava/lang/String; - public fun handleException (Ljava/lang/Exception;)V - public fun hasActiveCatalystInstance ()Z - public fun hasActiveReactInstance ()Z - public fun hasCatalystInstance ()Z - public fun hasNativeModule (Ljava/lang/Class;)Z - public fun hasReactInstance ()Z - public fun initializeWithInstance (Lcom/facebook/react/bridge/CatalystInstance;)V - public fun isBridgeless ()Z - public fun registerSegment (ILjava/lang/String;Lcom/facebook/react/bridge/Callback;)V -} - public abstract interface class com/facebook/react/bridge/BridgeReactContext$RCTDeviceEventEmitter : com/facebook/react/bridge/JavaScriptModule { public abstract fun emit (Ljava/lang/String;Ljava/lang/Object;)V } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.java index 5ef63bab9f6e66..39eb2780e2d44b 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/BridgeReactContext.java @@ -21,6 +21,7 @@ import com.facebook.react.common.annotations.DeprecatedInNewArchitecture; import com.facebook.react.common.annotations.FrameworkAPI; import com.facebook.react.common.annotations.UnstableReactNativeAPI; +import com.facebook.react.common.annotations.VisibleForTesting; import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder; import java.util.Collection; @@ -31,6 +32,7 @@ * BridgeReactContext. */ @DeprecatedInNewArchitecture +@VisibleForTesting public class BridgeReactContext extends ReactApplicationContext { @DoNotStrip public interface RCTDeviceEventEmitter extends JavaScriptModule {