Loading core/java/android/app/ActivityManager.java +5 −0 Original line number Diff line number Diff line Loading @@ -518,6 +518,11 @@ public class ActivityManager { */ public static final int RECENT_IGNORE_UNAVAILABLE = 0x0002; /** * @hide */ public static final int RECENT_DO_NOT_COUNT_EXCLUDED = 0x0004; /** * Return a list of the tasks that the user has recently launched, with * the most recent being first and older ones after in order. Loading packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java +12 −1 Original line number Diff line number Diff line Loading @@ -442,12 +442,15 @@ public class RecentTasksLoader implements View.OnTouchListener { mContext.getSystemService(Context.ACTIVITY_SERVICE); final List<ActivityManager.RecentTaskInfo> recentTasks = am.getRecentTasks(MAX_TASKS, ActivityManager.RECENT_IGNORE_UNAVAILABLE); am.getRecentTasks(MAX_TASKS, ActivityManager.RECENT_IGNORE_UNAVAILABLE | ActivityManager.RECENT_WITH_EXCLUDED | ActivityManager.RECENT_DO_NOT_COUNT_EXCLUDED); int numTasks = recentTasks.size(); ActivityInfo homeInfo = new Intent(Intent.ACTION_MAIN) .addCategory(Intent.CATEGORY_HOME).resolveActivityInfo(pm, 0); boolean firstScreenful = true; boolean loadOneExcluded = true; ArrayList<TaskDescription> tasks = new ArrayList<TaskDescription>(); // skip the first task - assume it's either the home screen or the current activity. Loading @@ -465,6 +468,7 @@ public class RecentTasksLoader implements View.OnTouchListener { // Don't load the current home activity. if (isCurrentHomeActivity(intent.getComponent(), homeInfo)) { loadOneExcluded = false; continue; } Loading @@ -473,6 +477,13 @@ public class RecentTasksLoader implements View.OnTouchListener { continue; } if (!loadOneExcluded && (recentInfo.baseIntent.getFlags() & Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0) { continue; } loadOneExcluded = false; TaskDescription item = createTaskDescription(recentInfo.id, recentInfo.persistentId, recentInfo.baseIntent, recentInfo.origActivity, recentInfo.description); Loading services/java/com/android/server/am/ActivityManagerService.java +5 −1 Original line number Diff line number Diff line Loading @@ -6028,9 +6028,13 @@ public final class ActivityManagerService extends ActivityManagerNative } res.add(rti); if ((tr.intent.getFlags() & Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) == 0 || (flags & ActivityManager.RECENT_DO_NOT_COUNT_EXCLUDED) == 0 || i == 0) { maxNum--; } } } return res; } } Loading Loading
core/java/android/app/ActivityManager.java +5 −0 Original line number Diff line number Diff line Loading @@ -518,6 +518,11 @@ public class ActivityManager { */ public static final int RECENT_IGNORE_UNAVAILABLE = 0x0002; /** * @hide */ public static final int RECENT_DO_NOT_COUNT_EXCLUDED = 0x0004; /** * Return a list of the tasks that the user has recently launched, with * the most recent being first and older ones after in order. Loading
packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java +12 −1 Original line number Diff line number Diff line Loading @@ -442,12 +442,15 @@ public class RecentTasksLoader implements View.OnTouchListener { mContext.getSystemService(Context.ACTIVITY_SERVICE); final List<ActivityManager.RecentTaskInfo> recentTasks = am.getRecentTasks(MAX_TASKS, ActivityManager.RECENT_IGNORE_UNAVAILABLE); am.getRecentTasks(MAX_TASKS, ActivityManager.RECENT_IGNORE_UNAVAILABLE | ActivityManager.RECENT_WITH_EXCLUDED | ActivityManager.RECENT_DO_NOT_COUNT_EXCLUDED); int numTasks = recentTasks.size(); ActivityInfo homeInfo = new Intent(Intent.ACTION_MAIN) .addCategory(Intent.CATEGORY_HOME).resolveActivityInfo(pm, 0); boolean firstScreenful = true; boolean loadOneExcluded = true; ArrayList<TaskDescription> tasks = new ArrayList<TaskDescription>(); // skip the first task - assume it's either the home screen or the current activity. Loading @@ -465,6 +468,7 @@ public class RecentTasksLoader implements View.OnTouchListener { // Don't load the current home activity. if (isCurrentHomeActivity(intent.getComponent(), homeInfo)) { loadOneExcluded = false; continue; } Loading @@ -473,6 +477,13 @@ public class RecentTasksLoader implements View.OnTouchListener { continue; } if (!loadOneExcluded && (recentInfo.baseIntent.getFlags() & Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) != 0) { continue; } loadOneExcluded = false; TaskDescription item = createTaskDescription(recentInfo.id, recentInfo.persistentId, recentInfo.baseIntent, recentInfo.origActivity, recentInfo.description); Loading
services/java/com/android/server/am/ActivityManagerService.java +5 −1 Original line number Diff line number Diff line Loading @@ -6028,9 +6028,13 @@ public final class ActivityManagerService extends ActivityManagerNative } res.add(rti); if ((tr.intent.getFlags() & Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS) == 0 || (flags & ActivityManager.RECENT_DO_NOT_COUNT_EXCLUDED) == 0 || i == 0) { maxNum--; } } } return res; } } Loading