From f8d5c5bfd79be0e20a205a1856bd9946143eeacf Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Wed, 11 Dec 2019 11:28:40 -0800 Subject: [PATCH] Make constructor arg of ReactContextBaseJavaModule @Nullable Summary: ExceptionManagers are created before the `ReactApplicationContext`. Once we make them all TurboModule-compatible, they'll also subclasses `ReactContextBaseJavaModule`. This means that they'll need to be created with `ReactApplicationContext`. Since one isn't available, we'll have to call `super(null)` in their constructor. Changelog: [Android][Changed] - Make ReactApplicationContext nullable as the constructor argument of ReactContextBaseJavaModule Reviewed By: PeteTheHeat Differential Revision: D18935950 fbshipit-source-id: a643a10a42cf36a2a2d6fde87795965f16295d43 --- .../com/facebook/react/bridge/ReactContextBaseJavaModule.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContextBaseJavaModule.java b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContextBaseJavaModule.java index ea6d366f9fe646..00bf2fb6ff3d3e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContextBaseJavaModule.java +++ b/ReactAndroid/src/main/java/com/facebook/react/bridge/ReactContextBaseJavaModule.java @@ -10,7 +10,6 @@ import static com.facebook.infer.annotation.ThreadConfined.ANY; import android.app.Activity; -import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.facebook.common.logging.FLog; import com.facebook.infer.annotation.Assertions; @@ -28,7 +27,7 @@ public ReactContextBaseJavaModule() { mReactApplicationContext = null; } - public ReactContextBaseJavaModule(@NonNull ReactApplicationContext reactContext) { + public ReactContextBaseJavaModule(@Nullable ReactApplicationContext reactContext) { mReactApplicationContext = reactContext; }