summaryrefslogtreecommitdiff
path: root/com/android/systemui/recents/RecentsActivityLaunchState.java
diff options
context:
space:
mode:
Diffstat (limited to 'com/android/systemui/recents/RecentsActivityLaunchState.java')
-rw-r--r--com/android/systemui/recents/RecentsActivityLaunchState.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/com/android/systemui/recents/RecentsActivityLaunchState.java b/com/android/systemui/recents/RecentsActivityLaunchState.java
index d2326ce2..5b8ed94d 100644
--- a/com/android/systemui/recents/RecentsActivityLaunchState.java
+++ b/com/android/systemui/recents/RecentsActivityLaunchState.java
@@ -33,6 +33,7 @@ public class RecentsActivityLaunchState {
public boolean launchedFromPipApp;
// Set if the next activity that quick-switch will launch is the PiP activity
public boolean launchedWithNextPipApp;
+ public boolean launchedFromBlacklistedApp;
public boolean launchedFromHome;
public boolean launchedViaDragGesture;
public boolean launchedViaDockGesture;
@@ -43,6 +44,7 @@ public class RecentsActivityLaunchState {
public void reset() {
launchedFromHome = false;
launchedFromApp = false;
+ launchedFromBlacklistedApp = false;
launchedFromPipApp = false;
launchedWithNextPipApp = false;
launchedToTaskId = -1;
@@ -58,6 +60,18 @@ public class RecentsActivityLaunchState {
RecentsDebugFlags debugFlags = Recents.getDebugFlags();
RecentsActivityLaunchState launchState = Recents.getConfiguration().getLaunchState();
if (launchedFromApp) {
+ if (!launchState.launchedWithAltTab && debugFlags.isFastToggleRecentsEnabled()) {
+ // If fast toggling, focus the front most task so that the next tap will launch the
+ // task
+ return numTasks - 1;
+ }
+
+ if (launchState.launchedFromBlacklistedApp) {
+ // If we are launching from a blacklisted app, focus the front most task so that the
+ // next tap will launch the task
+ return numTasks - 1;
+ }
+
if (useGridLayout) {
// If coming from another app to the grid layout, focus the front most task
return numTasks - 1;
@@ -66,6 +80,12 @@ public class RecentsActivityLaunchState {
// If coming from another app, focus the next task
return Math.max(0, numTasks - 2);
} else {
+ if (!launchState.launchedWithAltTab && debugFlags.isFastToggleRecentsEnabled()) {
+ // If fast toggling, defer focusing until the next tap (which will automatically
+ // focus the front most task)
+ return -1;
+ }
+
// If coming from home, focus the front most task
return numTasks - 1;
}