diff options
Diffstat (limited to 'src/com/android/gallery3d/app')
-rw-r--r-- | src/com/android/gallery3d/app/AlbumPage.java | 7 | ||||
-rw-r--r-- | src/com/android/gallery3d/app/MovieActivity.java | 11 | ||||
-rwxr-xr-x | src/com/android/gallery3d/app/PhotoDataAdapter.java | 6 | ||||
-rwxr-xr-x | src/com/android/gallery3d/app/PhotoPage.java | 50 | ||||
-rw-r--r-- | src/com/android/gallery3d/app/SlideshowPage.java | 16 |
5 files changed, 10 insertions, 80 deletions
diff --git a/src/com/android/gallery3d/app/AlbumPage.java b/src/com/android/gallery3d/app/AlbumPage.java index 629e88210..7e2f5f9e4 100644 --- a/src/com/android/gallery3d/app/AlbumPage.java +++ b/src/com/android/gallery3d/app/AlbumPage.java @@ -19,7 +19,6 @@ package com.android.gallery3d.app; import android.app.Activity; import android.content.Context; import android.content.Intent; -import android.drm.DrmHelper; import android.graphics.Rect; import android.net.Uri; import android.os.Bundle; @@ -311,12 +310,6 @@ public class AlbumPage extends ActivityState implements GalleryActionBar.Cluster if (isLayoutRtl && item == null) { return; // Item not ready yet, ignore the click } - if (DrmHelper.isDrmFile(DrmHelper.getFilePath( - mActivity.getAndroidContext(), item.getContentUri()))) { - Toast.makeText(mActivity, R.string.no_permission_for_drm, - Toast.LENGTH_SHORT).show(); - return; - } onGetContent(item); } else if (mLaunchedFromPhotoPage) { if (isLayoutRtl && item == null) { diff --git a/src/com/android/gallery3d/app/MovieActivity.java b/src/com/android/gallery3d/app/MovieActivity.java index f6fcaf87c..275b04ab3 100644 --- a/src/com/android/gallery3d/app/MovieActivity.java +++ b/src/com/android/gallery3d/app/MovieActivity.java @@ -35,7 +35,6 @@ import android.content.res.Configuration; import android.content.SharedPreferences; import android.content.pm.ActivityInfo; import android.database.Cursor; -import android.drm.DrmHelper; import android.graphics.Bitmap; import android.graphics.drawable.BitmapDrawable; import android.media.AudioManager; @@ -240,16 +239,6 @@ public class MovieActivity extends Activity { initEffects(mp.getAudioSessionId()); } }); - - // DRM validation - Uri original = intent.getData(); - String mimeType = intent.getType(); - String filepath = DrmHelper.getFilePath(this, original); - if (DrmHelper.isDrmFile(filepath)) { - if (!DrmHelper.validateLicense(this, filepath, mimeType)) { - finish(); - } - } } private void setActionBarLogoFromIntent(Intent intent) { diff --git a/src/com/android/gallery3d/app/PhotoDataAdapter.java b/src/com/android/gallery3d/app/PhotoDataAdapter.java index 5812bf82d..4322d9b7a 100755 --- a/src/com/android/gallery3d/app/PhotoDataAdapter.java +++ b/src/com/android/gallery3d/app/PhotoDataAdapter.java @@ -522,9 +522,9 @@ public class PhotoDataAdapter implements PhotoPage.Model { @Override public boolean isVideo(int offset) { MediaItem item = getItem(mCurrentIndex + offset); - return (item == null) ? false - : item.getMediaType() == MediaItem.MEDIA_TYPE_VIDEO - || item.getMediaType() == MediaItem.MEDIA_TYPE_DRM_VIDEO; + return (item == null) + ? false + : item.getMediaType() == MediaItem.MEDIA_TYPE_VIDEO; } @Override diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java index 65c26278a..dd27f2689 100755 --- a/src/com/android/gallery3d/app/PhotoPage.java +++ b/src/com/android/gallery3d/app/PhotoPage.java @@ -1,4 +1,4 @@ -/** +/* * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -24,7 +24,6 @@ import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.content.res.Configuration; -import android.drm.DrmHelper; import android.graphics.Rect; import android.media.MediaFile; import android.net.Uri; @@ -378,9 +377,8 @@ public abstract class PhotoPage extends ActivityState implements panoramaIntent = createSharePanoramaIntent(contentUri); } Intent shareIntent = createShareIntent(mCurrentPhoto); - if (shareIntent != null) { - mActionBar.setShareIntents(panoramaIntent, shareIntent, PhotoPage.this); - } + + mActionBar.setShareIntents(panoramaIntent, shareIntent, PhotoPage.this); setNfcBeamPushUri(contentUri); } break; @@ -685,7 +683,7 @@ public abstract class PhotoPage extends ActivityState implements mNfcPushUris[0] = uri; } - private Intent createShareIntent(MediaObject mediaObject) { + private static Intent createShareIntent(MediaObject mediaObject) { int type = mediaObject.getMediaType(); return new Intent(Intent.ACTION_SEND) .setType(MenuExecutor.getMimeType(type)) @@ -804,20 +802,6 @@ public abstract class PhotoPage extends ActivityState implements requestDeferredUpdate(); } else { updateUIForCurrentPhoto(); - - // Manage DRM rights while image selection changed. this - // flow will comes for both image and video, but here - // we will consume rights for image files only. - // Do not consume rights of a GIF image and video here. - // ViewGifImage will take care of GIF rights consumption stub. - // MediaPlayer will handle the video rights consumption stub. - String mime = mCurrentPhoto.getMimeType(); - if (!TextUtils.isEmpty(mime) && !mime.equals("image/gif") - && !mime.startsWith("video/")) { - DrmHelper.manageDrmLicense(mActivity.getAndroidContext(), - mHandler, mCurrentPhoto.getFilePath(), - mCurrentPhoto.getMimeType()); - } } } @@ -1173,12 +1157,6 @@ public abstract class PhotoPage extends ActivityState implements mSelectionManager.toggle(path); mMenuExecutor.onMenuClicked(item, confirmMsg, mConfirmDialogListener); return true; - case R.id.action_drm_info: - String filepath = current.getFilePath(); - if (DrmHelper.isDrmFile(filepath)) { - DrmHelper.showDrmInfo(mActivity.getAndroidContext(), filepath); - } - return true; default : return false; } @@ -1445,23 +1423,6 @@ public abstract class PhotoPage extends ActivityState implements UsageStatistics.onContentViewChanged( UsageStatistics.COMPONENT_CAMERA, "Unknown"); // TODO } - - // Manage DRM rights while image selection changed. this - // flow will comes for both image and video, but here - // we will consume rights for image files only. - // Do not consume rights of a GIF image and video here. - // ViewGifImage will take care of GIF rights consumption stub. - // MediaPlayer will handle the video rights consumption stub. - if ((mMediaSet != null && mMediaSet.getMediaItemCount() > 1) - || !(this instanceof SinglePhotoPage)) { - String mime = mCurrentPhoto.getMimeType(); - if (!TextUtils.isEmpty(mime) && !mime.equals("image/gif") - && !mime.startsWith("video/")) { - DrmHelper.manageDrmLicense(mActivity.getAndroidContext(), - mHandler, mCurrentPhoto.getFilePath(), - mCurrentPhoto.getMimeType()); - } - } } } @@ -1656,9 +1617,6 @@ public abstract class PhotoPage extends ActivityState implements private static void viewAnimateGif(Activity activity, Uri uri) { Intent intent = new Intent(ViewGifImage.VIEW_GIF_ACTION, uri); - if (DrmHelper.isDrmFile(uri.toString())) { - intent.setDataAndType(uri, "image/gif"); - } activity.startActivity(intent); } } diff --git a/src/com/android/gallery3d/app/SlideshowPage.java b/src/com/android/gallery3d/app/SlideshowPage.java index 2b15ab96e..174058dc8 100644 --- a/src/com/android/gallery3d/app/SlideshowPage.java +++ b/src/com/android/gallery3d/app/SlideshowPage.java @@ -16,12 +16,8 @@ package com.android.gallery3d.app; -import java.util.ArrayList; -import java.util.Random; - import android.app.Activity; import android.content.Intent; -import android.drm.DrmHelper; import android.graphics.Bitmap; import android.os.Bundle; import android.os.Handler; @@ -42,6 +38,9 @@ import com.android.gallery3d.ui.SynchronizedHandler; import com.android.gallery3d.util.Future; import com.android.gallery3d.util.FutureListener; +import java.util.ArrayList; +import java.util.Random; + public class SlideshowPage extends ActivityState { private static final String TAG = "SlideshowPage"; @@ -339,15 +338,6 @@ public class SlideshowPage extends ActivityState { mData = mMediaSet.getMediaItem(index, DATA_SIZE); mDataStart = index; dataEnd = index + mData.size(); - - // Consume license once in each element of the slide-show - // This is a non-blocking loop operation - for (int i = 0; i < mData.size(); i++) { - String path = mData.get(i).getFilePath(); - if (DrmHelper.isDrmFile(path)) { - DrmHelper.consumeDrmRights(path, "image/*"); - } - } } return (index < mDataStart || index >= dataEnd) ? null : mData.get(index - mDataStart); |