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

Commit cab882b3 authored by Jorge Gil's avatar Jorge Gil
Browse files

Use currentUserId for showForAllUsers tasks in TaskInfo

Similar to root tasks, let the userId reflect the current user otherwise
TaskInfo.userId will always reflect the userId of the user for which it
was initially created, even though it could now be running for a
different user.

Flag: com.android.window.flags.apply_desk_activation_on_user_switch
Bug: 430988310
Test: DesktopWallpaperActivity task's info or transition change info
shows the current user id even after switch

Change-Id: Ie836c57f31b82f0610dc55eb79fefe64eef1d1d0
parent 325d92db
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1117,6 +1117,8 @@ public final class TransitionInfo implements Parcelable {
                sb.append(mTaskInfo.parentTaskId);
                sb.append(" winMode=");
                sb.append(mTaskInfo.getWindowingMode());
                sb.append(" userId=");
                sb.append(mTaskInfo.userId);
            }
            if (mAnimationOptions != null) {
                sb.append(" opt=").append(mAnimationOptions);
+6 −1
Original line number Diff line number Diff line
@@ -1424,7 +1424,12 @@ class Task extends TaskFragment {

    /** Returns the user id associated with the current task. */
    int getUserId() {
        return isLeafTask() ? mUserId : mCurrentUser;
        if (!isLeafTask()) return mCurrentUser;
        if (DesktopExperienceFlags.ENABLE_APPLY_DESK_ACTIVATION_ON_USER_SWITCH.isTrue()
                && showForAllUsers()) {
            return mCurrentUser;
        }
        return mUserId;
    }

    /**