Loading core/java/android/app/ActivityManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -1199,6 +1199,12 @@ public class ActivityManager { */ public int id; /** * The stack that currently contains this task. * @hide */ public int stackId; /** * The component launched as the first activity in the task. This can * be considered the "application" of this task. Loading Loading @@ -1248,6 +1254,7 @@ public class ActivityManager { public void writeToParcel(Parcel dest, int flags) { dest.writeInt(id); dest.writeInt(stackId); ComponentName.writeToParcel(baseActivity, dest); ComponentName.writeToParcel(topActivity, dest); if (thumbnail != null) { Loading @@ -1264,6 +1271,7 @@ public class ActivityManager { public void readFromParcel(Parcel source) { id = source.readInt(); stackId = source.readInt(); baseActivity = ComponentName.readFromParcel(source); topActivity = ComponentName.readFromParcel(source); if (source.readInt() != 0) { Loading packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -346,7 +346,7 @@ public class RecentsImpl extends IRecentsNonSystemUserCallbacks.Stub // Return early if there is no running task (can't determine affiliated tasks in this case) if (runningTask == null) return; // Return early if the running task is in the home stack (optimization) if (ssp.isInHomeStack(runningTask.id)) return; if (SystemServicesProxy.isHomeStack(runningTask.stackId)) return; // Find the task in the recents list ArrayList<Task> tasks = focusedStack.getTasks(); Loading packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +14 −10 Original line number Diff line number Diff line Loading @@ -247,8 +247,10 @@ public class SystemServicesProxy { return true; } // Note, this is only valid because we currently only allow the recents and home // activities in the home stack if (isHomeTopMost != null) { isHomeTopMost.value = isInHomeStack(topTask.id); isHomeTopMost.value = SystemServicesProxy.isHomeStack(topTask.stackId); } } return false; Loading Loading @@ -313,16 +315,18 @@ public class SystemServicesProxy { } } /** Returns whether the specified task is in the home stack */ public boolean isInHomeStack(int taskId) { if (mAm == null) return false; // If we are mocking, then just return false if (Constants.DebugFlags.App.EnableSystemServicesProxy) { return false; /** * Returns whether the given stack id is the home stack id. */ public static boolean isHomeStack(int stackId) { return stackId == ActivityManager.HOME_STACK_ID; } return mAm.isInHomeStack(taskId); /** * Returns whether the given stack id is the freeform workspace stack id. */ public static boolean isFreeformStack(int stackId) { return stackId == ActivityManager.FREEFORM_WORKSPACE_STACK_ID; } /** Loading services/core/java/com/android/server/am/ActivityStack.java +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.app.ActivityManager.FIRST_STATIC_STACK_ID; import static android.app.ActivityManager.FREEFORM_WORKSPACE_STACK_ID; import static android.app.ActivityManager.FULLSCREEN_WORKSPACE_STACK_ID; import static android.app.ActivityManager.HOME_STACK_ID; import static android.app.ActivityManager.INVALID_STACK_ID; import static android.app.ActivityManager.LAST_STATIC_STACK_ID; import static android.app.ActivityManager.PINNED_STACK_ID; import static android.content.pm.ActivityInfo.FLAG_SHOW_FOR_ALL_USERS; Loading Loading @@ -4375,6 +4376,7 @@ final class ActivityStack { RunningTaskInfo ci = new RunningTaskInfo(); ci.id = task.taskId; ci.stackId = (task.stack == null) ? INVALID_STACK_ID : task.stack.getStackId(); ci.baseActivity = r.intent.getComponent(); ci.topActivity = top.intent.getComponent(); ci.lastActiveTime = task.lastActiveTime; Loading Loading
core/java/android/app/ActivityManager.java +8 −0 Original line number Diff line number Diff line Loading @@ -1199,6 +1199,12 @@ public class ActivityManager { */ public int id; /** * The stack that currently contains this task. * @hide */ public int stackId; /** * The component launched as the first activity in the task. This can * be considered the "application" of this task. Loading Loading @@ -1248,6 +1254,7 @@ public class ActivityManager { public void writeToParcel(Parcel dest, int flags) { dest.writeInt(id); dest.writeInt(stackId); ComponentName.writeToParcel(baseActivity, dest); ComponentName.writeToParcel(topActivity, dest); if (thumbnail != null) { Loading @@ -1264,6 +1271,7 @@ public class ActivityManager { public void readFromParcel(Parcel source) { id = source.readInt(); stackId = source.readInt(); baseActivity = ComponentName.readFromParcel(source); topActivity = ComponentName.readFromParcel(source); if (source.readInt() != 0) { Loading
packages/SystemUI/src/com/android/systemui/recents/RecentsImpl.java +1 −1 Original line number Diff line number Diff line Loading @@ -346,7 +346,7 @@ public class RecentsImpl extends IRecentsNonSystemUserCallbacks.Stub // Return early if there is no running task (can't determine affiliated tasks in this case) if (runningTask == null) return; // Return early if the running task is in the home stack (optimization) if (ssp.isInHomeStack(runningTask.id)) return; if (SystemServicesProxy.isHomeStack(runningTask.stackId)) return; // Find the task in the recents list ArrayList<Task> tasks = focusedStack.getTasks(); Loading
packages/SystemUI/src/com/android/systemui/recents/misc/SystemServicesProxy.java +14 −10 Original line number Diff line number Diff line Loading @@ -247,8 +247,10 @@ public class SystemServicesProxy { return true; } // Note, this is only valid because we currently only allow the recents and home // activities in the home stack if (isHomeTopMost != null) { isHomeTopMost.value = isInHomeStack(topTask.id); isHomeTopMost.value = SystemServicesProxy.isHomeStack(topTask.stackId); } } return false; Loading Loading @@ -313,16 +315,18 @@ public class SystemServicesProxy { } } /** Returns whether the specified task is in the home stack */ public boolean isInHomeStack(int taskId) { if (mAm == null) return false; // If we are mocking, then just return false if (Constants.DebugFlags.App.EnableSystemServicesProxy) { return false; /** * Returns whether the given stack id is the home stack id. */ public static boolean isHomeStack(int stackId) { return stackId == ActivityManager.HOME_STACK_ID; } return mAm.isInHomeStack(taskId); /** * Returns whether the given stack id is the freeform workspace stack id. */ public static boolean isFreeformStack(int stackId) { return stackId == ActivityManager.FREEFORM_WORKSPACE_STACK_ID; } /** Loading
services/core/java/com/android/server/am/ActivityStack.java +2 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.app.ActivityManager.FIRST_STATIC_STACK_ID; import static android.app.ActivityManager.FREEFORM_WORKSPACE_STACK_ID; import static android.app.ActivityManager.FULLSCREEN_WORKSPACE_STACK_ID; import static android.app.ActivityManager.HOME_STACK_ID; import static android.app.ActivityManager.INVALID_STACK_ID; import static android.app.ActivityManager.LAST_STATIC_STACK_ID; import static android.app.ActivityManager.PINNED_STACK_ID; import static android.content.pm.ActivityInfo.FLAG_SHOW_FOR_ALL_USERS; Loading Loading @@ -4375,6 +4376,7 @@ final class ActivityStack { RunningTaskInfo ci = new RunningTaskInfo(); ci.id = task.taskId; ci.stackId = (task.stack == null) ? INVALID_STACK_ID : task.stack.getStackId(); ci.baseActivity = r.intent.getComponent(); ci.topActivity = top.intent.getComponent(); ci.lastActiveTime = task.lastActiveTime; Loading