From 7ed7657c21e6f253afffdfbe7290157ef5db471f Mon Sep 17 00:00:00 2001 From: Jaewan Kim Date: Thu, 17 Mar 2016 18:15:07 +0900 Subject: [PATCH] Hide system UI activity with FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS in Recents Bug: 27319061 Change-Id: I41150137cdfac6750f74ba3a72c4872dc6816f1d --- .../systemui/recents/misc/SystemServicesProxy.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java index 532e79661c6ae..de3c2bed9435c 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +++ b/packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java @@ -94,12 +94,18 @@ public class SystemServicesProxy { final static String TAG = "SystemServicesProxy"; final static BitmapFactory.Options sBitmapOptions; - static { sBitmapOptions = new BitmapFactory.Options(); sBitmapOptions.inMutable = true; } + final static List sRecentsBlacklist; + static { + sRecentsBlacklist = new ArrayList<>(); + sRecentsBlacklist.add("com.android.systemui.tv.pip.PipOnboardingActivity"); + sRecentsBlacklist.add("com.android.systemui.tv.pip.PipMenuActivity"); + } + AccessibilityManager mAccm; ActivityManager mAm; IActivityManager mIam; @@ -227,12 +233,13 @@ public class SystemServicesProxy { // Check the first non-recents task, include this task even if it is marked as excluded // from recents if we are currently in the app. In other words, only remove excluded - // tasks if it is not the first active task. + // tasks if it is not the first active task, and not in the blacklist. boolean isExcluded = (t.baseIntent.getFlags() & Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) == Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS; + boolean isBlackListed = sRecentsBlacklist.contains(t.realActivity.getClassName()); // Filter out recent tasks from managed profiles which are in quiet mode. isExcluded |= quietProfileIds.contains(t.userId); - if (isExcluded && (isTopTaskHome || !isFirstValidTask)) { + if (isBlackListed || (isExcluded && (isTopTaskHome || !isFirstValidTask))) { iter.remove(); continue; }