Permalink
Browse files

Fix crashes on writing Gallery images to a local file

Exception java.lang.UnsupportedOperationException: Unsupported document images_bucket:89149399
android.database.DatabaseUtils.readExceptionFromParcel (DatabaseUtils.java:172)
android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel (DatabaseUtils.java:151)
android.content.ContentProviderProxy.openTypedAssetFile (ContentProviderNative.java:692)
android.content.ContentResolver.openTypedAssetFileDescriptor (ContentResolver.java:1145)
android.content.ContentResolver.openAssetFileDescriptor (ContentResolver.java:966)
android.content.ContentResolver.openInputStream (ContentResolver.java:686)
com.google.android.apps.muzei.gallery.GalleryProvider.writeUriToFile (GalleryProvider.java:433)
com.google.android.apps.muzei.gallery.GalleryProvider.insertChosenPhotos (GalleryProvider.java:376)
com.google.android.apps.muzei.gallery.GalleryProvider.insert (GalleryProvider.java:316)
android.content.ContentProviderOperation.apply (ContentProviderOperation.java:304)
com.google.android.apps.muzei.gallery.GalleryProvider.applyBatch (GalleryProvider.java:172)
android.content.ContentProvider$Transport.applyBatch (ContentProvider.java:349)
android.content.ContentProviderClient.applyBatch (ContentProviderClient.java:448)
android.content.ContentResolver.applyBatch (ContentResolver.java:1327)
com.google.android.apps.muzei.gallery.GallerySettingsActivity$19.run (GallerySettingsActivity.java:1063)
android.os.Handler.handleCallback (Handler.java:815)
android.os.Handler.dispatchMessage (Handler.java:104)
android.os.Looper.loop (Looper.java:207)
android.os.HandlerThread.run (HandlerThread.java:61)
  • Loading branch information...
ianhanniballake committed Nov 9, 2017
1 parent ae3352d commit ac48ff25f33289db91929292981d93bd406b44a2
@@ -180,7 +180,7 @@ private static void writeUriToFile(Context context, Uri uri, File destFile) thro
out.write(buffer, 0, bytesRead);
}
out.flush();
} catch (SecurityException e) {
} catch (SecurityException|UnsupportedOperationException e) {
throw new IOException("Unable to read Uri: " + uri, e);
}
}

0 comments on commit ac48ff2

Please sign in to comment.