diff options
author | Alan Newberger <alann@google.com> | 2013-10-30 11:58:29 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-10-30 11:58:29 -0700 |
commit | 011de38c76b356c9c83fd3cb153b6db79d0550d2 (patch) | |
tree | 5c896f052a87816cb36cd48db3a20cf444fefccd /src/com/android | |
parent | d803c60d5749c51f0af1b593c6835a030e7ac442 (diff) | |
parent | 63186c67ba93dd74a8585562909e4828b9f82f69 (diff) | |
download | android_packages_apps_Gallery2-011de38c76b356c9c83fd3cb153b6db79d0550d2.tar.gz android_packages_apps_Gallery2-011de38c76b356c9c83fd3cb153b6db79d0550d2.tar.bz2 android_packages_apps_Gallery2-011de38c76b356c9c83fd3cb153b6db79d0550d2.zip |
am 63186c67: am 71bf4978: am 48372e31: am ebbcc394: Avoid crash if user disables Camera while Gallery is open
* commit '63186c67ba93dd74a8585562909e4828b9f82f69':
Avoid crash if user disables Camera while Gallery is open
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/gallery3d/util/GalleryUtils.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/util/GalleryUtils.java b/src/com/android/gallery3d/util/GalleryUtils.java index d1f822923..8fb926c0b 100644 --- a/src/com/android/gallery3d/util/GalleryUtils.java +++ b/src/com/android/gallery3d/util/GalleryUtils.java @@ -247,7 +247,13 @@ public class GalleryUtils { Intent intent = new Intent(MediaStore.INTENT_ACTION_STILL_IMAGE_CAMERA) .setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK); - context.startActivity(intent); + try { + context.startActivity(intent); + } catch (ActivityNotFoundException e) { + // This will only occur if Camera was disabled while Gallery is open + // since we cache our availability check. Just abort the attempt. + Log.e(TAG, "Camera activity previously detected but cannot be found", e); + } } public static void startGalleryActivity(Context context) { |