diff --git a/ReactAndroid/src/main/java/com/facebook/react/BUCK b/ReactAndroid/src/main/java/com/facebook/react/BUCK index b550756ae1b..a32feeb61c9 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/BUCK +++ b/ReactAndroid/src/main/java/com/facebook/react/BUCK @@ -49,7 +49,6 @@ rn_android_library( react_native_target("java/com/facebook/react/config:config"), react_native_target("java/com/facebook/react/turbomodule/core:core"), react_native_target("java/com/facebook/react/turbomodule/core/interfaces:interfaces"), - react_native_target("java/com/facebook/react/runtimescheduler:runtimescheduler"), ], exported_deps = [ react_native_target("java/com/facebook/react/modules/core:core"), diff --git a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java index d73c8f7e1ec..4c8a8f97977 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/ReactInstanceManager.java @@ -92,7 +92,6 @@ import com.facebook.react.modules.core.ReactChoreographer; import com.facebook.react.modules.debug.interfaces.DeveloperSettings; import com.facebook.react.modules.fabric.ReactFabric; import com.facebook.react.packagerconnection.RequestHandler; -import com.facebook.react.runtimescheduler.RuntimeSchedulerManager; import com.facebook.react.surface.ReactStage; import com.facebook.react.turbomodule.core.TurboModuleManager; import com.facebook.react.turbomodule.core.TurboModuleManagerDelegate; @@ -167,7 +166,6 @@ public class ReactInstanceManager { private final boolean mUseDeveloperSupport; private final boolean mRequireActivity; private @Nullable ComponentNameResolverManager mComponentNameResolverManager; - private @Nullable RuntimeSchedulerManager mRuntimeSchedulerManager; private final @Nullable NotThreadSafeBridgeIdleDebugListener mBridgeIdleDebugListener; private final Object mReactContextLock = new Object(); private @Nullable volatile ReactContext mCurrentReactContext; @@ -759,7 +757,6 @@ public class ReactInstanceManager { mViewManagerNames = null; } mComponentNameResolverManager = null; - mRuntimeSchedulerManager = null; FLog.d(ReactConstants.TAG, "ReactInstanceManager has been destroyed"); } @@ -1394,9 +1391,6 @@ public class ReactInstanceManager { }); catalystInstance.setGlobalVariable("__fbStaticViewConfig", "true"); } - if (ReactFeatureFlags.enableRuntimeScheduler) { - mRuntimeSchedulerManager = new RuntimeSchedulerManager(catalystInstance.getRuntimeExecutor()); - } ReactMarker.logMarker(ReactMarkerConstants.PRE_RUN_JS_BUNDLE_START); Systrace.beginSection(TRACE_TAG_REACT_JAVA_BRIDGE, "runJSBundle"); diff --git a/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/BUCK b/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/BUCK deleted file mode 100644 index a68079db767..00000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/BUCK +++ /dev/null @@ -1,20 +0,0 @@ -load("//tools/build_defs/oss:rn_defs.bzl", "react_native_dep", "react_native_target", "rn_android_library") - -rn_android_library( - name = "runtimescheduler", - srcs = glob(["**/*.java"]), - autoglob = False, - is_androidx = True, - labels = ["supermodule:xplat/default/public.react_native.infra"], - visibility = [ - "PUBLIC", - ], - deps = [ - react_native_target("java/com/facebook/react/runtimescheduler/jni:jni"), - react_native_dep("third-party/android/androidx:annotation"), - react_native_dep("third-party/java/infer-annotations:infer-annotations"), - react_native_dep("libraries/fbjni:java"), - react_native_target("java/com/facebook/react/bridge:bridge"), - react_native_dep("libraries/soloader/java/com/facebook/soloader:soloader"), - ], -) diff --git a/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/RuntimeSchedulerManager.java b/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/RuntimeSchedulerManager.java deleted file mode 100644 index d7846b568c4..00000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/RuntimeSchedulerManager.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its 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.runtimescheduler; - -import com.facebook.jni.HybridData; -import com.facebook.proguard.annotations.DoNotStrip; -import com.facebook.proguard.annotations.DoNotStripAny; -import com.facebook.react.bridge.RuntimeExecutor; -import com.facebook.soloader.SoLoader; - -@DoNotStripAny -public class RuntimeSchedulerManager { - - static { - staticInit(); - } - - @DoNotStrip - @SuppressWarnings("unused") - private final HybridData mHybridData; - - public RuntimeSchedulerManager(RuntimeExecutor runtimeExecutor) { - mHybridData = initHybrid(runtimeExecutor); - installJSIBindings(); - } - - private native HybridData initHybrid(RuntimeExecutor runtimeExecutor); - - private native void installJSIBindings(); - - private static void staticInit() { - SoLoader.loadLibrary("runtimeschedulerjni"); - } -} diff --git a/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/Android.mk b/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/Android.mk deleted file mode 100644 index bb4e3201128..00000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/Android.mk +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) Facebook, Inc. and its affiliates. -# -# This source code is licensed under the MIT license found in the -# LICENSE file in the root directory of this source tree. - -LOCAL_PATH := $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := runtimeschedulerjni - -LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) - -LOCAL_SHARED_LIBRARIES := libglog libfb libfbjni libglog_init libreact_render_runtimescheduler librrc_native - -LOCAL_STATIC_LIBRARIES := - -LOCAL_C_INCLUDES := $(LOCAL_PATH)/ - -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/ - -LOCAL_CFLAGS := \ - -DLOG_TAG=\"ReacTNative\" - -LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall - -include $(BUILD_SHARED_LIBRARY) - -$(call import-module,fbgloginit) -$(call import-module,fb) -$(call import-module,fbjni) -$(call import-module,glog) - -$(call import-module,react/renderer/runtimescheduler) diff --git a/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/BUCK b/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/BUCK deleted file mode 100644 index 426b06a1391..00000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/BUCK +++ /dev/null @@ -1,35 +0,0 @@ -load("//tools/build_defs/oss:rn_defs.bzl", "ANDROID", "FBJNI_TARGET", "react_native_target", "react_native_xplat_target", "rn_xplat_cxx_library", "subdir_glob") - -rn_xplat_cxx_library( - name = "jni", - srcs = glob(["*.cpp"]), - headers = glob(["*.h"]), - header_namespace = "", - exported_headers = subdir_glob( - [ - ("", "**/*.h"), - ], - prefix = "react/runtimescheduler", - ), - compiler_flags = [ - "-fexceptions", - "-frtti", - "-std=c++17", - "-Wall", - ], - fbandroid_allow_jni_merging = True, - labels = ["supermodule:xplat/default/public.react_native.infra"], - platforms = ANDROID, - preprocessor_flags = [ - "-DLOG_TAG=\"ReactNative\"", - "-DWITH_FBSYSTRACE=1", - ], - soname = "libruntimeschedulerjni.$(ext)", - visibility = ["PUBLIC"], - deps = [ - react_native_xplat_target("react/renderer/runtimescheduler:runtimescheduler"), - react_native_xplat_target("runtimeexecutor:runtimeexecutor"), - react_native_target("jni/react/jni:jni"), - FBJNI_TARGET, - ], -) diff --git a/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/OnLoad.cpp b/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/OnLoad.cpp deleted file mode 100644 index 189de80dfce..00000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/OnLoad.cpp +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#include - -#include "RuntimeSchedulerManager.h" - -JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { - return facebook::jni::initialize( - vm, [] { facebook::react::RuntimeSchedulerManager::registerNatives(); }); -} diff --git a/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/RuntimeSchedulerManager.cpp b/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/RuntimeSchedulerManager.cpp deleted file mode 100644 index 2b0d8933703..00000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/RuntimeSchedulerManager.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#include -#include -#include -#include - -#include "RuntimeSchedulerManager.h" - -namespace facebook { -namespace react { - -RuntimeSchedulerManager::RuntimeSchedulerManager( - RuntimeExecutor runtimeExecutor) - : runtimeExecutor_(runtimeExecutor) {} - -jni::local_ref -RuntimeSchedulerManager::initHybrid( - jni::alias_ref, - jni::alias_ref runtimeExecutor) { - return makeCxxInstance(runtimeExecutor->cthis()->get()); -} - -void RuntimeSchedulerManager::registerNatives() { - registerHybrid({ - makeNativeMethod("initHybrid", RuntimeSchedulerManager::initHybrid), - makeNativeMethod( - "installJSIBindings", RuntimeSchedulerManager::installJSIBindings), - }); -} - -void RuntimeSchedulerManager::installJSIBindings() { - runtimeExecutor_([runtimeExecutor = runtimeExecutor_](jsi::Runtime &runtime) { - auto runtimeScheduler = std::make_shared(runtimeExecutor); - RuntimeSchedulerBinding::createAndInstallIfNeeded( - runtime, runtimeScheduler); - }); -} - -} // namespace react -} // namespace facebook diff --git a/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/RuntimeSchedulerManager.h b/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/RuntimeSchedulerManager.h deleted file mode 100644 index 6456c7176fa..00000000000 --- a/ReactAndroid/src/main/java/com/facebook/react/runtimescheduler/jni/RuntimeSchedulerManager.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -#include -#include -#include -#include - -namespace facebook { -namespace react { - -class RuntimeSchedulerManager - : public facebook::jni::HybridClass { - public: - static auto constexpr kJavaDescriptor = - "Lcom/facebook/react/runtimescheduler/RuntimeSchedulerManager;"; - - static facebook::jni::local_ref initHybrid( - jni::alias_ref, - facebook::jni::alias_ref runtimeExecutor); - - static void registerNatives(); - - private: - friend HybridBase; - RuntimeExecutor runtimeExecutor_; - - void installJSIBindings(); - - explicit RuntimeSchedulerManager(RuntimeExecutor runtimeExecutor); -}; - -} // namespace react -} // namespace facebook