Loading quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java +26 −5 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.statemanager.StatefulActivity; import com.android.launcher3.uioverrides.QuickstepLauncher; import com.android.quickstep.GestureState; import com.android.quickstep.SystemUiProxy; import com.android.quickstep.views.DesktopAppSelectView; import com.android.wm.shell.desktopmode.IDesktopTaskListener; Loading Loading @@ -170,20 +171,40 @@ public class DesktopVisibilityController { /** * Whether recents gesture is currently in progress. */ public boolean isGestureInProgress() { public boolean isRecentsGestureInProgress() { return mGestureInProgress; } /** * Sets whether recents gesture is in progress. * Notify controller that recents gesture has started. */ public void setGestureInProgress(boolean gestureInProgress) { if (DEBUG) { Log.d(TAG, "setGestureInProgress: inProgress=" + gestureInProgress); public void setRecentsGestureStart() { if (!isDesktopModeSupported()) { return; } setRecentsGestureInProgress(true); } /** * Notify controller that recents gesture finished with the given * {@link com.android.quickstep.GestureState.GestureEndTarget} */ public void setRecentsGestureEnd(@Nullable GestureState.GestureEndTarget endTarget) { if (!isDesktopModeSupported()) { return; } setRecentsGestureInProgress(false); if (endTarget == null) { // Gesture did not result in a new end target. Ensure launchers gets paused again. markLauncherPaused(); } } private void setRecentsGestureInProgress(boolean gestureInProgress) { if (DEBUG) { Log.d(TAG, "setGestureInProgress: inProgress=" + gestureInProgress); } if (gestureInProgress != mGestureInProgress) { mGestureInProgress = gestureInProgress; } Loading quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +1 −1 Original line number Diff line number Diff line Loading @@ -867,7 +867,7 @@ public class QuickstepLauncher extends Launcher { if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) { DesktopVisibilityController controller = mDesktopVisibilityController; if (controller != null && controller.areFreeformTasksVisible() && !controller.isGestureInProgress()) { && !controller.isRecentsGestureInProgress()) { // Return early to skip setting activity to appear as resumed // TODO(b/255649902): shouldn't be needed when we have a separate launcher state // for desktop that we can use to control other parts of launcher Loading quickstep/src/com/android/quickstep/views/LauncherRecentsView.java +5 −3 Original line number Diff line number Diff line Loading @@ -249,7 +249,7 @@ public class LauncherRecentsView extends RecentsView<QuickstepLauncher, Launcher DesktopVisibilityController desktopVisibilityController = mActivity.getDesktopVisibilityController(); if (desktopVisibilityController != null) { desktopVisibilityController.setGestureInProgress(true); desktopVisibilityController.setRecentsGestureStart(); } } Loading @@ -257,9 +257,11 @@ public class LauncherRecentsView extends RecentsView<QuickstepLauncher, Launcher public void onGestureAnimationEnd() { DesktopVisibilityController desktopVisibilityController = null; boolean showDesktopApps = false; GestureState.GestureEndTarget endTarget = null; if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) { desktopVisibilityController = mActivity.getDesktopVisibilityController(); if (mCurrentGestureEndTarget == GestureState.GestureEndTarget.LAST_TASK endTarget = mCurrentGestureEndTarget; if (endTarget == GestureState.GestureEndTarget.LAST_TASK && desktopVisibilityController.areFreeformTasksVisible()) { // Recents gesture was cancelled and we are returning to the previous task. // After super class has handled clean up, show desktop apps on top again Loading @@ -268,7 +270,7 @@ public class LauncherRecentsView extends RecentsView<QuickstepLauncher, Launcher } super.onGestureAnimationEnd(); if (desktopVisibilityController != null) { desktopVisibilityController.setGestureInProgress(false); desktopVisibilityController.setRecentsGestureEnd(endTarget); } if (showDesktopApps) { SystemUiProxy.INSTANCE.get(mActivity).showDesktopApps(mActivity.getDisplayId()); Loading Loading
quickstep/src/com/android/launcher3/statehandlers/DesktopVisibilityController.java +26 −5 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ import com.android.launcher3.Launcher; import com.android.launcher3.LauncherState; import com.android.launcher3.statemanager.StatefulActivity; import com.android.launcher3.uioverrides.QuickstepLauncher; import com.android.quickstep.GestureState; import com.android.quickstep.SystemUiProxy; import com.android.quickstep.views.DesktopAppSelectView; import com.android.wm.shell.desktopmode.IDesktopTaskListener; Loading Loading @@ -170,20 +171,40 @@ public class DesktopVisibilityController { /** * Whether recents gesture is currently in progress. */ public boolean isGestureInProgress() { public boolean isRecentsGestureInProgress() { return mGestureInProgress; } /** * Sets whether recents gesture is in progress. * Notify controller that recents gesture has started. */ public void setGestureInProgress(boolean gestureInProgress) { if (DEBUG) { Log.d(TAG, "setGestureInProgress: inProgress=" + gestureInProgress); public void setRecentsGestureStart() { if (!isDesktopModeSupported()) { return; } setRecentsGestureInProgress(true); } /** * Notify controller that recents gesture finished with the given * {@link com.android.quickstep.GestureState.GestureEndTarget} */ public void setRecentsGestureEnd(@Nullable GestureState.GestureEndTarget endTarget) { if (!isDesktopModeSupported()) { return; } setRecentsGestureInProgress(false); if (endTarget == null) { // Gesture did not result in a new end target. Ensure launchers gets paused again. markLauncherPaused(); } } private void setRecentsGestureInProgress(boolean gestureInProgress) { if (DEBUG) { Log.d(TAG, "setGestureInProgress: inProgress=" + gestureInProgress); } if (gestureInProgress != mGestureInProgress) { mGestureInProgress = gestureInProgress; } Loading
quickstep/src/com/android/launcher3/uioverrides/QuickstepLauncher.java +1 −1 Original line number Diff line number Diff line Loading @@ -867,7 +867,7 @@ public class QuickstepLauncher extends Launcher { if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) { DesktopVisibilityController controller = mDesktopVisibilityController; if (controller != null && controller.areFreeformTasksVisible() && !controller.isGestureInProgress()) { && !controller.isRecentsGestureInProgress()) { // Return early to skip setting activity to appear as resumed // TODO(b/255649902): shouldn't be needed when we have a separate launcher state // for desktop that we can use to control other parts of launcher Loading
quickstep/src/com/android/quickstep/views/LauncherRecentsView.java +5 −3 Original line number Diff line number Diff line Loading @@ -249,7 +249,7 @@ public class LauncherRecentsView extends RecentsView<QuickstepLauncher, Launcher DesktopVisibilityController desktopVisibilityController = mActivity.getDesktopVisibilityController(); if (desktopVisibilityController != null) { desktopVisibilityController.setGestureInProgress(true); desktopVisibilityController.setRecentsGestureStart(); } } Loading @@ -257,9 +257,11 @@ public class LauncherRecentsView extends RecentsView<QuickstepLauncher, Launcher public void onGestureAnimationEnd() { DesktopVisibilityController desktopVisibilityController = null; boolean showDesktopApps = false; GestureState.GestureEndTarget endTarget = null; if (DesktopTaskView.DESKTOP_MODE_SUPPORTED) { desktopVisibilityController = mActivity.getDesktopVisibilityController(); if (mCurrentGestureEndTarget == GestureState.GestureEndTarget.LAST_TASK endTarget = mCurrentGestureEndTarget; if (endTarget == GestureState.GestureEndTarget.LAST_TASK && desktopVisibilityController.areFreeformTasksVisible()) { // Recents gesture was cancelled and we are returning to the previous task. // After super class has handled clean up, show desktop apps on top again Loading @@ -268,7 +270,7 @@ public class LauncherRecentsView extends RecentsView<QuickstepLauncher, Launcher } super.onGestureAnimationEnd(); if (desktopVisibilityController != null) { desktopVisibilityController.setGestureInProgress(false); desktopVisibilityController.setRecentsGestureEnd(endTarget); } if (showDesktopApps) { SystemUiProxy.INSTANCE.get(mActivity).showDesktopApps(mActivity.getDisplayId()); Loading