Cover from third party only has temporary permission(SecurityException)

Bug #1300489 reported by pjv
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Collectionista
Confirmed
Medium
pjv

Bug Description

Add a music score to a sheet music collection. Choose a different cover from Google Photos (the windmill). THen save item. Reopen item, the app will crash:

03-30 18:05:48.460: E/AndroidRuntime(3669): FATAL EXCEPTION: ProductUpdater
03-30 18:05:48.460: E/AndroidRuntime(3669): java.lang.SecurityException: Permission Denial: opening provider com.google.android.apps.photos.content.GooglePhotosImageProvider from ProcessRecord{429506d8 3669:net.lp.collectionista.ext.sheet_music/u0a10060} (pid=3669, uid=10060) requires com.google.android.apps.photos.permission.GOOGLE_PHOTOS or com.google.android.apps.photos.permission.GOOGLE_PHOTOS
03-30 18:05:48.460: E/AndroidRuntime(3669): at android.os.Parcel.readException(Parcel.java:1431)
03-30 18:05:48.460: E/AndroidRuntime(3669): at android.os.Parcel.readException(Parcel.java:1385)
03-30 18:05:48.460: E/AndroidRuntime(3669): at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:2611)
03-30 18:05:48.460: E/AndroidRuntime(3669): at android.app.ActivityThread.acquireProvider(ActivityThread.java:4515)
03-30 18:05:48.460: E/AndroidRuntime(3669): at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2036)
03-30 18:05:48.460: E/AndroidRuntime(3669): at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1149)
03-30 18:05:48.460: E/AndroidRuntime(3669): at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:756)
03-30 18:05:48.460: E/AndroidRuntime(3669): at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:662)
03-30 18:05:48.460: E/AndroidRuntime(3669): at android.content.ContentResolver.openInputStream(ContentResolver.java:497)
03-30 18:05:48.460: E/AndroidRuntime(3669): at net.lp.collectionista.util.ImageUtilities.getThumbnail(ImageUtilities.java:444)
03-30 18:05:48.460: E/AndroidRuntime(3669): at net.lp.collectionista.util.ImageUtilities.loadImageResource(ImageUtilities.java:420)
03-30 18:05:48.460: E/AndroidRuntime(3669): at net.lp.collectionista.util.ImageUtilities.getImage(ImageUtilities.java:489)
03-30 18:05:48.460: E/AndroidRuntime(3669): at net.lp.collectionista.domain.items.sheet.SheetItem.getCoverImageForFormField(SheetItem.java:266)
03-30 18:05:48.460: E/AndroidRuntime(3669): at net.lp.collectionista.ui.fragments.items.sheet.music.TabbedMusicSheetItemEditFragment$3.perform(TabbedMusicSheetItemEditFragment.java:494)
03-30 18:05:48.460: E/AndroidRuntime(3669): at net.lp.collectionista.ui.activities.phones.collections.ImageRepresentationLoader$1.run(ImageRepresentationLoader.java:47)
03-30 18:05:48.460: E/AndroidRuntime(3669): at java.lang.Thread.run(Thread.java:841)

Apparently only a temporary permission is administered, but it is expired the second time:
http://stackoverflow.com/questions/21082708/java-lang-securityexception-permission-denial-opening-provider-com-google-andr . Strange that I don't have the problem for other item types.

pjv (pjv)
Changed in collectionista:
importance: Undecided → Medium
assignee: nobody → pjv (pjv)
status: New → Confirmed
Revision history for this message
pjv (pjv) wrote :

Bugsense :
https://www.bugsense.com/dashboard/project/98c9e403/errors/998668128
https://www.bugsense.com/dashboard/project/98c9e403/errors/1003128025

java.lang.SecurityException: Permission Denial: opening provider com.google.android.apps.photos.content.GooglePhotosImageProvider from ProcessRecord{4304dd60 27363:net.lp.collectionista/u0a237} (pid=27363, uid=10237) requires com.google.android.apps.photos.permission.GOOGLE_PHOTOS or com.google.android.apps.photos.permission.GOOGLE_PHOTOS
at android.os.Parcel.readException(Parcel.java:1465)
at android.os.Parcel.readException(Parcel.java:1419)
at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:3092)
at android.app.ActivityThread.acquireProvider(ActivityThread.java:4678)
at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2675)
at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1428)
at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1050)
at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:907)
at android.content.ContentResolver.openInputStream(ContentResolver.java:632)
at net.lp.collectionista.util.ImageUtilities.android.graphics.Bitmap loadImageResource(java.lang.String)(Collectionista:422)
at net.lp.collectionista.util.ImageUtilities.android.graphics.Bitmap getImage(java.lang.String)(Collectionista:489)
at net.lp.collectionista.domain.items.book.BookItem.android.graphics.Bitmap getCoverImageForFormField()(Collectionista:1345)
at net.lp.collectionista.ui.fragments.items.book.TabbedBookItemEditFragment$3.void perform()(Collectionista:518)
at net.lp.collectionista.ui.activities.phones.collections.ImageRepresentationLoader$1.void run()(Collectionista:47)
at java.lang.Thread.run(Thread.java:841)

Revision history for this message
pjv (pjv) wrote :

Fixed by showing the cached cover (which includes the shadow) for now. Can still be improved.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.