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

Commit b7e7bdfe authored by Gloria Wang's avatar Gloria Wang
Browse files

- Add two sanity checks.

- Remove one unnecessary line.
- Clear the extendedData vector in DecryptHandle.

Change-Id: I2610c6d68f12d48cb69323a5eb2ae4b3b3e44dff
parent 8969d992
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -43,6 +43,10 @@ bool DrmSupportInfo::operator==(const DrmSupportInfo& drmSupportInfo) const {
}

bool DrmSupportInfo::isSupportedMimeType(const String8& mimeType) const {
    if (String8("") == mimeType) {
        return false;
    }

    for (unsigned int i = 0; i < mMimeTypeVector.size(); i++) {
        const String8 item = mMimeTypeVector.itemAt(i);

+1 −0
Original line number Diff line number Diff line
@@ -107,6 +107,7 @@ static void clearDecryptHandle(DecryptHandle* handle) {
        handle->decryptInfo = NULL;
    }
    handle->copyControlVector.clear();
    handle->extendedData.clear();
}

int BpDrmManagerService::addUniqueId(int uniqueId) {
+14 −21
Original line number Diff line number Diff line
@@ -107,21 +107,13 @@ public class DrmRights {

    /**
     * Creates a <code>DrmRights</code> object with the given parameters.
     *<p>
     * The application can pass the processed data as a <code>String</code> or as binary data.
     *<p>
     * The following code snippet shows how to pass the processed data as a <code>String</code>:
     *<p>
     * new DrmRights(data.getBytes(), mimeType)
     *<p>
     * The following code snippet shows how to pass the processed data as binary data:
     *<p>
     * new DrmRights(binaryData[], mimeType)
     *
     * @param data A {@link ProcessedData} object.
     * @param data A {@link ProcessedData} object containing rights information.
     *             data could be null because it's optional for some DRM schemes.
     * @param mimeType The MIME type.
     */
    public DrmRights(ProcessedData data, String mimeType) {
        if (data != null) {
            mData = data.getData();

            String accountId = data.getAccountId();
@@ -133,6 +125,7 @@ public class DrmRights {
            if (null != subscriptionId && !subscriptionId.equals("")) {
                mSubscriptionId = subscriptionId;
            }
        }

        mMimeType = mimeType;
    }
+0 −1
Original line number Diff line number Diff line
@@ -145,7 +145,6 @@ DrmInfo* DrmManagerClientImpl::acquireDrmInfo(

status_t DrmManagerClientImpl::saveRights(int uniqueId, const DrmRights& drmRights,
            const String8& rightsPath, const String8& contentPath) {
    status_t status = DRM_ERROR_UNKNOWN;
    return getDrmManagerService()->saveRights(
                uniqueId, drmRights, rightsPath, contentPath);
}