Fix deadlock in MediaSessionService during getCurrentUser()

SystemServiceMAnager.stopUser() acquires ActivityManagerService
lock first and then acquires MediaSessionService.mLock during
onStopUser(). MediaSessionService.onSwitchUser(), on the other
hand, acquires mLock first and ActivityManagerService lock next.
This is a potential deadlock situation which can be resolved by
moving getCurrentUser() out of synchronized block. This will
release mLock sooner and avoid the deadlock.

https://code.google.com/p/android/issues/detail?id=214469

Change-Id: Ieb4520d60af6ca38496ca933da0cd9ae096a9408
Signed-off-by: Shibin George <shibing@codeaurora.org>
1 file changed