summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Vadim Tryshev <vadimt@google.com> 2018-03-05 18:33:48 -0800
committer Vadim Tryshev <vadimt@google.com> 2018-03-06 12:51:23 -0800
commiteff42d317b218bcd5fb46888fc59b7f987fcc238 (patch)
tree9f376bf26f4730a7cf1e036d7881dc4501c0e534
parent2cb0244ade0daf166882c6d4ca147e1f92862af2 (diff)
Exclude from Recents Assistant in half-screen mode
The expectation is that full-screen assistant will not have FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS attribute, and will be shown in Recents, whether it's a first or a non-first task. The half-screen assistant will have this flag set, and will never be shown in Recents. Bug: 70789568 Test: Check that Assistant with FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS isn't shown in Recents. Change-Id: I5bd2f5f638cc4e0100e435d94eee22e7c022aab6
-rw-r--r--services/core/java/com/android/server/am/RecentTasks.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/am/RecentTasks.java b/services/core/java/com/android/server/am/RecentTasks.java
index 5fd300c034e3..99f5298b55f3 100644
--- a/services/core/java/com/android/server/am/RecentTasks.java
+++ b/services/core/java/com/android/server/am/RecentTasks.java
@@ -19,6 +19,7 @@ package com.android.server.am;
import static android.app.ActivityManager.FLAG_AND_UNLOCKED;
import static android.app.ActivityManager.RECENT_IGNORE_UNAVAILABLE;
import static android.app.ActivityManager.RECENT_WITH_EXCLUDED;
+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_PINNED;
@@ -1099,13 +1100,22 @@ class RecentTasks {
+ " sessionDuration=" + mActiveTasksSessionDurationMs
+ " inactiveDuration=" + task.getInactiveDuration()
+ " activityType=" + task.getActivityType()
- + " windowingMode=" + task.getWindowingMode());
+ + " windowingMode=" + task.getWindowingMode()
+ + " intentFlags=" + task.getBaseIntent().getFlags());
- // Ignore certain activity types completely
switch (task.getActivityType()) {
case ACTIVITY_TYPE_HOME:
case ACTIVITY_TYPE_RECENTS:
+ // Ignore certain activity types completely
return false;
+ case ACTIVITY_TYPE_ASSISTANT:
+ // Ignore assistant that chose to be excluded from Recents, even if it's a top
+ // task.
+ if ((task.getBaseIntent().getFlags()
+ & Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS)
+ == Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) {
+ return false;
+ }
}
// Ignore certain windowing modes