mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Migrate FabricSoLoader to Kotlin (#43837)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43837 FabricSoLoader.java -> FabricSoLoader.kt Changelog: [Internal] Reviewed By: cortinico Differential Revision: D55724712 fbshipit-source-id: bef37f74df50006d842dd4913386841a2eddf2b5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
e7b352daf0
commit
dc83cb7a26
@@ -2570,9 +2570,9 @@ public class com/facebook/react/fabric/FabricComponents {
|
||||
public static fun getFabricComponentName (Ljava/lang/String;)Ljava/lang/String;
|
||||
}
|
||||
|
||||
public class com/facebook/react/fabric/FabricSoLoader {
|
||||
public fun <init> ()V
|
||||
public static fun staticInit ()V
|
||||
public final class com/facebook/react/fabric/FabricSoLoader {
|
||||
public static final field INSTANCE Lcom/facebook/react/fabric/FabricSoLoader;
|
||||
public static final fun staticInit ()V
|
||||
}
|
||||
|
||||
public class com/facebook/react/fabric/FabricUIManager : com/facebook/react/bridge/LifecycleEventListener, com/facebook/react/bridge/UIManager, com/facebook/react/fabric/interop/UIBlockViewResolver {
|
||||
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.fabric;
|
||||
|
||||
import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE;
|
||||
|
||||
import com.facebook.infer.annotation.Nullsafe;
|
||||
import com.facebook.react.bridge.ReactMarker;
|
||||
import com.facebook.react.bridge.ReactMarkerConstants;
|
||||
import com.facebook.soloader.SoLoader;
|
||||
import com.facebook.systrace.Systrace;
|
||||
|
||||
@Nullsafe(Nullsafe.Mode.LOCAL)
|
||||
public class FabricSoLoader {
|
||||
private static volatile boolean sDidInit = false;
|
||||
|
||||
public static void staticInit() {
|
||||
if (sDidInit) {
|
||||
return;
|
||||
}
|
||||
Systrace.beginSection(
|
||||
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "FabricSoLoader.staticInit::load:fabricjni");
|
||||
ReactMarker.logMarker(ReactMarkerConstants.LOAD_REACT_NATIVE_SO_FILE_START);
|
||||
SoLoader.loadLibrary("fabricjni");
|
||||
ReactMarker.logMarker(ReactMarkerConstants.LOAD_REACT_NATIVE_SO_FILE_END);
|
||||
Systrace.endSection(TRACE_TAG_REACT_JAVA_BRIDGE);
|
||||
sDidInit = true;
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
package com.facebook.react.fabric
|
||||
|
||||
import com.facebook.react.bridge.ReactMarker
|
||||
import com.facebook.react.bridge.ReactMarkerConstants
|
||||
import com.facebook.soloader.SoLoader
|
||||
import com.facebook.systrace.Systrace
|
||||
|
||||
public object FabricSoLoader {
|
||||
@Volatile private var didInit = false
|
||||
|
||||
@JvmStatic
|
||||
public fun staticInit() {
|
||||
if (didInit) {
|
||||
return
|
||||
}
|
||||
Systrace.beginSection(
|
||||
Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "FabricSoLoader.staticInit::load:fabricjni")
|
||||
ReactMarker.logMarker(ReactMarkerConstants.LOAD_REACT_NATIVE_SO_FILE_START)
|
||||
SoLoader.loadLibrary("fabricjni")
|
||||
ReactMarker.logMarker(ReactMarkerConstants.LOAD_REACT_NATIVE_SO_FILE_END)
|
||||
Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE)
|
||||
didInit = true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user