PlayerBase: fix deadlock
Source of deadlock between PlayerBase.mLock and PlaybackActivityMonitor.mPlayerLock: android.media.MediaPlayer.release() > android.media.PlayerBase.baseRelease() > synchronized (mLock) > com.android.server.audio.PlaybackActivityMonitor.releasePlayer() > synchronized(mPlayerLock) and: com.android.server.audio.PlaybackActivityMonitor.unmutePlayersForCall() > synchronized (mPlayerLock) > android.media.PlayerProxy.setVolume() > android.media.PlayerBase$IPlayerWrapper.setVolume() > android.media.PlayerBase.baseSetVolume() > synchronized (mLock) playerSetVolume() Since system_server can have its own players, the calls to AudioService from PlayerBase can be synchronous, hence the deadlock. The fix consists in never holding the lock in PlayerBase while calling into AudioService. Refactor the playstate update into a method used for start / stop / pause. Bug: 72294559 Test: see bug Change-Id: I6451aa3bf19a0365472ba007b116a9e6151ab33e
Loading
Please register or sign in to comment