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

Commit 9a7836d4 authored by Gloria Wang's avatar Gloria Wang Committed by Android (Google) Code Review
Browse files

Merge "Add more check before using the DRM manager client."

parents 5ed9a805 adc4d9c8
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -291,10 +291,12 @@ status_t AwesomePlayer::setDataSource_l(
    }

    dataSource->getDrmInfo(&mDecryptHandle, &mDrmManagerClient);
    if (mDecryptHandle != NULL
            && RightsStatus::RIGHTS_VALID != mDecryptHandle->status) {
    if (mDecryptHandle != NULL) {
        CHECK(mDrmManagerClient);
        if (RightsStatus::RIGHTS_VALID != mDecryptHandle->status) {
            notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
        }
    }

    return setDataSource_l(extractor);
}
@@ -1738,6 +1740,7 @@ status_t AwesomePlayer::finishSetDataSource_l() {

    dataSource->getDrmInfo(&mDecryptHandle, &mDrmManagerClient);
    if (mDecryptHandle != NULL) {
        CHECK(mDrmManagerClient);
        if (RightsStatus::RIGHTS_VALID == mDecryptHandle->status) {
            if (DecryptApiType::WV_BASED == mDecryptHandle->decryptApiType) {
                LOGD("Setting mCachedSource to NULL for WVM\n");
+1 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ DRMSource::DRMSource(const sp<MediaSource> &mediaSource,
      mTrackId(trackId),
      mNALLengthSize(0),
      mWantsNALFragments(false) {
    CHECK(mDrmManagerClient);
    mDrmManagerClient->initializeDecryptUnit(
            mDecryptHandle, trackId, ipmpBox);

+1 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ FileSource::~FileSource() {

    if (mDecryptHandle != NULL) {
        // To release mDecryptHandle
        CHECK(mDrmManagerClient);
        mDrmManagerClient->closeDecryptSession(mDecryptHandle);
        mDecryptHandle = NULL;
    }
+1 −0
Original line number Diff line number Diff line
@@ -81,6 +81,7 @@ NuHTTPDataSource::NuHTTPDataSource()
NuHTTPDataSource::~NuHTTPDataSource() {
    if (mDecryptHandle != NULL) {
        // To release mDecryptHandle
        CHECK(mDrmManagerClient);
        mDrmManagerClient->closeDecryptSession(mDecryptHandle);
        mDecryptHandle = NULL;
    }