Loading quickstep/src/com/android/quickstep/RecentTasksList.java +18 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.quickstep; import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import static com.android.quickstep.views.DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED; import static com.android.wm.shell.util.GroupedRecentTaskInfo.TYPE_FREEFORM; Loading Loading @@ -269,6 +271,7 @@ public class RecentTasksList { TaskLoadResult allTasks = new TaskLoadResult(requestId, loadKeysOnly, rawTasks.size()); int numVisibleTasks = 0; for (GroupedRecentTaskInfo rawTask : rawTasks) { if (DESKTOP_IS_PROTO2_ENABLED && rawTask.getType() == TYPE_FREEFORM) { GroupTask desktopTask = createDesktopTask(rawTask); Loading @@ -285,12 +288,27 @@ public class RecentTasksList { task1.setLastSnapshotData(taskInfo1); Task task2 = null; if (taskInfo2 != null) { // Is split task Task.TaskKey task2Key = new Task.TaskKey(taskInfo2); task2 = loadKeysOnly ? new Task(task2Key) : Task.from(task2Key, taskInfo2, tmpLockedUsers.get(task2Key.userId) /* isLocked */); task2.setLastSnapshotData(taskInfo2); } else { // Is fullscreen task if (numVisibleTasks > 0) { boolean isExcluded = (taskInfo1.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0; if (taskInfo1.isTopActivityTransparent && isExcluded) { // If there are already visible tasks, then ignore the excluded tasks and // don't add them to the returned list continue; } } } if (taskInfo1.isVisible) { numVisibleTasks++; } final SplitConfigurationOptions.SplitBounds launcherSplitBounds = convertSplitBounds(rawTask.getSplitBounds()); Loading quickstep/src/com/android/quickstep/TopTaskTracker.java +14 −6 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.quickstep; import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.app.WindowConfiguration.ACTIVITY_TYPE_ASSISTANT; import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME; import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS; import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM; Loading Loading @@ -229,12 +228,21 @@ public class TopTaskTracker extends ISplitScreenListener.Stub implements TaskSta } /** * Returns true if the given task holds an Assistant activity that is excluded from recents * If the given task holds an activity that is excluded from recents, and there * is another running task that is not excluded from recents, returns that underlying task. */ public boolean isExcludedAssistant() { return mTopTask != null && mTopTask.configuration.windowConfiguration .getActivityType() == ACTIVITY_TYPE_ASSISTANT && (mTopTask.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0; public @Nullable CachedTaskInfo otherVisibleTaskThisIsExcludedOver() { if (mTopTask == null || (mTopTask.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) == 0) { // Not an excluded task. return null; } List<RunningTaskInfo> visibleNonExcludedTasks = mAllCachedTasks.stream() .filter(t -> t.isVisible && (t.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) == 0) .toList(); return visibleNonExcludedTasks.isEmpty() ? null : new CachedTaskInfo(visibleNonExcludedTasks); } /** Loading quickstep/src/com/android/quickstep/TouchInteractionService.java +13 −7 Original line number Diff line number Diff line Loading @@ -1044,13 +1044,19 @@ public class TouchInteractionService extends Service { boolean forceOverviewInputConsumer = gestureState.getActivityInterface().isStarted() && gestureState.getRunningTask() != null && gestureState.getRunningTask().isRootChooseActivity(); if (gestureState.getRunningTask() != null && gestureState.getRunningTask().isExcludedAssistant()) { // In the case where we are in the excluded assistant state, ignore it and treat the // running activity as the task behind the assistant gestureState.updateRunningTask(TopTaskTracker.INSTANCE.get(this) .getCachedTopTask(true /* filterOnlyVisibleRecents */)); forceOverviewInputConsumer = gestureState.getRunningTask().isHomeTask(); // In the case where we are in an excluded, translucent overlay, ignore it and treat the // running activity as the task behind the overlay. TopTaskTracker.CachedTaskInfo otherVisibleTask = gestureState.getRunningTask() == null ? null : gestureState.getRunningTask().otherVisibleTaskThisIsExcludedOver(); if (otherVisibleTask != null) { ActiveGestureLog.INSTANCE.addLog(new CompoundString("Changing active task to ") .append(otherVisibleTask.getPackageName()) .append(" because the previous task running on top of this one (") .append(gestureState.getRunningTask().getPackageName()) .append(") was excluded from recents")); gestureState.updateRunningTask(otherVisibleTask); } boolean previousGestureAnimatedToLauncher = Loading quickstep/src/com/android/quickstep/util/TaskViewSimulator.java +1 −0 Original line number Diff line number Diff line Loading @@ -375,6 +375,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { mInversePositionMatrix.mapRect(mTempRectF); mTempRectF.roundOut(mTmpCropRect); params.setProgress(1f - fullScreenProgress); params.applySurfaceParams(params.createSurfaceParams(this)); if (!DEBUG) { Loading quickstep/src/com/android/quickstep/util/TransformParams.java +9 −3 Original line number Diff line number Diff line Loading @@ -15,8 +15,8 @@ */ package com.android.quickstep.util; import static android.app.WindowConfiguration.ACTIVITY_TYPE_ASSISTANT; import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME; import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS; import android.util.FloatProperty; import android.view.RemoteAnimationTarget; Loading Loading @@ -54,6 +54,7 @@ public class TransformParams { } }; /** Progress from 0 to 1 where 0 is in-app and 1 is Overview */ private float mProgress; private float mTargetAlpha; private float mCornerRadius; Loading Loading @@ -135,6 +136,7 @@ public class TransformParams { return this; } /** Builds the SurfaceTransaction from the given BuilderProxy params. */ public SurfaceTransaction createSurfaceParams(BuilderProxy proxy) { RemoteAnimationTargets targets = mTargetSet; SurfaceTransaction transaction = new SurfaceTransaction(); Loading @@ -150,8 +152,12 @@ public class TransformParams { if (activityType == ACTIVITY_TYPE_HOME) { mHomeBuilderProxy.onBuildTargetParams(builder, app, this); } else { // Fade out Assistant overlay. if (activityType == ACTIVITY_TYPE_ASSISTANT && app.isNotInRecents) { // Fade out translucent overlay. // TODO(b/303351074): use app.isNotInRecents directly once it is fixed. boolean isNotInRecents = app.taskInfo != null && (app.taskInfo.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0; if (app.isTranslucent && isNotInRecents) { float progress = Utilities.boundToRange(getProgress(), 0, 1); builder.setAlpha(1 - Interpolators.DECELERATE_QUINT .getInterpolation(progress)); Loading Loading
quickstep/src/com/android/quickstep/RecentTasksList.java +18 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,8 @@ package com.android.quickstep; import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import static com.android.quickstep.views.DesktopTaskView.DESKTOP_IS_PROTO2_ENABLED; import static com.android.wm.shell.util.GroupedRecentTaskInfo.TYPE_FREEFORM; Loading Loading @@ -269,6 +271,7 @@ public class RecentTasksList { TaskLoadResult allTasks = new TaskLoadResult(requestId, loadKeysOnly, rawTasks.size()); int numVisibleTasks = 0; for (GroupedRecentTaskInfo rawTask : rawTasks) { if (DESKTOP_IS_PROTO2_ENABLED && rawTask.getType() == TYPE_FREEFORM) { GroupTask desktopTask = createDesktopTask(rawTask); Loading @@ -285,12 +288,27 @@ public class RecentTasksList { task1.setLastSnapshotData(taskInfo1); Task task2 = null; if (taskInfo2 != null) { // Is split task Task.TaskKey task2Key = new Task.TaskKey(taskInfo2); task2 = loadKeysOnly ? new Task(task2Key) : Task.from(task2Key, taskInfo2, tmpLockedUsers.get(task2Key.userId) /* isLocked */); task2.setLastSnapshotData(taskInfo2); } else { // Is fullscreen task if (numVisibleTasks > 0) { boolean isExcluded = (taskInfo1.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0; if (taskInfo1.isTopActivityTransparent && isExcluded) { // If there are already visible tasks, then ignore the excluded tasks and // don't add them to the returned list continue; } } } if (taskInfo1.isVisible) { numVisibleTasks++; } final SplitConfigurationOptions.SplitBounds launcherSplitBounds = convertSplitBounds(rawTask.getSplitBounds()); Loading
quickstep/src/com/android/quickstep/TopTaskTracker.java +14 −6 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.quickstep; import static android.app.ActivityTaskManager.INVALID_TASK_ID; import static android.app.WindowConfiguration.ACTIVITY_TYPE_ASSISTANT; import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME; import static android.app.WindowConfiguration.ACTIVITY_TYPE_RECENTS; import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM; Loading Loading @@ -229,12 +228,21 @@ public class TopTaskTracker extends ISplitScreenListener.Stub implements TaskSta } /** * Returns true if the given task holds an Assistant activity that is excluded from recents * If the given task holds an activity that is excluded from recents, and there * is another running task that is not excluded from recents, returns that underlying task. */ public boolean isExcludedAssistant() { return mTopTask != null && mTopTask.configuration.windowConfiguration .getActivityType() == ACTIVITY_TYPE_ASSISTANT && (mTopTask.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0; public @Nullable CachedTaskInfo otherVisibleTaskThisIsExcludedOver() { if (mTopTask == null || (mTopTask.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) == 0) { // Not an excluded task. return null; } List<RunningTaskInfo> visibleNonExcludedTasks = mAllCachedTasks.stream() .filter(t -> t.isVisible && (t.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) == 0) .toList(); return visibleNonExcludedTasks.isEmpty() ? null : new CachedTaskInfo(visibleNonExcludedTasks); } /** Loading
quickstep/src/com/android/quickstep/TouchInteractionService.java +13 −7 Original line number Diff line number Diff line Loading @@ -1044,13 +1044,19 @@ public class TouchInteractionService extends Service { boolean forceOverviewInputConsumer = gestureState.getActivityInterface().isStarted() && gestureState.getRunningTask() != null && gestureState.getRunningTask().isRootChooseActivity(); if (gestureState.getRunningTask() != null && gestureState.getRunningTask().isExcludedAssistant()) { // In the case where we are in the excluded assistant state, ignore it and treat the // running activity as the task behind the assistant gestureState.updateRunningTask(TopTaskTracker.INSTANCE.get(this) .getCachedTopTask(true /* filterOnlyVisibleRecents */)); forceOverviewInputConsumer = gestureState.getRunningTask().isHomeTask(); // In the case where we are in an excluded, translucent overlay, ignore it and treat the // running activity as the task behind the overlay. TopTaskTracker.CachedTaskInfo otherVisibleTask = gestureState.getRunningTask() == null ? null : gestureState.getRunningTask().otherVisibleTaskThisIsExcludedOver(); if (otherVisibleTask != null) { ActiveGestureLog.INSTANCE.addLog(new CompoundString("Changing active task to ") .append(otherVisibleTask.getPackageName()) .append(" because the previous task running on top of this one (") .append(gestureState.getRunningTask().getPackageName()) .append(") was excluded from recents")); gestureState.updateRunningTask(otherVisibleTask); } boolean previousGestureAnimatedToLauncher = Loading
quickstep/src/com/android/quickstep/util/TaskViewSimulator.java +1 −0 Original line number Diff line number Diff line Loading @@ -375,6 +375,7 @@ public class TaskViewSimulator implements TransformParams.BuilderProxy { mInversePositionMatrix.mapRect(mTempRectF); mTempRectF.roundOut(mTmpCropRect); params.setProgress(1f - fullScreenProgress); params.applySurfaceParams(params.createSurfaceParams(this)); if (!DEBUG) { Loading
quickstep/src/com/android/quickstep/util/TransformParams.java +9 −3 Original line number Diff line number Diff line Loading @@ -15,8 +15,8 @@ */ package com.android.quickstep.util; import static android.app.WindowConfiguration.ACTIVITY_TYPE_ASSISTANT; import static android.app.WindowConfiguration.ACTIVITY_TYPE_HOME; import static android.content.Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS; import android.util.FloatProperty; import android.view.RemoteAnimationTarget; Loading Loading @@ -54,6 +54,7 @@ public class TransformParams { } }; /** Progress from 0 to 1 where 0 is in-app and 1 is Overview */ private float mProgress; private float mTargetAlpha; private float mCornerRadius; Loading Loading @@ -135,6 +136,7 @@ public class TransformParams { return this; } /** Builds the SurfaceTransaction from the given BuilderProxy params. */ public SurfaceTransaction createSurfaceParams(BuilderProxy proxy) { RemoteAnimationTargets targets = mTargetSet; SurfaceTransaction transaction = new SurfaceTransaction(); Loading @@ -150,8 +152,12 @@ public class TransformParams { if (activityType == ACTIVITY_TYPE_HOME) { mHomeBuilderProxy.onBuildTargetParams(builder, app, this); } else { // Fade out Assistant overlay. if (activityType == ACTIVITY_TYPE_ASSISTANT && app.isNotInRecents) { // Fade out translucent overlay. // TODO(b/303351074): use app.isNotInRecents directly once it is fixed. boolean isNotInRecents = app.taskInfo != null && (app.taskInfo.baseIntent.getFlags() & FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0; if (app.isTranslucent && isNotInRecents) { float progress = Utilities.boundToRange(getProgress(), 0, 1); builder.setAlpha(1 - Interpolators.DECELERATE_QUINT .getInterpolation(progress)); Loading