alexandroid/decompiled/jadx/sources/com/facebook/react/bridge/BaseJavaModule.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

77 lines
2.8 KiB
Java

package com.facebook.react.bridge;
import androidx.annotation.Nullable;
import com.facebook.common.logging.FLog;
import com.facebook.infer.annotation.Assertions;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.infer.annotation.ThreadConfined;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.react.common.ReactConstants;
import com.facebook.react.common.build.ReactBuildConfig;
import java.util.Map;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
@Nullsafe(Nullsafe.Mode.LOCAL)
/* loaded from: classes6.dex */
public abstract class BaseJavaModule implements NativeModule {
public static final String METHOD_TYPE_ASYNC = "async";
public static final String METHOD_TYPE_PROMISE = "promise";
public static final String METHOD_TYPE_SYNC = "sync";
@Nullable
protected CxxCallbackImpl mEventEmitterCallback;
@Nullable
private final ReactApplicationContext mReactApplicationContext;
public BaseJavaModule(@Nullable ReactApplicationContext reactApplicationContext) {
this.mReactApplicationContext = reactApplicationContext;
}
@Override // com.facebook.react.bridge.NativeModule
public boolean canOverrideExistingModule() {
return false;
}
@Nullable
public Map<String, Object> getConstants() {
return null;
}
public final ReactApplicationContext getReactApplicationContext() {
return (ReactApplicationContext) Assertions.assertNotNull(this.mReactApplicationContext, "Tried to get ReactApplicationContext even though NativeModule wasn't instantiated with one");
}
@Nullable
@ThreadConfined(ThreadConfined.ANY)
public final ReactApplicationContext getReactApplicationContextIfActiveOrWarn() {
ReactApplicationContext reactApplicationContext = this.mReactApplicationContext;
if (reactApplicationContext != null && reactApplicationContext.hasActiveReactInstance()) {
return this.mReactApplicationContext;
}
String str = "React Native Instance has already disappeared: requested by " + getName();
if (ReactBuildConfig.DEBUG) {
FLog.w(ReactConstants.TAG, str);
return null;
}
ReactSoftExceptionLogger.logSoftException(ReactConstants.TAG, new RuntimeException(str));
return null;
}
@DoNotStrip
public void setEventEmitterCallback(CxxCallbackImpl cxxCallbackImpl) {
this.mEventEmitterCallback = cxxCallbackImpl;
}
public BaseJavaModule() {
this(null);
}
@Override // com.facebook.react.bridge.NativeModule
public void initialize() {
}
@Override // com.facebook.react.bridge.NativeModule, com.facebook.react.turbomodule.core.interfaces.TurboModule
public void invalidate() {
}
}