destroy react instance on background critical memory pressure
Reviewed By: astreet Differential Revision: D2989125 fb-gh-sync-id: 0e441409d6b0ea7d5ff6a037730cc1c36818a2da shipit-source-id: 0e441409d6b0ea7d5ff6a037730cc1c36818a2da
This commit is contained in:
parent
4b52d185ac
commit
2e4bb5364d
|
@ -62,6 +62,8 @@ public abstract class ReactInstanceManager {
|
||||||
|
|
||||||
public abstract DevSupportManager getDevSupportManager();
|
public abstract DevSupportManager getDevSupportManager();
|
||||||
|
|
||||||
|
public abstract MemoryPressureRouter getMemoryPressureRouter();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trigger react context initialization asynchronously in a background async task. This enables
|
* Trigger react context initialization asynchronously in a background async task. This enables
|
||||||
* applications to pre-load the application JS, and execute global code before
|
* applications to pre-load the application JS, and execute global code before
|
||||||
|
@ -159,6 +161,8 @@ public abstract class ReactInstanceManager {
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
public abstract @Nullable ReactContext getCurrentReactContext();
|
public abstract @Nullable ReactContext getCurrentReactContext();
|
||||||
|
|
||||||
|
public abstract LifecycleState getLifecycleState();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a builder that is capable of creating an instance of {@link ReactInstanceManagerImpl}.
|
* Creates a builder that is capable of creating an instance of {@link ReactInstanceManagerImpl}.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -308,6 +308,11 @@ import static com.facebook.react.bridge.ReactMarkerConstants.RUN_JS_BUNDLE_START
|
||||||
return mDevSupportManager;
|
return mDevSupportManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MemoryPressureRouter getMemoryPressureRouter() {
|
||||||
|
return mMemoryPressureRouter;
|
||||||
|
}
|
||||||
|
|
||||||
private static void initializeSoLoaderIfNecessary(Context applicationContext) {
|
private static void initializeSoLoaderIfNecessary(Context applicationContext) {
|
||||||
// Call SoLoader.initialize here, this is required for apps that does not use exopackage and
|
// Call SoLoader.initialize here, this is required for apps that does not use exopackage and
|
||||||
// does not use SoLoader for loading other native code except from the one used by React Native
|
// does not use SoLoader for loading other native code except from the one used by React Native
|
||||||
|
@ -582,6 +587,10 @@ import static com.facebook.react.bridge.ReactMarkerConstants.RUN_JS_BUNDLE_START
|
||||||
mLifecycleState = LifecycleState.BEFORE_CREATE;
|
mLifecycleState = LifecycleState.BEFORE_CREATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public LifecycleState getLifecycleState() {
|
||||||
|
return mLifecycleState;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
if (mCurrentReactContext != null) {
|
if (mCurrentReactContext != null) {
|
||||||
|
|
Loading…
Reference in New Issue