diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaModuleWrapper.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaModuleWrapper.java index b9ea9bb79e4dc4..0272cc4c21b080 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaModuleWrapper.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/JavaModuleWrapper.java @@ -16,6 +16,7 @@ import androidx.annotation.Nullable; import com.facebook.proguard.annotations.DoNotStrip; import com.facebook.react.config.ReactFeatureFlags; +import com.facebook.react.turbomodule.core.interfaces.TurboModule; import com.facebook.systrace.Systrace; import com.facebook.systrace.SystraceMessage; import java.lang.reflect.Method; @@ -71,7 +72,7 @@ private void findMethods() { Class classForMethods = mModuleHolder.getModule().getClass(); Class superClass = (Class) classForMethods.getSuperclass(); - if (ReactModuleWithSpec.class.isAssignableFrom(superClass)) { + if (TurboModule.class.isAssignableFrom(superClass)) { // For java module that is based on generated flow-type spec, inspect the // spec abstract class instead, which is the super class of the given java // module. diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleInteropUtils.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleInteropUtils.java index c6a729e79ca8bf..b079f1cfda5052 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleInteropUtils.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/TurboModuleInteropUtils.java @@ -14,11 +14,11 @@ import com.facebook.react.bridge.NativeModule; import com.facebook.react.bridge.Promise; import com.facebook.react.bridge.ReactMethod; -import com.facebook.react.bridge.ReactModuleWithSpec; import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; import com.facebook.react.bridge.WritableArray; import com.facebook.react.bridge.WritableMap; +import com.facebook.react.turbomodule.core.interfaces.TurboModule; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashSet; @@ -112,7 +112,7 @@ private static Method[] getMethodsFromModule(NativeModule module) { Class classForMethods = module.getClass(); Class superClass = (Class) classForMethods.getSuperclass(); - if (ReactModuleWithSpec.class.isAssignableFrom(superClass)) { + if (TurboModule.class.isAssignableFrom(superClass)) { // For java module that is based on generated flow-type spec, inspect the // spec abstract class instead, which is the super class of the given java // module. diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BUCK b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BUCK index 7bb8b24c8e41f4..d86795f20415c7 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BUCK +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BUCK @@ -40,6 +40,7 @@ rn_robolectric_test( react_native_dep("third-party/java/junit:junit"), react_native_target("java/com/facebook/react/bridge:bridge"), react_native_target("java/com/facebook/react/common:common"), + react_native_target("java/com/facebook/react/turbomodule/core/interfaces:interfaces"), react_native_target("java/com/facebook/react/uimanager:uimanager"), react_native_tests_target("java/com/facebook/common/logging:logging"), ], diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BaseJavaModuleTest.java b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BaseJavaModuleTest.java index 6b7dbb011872e7..52919c2a1e7cb8 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BaseJavaModuleTest.java +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/bridge/BaseJavaModuleTest.java @@ -10,6 +10,7 @@ import static org.mockito.Mockito.when; import android.content.Context; +import com.facebook.react.turbomodule.core.interfaces.TurboModule; import com.facebook.soloader.SoLoader; import java.util.List; import org.junit.Before; @@ -127,7 +128,7 @@ public int syncMethod(int a, int b) { } private abstract class NativeTestGeneratedModuleSpec extends BaseJavaModule - implements ReactModuleWithSpec { + implements TurboModule { @ReactMethod public abstract void generatedMethod(String a, int b); }