diff options
author | Steve Kondik <steve@cyngn.com> | 2015-03-28 14:09:12 -0700 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-03-28 15:35:36 -0700 |
commit | bbbc9107f02bf48505c1123cbb5bb1810572079c (patch) | |
tree | 9dc45a0ebbeebabfbceb13a00ac994ebac2736b4 /src/com/android/gallery3d/app/GalleryActivity.java | |
parent | 741973ed5c52011444250d7b6002dd8b86ac7be3 (diff) | |
download | android_packages_apps_Gallery2-bbbc9107f02bf48505c1123cbb5bb1810572079c.tar.gz android_packages_apps_Gallery2-bbbc9107f02bf48505c1123cbb5bb1810572079c.tar.bz2 android_packages_apps_Gallery2-bbbc9107f02bf48505c1123cbb5bb1810572079c.zip |
Revert OMADRM feature.staging/cm-12.1
* No need for this.
Revert "Gallery2 : Added support for Oma drm (CD and SD)"
This reverts commit 6144de8cc35fdd114802545c9922a1a234af8397.
Revert "Gallery2: Make Gallery2 support OMADRM feature"
This reverts commit 9382a979292e52de5c60a39ba24688362dce8bc1.
Change-Id: I13a0d69a792aad36d7b15bc0b3c78e3f55d396bc
Diffstat (limited to 'src/com/android/gallery3d/app/GalleryActivity.java')
-rw-r--r-- | src/com/android/gallery3d/app/GalleryActivity.java | 82 |
1 files changed, 1 insertions, 81 deletions
diff --git a/src/com/android/gallery3d/app/GalleryActivity.java b/src/com/android/gallery3d/app/GalleryActivity.java index d918e1457..1be5e73c8 100644 --- a/src/com/android/gallery3d/app/GalleryActivity.java +++ b/src/com/android/gallery3d/app/GalleryActivity.java @@ -18,19 +18,11 @@ package com.android.gallery3d.app; import android.app.Dialog; import android.content.ContentResolver; -import android.content.ContentValues; import android.content.DialogInterface; 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; import android.net.Uri; import android.os.Bundle; -import android.provider.MediaStore.Video.VideoColumns; import android.view.InputDevice; import android.view.MotionEvent; import android.view.View; @@ -42,14 +34,12 @@ import com.android.gallery3d.R; import com.android.gallery3d.common.Utils; import com.android.gallery3d.data.DataManager; import com.android.gallery3d.data.MediaItem; -import com.android.gallery3d.data.MediaObject; import com.android.gallery3d.data.MediaSet; import com.android.gallery3d.data.Path; import com.android.gallery3d.picasasource.PicasaSource; import com.android.gallery3d.util.GalleryUtils; public final class GalleryActivity extends AbstractGalleryActivity implements OnCancelListener { - public static final String BUY_LICENSE = "android.drmservice.intent.action.BUY_LICENSE"; public static final String EXTRA_SLIDESHOW = "slideshow"; public static final String EXTRA_DREAM = "dream"; public static final String EXTRA_CROP = "crop"; @@ -213,77 +203,7 @@ public final class GalleryActivity extends AbstractGalleryActivity implements On startDefaultPage(); } } else { - Path itemPath = null; - String imagePath = null; - String scheme = uri.getScheme(); - if ("file".equals(scheme)) { - imagePath = uri.getPath(); - } else { - Cursor cursor = null; - try { - cursor = this.getContentResolver().query(uri, - new String[] {VideoColumns.DATA}, null, null, null); - if (cursor != null && cursor.moveToNext()) { - imagePath = cursor.getString(0); - } - } catch (Throwable t) { - Log.d(TAG, "cannot get path from: " + uri); - } finally { - if (cursor != null) cursor.close(); - } - } - String mime_Type = intent.getType(); - if (imagePath != null - && (imagePath.endsWith(".dcf") || imagePath.endsWith(".dm")) - && "*/*".equals(mime_Type)) { - imagePath = imagePath.replace("/storage/emulated/0", "/storage/emulated/legacy"); - DrmManagerClient drmClient = new DrmManagerClient(this); - mime_Type = drmClient.getOriginalMimeType(imagePath); - if (drmClient != null) drmClient.release(); - } - - Log.d(TAG, "DRM mime_Type==" + mime_Type); - itemPath = getDataManager().findPathByUri(uri, mime_Type); - Log.d(TAG, "itemPath=" + itemPath); - // If item path not correct, just finish starting the gallery - if (itemPath == null) { - finish(); - return; - } - - Log.d(TAG,"imagePath=" + imagePath); - if (intent.getBooleanExtra("WidgetClick", false) == true) { - DrmManagerClientWrapper drmClient = new DrmManagerClientWrapper(this); - int status = drmClient.checkRightsStatus(imagePath, Action.DISPLAY); - if (RightsStatus.RIGHTS_VALID != status) { - ContentValues values = drmClient.getMetadata(imagePath); - String address = values.getAsString("Rights-Issuer"); - Intent buyIntent = new Intent(BUY_LICENSE); - buyIntent.putExtra("DRM_FILE_PATH", address); - sendBroadcast(buyIntent); - Log.d(TAG, "startViewAction:WidgetClick, intent sent"); - } - if (drmClient != null) drmClient.release(); - } - - if (imagePath != null - && (imagePath.endsWith(".dcf") || imagePath.endsWith(".dm"))) { - 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"); - if (drmType > DrmDeliveryType.FORWARD_LOCK) { - MediaItem mediaItem = (MediaItem) getDataManager() - .getMediaObject(itemPath); - if (mediaItem.getMediaType() == MediaObject.MEDIA_TYPE_IMAGE) { - mediaItem.setConsumeRights(true); - } - Toast.makeText(this, R.string.action_consumes_rights, - Toast.LENGTH_LONG).show(); - } - if (drmClient != null) drmClient.release(); - } - + Path itemPath = dm.findPathByUri(uri, contentType); Path albumPath = dm.getDefaultSetOf(itemPath); data.putString(PhotoPage.KEY_MEDIA_ITEM_PATH, itemPath.toString()); |