summaryrefslogtreecommitdiffstats
path: root/src/com/android/camera/MenuHelper.java
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2011-03-11 12:34:19 +0800
committerWu-cheng Li <wuchengli@google.com>2011-03-14 15:27:01 +0800
commitbcf6200327be0b408426221767467ad2ce132a08 (patch)
treee74620a0b3b61168f13ea0e7cc3b2acf250eb6dc /src/com/android/camera/MenuHelper.java
parent26ebb8e98e92599deec34b81623bbcb6213e5544 (diff)
downloadLegacyCamera-bcf6200327be0b408426221767467ad2ce132a08.zip
LegacyCamera-bcf6200327be0b408426221767467ad2ce132a08.tar.gz
LegacyCamera-bcf6200327be0b408426221767467ad2ce132a08.tar.bz2
Fix image/video capture intents are broken after switching cameras.
The intent action should be kept if it is IMAGE_CAPTURE or VIDEO_CAPTURE. This also fixes the bug that video capture will fail after retake. If the URI is passed in by the intent, it should not be removed from the content resolver. bug:4083519 Change-Id: Ia72e399ff8cd5c2a72cc6fe1500ee6922d9a4f5d
Diffstat (limited to 'src/com/android/camera/MenuHelper.java')
-rw-r--r--src/com/android/camera/MenuHelper.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/com/android/camera/MenuHelper.java b/src/com/android/camera/MenuHelper.java
index 4c2d608..fba5738 100644
--- a/src/com/android/camera/MenuHelper.java
+++ b/src/com/android/camera/MenuHelper.java
@@ -112,9 +112,8 @@ public class MenuHelper {
item.setIcon(iconId);
}
- private static void startCameraActivity(Activity activity, String action,
+ private static void startCameraActivity(Activity activity, Intent intent,
String className) {
- Intent intent = new Intent(action);
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
intent.setClassName(activity.getPackageName(), className);
@@ -133,13 +132,21 @@ public class MenuHelper {
}
public static void gotoVideoMode(Activity activity) {
- startCameraActivity(activity, MediaStore.INTENT_ACTION_VIDEO_CAMERA,
- VIDEO_CAMERA_CLASS);
+ Intent intent = new Intent(MediaStore.INTENT_ACTION_VIDEO_CAMERA);
+ startCameraActivity(activity, intent, VIDEO_CAMERA_CLASS);
}
public static void gotoCameraMode(Activity activity) {
- startCameraActivity(activity,
- MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA, CAMERA_CLASS);
+ Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA);
+ startCameraActivity(activity, intent, CAMERA_CLASS);
+ }
+
+ public static void gotoVideoMode(Activity activity, Intent intent) {
+ startCameraActivity(activity, intent, VIDEO_CAMERA_CLASS);
+ }
+
+ public static void gotoCameraMode(Activity activity, Intent intent) {
+ startCameraActivity(activity, intent, CAMERA_CLASS);
}
public static void gotoCameraImageGallery(Activity activity) {