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

Commit f35f6be3 authored by Ronghua Wu's avatar Ronghua Wu
Browse files

libmediaplayerservice: unlock before trying to reclaim drm session.

Bug: 21086224
Change-Id: Icebd8eab70570e818ff7f5fc3a32e1801c3b92d2
parent 9ba21b94
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -358,7 +358,18 @@ status_t Drm::openSession(Vector<uint8_t> &sessionId) {
    status_t err = mPlugin->openSession(sessionId);
    if (err == ERROR_DRM_RESOURCE_BUSY) {
        bool retry = false;
        mLock.unlock();
        // reclaimSession may call back to closeSession, since mLock is shared between Drm
        // instances, we should unlock here to avoid deadlock.
        retry = DrmSessionManager::Instance()->reclaimSession(getCallingPid());
        mLock.lock();
        if (mInitCheck != OK) {
            return mInitCheck;
        }

        if (mPlugin == NULL) {
            return -EINVAL;
        }
        if (retry) {
            err = mPlugin->openSession(sessionId);
        }