summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorParamananda <parama@codeaurora.org>2015-02-06 12:45:45 (GMT)
committerRicardo Cerqueira <ricardo@cyngn.com>2015-09-15 20:31:49 (GMT)
commit43044da1965c1b687695f3f4e1d44d3636496978 (patch)
treec4a603ea21d60919b8f48bad7f8bbb2a5f44b552
parent829f9ad8c06070038cdef24e5fac76a8a16f841b (diff)
downloadandroid_packages_apps_Gallery2-43044da1965c1b687695f3f4e1d44d3636496978.zip
android_packages_apps_Gallery2-43044da1965c1b687695f3f4e1d44d3636496978.tar.gz
android_packages_apps_Gallery2-43044da1965c1b687695f3f4e1d44d3636496978.tar.bz2
Gallery2 : Added support for Oma drm (CD and SD)
Change-Id: I9c793f85e255e8fd183197410111de2dc618ca76
-rw-r--r--src/com/android/gallery3d/app/AlbumPage.java10
-rw-r--r--src/com/android/gallery3d/app/AlbumSetPage.java7
-rw-r--r--src/com/android/gallery3d/app/GalleryActivity.java9
-rw-r--r--src/com/android/gallery3d/app/MovieActivity.java4
-rwxr-xr-xsrc/com/android/gallery3d/app/PhotoPage.java10
-rw-r--r--src/com/android/gallery3d/data/ImageCacheRequest.java9
-rw-r--r--src/com/android/gallery3d/data/LocalImage.java4
-rw-r--r--src/com/android/gallery3d/data/LocalVideo.java4
-rw-r--r--src/com/android/gallery3d/data/UriImage.java4
9 files changed, 21 insertions, 40 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java
index 436ecbb..d0056fc 100644
--- a/src/com/android/gallery3d/app/AlbumPage.java
+++ b/src/com/android/gallery3d/app/AlbumPage.java
@@ -21,7 +21,7 @@ import android.content.Context;
import android.content.ContentValues;
import android.content.Intent;
import android.database.Cursor;
-import android.drm.DrmManagerClient;
+import android.drm.DrmManagerClientWrapper;
import android.drm.DrmRights;
import android.drm.DrmStore.Action;
import android.drm.DrmStore.DrmDeliveryType;
@@ -367,7 +367,7 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster
Log.d(TAG, "pickPhoto:path = " + path);
if (path != null && (path.endsWith(".dcf") || path.endsWith(".dm"))) {
- DrmManagerClient drmClient = new DrmManagerClient(context);
+ DrmManagerClientWrapper drmClient = new DrmManagerClientWrapper(context);
path = path.replace("/storage/emulated/0", "/storage/emulated/legacy");
int status = -1;
Log.d(TAG, "pickPhoto:item type = " + Integer.toString(item.getMediaType()));
@@ -381,10 +381,6 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster
+ Integer.toString(status));
ContentValues values = drmClient.getMetadata(path);
-
- // This hack is added to work FL. It will remove after the sdcard permission issue solved
- status = RightsStatus.RIGHTS_VALID;
-
if (RightsStatus.RIGHTS_VALID!= status) {
String address = values.getAsString("Rights-Issuer");
Log.d(TAG, "pickPhoto:address = " + address);
@@ -454,7 +450,7 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster
path = ((LocalMediaItem)item).filePath;
}
if (path != null && (path.endsWith(".dcf") || path.endsWith(".dm"))) {
- DrmManagerClient drmClient = new DrmManagerClient((Context) mActivity);
+ DrmManagerClientWrapper drmClient = new DrmManagerClientWrapper((Context) mActivity);
path = path.replace("/storage/emulated/0", "/storage/emulated/legacy");
ContentValues values = drmClient.getMetadata(path);
int drmType = values.getAsInteger("DRM-TYPE");
diff --git a/src/com/android/gallery3d/app/AlbumSetPage.java b/src/com/android/gallery3d/app/AlbumSetPage.java
index 8db74f5..5e10049 100644
--- a/src/com/android/gallery3d/app/AlbumSetPage.java
+++ b/src/com/android/gallery3d/app/AlbumSetPage.java
@@ -24,7 +24,7 @@ import android.content.Context;
import android.content.ContentValues;
import android.content.Intent;
import android.database.Cursor;
-import android.drm.DrmManagerClient;
+import android.drm.DrmManagerClientWrapper;
import android.drm.DrmRights;
import android.drm.DrmStore.Action;
import android.drm.DrmStore.DrmDeliveryType;
@@ -286,7 +286,7 @@ public class AlbumSetPage extends ActivityState implements
Log.d(TAG, "pickAlbum:path = " + path);
if (path != null && (path.endsWith(".dcf") || path.endsWith(".dm"))) {
- DrmManagerClient drmClient = new DrmManagerClient(context);
+ DrmManagerClientWrapper drmClient = new DrmManagerClientWrapper(context);
int status = -1;
path = path.replace("/storage/emulated/0", "/storage/emulated/legacy");
Log.d(TAG, "pickAlbum:item type = " + Integer.toString(item.getMediaType()));
@@ -300,9 +300,6 @@ public class AlbumSetPage extends ActivityState implements
ContentValues values = drmClient.getMetadata(path);
- // This hack is added to work FL. It will remove after the sdcard permission issue solved
- status = RightsStatus.RIGHTS_VALID;
-
if (RightsStatus.RIGHTS_VALID != status) {
String address = values.getAsString("Rights-Issuer");
Log.d(TAG, "pickAlbum:address = " + address);
diff --git a/src/com/android/gallery3d/app/GalleryActivity.java b/src/com/android/gallery3d/app/GalleryActivity.java
index 061c783..d918e14 100644
--- a/src/com/android/gallery3d/app/GalleryActivity.java
+++ b/src/com/android/gallery3d/app/GalleryActivity.java
@@ -24,6 +24,7 @@ import android.content.DialogInterface.OnCancelListener;
import android.content.Intent;
import android.database.Cursor;
import android.drm.DrmManagerClient;
+import android.drm.DrmManagerClientWrapper;
import android.drm.DrmStore.Action;
import android.drm.DrmStore.DrmDeliveryType;
import android.drm.DrmStore.RightsStatus;
@@ -252,12 +253,8 @@ public final class GalleryActivity extends AbstractGalleryActivity implements On
Log.d(TAG,"imagePath=" + imagePath);
if (intent.getBooleanExtra("WidgetClick", false) == true) {
- DrmManagerClient drmClient = new DrmManagerClient(this);
-
- // This hack is added to work FL. It will remove after the sdcard permission issue solved
+ DrmManagerClientWrapper drmClient = new DrmManagerClientWrapper(this);
int status = drmClient.checkRightsStatus(imagePath, Action.DISPLAY);
- status = RightsStatus.RIGHTS_VALID;
-
if (RightsStatus.RIGHTS_VALID != status) {
ContentValues values = drmClient.getMetadata(imagePath);
String address = values.getAsString("Rights-Issuer");
@@ -271,7 +268,7 @@ public final class GalleryActivity extends AbstractGalleryActivity implements On
if (imagePath != null
&& (imagePath.endsWith(".dcf") || imagePath.endsWith(".dm"))) {
- DrmManagerClient drmClient = new DrmManagerClient(this);
+ DrmManagerClientWrapper drmClient = new DrmManagerClientWrapper(this);
imagePath = imagePath.replace("/storage/emulated/0", "/storage/emulated/legacy");
ContentValues values = drmClient.getMetadata(imagePath);
int drmType = values.getAsInteger("DRM-TYPE");
diff --git a/src/com/android/gallery3d/app/MovieActivity.java b/src/com/android/gallery3d/app/MovieActivity.java
index c316a78..0943195 100644
--- a/src/com/android/gallery3d/app/MovieActivity.java
+++ b/src/com/android/gallery3d/app/MovieActivity.java
@@ -38,7 +38,7 @@ import android.content.res.Configuration;
import android.content.SharedPreferences;
import android.content.pm.ActivityInfo;
import android.database.Cursor;
-import android.drm.DrmManagerClient;
+import android.drm.DrmManagerClientWrapper;
import android.drm.DrmStore.DrmDeliveryType;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
@@ -332,7 +332,7 @@ public class MovieActivity extends Activity {
}
Log.d(TAG, "onCreateOptionsMenu= " + path);
if ((path != null) && ((path.endsWith(".dcf") || path.endsWith(".dm")))) {
- DrmManagerClient drmClient = new DrmManagerClient(this);
+ DrmManagerClientWrapper drmClient = new DrmManagerClientWrapper(this);
ContentValues values = drmClient.getMetadata(path);
int drmType = values.getAsInteger("DRM-TYPE");
Log.d(TAG, "onCreateOptionsMenu:DRM-TYPE = " + Integer.toString(drmType));
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index b5a4d56..7bc9c9d 100755
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -26,7 +26,7 @@ import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.database.Cursor;
-import android.drm.DrmManagerClient;
+import android.drm.DrmManagerClientWrapper;
import android.drm.DrmStore.Action;
import android.drm.DrmStore.DrmDeliveryType;
import android.drm.DrmStore.RightsStatus;
@@ -770,7 +770,7 @@ public abstract class PhotoPage extends ActivityState implements
}
if (filepath != null && filepath.endsWith(".dcf")) {
- DrmManagerClient drmClient = new DrmManagerClient(mActivity.getAndroidContext());
+ DrmManagerClientWrapper drmClient = new DrmManagerClientWrapper(mActivity.getAndroidContext());
filepath = filepath.replace("/storage/emulated/0", "/storage/emulated/legacy");
ContentValues values = drmClient.getMetadata(filepath);
int drmType = values.getAsInteger("DRM-TYPE");
@@ -1433,13 +1433,9 @@ public abstract class PhotoPage extends ActivityState implements
path = uri.getPath();
}
if (path.endsWith(".dcf")) {
- DrmManagerClient drmClient = new DrmManagerClient(activity);
+ DrmManagerClientWrapper drmClient = new DrmManagerClientWrapper(activity);
path = path.replace("/storage/emulated/0", "/storage/emulated/legacy");
-
- // This hack is added to work FL. It will remove after the sdcard permission issue solved
int status = drmClient.checkRightsStatus(path, Action.PLAY);
- status = RightsStatus.RIGHTS_VALID;
-
if (RightsStatus.RIGHTS_VALID != status) {
ContentValues values = drmClient.getMetadata(path);
String address = values.getAsString("Rights-Issuer");
diff --git a/src/com/android/gallery3d/data/ImageCacheRequest.java b/src/com/android/gallery3d/data/ImageCacheRequest.java
index f93f6e2..8fb418d 100644
--- a/src/com/android/gallery3d/data/ImageCacheRequest.java
+++ b/src/com/android/gallery3d/data/ImageCacheRequest.java
@@ -16,7 +16,7 @@
package com.android.gallery3d.data;
-import android.drm.DrmManagerClient;
+import android.drm.DrmManagerClientWrapper;
import android.drm.DrmStore.Action;
import android.drm.DrmStore.RightsStatus;
import android.graphics.Bitmap;
@@ -61,15 +61,10 @@ abstract class ImageCacheRequest implements Job<Bitmap> {
ImageCacheService cacheService = mApplication.getImageCacheService();
if (mFilePath != null && mFilePath.endsWith(".dcf")) {
- DrmManagerClient drmClient = new DrmManagerClient(mApplication.getAndroidContext());
+ DrmManagerClientWrapper drmClient = new DrmManagerClientWrapper(mApplication.getAndroidContext());
mFilePath = mFilePath.replace("/storage/emulated/0", "/storage/emulated/legacy");
-
- // This hack is added to work FL. It will remove after the sdcard permission issue solved
int statusDisplay = drmClient.checkRightsStatus(mFilePath, Action.DISPLAY);
- statusDisplay = RightsStatus.RIGHTS_VALID;
int statusPlay = drmClient.checkRightsStatus(mFilePath, Action.PLAY);
- statusPlay = RightsStatus.RIGHTS_VALID;
-
if (mMimeType == null) {
if ((RightsStatus.RIGHTS_VALID != statusDisplay)
&& (RightsStatus.RIGHTS_VALID != statusPlay)) {
diff --git a/src/com/android/gallery3d/data/LocalImage.java b/src/com/android/gallery3d/data/LocalImage.java
index 32c4880..96ab3e3 100644
--- a/src/com/android/gallery3d/data/LocalImage.java
+++ b/src/com/android/gallery3d/data/LocalImage.java
@@ -20,7 +20,7 @@ import android.annotation.TargetApi;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.database.Cursor;
-import android.drm.DrmManagerClient;
+import android.drm.DrmManagerClientWrapper;
import android.drm.DrmStore.DrmDeliveryType;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
@@ -242,7 +242,7 @@ public class LocalImage extends LocalMediaItem {
if (filePath != null && (filePath.endsWith(".dcf") || filePath.endsWith(".dm"))) {
filePath = filePath.replace("/storage/emulated/0", "/storage/emulated/legacy");
operation |= SUPPORT_DRM_INFO;
- DrmManagerClient drmClient = new DrmManagerClient(mApplication.getAndroidContext());
+ DrmManagerClientWrapper drmClient = new DrmManagerClientWrapper(mApplication.getAndroidContext());
ContentValues values = drmClient.getMetadata(filePath);
int drmType = values.getAsInteger("DRM-TYPE");
Log.d(TAG, "getSupportedOperations:drmType returned= "
diff --git a/src/com/android/gallery3d/data/LocalVideo.java b/src/com/android/gallery3d/data/LocalVideo.java
index d5e21e9..12b3c7a 100644
--- a/src/com/android/gallery3d/data/LocalVideo.java
+++ b/src/com/android/gallery3d/data/LocalVideo.java
@@ -19,7 +19,7 @@ package com.android.gallery3d.data;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.database.Cursor;
-import android.drm.DrmManagerClient;
+import android.drm.DrmManagerClientWrapper;
import android.drm.DrmStore.DrmDeliveryType;
import android.graphics.Bitmap;
import android.graphics.BitmapRegionDecoder;
@@ -189,7 +189,7 @@ public class LocalVideo extends LocalMediaItem {
int supported = SUPPORT_DELETE | SUPPORT_PLAY | SUPPORT_INFO;
if (filePath != null && (filePath.endsWith(".dcf") || filePath.endsWith(".dm"))) {
supported |= SUPPORT_DRM_INFO;
- DrmManagerClient drmClient = new DrmManagerClient(mApplication.getAndroidContext());
+ DrmManagerClientWrapper drmClient = new DrmManagerClientWrapper(mApplication.getAndroidContext());
ContentValues values = drmClient.getMetadata(filePath);
int drmType = values.getAsInteger("DRM-TYPE");
Log.d("LocalVideo", "getSupportedOperations:drmType returned= "
diff --git a/src/com/android/gallery3d/data/UriImage.java b/src/com/android/gallery3d/data/UriImage.java
index fba34a0..b9a12e7 100644
--- a/src/com/android/gallery3d/data/UriImage.java
+++ b/src/com/android/gallery3d/data/UriImage.java
@@ -19,7 +19,7 @@ package com.android.gallery3d.data;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.database.Cursor;
-import android.drm.DrmManagerClient;
+import android.drm.DrmManagerClientWrapper;
import android.drm.DrmStore.DrmDeliveryType;
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
@@ -239,7 +239,7 @@ public class UriImage extends MediaItem {
if (filePath != null && (filePath.endsWith(".dcf") || filePath.endsWith(".dm"))) {
supported |= SUPPORT_DRM_INFO;
filePath = filePath.replace("/storage/emulated/0", "/storage/emulated/legacy");
- DrmManagerClient drmClient = new DrmManagerClient(mApplication.getAndroidContext());
+ DrmManagerClientWrapper drmClient = new DrmManagerClientWrapper(mApplication.getAndroidContext());
ContentValues values = drmClient.getMetadata(filePath);
int drmType = values.getAsInteger("DRM-TYPE");
Log.d(TAG, "getSupportedOperations:drmType returned= "