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

Skip to content
Commit ec4f10df authored by Jean-Michel Trivi's avatar Jean-Michel Trivi
Browse files

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: Ib41045de124683a7484184cf63577bd2412d1362
parent bd6bf7cb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment