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
This commit is contained in:
Ramanpreet Nara
2019-12-11 11:31:51 -08:00
committed by Facebook Github Bot
parent a8fbc5b893
commit f8d5c5bfd7
@@ -10,7 +10,6 @@ package com.facebook.react.bridge;
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 abstract class ReactContextBaseJavaModule extends BaseJavaModule {
mReactApplicationContext = null;
}
public ReactContextBaseJavaModule(@NonNull ReactApplicationContext reactContext) {
public ReactContextBaseJavaModule(@Nullable ReactApplicationContext reactContext) {
mReactApplicationContext = reactContext;
}