Loading services/java/com/android/server/am/ActivityStack.java +6 −3 Original line number Diff line number Diff line Loading @@ -551,9 +551,6 @@ final class ActivityStack { * Move the activities around in the stack to bring a user to the foreground. */ final void switchUserLocked(int userId) { if (VALIDATE_TOKENS) { validateAppTokensLocked(); } if (mCurrentUser == userId) { return; } Loading @@ -564,11 +561,16 @@ final class ActivityStack { for (int i = 0; i < index; ++i) { TaskRecord task = mTaskHistory.get(i); if (task.userId == userId) { if (DEBUG_TASKS) Slog.d(TAG, "switchUserLocked: stack=" + getStackId() + " moving " + task + " to top"); mTaskHistory.remove(i); mTaskHistory.add(task); --index; } } if (VALIDATE_TOKENS) { validateAppTokensLocked(); } } void minimalResumeActivityLocked(ActivityRecord r) { Loading Loading @@ -2951,6 +2953,7 @@ final class ActivityStack { for (int taskNdx = top; taskNdx >= 0; --taskNdx) { final TaskRecord task = mTaskHistory.get(taskNdx); if (task.isHomeTask()) { if (DEBUG_TASKS || DEBUG_STACK) Slog.d(TAG, "moveHomeTaskToTop: moving " + task); mTaskHistory.remove(taskNdx); mTaskHistory.add(top, task); mWindowManager.moveTaskToTop(task.taskId); Loading services/java/com/android/server/am/ActivityStackSupervisor.java +13 −8 Original line number Diff line number Diff line Loading @@ -68,9 +68,8 @@ import android.os.SystemClock; import android.os.UserHandle; import android.util.EventLog; import android.util.Slog; import android.util.SparseArray; import android.util.SparseIntArray; import android.util.SparseBooleanArray; import com.android.internal.app.HeavyWeightSwitcherActivity; import com.android.internal.os.TransferPipe; import com.android.server.am.ActivityManagerService.PendingActivityLaunch; Loading Loading @@ -204,8 +203,8 @@ public final class ActivityStackSupervisor { */ final PowerManager.WakeLock mGoingToSleep; /** State of the stacks when user switched, indexed by userId. */ SparseBooleanArray mUserHomeInFront = new SparseBooleanArray(2); /** Stack id of the front stack when user switched, indexed by userId. */ SparseIntArray mUserStackInFront = new SparseIntArray(2); public ActivityStackSupervisor(ActivityManagerService service, Context context, Looper looper) { Loading Loading @@ -1927,7 +1926,7 @@ public final class ActivityStackSupervisor { } void removeUserLocked(int userId) { mUserHomeInFront.delete(userId); mUserStackInFront.delete(userId); } /** Loading Loading @@ -2248,8 +2247,8 @@ public final class ActivityStackSupervisor { } boolean switchUserLocked(int userId, UserStartedState uss) { mUserHomeInFront.put(mCurrentUser, isFrontStack(mHomeStack)); final boolean homeInFront = mUserHomeInFront.get(userId, true); mUserStackInFront.put(mCurrentUser, getFocusedStack().getStackId()); final int restoreStackId = mUserStackInFront.get(userId, HOME_STACK_ID); mCurrentUser = userId; mStartingUsers.add(uss); Loading @@ -2257,7 +2256,13 @@ public final class ActivityStackSupervisor { mStacks.get(stackNdx).switchUserLocked(userId); } ActivityStack stack = getStack(restoreStackId); if (stack == null) { stack = mHomeStack; } final boolean homeInFront = stack.isHomeStack(); moveHomeStack(homeInFront); mWindowManager.moveTaskToTop(stack.topTask().taskId); return homeInFront; } Loading Loading @@ -2351,7 +2356,7 @@ public final class ActivityStackSupervisor { pw.print(prefix); pw.print("mStackState="); pw.println(stackStateToString(mStackState)); pw.print(prefix); pw.println("mSleepTimeout: " + mSleepTimeout); pw.print(prefix); pw.println("mCurTaskId: " + mCurTaskId); pw.print(prefix); pw.println("mUserHomeInFront: " + mUserHomeInFront); pw.print(prefix); pw.println("mUserStackInFront: " + mUserStackInFront); } ArrayList<ActivityRecord> getDumpActivitiesLocked(String name) { Loading Loading
services/java/com/android/server/am/ActivityStack.java +6 −3 Original line number Diff line number Diff line Loading @@ -551,9 +551,6 @@ final class ActivityStack { * Move the activities around in the stack to bring a user to the foreground. */ final void switchUserLocked(int userId) { if (VALIDATE_TOKENS) { validateAppTokensLocked(); } if (mCurrentUser == userId) { return; } Loading @@ -564,11 +561,16 @@ final class ActivityStack { for (int i = 0; i < index; ++i) { TaskRecord task = mTaskHistory.get(i); if (task.userId == userId) { if (DEBUG_TASKS) Slog.d(TAG, "switchUserLocked: stack=" + getStackId() + " moving " + task + " to top"); mTaskHistory.remove(i); mTaskHistory.add(task); --index; } } if (VALIDATE_TOKENS) { validateAppTokensLocked(); } } void minimalResumeActivityLocked(ActivityRecord r) { Loading Loading @@ -2951,6 +2953,7 @@ final class ActivityStack { for (int taskNdx = top; taskNdx >= 0; --taskNdx) { final TaskRecord task = mTaskHistory.get(taskNdx); if (task.isHomeTask()) { if (DEBUG_TASKS || DEBUG_STACK) Slog.d(TAG, "moveHomeTaskToTop: moving " + task); mTaskHistory.remove(taskNdx); mTaskHistory.add(top, task); mWindowManager.moveTaskToTop(task.taskId); Loading
services/java/com/android/server/am/ActivityStackSupervisor.java +13 −8 Original line number Diff line number Diff line Loading @@ -68,9 +68,8 @@ import android.os.SystemClock; import android.os.UserHandle; import android.util.EventLog; import android.util.Slog; import android.util.SparseArray; import android.util.SparseIntArray; import android.util.SparseBooleanArray; import com.android.internal.app.HeavyWeightSwitcherActivity; import com.android.internal.os.TransferPipe; import com.android.server.am.ActivityManagerService.PendingActivityLaunch; Loading Loading @@ -204,8 +203,8 @@ public final class ActivityStackSupervisor { */ final PowerManager.WakeLock mGoingToSleep; /** State of the stacks when user switched, indexed by userId. */ SparseBooleanArray mUserHomeInFront = new SparseBooleanArray(2); /** Stack id of the front stack when user switched, indexed by userId. */ SparseIntArray mUserStackInFront = new SparseIntArray(2); public ActivityStackSupervisor(ActivityManagerService service, Context context, Looper looper) { Loading Loading @@ -1927,7 +1926,7 @@ public final class ActivityStackSupervisor { } void removeUserLocked(int userId) { mUserHomeInFront.delete(userId); mUserStackInFront.delete(userId); } /** Loading Loading @@ -2248,8 +2247,8 @@ public final class ActivityStackSupervisor { } boolean switchUserLocked(int userId, UserStartedState uss) { mUserHomeInFront.put(mCurrentUser, isFrontStack(mHomeStack)); final boolean homeInFront = mUserHomeInFront.get(userId, true); mUserStackInFront.put(mCurrentUser, getFocusedStack().getStackId()); final int restoreStackId = mUserStackInFront.get(userId, HOME_STACK_ID); mCurrentUser = userId; mStartingUsers.add(uss); Loading @@ -2257,7 +2256,13 @@ public final class ActivityStackSupervisor { mStacks.get(stackNdx).switchUserLocked(userId); } ActivityStack stack = getStack(restoreStackId); if (stack == null) { stack = mHomeStack; } final boolean homeInFront = stack.isHomeStack(); moveHomeStack(homeInFront); mWindowManager.moveTaskToTop(stack.topTask().taskId); return homeInFront; } Loading Loading @@ -2351,7 +2356,7 @@ public final class ActivityStackSupervisor { pw.print(prefix); pw.print("mStackState="); pw.println(stackStateToString(mStackState)); pw.print(prefix); pw.println("mSleepTimeout: " + mSleepTimeout); pw.print(prefix); pw.println("mCurTaskId: " + mCurTaskId); pw.print(prefix); pw.println("mUserHomeInFront: " + mUserHomeInFront); pw.print(prefix); pw.println("mUserStackInFront: " + mUserStackInFront); } ArrayList<ActivityRecord> getDumpActivitiesLocked(String name) { Loading