OSDN Git Service

- Add two sanity checks.
authorGloria Wang <gwang@google.com>
Wed, 22 Jun 2011 21:55:16 +0000 (14:55 -0700)
committerGloria Wang <gwang@google.com>
Wed, 22 Jun 2011 23:36:24 +0000 (16:36 -0700)
- Remove one unnecessary line.
- Clear the extendedData vector in DecryptHandle.

Change-Id: I2610c6d68f12d48cb69323a5eb2ae4b3b3e44dff

drm/common/DrmSupportInfo.cpp
drm/common/IDrmManagerService.cpp
drm/libdrmframework/DrmManagerClientImpl.cpp

index 3dee435..5400bdd 100644 (file)
@@ -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);
 
index 458f1b6..2d8e877 100644 (file)
@@ -107,6 +107,7 @@ static void clearDecryptHandle(DecryptHandle* handle) {
         handle->decryptInfo = NULL;
     }
     handle->copyControlVector.clear();
+    handle->extendedData.clear();
 }
 
 int BpDrmManagerService::addUniqueId(int uniqueId) {
index a57dd98..a36bd4a 100644 (file)
@@ -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);
 }