mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43642 Changelog: [internal] This change broke some apps at Meta. Reverting until we figure out a safe way to land this. Reviewed By: rshest Differential Revision: D55324557 fbshipit-source-id: 684d3dc3780fc41e2e91f367d97fa5cd392e6638
This commit is contained in:
committed by
Facebook GitHub Bot
parent
dbf8e3f5ba
commit
152f5f4a47
@@ -100,7 +100,6 @@ public abstract class com/facebook/react/ReactActivity : androidx/appcompat/app/
|
||||
protected fun onPause ()V
|
||||
public fun onRequestPermissionsResult (I[Ljava/lang/String;[I)V
|
||||
protected fun onResume ()V
|
||||
public fun onUserLeaveHint ()V
|
||||
public fun onWindowFocusChanged (Z)V
|
||||
public fun requestPermissions ([Ljava/lang/String;ILcom/facebook/react/modules/core/PermissionListener;)V
|
||||
}
|
||||
@@ -132,7 +131,6 @@ public class com/facebook/react/ReactActivityDelegate {
|
||||
public fun onPause ()V
|
||||
public fun onRequestPermissionsResult (I[Ljava/lang/String;[I)V
|
||||
public fun onResume ()V
|
||||
public fun onUserLeaveHint ()V
|
||||
public fun onWindowFocusChanged (Z)V
|
||||
public fun requestPermissions ([Ljava/lang/String;ILcom/facebook/react/modules/core/PermissionListener;)V
|
||||
}
|
||||
@@ -161,7 +159,6 @@ public class com/facebook/react/ReactDelegate {
|
||||
public fun onKeyDown (ILandroid/view/KeyEvent;)Z
|
||||
public fun onKeyLongPress (I)Z
|
||||
public fun onNewIntent (Landroid/content/Intent;)Z
|
||||
public fun onUserLeaveHint ()V
|
||||
public fun onWindowFocusChanged (Z)V
|
||||
public fun reload ()V
|
||||
public fun shouldShowDevMenuOrReload (ILandroid/view/KeyEvent;)Z
|
||||
@@ -212,7 +209,6 @@ public abstract interface class com/facebook/react/ReactHost {
|
||||
public abstract fun onConfigurationChanged (Landroid/content/Context;)V
|
||||
public abstract fun onHostDestroy ()V
|
||||
public abstract fun onHostDestroy (Landroid/app/Activity;)V
|
||||
public abstract fun onHostLeaveHint (Landroid/app/Activity;)V
|
||||
public abstract fun onHostPause ()V
|
||||
public abstract fun onHostPause (Landroid/app/Activity;)V
|
||||
public abstract fun onHostResume (Landroid/app/Activity;)V
|
||||
@@ -256,7 +252,6 @@ public class com/facebook/react/ReactInstanceManager {
|
||||
public fun onHostResume (Landroid/app/Activity;)V
|
||||
public fun onHostResume (Landroid/app/Activity;Lcom/facebook/react/modules/core/DefaultHardwareBackBtnHandler;)V
|
||||
public fun onNewIntent (Landroid/content/Intent;)V
|
||||
public fun onUserLeaveHint (Landroid/app/Activity;)V
|
||||
public fun onWindowFocusChange (Z)V
|
||||
public fun recreateReactContextInBackground ()V
|
||||
public fun removeReactInstanceEventListener (Lcom/facebook/react/ReactInstanceEventListener;)V
|
||||
@@ -491,7 +486,6 @@ public class com/facebook/react/animated/NativeAnimatedNodesManager : com/facebo
|
||||
public abstract interface class com/facebook/react/bridge/ActivityEventListener {
|
||||
public abstract fun onActivityResult (Landroid/app/Activity;IILandroid/content/Intent;)V
|
||||
public abstract fun onNewIntent (Landroid/content/Intent;)V
|
||||
public fun onUserLeaveHint (Landroid/app/Activity;)V
|
||||
}
|
||||
|
||||
public class com/facebook/react/bridge/Arguments {
|
||||
@@ -1118,7 +1112,6 @@ public class com/facebook/react/bridge/ReactContext : android/content/ContextWra
|
||||
public fun onHostPause ()V
|
||||
public fun onHostResume (Landroid/app/Activity;)V
|
||||
public fun onNewIntent (Landroid/app/Activity;Landroid/content/Intent;)V
|
||||
public fun onUserLeaveHint (Landroid/app/Activity;)V
|
||||
public fun onWindowFocusChange (Z)V
|
||||
public fun registerSegment (ILjava/lang/String;Lcom/facebook/react/bridge/Callback;)V
|
||||
public fun removeActivityEventListener (Lcom/facebook/react/bridge/ActivityEventListener;)V
|
||||
@@ -1268,8 +1261,6 @@ public final class com/facebook/react/bridge/ReactMarkerConstants : java/lang/En
|
||||
public static final field ON_HOST_PAUSE_START Lcom/facebook/react/bridge/ReactMarkerConstants;
|
||||
public static final field ON_HOST_RESUME_END Lcom/facebook/react/bridge/ReactMarkerConstants;
|
||||
public static final field ON_HOST_RESUME_START Lcom/facebook/react/bridge/ReactMarkerConstants;
|
||||
public static final field ON_USER_LEAVE_HINT_END Lcom/facebook/react/bridge/ReactMarkerConstants;
|
||||
public static final field ON_USER_LEAVE_HINT_START Lcom/facebook/react/bridge/ReactMarkerConstants;
|
||||
public static final field PRE_REACT_CONTEXT_END Lcom/facebook/react/bridge/ReactMarkerConstants;
|
||||
public static final field PRE_RUN_JS_BUNDLE_START Lcom/facebook/react/bridge/ReactMarkerConstants;
|
||||
public static final field PRE_SETUP_REACT_CONTEXT_END Lcom/facebook/react/bridge/ReactMarkerConstants;
|
||||
@@ -3657,7 +3648,6 @@ public class com/facebook/react/runtime/ReactHostImpl : com/facebook/react/React
|
||||
public fun onConfigurationChanged (Landroid/content/Context;)V
|
||||
public fun onHostDestroy ()V
|
||||
public fun onHostDestroy (Landroid/app/Activity;)V
|
||||
public fun onHostLeaveHint (Landroid/app/Activity;)V
|
||||
public fun onHostPause ()V
|
||||
public fun onHostPause (Landroid/app/Activity;)V
|
||||
public fun onHostResume (Landroid/app/Activity;)V
|
||||
|
||||
@@ -109,12 +109,6 @@ public abstract class ReactActivity extends AppCompatActivity
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserLeaveHint() {
|
||||
super.onUserLeaveHint();
|
||||
mDelegate.onUserLeaveHint();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void requestPermissions(
|
||||
String[] permissions, int requestCode, PermissionListener listener) {
|
||||
|
||||
-4
@@ -129,10 +129,6 @@ public class ReactActivityDelegate {
|
||||
getPlainActivity().setContentView(mReactDelegate.getReactRootView());
|
||||
}
|
||||
|
||||
public void onUserLeaveHint() {
|
||||
mReactDelegate.onUserLeaveHint();
|
||||
}
|
||||
|
||||
public void onPause() {
|
||||
mReactDelegate.onHostPause();
|
||||
}
|
||||
|
||||
-10
@@ -111,16 +111,6 @@ public class ReactDelegate {
|
||||
}
|
||||
}
|
||||
|
||||
public void onUserLeaveHint() {
|
||||
if (ReactFeatureFlags.enableBridgelessArchitecture) {
|
||||
mReactHost.onHostLeaveHint(mActivity);
|
||||
} else {
|
||||
if (getReactNativeHost().hasInstance()) {
|
||||
getReactNativeHost().getReactInstanceManager().onUserLeaveHint(mActivity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onHostPause() {
|
||||
if (ReactFeatureFlags.enableBridgelessArchitecture) {
|
||||
mReactHost.onHostPause(mActivity);
|
||||
|
||||
@@ -64,12 +64,6 @@ public interface ReactHost {
|
||||
/** To be called when the host activity is resumed. */
|
||||
public fun onHostResume(activity: Activity?)
|
||||
|
||||
/**
|
||||
* To be called when the host activity is about to go into the background as the result of user
|
||||
* choice.
|
||||
*/
|
||||
public fun onHostLeaveHint(activity: Activity?)
|
||||
|
||||
/** To be called when the host activity is paused. */
|
||||
public fun onHostPause(activity: Activity?)
|
||||
|
||||
|
||||
-19
@@ -583,25 +583,6 @@ public class ReactInstanceManager {
|
||||
moveToBeforeResumeLifecycleState();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method should be called from {@link Activity#onUserLeaveHint()}. It notifies all listening
|
||||
* modules that the user is about to leave the activity. The passed Activity is has to be the
|
||||
* current Activity.
|
||||
*
|
||||
* @param activity the activity being backgrounded as a result of user action
|
||||
*/
|
||||
@ThreadConfined(UI)
|
||||
public void onUserLeaveHint(@Nullable Activity activity) {
|
||||
if (mCurrentActivity != null && activity == mCurrentActivity) {
|
||||
UiThreadUtil.assertOnUiThread();
|
||||
|
||||
ReactContext currentContext = getCurrentReactContext();
|
||||
if (currentContext != null) {
|
||||
currentContext.onUserLeaveHint(activity);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Call this from {@link Activity#onPause()}. This notifies any listening modules so they can do
|
||||
* any necessary cleanup. The passed Activity is the current Activity being paused. This will
|
||||
|
||||
-4
@@ -22,8 +22,4 @@ public interface ActivityEventListener {
|
||||
|
||||
/** Called when a new intent is passed to the activity */
|
||||
void onNewIntent(Intent intent);
|
||||
|
||||
/** Called when host activity receives an {@link Activity#onUserLeaveHint()} call. */
|
||||
default void onUserLeaveHint(Activity activity) {}
|
||||
;
|
||||
}
|
||||
|
||||
-13
@@ -335,19 +335,6 @@ public class ReactContext extends ContextWrapper {
|
||||
ReactMarker.logMarker(ReactMarkerConstants.ON_HOST_RESUME_END);
|
||||
}
|
||||
|
||||
@ThreadConfined(UI)
|
||||
public void onUserLeaveHint(@Nullable Activity activity) {
|
||||
ReactMarker.logMarker(ReactMarkerConstants.ON_USER_LEAVE_HINT_START);
|
||||
for (ActivityEventListener listener : mActivityEventListeners) {
|
||||
try {
|
||||
listener.onUserLeaveHint(activity);
|
||||
} catch (RuntimeException e) {
|
||||
handleException(e);
|
||||
}
|
||||
}
|
||||
ReactMarker.logMarker(ReactMarkerConstants.ON_USER_LEAVE_HINT_END);
|
||||
}
|
||||
|
||||
@ThreadConfined(UI)
|
||||
public void onNewIntent(@Nullable Activity activity, Intent intent) {
|
||||
UiThreadUtil.assertOnUiThread();
|
||||
|
||||
-2
@@ -52,8 +52,6 @@ public enum ReactMarkerConstants {
|
||||
INITIALIZE_MODULE_END,
|
||||
ON_HOST_RESUME_START,
|
||||
ON_HOST_RESUME_END,
|
||||
ON_USER_LEAVE_HINT_START,
|
||||
ON_USER_LEAVE_HINT_END,
|
||||
ON_HOST_PAUSE_START,
|
||||
ON_HOST_PAUSE_END,
|
||||
CONVERT_CONSTANTS_START,
|
||||
|
||||
-12
@@ -290,18 +290,6 @@ public class ReactHostImpl implements ReactHost {
|
||||
mReactLifecycleStateManager.moveToOnHostResume(currentContext, getCurrentActivity());
|
||||
}
|
||||
|
||||
@ThreadConfined(UI)
|
||||
@Override
|
||||
public void onHostLeaveHint(final @Nullable Activity activity) {
|
||||
final String method = "onUserLeaveHint(activity)";
|
||||
log(method);
|
||||
|
||||
ReactContext currentContext = getCurrentReactContext();
|
||||
if (currentContext != null) {
|
||||
currentContext.onUserLeaveHint(activity);
|
||||
}
|
||||
}
|
||||
|
||||
@ThreadConfined(UI)
|
||||
@Override
|
||||
public void onHostPause(final @Nullable Activity activity) {
|
||||
|
||||
Reference in New Issue
Block a user