From ea7d6f09b1bd5f6f4381cd720981655286bee38c Mon Sep 17 00:00:00 2001 From: Arushi Kesarwani Date: Mon, 7 Oct 2024 14:51:25 -0700 Subject: [PATCH] Adding support for custom C++ TM wrapper to CxxReactPackage (#46822) Summary: Modifying the CxxReactPackage by changing the annotation from UnstableReactNativeAPI to FrameworkAPI so as to now support custom C++ TM wrapper Changelog: [Android][Changed] - Modify CxxReactPackage to support custom C++ TM wrapper Reviewed By: shwanton, christophpurrer Differential Revision: D63740964 --- packages/react-native/ReactAndroid/api/ReactAndroid.api | 4 ++++ .../facebook/react/runtime/cxxreactpackage/CxxReactPackage.kt | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactAndroid/api/ReactAndroid.api b/packages/react-native/ReactAndroid/api/ReactAndroid.api index c84e8b87f72e8d..bab878e0398314 100644 --- a/packages/react-native/ReactAndroid/api/ReactAndroid.api +++ b/packages/react-native/ReactAndroid/api/ReactAndroid.api @@ -3936,6 +3936,10 @@ public final class com/facebook/react/runtime/ReactSurfaceView : com/facebook/re public fun setIsFabric (Z)V } +public abstract class com/facebook/react/runtime/cxxreactpackage/CxxReactPackage { + protected fun (Lcom/facebook/jni/HybridData;)V +} + public final class com/facebook/react/runtime/hermes/HermesInstance : com/facebook/react/runtime/JSRuntimeFactory { public static final field Companion Lcom/facebook/react/runtime/hermes/HermesInstance$Companion; public fun ()V diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/cxxreactpackage/CxxReactPackage.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/cxxreactpackage/CxxReactPackage.kt index d78900c6a94349..b034ace81b1837 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/cxxreactpackage/CxxReactPackage.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/runtime/cxxreactpackage/CxxReactPackage.kt @@ -10,10 +10,10 @@ package com.facebook.react.runtime.cxxreactpackage import com.facebook.jni.HybridData import com.facebook.proguard.annotations.DoNotStrip -import com.facebook.react.common.annotations.UnstableReactNativeAPI +import com.facebook.react.common.annotations.FrameworkAPI /** CxxReactPackage is used to register C++ Turbo Modules with React Native. */ -@UnstableReactNativeAPI +@OptIn(FrameworkAPI::class) public abstract class CxxReactPackage protected constructor(hybridData: HybridData?) { @DoNotStrip @Suppress("NoHungarianNotation") private var mHybridData: HybridData? = hybridData