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

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

Desks: Add multi-user support

Implements full multi-user support when multiple-desks are enabled.
Prior to this change, desk roots where only created for the current
user, and attempts to create them for another user would fail, resulting
in a persisted desk not being restored on reboot, or a default desk not
being created at all.

This change introduces a |userId| argument to DesksOrganizer's
create/remove functions, to allow implementations to manage roots
per-user. Since root-tasks are user-agnostic in WMCore,
RootTasksDesksOrganizer doesn't need to create different roots for N
desks times M users, and can instead reuse one root for one desk of each
user. DeskRoot#users is added to keep track of which users are already
using a given root to known when a new root actually needs to be
created.

Flag: com.android.window.flags.enable_multiple_desktops_backend
Bug: 403685486
Bug: 400984250
Bug: 399394443
Test: create multiple desks, switch users and create multiple desks -
verify roots are reused when possible and new roots are created when
needed. Also verify removing a user's desk does not remove the root
unless it is not used by any other users.
Test: create multiple desks under multiple users, reboot - verify
DesktopRepository restores all user desktops
Test: In an HSUM build, create multiple desks, reboot, try to enter
desktop mode - verify no crash

Change-Id: I7d6bd3cab235bebdaa94e01f2f102d4c494f7857
parent da47f1d5
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment