diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index bd2e5dc8d9af7a..793683fe0da047 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -2957,11 +2957,9 @@ public abstract interface annotation class com/facebook/react/module/annotations public final class com/facebook/react/module/model/ReactModuleInfo { public static final field Companion Lcom/facebook/react/module/model/ReactModuleInfo$Companion; public fun (Ljava/lang/String;Ljava/lang/String;ZZZZ)V - public fun (Ljava/lang/String;Ljava/lang/String;ZZZZZ)V public final fun canOverrideExistingModule ()Z public static final fun classIsTurboModule (Ljava/lang/Class;)Z public final fun className ()Ljava/lang/String; - public final fun hasConstants ()Z public final fun isCxxModule ()Z public final fun isTurboModule ()Z public final fun name ()Ljava/lang/String; diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfo.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfo.kt index 7a62f312f40743..246b2adb68397d 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfo.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/module/model/ReactModuleInfo.kt @@ -14,36 +14,13 @@ import com.facebook.react.turbomodule.core.interfaces.TurboModule * so Java modules don't have to be instantiated at React Native start up. */ public class ReactModuleInfo( - private val _name: String, - private val _className: String, - private val _canOverrideExistingModule: Boolean, - private val _needsEagerInit: Boolean, + @get:JvmName("name") public val name: String, + @get:JvmName("className") public val className: String, + @get:JvmName("canOverrideExistingModule") public val canOverrideExistingModule: Boolean, + @get:JvmName("needsEagerInit") public val needsEagerInit: Boolean, public val isCxxModule: Boolean, public val isTurboModule: Boolean ) { - - @Deprecated("use ReactModuleInfo(String, String, boolean, boolean, boolean, boolean)]") - public constructor( - name: String, - className: String, - canOverrideExistingModule: Boolean, - needsEagerInit: Boolean, - @Suppress("UNUSED_PARAMETER") hasConstants: Boolean, - isCxxModule: Boolean, - isTurboModule: Boolean - ) : this(name, className, canOverrideExistingModule, needsEagerInit, isCxxModule, isTurboModule) - - public fun name(): String = _name - - public fun className(): String = _className - - public fun canOverrideExistingModule(): Boolean = _canOverrideExistingModule - - public fun needsEagerInit(): Boolean = _needsEagerInit - - @Deprecated("this is hardcoded to return true, regardless if the module has constants or not") - public fun hasConstants(): Boolean = true - public companion object { /** * Checks if the passed class is a TurboModule. Useful to populate the parameter [isTurboModule] diff --git a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/model/ReactModuleInfoTest.kt b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/model/ReactModuleInfoTest.kt index 02e7cb1032b3ad..7b05b99b43911a 100644 --- a/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/model/ReactModuleInfoTest.kt +++ b/packages/react-native/ReactAndroid/src/test/java/com/facebook/react/modules/model/ReactModuleInfoTest.kt @@ -24,9 +24,9 @@ class ReactModuleInfoTest { /* needsEagerInit = */ false, /* isCxxModule = */ false, /* isTurboModule = */ false) - assertThat(reactModuleInfo.name()).isEqualTo("name") - assertThat(reactModuleInfo.canOverrideExistingModule()).isFalse() - assertThat(reactModuleInfo.needsEagerInit()).isFalse() + assertThat(reactModuleInfo.name).isEqualTo("name") + assertThat(reactModuleInfo.canOverrideExistingModule).isFalse() + assertThat(reactModuleInfo.needsEagerInit).isFalse() assertThat(reactModuleInfo.isCxxModule).isFalse() assertThat(reactModuleInfo.isTurboModule).isFalse() } diff --git a/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.kt b/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.kt index aadae931fe00e0..2fe4530c3e2798 100644 --- a/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.kt +++ b/packages/rn-tester/android/app/src/main/java/com/facebook/react/uiapp/RNTesterApplication.kt @@ -76,16 +76,16 @@ internal class RNTesterApplication : Application(), ReactApplication { ReactModuleInfo( SampleTurboModule.NAME, "SampleTurboModule", - _canOverrideExistingModule = false, - _needsEagerInit = false, + canOverrideExistingModule = false, + needsEagerInit = false, isCxxModule = false, isTurboModule = true), SampleLegacyModule.NAME to ReactModuleInfo( SampleLegacyModule.NAME, "SampleLegacyModule", - _canOverrideExistingModule = false, - _needsEagerInit = false, + canOverrideExistingModule = false, + needsEagerInit = false, isCxxModule = false, isTurboModule = false)) } else {