mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Kotlinify CallInvokerHolderImpl (#43796)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43796 Changelog: [Internal] As part of the Sustainability Week (see [post](https://fb.workplace.com/groups/251759413609061/permalink/742797531171911/)). Reviewed By: cortinico Differential Revision: D55655061 fbshipit-source-id: fd2c81ce91681f9f26e2b4a659b8fbae8a4b7d51
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e1800726af
commit
ca5d940fe4
@@ -3869,7 +3869,7 @@ public abstract interface class com/facebook/react/touch/ReactInterceptingViewGr
|
||||
public abstract fun setOnInterceptTouchEventListener (Lcom/facebook/react/touch/OnInterceptTouchEventListener;)V
|
||||
}
|
||||
|
||||
public class com/facebook/react/turbomodule/core/CallInvokerHolderImpl : com/facebook/react/turbomodule/core/interfaces/CallInvokerHolder {
|
||||
public final class com/facebook/react/turbomodule/core/CallInvokerHolderImpl : com/facebook/react/turbomodule/core/interfaces/CallInvokerHolder {
|
||||
}
|
||||
|
||||
public class com/facebook/react/turbomodule/core/NativeMethodCallInvokerHolderImpl : com/facebook/react/turbomodule/core/interfaces/NativeMethodCallInvokerHolder {
|
||||
|
||||
+3
-3
@@ -9,13 +9,13 @@ package com.facebook.react.internal.turbomodule.core
|
||||
|
||||
import com.facebook.soloader.SoLoader
|
||||
|
||||
internal class NativeModuleSoLoader {
|
||||
companion object {
|
||||
public class NativeModuleSoLoader {
|
||||
public companion object {
|
||||
private var isSoLibraryLoaded = false
|
||||
|
||||
@Synchronized
|
||||
@JvmStatic
|
||||
fun maybeLoadSoLibrary() {
|
||||
public fun maybeLoadSoLibrary() {
|
||||
if (!isSoLibraryLoaded) {
|
||||
SoLoader.loadLibrary("turbomodulejsijni")
|
||||
isSoLibraryLoaded = true
|
||||
|
||||
+12
-18
@@ -5,31 +5,25 @@
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.turbomodule.core;
|
||||
package com.facebook.react.turbomodule.core
|
||||
|
||||
import com.facebook.infer.annotation.Nullsafe;
|
||||
import com.facebook.jni.HybridData;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
import com.facebook.react.common.annotations.FrameworkAPI;
|
||||
import com.facebook.react.internal.turbomodule.core.NativeModuleSoLoader;
|
||||
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder;
|
||||
import com.facebook.jni.HybridData
|
||||
import com.facebook.proguard.annotations.DoNotStrip
|
||||
import com.facebook.react.common.annotations.FrameworkAPI
|
||||
import com.facebook.react.internal.turbomodule.core.NativeModuleSoLoader
|
||||
import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder
|
||||
|
||||
/**
|
||||
* JSCallInvoker is created at a different time/place (i.e: in CatalystInstance) than
|
||||
* TurboModuleManager. Therefore, we need to wrap JSCallInvoker within a hybrid class so that we may
|
||||
* pass it from CatalystInstance, through Java, to TurboModuleManager::initHybrid.
|
||||
*/
|
||||
@Nullsafe(Nullsafe.Mode.LOCAL)
|
||||
@FrameworkAPI
|
||||
public class CallInvokerHolderImpl implements CallInvokerHolder {
|
||||
|
||||
@DoNotStrip private final HybridData mHybridData;
|
||||
|
||||
static {
|
||||
NativeModuleSoLoader.maybeLoadSoLibrary();
|
||||
}
|
||||
|
||||
private CallInvokerHolderImpl(HybridData hd) {
|
||||
mHybridData = hd;
|
||||
public class CallInvokerHolderImpl
|
||||
private constructor(@field:DoNotStrip private val mHybridData: HybridData) : CallInvokerHolder {
|
||||
private companion object {
|
||||
init {
|
||||
NativeModuleSoLoader.maybeLoadSoLibrary()
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user