summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Newberger <alann@google.com>2013-10-30 12:51:21 -0700
committerAlan Newberger <alann@google.com>2013-10-30 13:27:43 -0700
commit761306fadfa94b538f43e8cf3463bf6d22814947 (patch)
tree942a38d3fd28f180df0f621101f83715dcc6c3fa
parentcec75e408a2d451b90bac5f06e10906ffcafff33 (diff)
downloadandroid_packages_apps_Snap-761306fadfa94b538f43e8cf3463bf6d22814947.tar.gz
android_packages_apps_Snap-761306fadfa94b538f43e8cf3463bf6d22814947.tar.bz2
android_packages_apps_Snap-761306fadfa94b538f43e8cf3463bf6d22814947.zip
Remove CameraUtil.launchGallery, ensure SecureCamera uses Gallery up icon
CameraUtil.launchGallery incorrectly describes a mechanism to call an APP_GALLERY category intent. Since we're using Gallery icon we should go direct to Gallery, which IntentHelper already does. Simply removed the util class and call the helper direct from the activity. Also noticed during testing that the SecureCamera was not correctly showing the Gallery icon, though its behavior would take user to Gallery. Finally, removing restriction that the video player intent should go to Gallery, instead it should route to system preferred intent. Bug: 11065256 Change-Id: I941f9469de169919c4bac6c91dde7e577921f737
-rw-r--r--AndroidManifest.xml1
-rw-r--r--src/com/android/camera/CameraActivity.java13
-rw-r--r--src/com/android/camera/util/CameraUtil.java16
-rw-r--r--src_pd/com/android/camera/util/IntentHelper.java1
4 files changed, 9 insertions, 22 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 8152f8193..9368e38ab 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -112,6 +112,7 @@
android:excludeFromRecents="true"
android:icon="@mipmap/ic_launcher_camera"
android:label="@string/app_name"
+ android:logo="@mipmap/ic_launcher_gallery"
android:taskAffinity="com.android.camera.SecureCameraActivity"
android:theme="@style/Theme.Camera"
android:windowSoftInputMode="stateAlwaysHidden|adjustPan" >
diff --git a/src/com/android/camera/CameraActivity.java b/src/com/android/camera/CameraActivity.java
index eb2da1d1b..86f1de590 100644
--- a/src/com/android/camera/CameraActivity.java
+++ b/src/com/android/camera/CameraActivity.java
@@ -84,6 +84,7 @@ import com.android.camera.ui.FilmStripView;
import com.android.camera.util.ApiHelper;
import com.android.camera.util.CameraUtil;
import com.android.camera.util.GcamHelper;
+import com.android.camera.util.IntentHelper;
import com.android.camera.util.PhotoSphereHelper;
import com.android.camera.util.PhotoSphereHelper.PanoramaViewHelper;
import com.android.camera2.R;
@@ -868,12 +869,10 @@ public class CameraActivity extends Activity
case android.R.id.home:
// ActionBar's Up/Home button was clicked
try {
- if (!CameraUtil.launchGallery(CameraActivity.this)) {
- mFilmStripView.getController().goToFirstItem();
- }
+ startActivity(IntentHelper.getGalleryIntent(this));
return true;
} catch (ActivityNotFoundException e) {
- Log.w(TAG, "No activity found to handle APP_GALLERY category!");
+ Log.w(TAG, "Failed to launch gallery activity, closing");
finish();
}
case R.id.action_delete:
@@ -1070,7 +1069,11 @@ public class CameraActivity extends Activity
v.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
- CameraUtil.launchGallery(CameraActivity.this);
+ try {
+ startActivity(IntentHelper.getGalleryIntent(CameraActivity.this));
+ } catch (ActivityNotFoundException e) {
+ Log.w(TAG, "Failed to launch gallery activity, closing");
+ }
finish();
}
});
diff --git a/src/com/android/camera/util/CameraUtil.java b/src/com/android/camera/util/CameraUtil.java
index cbc9ebe34..fa1d58150 100644
--- a/src/com/android/camera/util/CameraUtil.java
+++ b/src/com/android/camera/util/CameraUtil.java
@@ -977,20 +977,4 @@ public class CameraUtil {
}
return ret;
}
-
- /**
- * Launches apps supporting action {@link Intent.ACTION_MAIN} of category
- * {@link Intent.CATEGORY_APP_GALLERY}. Note that
- * {@link Intent.CATEGORY_APP_GALLERY} is only available on API level 15+.
- *
- * @param ctx The {@link android.content.Context} to launch the app.
- * @return {@code true} on success.
- */
- public static boolean launchGallery(Context ctx) {
- if (ApiHelper.HAS_APP_GALLERY) {
- ctx.startActivity(IntentHelper.getGalleryIntent(ctx));
- return true;
- }
- return false;
- }
}
diff --git a/src_pd/com/android/camera/util/IntentHelper.java b/src_pd/com/android/camera/util/IntentHelper.java
index a6c2c3720..6f17a624b 100644
--- a/src_pd/com/android/camera/util/IntentHelper.java
+++ b/src_pd/com/android/camera/util/IntentHelper.java
@@ -32,7 +32,6 @@ public class IntentHelper {
public static Intent getVideoPlayerIntent(Context context, Uri uri) {
return new Intent(Intent.ACTION_VIEW)
- .setPackage(GALLERY_PACKAGE_NAME)
.setDataAndType(uri, "video/*");
}
}