Delete unnecessary DevSupportSoLoader (#50198)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/50198

We don't really need another wrapper around SoLoader to decide when to load a library. SoLoader already does this for us. See:
https://github.com/facebook/SoLoader/blob/62c2028a07f146bbc56c0337dacf226fcd6f95ef/java/com/facebook/soloader/SoLoader.java#L1070-L1139

I'm removing this extra unnecessary class.

Changelog:
[Internal] [Changed] - Delete unnecessary DevSupportSoLoader

Reviewed By: huntie

Differential Revision: D71636985

fbshipit-source-id: b6df35b61d4e376503c158e921ca970ad77a6deb
This commit is contained in:
Nicola Corti
2025-03-24 05:06:53 -07:00
committed by Facebook GitHub Bot
parent ca4b82a629
commit 4435d7b8dc
3 changed files with 4 additions and 26 deletions
@@ -13,6 +13,7 @@ import androidx.annotation.Nullable;
import com.facebook.infer.annotation.Nullsafe;
import com.facebook.jni.HybridData;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.soloader.SoLoader;
import java.io.Closeable;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
@@ -25,7 +26,7 @@ import okhttp3.WebSocketListener;
/* package */ @Nullsafe(Nullsafe.Mode.LOCAL)
class CxxInspectorPackagerConnection implements IInspectorPackagerConnection {
static {
DevSupportSoLoader.staticInit();
SoLoader.loadLibrary("react_devsupportjni");
}
@DoNotStrip private final HybridData mHybridData;
@@ -1,24 +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.devsupport
import com.facebook.soloader.SoLoader
internal object DevSupportSoLoader {
@Volatile private var didInit: Boolean = false
@JvmStatic
@Synchronized
fun staticInit() {
if (didInit) {
return
}
SoLoader.loadLibrary("react_devsupportjni")
didInit = true
}
}
@@ -8,12 +8,13 @@
package com.facebook.react.devsupport
import com.facebook.proguard.annotations.DoNotStrip
import com.facebook.soloader.SoLoader
/** JNI wrapper for `jsinspector_modern::InspectorFlags`. */
@DoNotStrip
internal object InspectorFlags {
init {
DevSupportSoLoader.staticInit()
SoLoader.loadLibrary("react_devsupportjni")
}
@DoNotStrip @JvmStatic external fun getFuseboxEnabled(): Boolean