diff --git a/src/com/android/gallery3d/app/GalleryActivity.java b/src/com/android/gallery3d/app/GalleryActivity.java
index 27e9f9a..86698dd 100755
--- a/src/com/android/gallery3d/app/GalleryActivity.java
+++ b/src/com/android/gallery3d/app/GalleryActivity.java
@@ -76,7 +76,6 @@
     public static final String KEY_TYPE_BITS = "type-bits";
     public static final String KEY_MEDIA_TYPES = "mediaTypes";
     public static final String KEY_DISMISS_KEYGUARD = "dismiss-keyguard";
-    public static final String KEY_FROM_SNAPCAM = "from-snapcam";
     public static final String KEY_TOTAL_NUMBER = "total-number";
     public static final String QSST = "QSST";
 
@@ -455,16 +454,13 @@
                 Path albumPath = dm.getDefaultSetOf(itemPath);
 
                 data.putString(PhotoPage.KEY_MEDIA_ITEM_PATH, itemPath.toString());
-                if (!intent.getBooleanExtra(KEY_FROM_SNAPCAM, false)) {
-                    data.putBoolean(PhotoPage.KEY_READONLY, true);
-                } else {
-                    int hintIndex = 0;
-                    if (View.LAYOUT_DIRECTION_RTL == TextUtils
-                        .getLayoutDirectionFromLocale(Locale.getDefault())) {
-                        hintIndex = intent.getIntExtra(KEY_TOTAL_NUMBER, 1) - 1;
-                    }
-                    data.putInt(PhotoPage.KEY_INDEX_HINT, hintIndex);
+
+                int hintIndex = 0;
+                if (View.LAYOUT_DIRECTION_RTL == TextUtils
+                    .getLayoutDirectionFromLocale(Locale.getDefault())) {
+                    hintIndex = intent.getIntExtra(KEY_TOTAL_NUMBER, 1) - 1;
                 }
+                data.putInt(PhotoPage.KEY_INDEX_HINT, hintIndex);
 
                 // TODO: Make the parameter "SingleItemOnly" public so other
                 //       activities can reference it.
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 7f69e0c..619667b 100755
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -124,7 +124,6 @@
     public static final String KEY_RETURN_INDEX_HINT = "return-index-hint";
     public static final String KEY_SHOW_WHEN_LOCKED = "show_when_locked";
     public static final String KEY_IN_CAMERA_ROLL = "in_camera_roll";
-    public static final String KEY_READONLY = "read-only";
     public static final String KEY_FROM_VIDEOS_SCREEN = "from-video-screen";
     public static final String KEY_FROM_TIMELINE_SCREEN = "from-timeline-screen";
 
@@ -169,7 +168,6 @@
     private boolean mShowSpinner;
     private String mSetPathString;
     // This is the original mSetPathString before adding the camera preview item.
-    private boolean mReadOnlyView = false;
     private String mOriginalSetPathString;
     private AppBridge mAppBridge;
     private SnailItem mScreenNailItem;
@@ -411,7 +409,6 @@
         };
 
         mSetPathString = data.getString(KEY_MEDIA_SET_PATH);
-        mReadOnlyView = data.getBoolean(KEY_READONLY);
         mOriginalSetPathString = mSetPathString;
         setupNfcBeamPush();
         String itemPathString = data.getString(KEY_MEDIA_ITEM_PATH);
@@ -659,7 +656,6 @@
         case R.id.photopage_bottom_control_edit:
             return mHaveImageEditor
                     && mShowBars
-                    && !mReadOnlyView
                     && !mPhotoView.getFilmMode()
                     && (mCurrentPhoto.getSupportedOperations() & MediaItem.SUPPORT_EDIT) != 0
                     && mCurrentPhoto.getMediaType() == MediaObject.MEDIA_TYPE_IMAGE;
@@ -667,7 +663,7 @@
             mShareIntent = new Intent(Intent.ACTION_SEND);
             return mShowBars;
         case R.id.photopage_bottom_control_delete:
-            return mShowBars && !mReadOnlyView;
+            return mShowBars;
         default:
             return false;
         }
@@ -921,9 +917,6 @@
         if (mCurrentPhoto == null) return;
 
         int supportedOperations = mCurrentPhoto.getSupportedOperations();
-        if (mReadOnlyView) {
-            supportedOperations &= ~MediaObject.SUPPORT_EDIT;
-        }
         if (mSecureAlbum != null) {
             supportedOperations &= MediaObject.SUPPORT_DELETE;
         } else {
