diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadHandler.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadHandler.java index ddac0bfec7360f..010b6871593ea1 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadHandler.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridge/queue/MessageQueueThreadHandler.java @@ -10,8 +10,6 @@ import android.os.Handler; import android.os.Looper; import android.os.Message; -import com.facebook.common.logging.FLog; -import com.facebook.react.common.ReactConstants; /** Handler that can catch and dispatch Exceptions to an Exception handler. */ public class MessageQueueThreadHandler extends Handler { @@ -28,15 +26,6 @@ public void dispatchMessage(Message msg) { try { super.dispatchMessage(msg); } catch (Exception e) { - if (e instanceof NullPointerException) { - FLog.e( - ReactConstants.TAG, - "Caught NullPointerException when dispatching message in MessageQueueThreadHandler. This is likely caused by runnable" - + "(msg.callback) being nulled in Android Handler after dispatching and before handling (see T170239922 for more details)." - + "Currently we observe that it only happen once which is during initialisation. Due to fixing probably involve Android " - + "System code, we decide to ignore here for now and print an error message for debugging purpose in case this cause more serious issues in future."); - return; - } mExceptionHandler.handleException(e); } } diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultBindingsInstaller.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultBindingsInstaller.kt deleted file mode 100644 index 06a47d80908ebb..00000000000000 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultBindingsInstaller.kt +++ /dev/null @@ -1,20 +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.defaults - -import com.facebook.jni.annotations.DoNotStrip -import com.facebook.react.common.annotations.UnstableReactNativeAPI -import com.facebook.react.runtime.BindingsInstaller - -/** - * A utility class that provides users a default [BindingsInstaller] class that's used to initialize - * [ReactHostDelegate] - */ -@DoNotStrip -@UnstableReactNativeAPI -public class DefaultBindingsInstaller : BindingsInstaller(null) {} diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt index 5f53398208a74d..3c50cac823e6f7 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/defaults/DefaultReactHostDelegate.kt @@ -43,7 +43,7 @@ public class DefaultReactHostDelegate( override val jsBundleLoader: JSBundleLoader, override val reactPackages: List = emptyList(), override val jsRuntimeFactory: JSRuntimeFactory = HermesInstance(), - override val bindingsInstaller: BindingsInstaller = DefaultBindingsInstaller(), + override val bindingsInstaller: BindingsInstaller? = null, private val reactNativeConfig: ReactNativeConfig = ReactNativeConfig.DEFAULT_CONFIG, private val exceptionHandler: (Exception) -> Unit = {}, override val turboModuleManagerDelegateBuilder: ReactPackageTurboModuleManagerDelegate.Builder diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.cpp b/packages/react-native/ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.cpp index df01e447a42e5d..e945c01e267944 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.cpp +++ b/packages/react-native/ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.cpp @@ -10,7 +10,6 @@ #include #include -#include #include #include #include diff --git a/packages/react-native/ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.h b/packages/react-native/ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.h index 3926fa906deaaf..716e58b0a7b61e 100644 --- a/packages/react-native/ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.h +++ b/packages/react-native/ReactAndroid/src/main/jni/react/jni/JMessageQueueThread.h @@ -42,10 +42,6 @@ class JMessageQueueThread : public MessageQueueThread { */ void quitSynchronous() override; - JavaMessageQueueThread::javaobject jobj() { - return m_jobj.get(); - } - private: jni::global_ref m_jobj; };