Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e0d50cc1 authored by Craig Mautner's avatar Craig Mautner
Browse files

Compare task userId with userId profiles.

Change comparison of Task.mUserId from comparing with only the
current user id to comparing with all current profile user ids.

Fixes bug 14930145.

Change-Id: Ibbae08da6f4eaa31b171becdd8957293758f527b
parent 9dcfe061
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -174,14 +174,14 @@ public class TaskStack {
            stackNdx = 0;
        } else {
            stackNdx = mTasks.size();
            final int currentUserId = mService.mCurrentUserId;
            if (task.mUserId != currentUserId) {
            if (!mService.isCurrentProfileLocked(task.mUserId)) {
                // Place the task below all current user tasks.
                while (--stackNdx >= 0) {
                    if (currentUserId != mTasks.get(stackNdx).mUserId) {
                    if (!mService.isCurrentProfileLocked(mTasks.get(stackNdx).mUserId)) {
                        break;
                    }
                }
                // Put it above first non-current user task.
                ++stackNdx;
            }
        }
@@ -352,7 +352,7 @@ public class TaskStack {
        int top = mTasks.size();
        for (int taskNdx = 0; taskNdx < top; ++taskNdx) {
            Task task = mTasks.get(taskNdx);
            if (task.mUserId == userId) {
            if (mService.isCurrentProfileLocked(task.mUserId)) {
                mTasks.remove(taskNdx);
                mTasks.add(task);
                --top;