summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhuiyan <huiyan@codeaurora.org>2016-05-11 15:10:28 +0800
committerSteve Kondik <steve@cyngn.com>2016-09-26 04:54:49 -0700
commitc9611fe10848db873d3e54f7e33cff3a985f78ec (patch)
treed8c868943c2bd117861867af45bca7f82ee4e58f
parentb750059243b8b484a744b7715fbba55e6f968349 (diff)
downloadandroid_packages_apps_Gallery2-c9611fe10848db873d3e54f7e33cff3a985f78ec.tar.gz
android_packages_apps_Gallery2-c9611fe10848db873d3e54f7e33cff3a985f78ec.tar.bz2
android_packages_apps_Gallery2-c9611fe10848db873d3e54f7e33cff3a985f78ec.zip
Gallery2: Fix force closed when print deleted picture.
When delete the image file, the permissions are also revoked. So securityException occur if read the picture again. Try to catch the securityException and finish it. Change-Id: Ic341425ad097cbdec49be8ddd620ee409f632433 CRs-Fixed: 1004534
-rwxr-xr-xsrc/com/android/gallery3d/app/PhotoPage.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/gallery3d/app/PhotoPage.java b/src/com/android/gallery3d/app/PhotoPage.java
index 8f269174d..cc8b2fe67 100755
--- a/src/com/android/gallery3d/app/PhotoPage.java
+++ b/src/com/android/gallery3d/app/PhotoPage.java
@@ -1175,7 +1175,12 @@ public abstract class PhotoPage extends ActivityState implements
return true;
}
case R.id.print: {
- mActivity.printSelectedImage(manager.getContentUri(path));
+ try {
+ mActivity.printSelectedImage(manager.getContentUri(path));
+ } catch (SecurityException e) {
+ e.printStackTrace();
+ mActivity.finish();
+ }
return true;
}
case R.id.action_delete: