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
Loading
Please register or sign in to comment