diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java index a4fdc8a44a..0d3d119594 100644 --- a/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java +++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/LauncherActivityControllerHelper.java @@ -109,6 +109,14 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe // Ensure recents is at the correct position for NORMAL state. For example, when we detach // recents, we assume the first task is invisible, making translation off by one task. activity.getStateManager().reapplyState(); + setLauncherHideBackArrow(false); + } + + private void setLauncherHideBackArrow(boolean hideBackArrow) { + Launcher launcher = getCreatedActivity(); + if (launcher != null) { + launcher.getRootView().setForceHideBackArrow(hideBackArrow); + } } @Override @@ -139,7 +147,7 @@ public final class LauncherActivityControllerHelper implements ActivityControlHe ? FloatingIconView.getFloatingIconView(activity, workspaceView, true /* hideOriginal */, iconLocation, false /* isOpening */) : null; - + setLauncherHideBackArrow(true); return new HomeAnimationFactory() { @Nullable @Override diff --git a/src/com/android/launcher3/LauncherRootView.java b/src/com/android/launcher3/LauncherRootView.java index f964b8d9ee..ce1795aa11 100644 --- a/src/com/android/launcher3/LauncherRootView.java +++ b/src/com/android/launcher3/LauncherRootView.java @@ -39,6 +39,8 @@ public class LauncherRootView extends InsettableFrameLayout { private WindowStateListener mWindowStateListener; @ViewDebug.ExportedProperty(category = "launcher") private boolean mDisallowBackGesture; + @ViewDebug.ExportedProperty(category = "launcher") + private boolean mForceHideBackArrow; public LauncherRootView(Context context, AttributeSet attrs) { super(context, attrs); @@ -175,13 +177,19 @@ public class LauncherRootView extends InsettableFrameLayout { setDisallowBackGesture(mDisallowBackGesture); } + @TargetApi(Build.VERSION_CODES.Q) + public void setForceHideBackArrow(boolean forceHideBackArrow) { + this.mForceHideBackArrow = forceHideBackArrow; + setDisallowBackGesture(mDisallowBackGesture); + } + @TargetApi(Build.VERSION_CODES.Q) public void setDisallowBackGesture(boolean disallowBackGesture) { if (!Utilities.ATLEAST_Q) { return; } mDisallowBackGesture = disallowBackGesture; - setSystemGestureExclusionRects(mDisallowBackGesture + setSystemGestureExclusionRects((mForceHideBackArrow || mDisallowBackGesture) ? SYSTEM_GESTURE_EXCLUSION_RECT : Collections.emptyList()); }