Skip to content

Commit

Permalink
Make ReactContext and ReactApplicationContext classes abstract (faceb…
Browse files Browse the repository at this point in the history
…ook#43625)

Summary:
Pull Request resolved: facebook#43625

Changelog: [Android][Breaking] Make ReactApplicationContext and ReactContext abstract. Please instantiate BridgeReactContext instead (bridge mode). Or BridgelessReactContext instead (bridgeless mode).

Reviewed By: arushikesarwani94

Differential Revision: D55218590
  • Loading branch information
RSNara authored and facebook-github-bot committed Mar 22, 2024
1 parent 7212061 commit 870095b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/react-native/ReactAndroid/api/ReactAndroid.api
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,7 @@ public class com/facebook/react/bridge/ProxyJavaScriptExecutor$Factory : com/fac
public fun stopSamplingProfiler (Ljava/lang/String;)V
}

public class com/facebook/react/bridge/ReactApplicationContext : com/facebook/react/bridge/ReactContext {
public abstract class com/facebook/react/bridge/ReactApplicationContext : com/facebook/react/bridge/ReactContext {
public fun <init> (Landroid/content/Context;)V
}

Expand All @@ -1068,7 +1068,7 @@ public class com/facebook/react/bridge/ReactBridge {
public static fun staticInit ()V
}

public class com/facebook/react/bridge/ReactContext : android/content/ContextWrapper {
public abstract class com/facebook/react/bridge/ReactContext : android/content/ContextWrapper {
protected field mInteropModuleRegistry Lcom/facebook/react/bridge/interop/InteropModuleRegistry;
public fun <init> (Landroid/content/Context;)V
public fun addActivityEventListener (Lcom/facebook/react/bridge/ActivityEventListener;)V
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* A context wrapper that always wraps Android Application {@link Context} and {@link
* CatalystInstance} by extending {@link ReactContext}
*/
public class ReactApplicationContext extends ReactContext {
public abstract class ReactApplicationContext extends ReactContext {
// We want to wrap ApplicationContext, since there is no easy way to verify that application
// context is passed as a param, we use {@link Context#getApplicationContext} to ensure that
// the context we're wrapping is in fact an application context.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* Abstract ContextWrapper for Android application or activity {@link Context} and {@link
* CatalystInstance}
*/
public class ReactContext extends ContextWrapper {
public abstract class ReactContext extends ContextWrapper {

@DoNotStrip
public interface RCTDeviceEventEmitter extends JavaScriptModule {
Expand Down

0 comments on commit 870095b

Please sign in to comment.