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

Commit 2b5d6707 authored by Yasin Kilicdere's avatar Yasin Kilicdere
Browse files

Serialize concurrent user switch requests.

If a user switch request comes during an ongoing user switch, it's
possible that the UserSwitchObservers which are registered for the
previous one are not informed and this causes a timeout for them. We
can postpone the request if that's the case, so that the requests are
serialised one after another.

Bug: 280672682
Test: atest com.android.server.pm.UserManagerTest#testConcurrentUserSwitch
Test: adb shell pm create-user user10
   && adb shell pm create-user user11
   && adb shell pm create-user user12
   && adb shell am switch-user -w 0  # switch to user0 and wait
   && adb shell am switch-user 10    # switch to user10
   && adb shell am switch-user 11    # this will be queued
   && adb shell am switch-user -w 12 # this will be queued
Change-Id: Ibfacd4193b66a4adb313085899d584f442893910
parent b6379cdc
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