summaryrefslogtreecommitdiffstats
path: root/WallpaperPicker
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2014-01-23 14:37:59 +0100
committerDanesh M <daneshm90@gmail.com>2014-06-06 22:54:27 -0700
commit1d9c2810700b8bc643be34f5e576d82e94115fe5 (patch)
tree2ce0bbe3fb604053f85885f1dd7300d2557f8a80 /WallpaperPicker
parenta62da2c9a8a9fb7b45553132d4b2de3ef079a5fa (diff)
downloadandroid_packages_apps_Trebuchet-1d9c2810700b8bc643be34f5e576d82e94115fe5.zip
android_packages_apps_Trebuchet-1d9c2810700b8bc643be34f5e576d82e94115fe5.tar.gz
android_packages_apps_Trebuchet-1d9c2810700b8bc643be34f5e576d82e94115fe5.tar.bz2
Catch exceptions if Exif is malformed
Bug: 11650650 Change-Id: Iee8f1675850c692fe54dc619f3e969ba180e4206
Diffstat (limited to 'WallpaperPicker')
-rw-r--r--WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java3
-rw-r--r--WallpaperPicker/src/com/android/photos/BitmapRegionTileSource.java6
2 files changed, 9 insertions, 0 deletions
diff --git a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java
index 96c9723..23fbe73 100644
--- a/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java
+++ b/WallpaperPicker/src/com/android/launcher3/WallpaperCropActivity.java
@@ -276,6 +276,9 @@ public class WallpaperCropActivity extends Activity {
}
} catch (IOException e) {
Log.w(LOGTAG, "Getting exif data failed", e);
+ } catch (NullPointerException e) {
+ // Sometimes the ExifInterface has an internal NPE if Exif data isn't valid
+ Log.w(LOGTAG, "Getting exif data failed", e);
} finally {
Utils.closeSilently(bis);
Utils.closeSilently(is);
diff --git a/WallpaperPicker/src/com/android/photos/BitmapRegionTileSource.java b/WallpaperPicker/src/com/android/photos/BitmapRegionTileSource.java
index cdc5cdc..764156d 100644
--- a/WallpaperPicker/src/com/android/photos/BitmapRegionTileSource.java
+++ b/WallpaperPicker/src/com/android/photos/BitmapRegionTileSource.java
@@ -245,6 +245,9 @@ public class BitmapRegionTileSource implements TiledImageRenderer.TileSource {
try {
ei.readExif(mPath);
return true;
+ } catch (NullPointerException e) {
+ Log.w("BitmapRegionTileSource", "reading exif failed", e);
+ return false;
} catch (IOException e) {
Log.w("BitmapRegionTileSource", "getting decoder failed", e);
return false;
@@ -311,6 +314,9 @@ public class BitmapRegionTileSource implements TiledImageRenderer.TileSource {
} catch (IOException e) {
Log.e("BitmapRegionTileSource", "Failed to load URI " + mUri, e);
return false;
+ } catch (NullPointerException e) {
+ Log.e("BitmapRegionTileSource", "Failed to read EXIF for URI " + mUri, e);
+ return false;
} finally {
Utils.closeSilently(is);
}