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

Commit b5c8f21e authored by Edwin Wong's avatar Edwin Wong
Browse files

Fixed AMediaDrm_getKeyRequest returning both new and old requests.

If multiple key requests are made through AMediaDrm_getKeyRequest,
(e.g. Service Certification + key request in private mode), the
new request will be appended to the old request/s.

AMediaDrm_getKeyRequest should just return the most recent request.

Test: CTS test
  Modify testQueryKeyStatus to make two back to back queries. The test
  should pass.

Test: CTS test
  ANDROID_BUILD_TOP= ./android-cts/toolsefed run cts-dev --module CtsMediaTestCases
  -t android.media.cts.NativeMediaDrmClearkeyTest#testQueryKeyStatus

bug: 77713912
Change-Id: I21a30572fedc67cdf1d813ea36b92d2a67b4ebb4
parent 908c7d77
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -309,6 +309,7 @@ media_status_t AMediaDrm_getKeyRequest(AMediaDrm *mObj, const AMediaDrmScope *sc
    }
    String8 defaultUrl;
    DrmPlugin::KeyRequestType keyRequestType;
    mObj->mKeyRequest.clear();
    status_t status = mObj->mDrm->getKeyRequest(*iter, mdInit, String8(mimeType),
            mdKeyType, mdOptionalParameters, mObj->mKeyRequest, defaultUrl,
            &keyRequestType);