Merge "Hide system UI activity with FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS in Recents" into nyc-dev

This commit is contained in:
Jaewan Kim
2016-03-22 00:34:17 +00:00
committed by Android (Google) Code Review

View File

@@ -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<String> 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;
}