OSDN Git Service

Add content URI for current filmstrip item to Gallery intent
authorAlan Newberger <alann@google.com>
Mon, 3 Feb 2014 23:03:26 +0000 (15:03 -0800)
committerAlan Newberger <alann@google.com>
Mon, 3 Feb 2014 23:36:51 +0000 (15:36 -0800)
when starting Gallery, if there is a current filmstrip ID, retrieve
its content URI and pass to the GalleryHelper to process it. Do nothing
within the GalleryHelper at this time.

Bug: 12587688
Change-Id: I5becbfa7d12e739383b9f2ef3d3dba7460fa3d25

src/com/android/camera/CameraActivity.java
src_pd/com/android/camera/util/GalleryHelper.java

index c6f7afb..e688269 100644 (file)
@@ -108,6 +108,7 @@ import com.android.camera.ui.SettingsView;
 import com.android.camera.util.ApiHelper;
 import com.android.camera.util.CameraUtil;
 import com.android.camera.util.FeedbackHelper;
+import com.android.camera.util.GalleryHelper;
 import com.android.camera.util.GcamHelper;
 import com.android.camera.util.IntentHelper;
 import com.android.camera.util.PhotoSphereHelper.PanoramaViewHelper;
@@ -1878,7 +1879,13 @@ public class CameraActivity extends Activity
         }
         try {
             UsageStatistics.changeScreen(NavigationChange.Mode.GALLERY, InteractionCause.BUTTON);
-            launchActivityByIntent(new Intent(mGalleryIntent));
+            Intent startGalleryIntent = new Intent(mGalleryIntent);
+            int currentDataId = mFilmstripController.getCurrentId();
+            LocalData currentLocalData = mDataAdapter.getLocalData(currentDataId);
+            if (currentLocalData != null) {
+                GalleryHelper.setContentUri(startGalleryIntent, currentLocalData.getContentUri());
+            }
+            launchActivityByIntent(startGalleryIntent);
         } catch (ActivityNotFoundException e) {
             Log.w(TAG, "Failed to launch gallery activity, closing");
         }
index 8f1b360..81e34e9 100644 (file)
@@ -19,6 +19,7 @@ import android.content.Context;
 import android.content.Intent;
 import android.content.pm.PackageManager;
 import android.graphics.drawable.Drawable;
+import android.net.Uri;
 
 /**
  * A helper class to provide Gallery related info.
@@ -42,4 +43,8 @@ public class GalleryHelper {
         }
         return null;
     }
+
+    public static void setContentUri(Intent intent, Uri uri) {
+        // Do nothing.
+    }
 }