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

Commit 8f7a0275 authored by Gloria Wang's avatar Gloria Wang Committed by Android Git Automerger
Browse files

am cf393faa: Merge "resolved conflicts for merge of c1c45a4d to...

am cf393faa: Merge "resolved conflicts for merge of c1c45a4d to gingerbread-plus-aosp" into gingerbread-plus-aosp

* commit 'cf393faa':
  - Move the business rule management down to DRM agents. - Do not register DRM sniffer because drmserver is not enabled.
parents a7bd8857 cf393faa
Loading
Loading
Loading
Loading
+6 −23
Original line number Original line Diff line number Diff line
@@ -333,15 +333,10 @@ status_t AwesomePlayer::setDataSource_l(
    }
    }


    dataSource->getDrmInfo(&mDecryptHandle, &mDrmManagerClient);
    dataSource->getDrmInfo(&mDecryptHandle, &mDrmManagerClient);
    if (mDecryptHandle != NULL) {
    if (mDecryptHandle != NULL
        if (RightsStatus::RIGHTS_VALID == mDecryptHandle->status) {
            && RightsStatus::RIGHTS_VALID != mDecryptHandle->status) {
            if (DecryptApiType::CONTAINER_BASED == mDecryptHandle->decryptApiType) {
                mDrmManagerClient->consumeRights(mDecryptHandle, Action::PLAY, true);
            }
        } else {
        notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
        notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
    }
    }
    }


    return setDataSource_l(extractor);
    return setDataSource_l(extractor);
}
}
@@ -408,11 +403,6 @@ status_t AwesomePlayer::setDataSource_l(const sp<MediaExtractor> &extractor) {
    }
    }


    mExtractorFlags = extractor->flags();
    mExtractorFlags = extractor->flags();
    if (mDecryptHandle != NULL) {
        if (DecryptApiType::ELEMENTARY_STREAM_BASED == mDecryptHandle->decryptApiType) {
            mDrmManagerClient->consumeRights(mDecryptHandle, Action::PLAY, true);
        }
    }


    return OK;
    return OK;
}
}
@@ -426,8 +416,6 @@ void AwesomePlayer::reset_l() {
    if (mDecryptHandle != NULL) {
    if (mDecryptHandle != NULL) {
            mDrmManagerClient->setPlaybackStatus(mDecryptHandle,
            mDrmManagerClient->setPlaybackStatus(mDecryptHandle,
                    Playback::STOP, 0);
                    Playback::STOP, 0);
            mDrmManagerClient->consumeRights(mDecryptHandle,
                    Action::PLAY, false);
            mDecryptHandle = NULL;
            mDecryptHandle = NULL;
            mDrmManagerClient = NULL;
            mDrmManagerClient = NULL;
    }
    }
@@ -1679,15 +1667,10 @@ status_t AwesomePlayer::finishSetDataSource_l() {
    }
    }


    dataSource->getDrmInfo(&mDecryptHandle, &mDrmManagerClient);
    dataSource->getDrmInfo(&mDecryptHandle, &mDrmManagerClient);
    if (mDecryptHandle != NULL) {
    if (mDecryptHandle != NULL
        if (RightsStatus::RIGHTS_VALID == mDecryptHandle->status) {
            && RightsStatus::RIGHTS_VALID != mDecryptHandle->status) {
            if (DecryptApiType::CONTAINER_BASED == mDecryptHandle->decryptApiType) {
                mDrmManagerClient->consumeRights(mDecryptHandle, Action::PLAY, true);
            }
        } else {
        notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
        notifyListener_l(MEDIA_ERROR, MEDIA_ERROR_UNKNOWN, ERROR_NO_LICENSE);
    }
    }
    }


    return setDataSource_l(extractor);
    return setDataSource_l(extractor);
}
}