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

Commit 06ffd3d1 authored by Jorge Gil's avatar Jorge Gil
Browse files

Update UserTracker.Callback after registering it

A user change may have already happened before the callback is
registered, which would leave the rest of WMShell with the incorrect
current user.

Additionally, ShellController now tracks the current user/profiles to
prevent it from updating UserChangeListeners when the user did not
really change. It also immediately updates new UserChangeListeners with
the current user/profiles, which removes the burden Shell classes have
of checking for user-changes that happen between their constructor and
onInit.

In the future, Shell classes should be migrated to rely solely on
UserChangeListener to keep their userId updated, or they can peek into
ShellController if they only need it in response to other events and
don't need to do work on user changes or maintain their own
currentUserId.

Flag: com.android.wm.shell.fix_missing_user_change_callbacks
Bug: 404251029
Test: adevice update, verify through logs WMShell classes always get an
update with the current user after WMShell.start()

Change-Id: I03e6c2cbcda498be786899e0d0271e98b421477e
parent dc5080a9
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