From fa9ea8326e693b258e303aee6f59b049dcecea31 Mon Sep 17 00:00:00 2001 From: Lulu Wu Date: Wed, 19 Jul 2023 11:04:12 -0700 Subject: [PATCH] Throw ReactNoCrashSoftException when handle memeory pressure to avoid crash Summary: As title Changelog: [Android][Changed] - Throw ReactNoCrashSoftException when handle memeory pressure to avoid crash Reviewed By: jacdebug Differential Revision: D47596577 fbshipit-source-id: 311492eaa4ed15b17807f5aa6c351a528fcfcdfa --- .../main/java/com/facebook/react/bridgeless/ReactInstance.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java index 4f111194952023..cdea79ae8c585c 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/bridgeless/ReactInstance.java @@ -26,6 +26,7 @@ import com.facebook.react.bridge.NativeArray; import com.facebook.react.bridge.NativeMap; import com.facebook.react.bridge.NativeModule; +import com.facebook.react.bridge.ReactNoCrashSoftException; import com.facebook.react.bridge.ReactSoftExceptionLogger; import com.facebook.react.bridge.RuntimeExecutor; import com.facebook.react.bridge.RuntimeScheduler; @@ -467,7 +468,7 @@ public void handleMemoryPressure(int level) { } catch (NullPointerException e) { ReactSoftExceptionLogger.logSoftException( TAG, - new IllegalViewOperationException( + new ReactNoCrashSoftException( "Native method handleMemoryPressureJs is called earlier than librninstance.so got ready.")); } }