Remove redundant isBridgeless() checking

Summary:
3rd step of following 3 steps:

1, Rename hasActiveCatalystInstance() to hasActiveReactInstance() so it won't sounds like CatalystInstance-only. D27335055 (https://github.com/facebook/react-native/commit/dfa8eb0558338f18ea01f294a64d355f6deeff06)
2, Implement hasActiveReactInstance() for Venice. D27343867
3, Remove previous mitigation. D27343952

Changelog:
[Category][Type] - Remove isBridgeless() mitigation

Reviewed By: mdvacca

Differential Revision: D27343952

fbshipit-source-id: 158175e58d0f4248623d369793e919e43e8ad972
This commit is contained in:
Lulu Wu
2021-03-31 09:38:14 -07:00
committed by Facebook GitHub Bot
parent dfa8eb0558
commit 10830f4db9
3 changed files with 4 additions and 8 deletions
@@ -52,8 +52,7 @@ public abstract class ReactContextBaseJavaModule extends BaseJavaModule {
*/
@ThreadConfined(ANY)
protected @Nullable final ReactApplicationContext getReactApplicationContextIfActiveOrWarn() {
if (mReactApplicationContext.hasActiveReactInstance()
|| mReactApplicationContext.isBridgeless()) {
if (mReactApplicationContext.hasActiveReactInstance()) {
return mReactApplicationContext;
}
@@ -914,8 +914,7 @@ public abstract class DevSupportManagerBase
});
@Nullable ReactContext context = mCurrentContext;
if (context == null
|| (!context.isBridgeless() && !context.hasActiveReactInstance())) {
if (context == null || !context.hasActiveReactInstance()) {
return;
}
@@ -129,8 +129,7 @@ public class DialogModule extends NativeDialogManagerAndroidSpec implements Life
@Override
public void onClick(DialogInterface dialog, int which) {
if (!mCallbackConsumed) {
if (getReactApplicationContext().isBridgeless()
|| getReactApplicationContext().hasActiveReactInstance()) {
if (getReactApplicationContext().hasActiveReactInstance()) {
mCallback.invoke(ACTION_BUTTON_CLICKED, which);
mCallbackConsumed = true;
}
@@ -140,8 +139,7 @@ public class DialogModule extends NativeDialogManagerAndroidSpec implements Life
@Override
public void onDismiss(DialogInterface dialog) {
if (!mCallbackConsumed) {
if (getReactApplicationContext().isBridgeless()
|| getReactApplicationContext().hasActiveReactInstance()) {
if (getReactApplicationContext().hasActiveReactInstance()) {
mCallback.invoke(ACTION_DISMISSED);
mCallbackConsumed = true;
}