Uploaded image for project: 'PUBLIC - Liferay Mobile Apps'
  1. PUBLIC - Liferay Mobile Apps
  2. MOBILE-936

Unable to share multiple files from Google Photos

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: Liferay Sync Android 3.0.12
    • Fix Version/s: None
    • Component/s: Android
    • Labels:
      None

      Description

      When we try to share multiple files from Google Photos, only the first is uploaded. The other files are not uploaded and we get the following exception for them:

      java.lang.SecurityException: Permission Denial: reading com.google.android.apps.photos.contentprovider.MediaContentProvider uri content://com.google.android.apps.photos.contentprovider/0/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F2463/ACTUAL/588064881 from pid=6844, uid=10185 requires the provider be exported, or grantUriPermission()
      at android.os.Parcel.readException(Parcel.java:1540)
      at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:185)
      at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:148)
      at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:689)
      at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1080)
      at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:921)
      at android.content.ContentResolver.openInputStream(ContentResolver.java:646)
      at com.liferay.sync.service.UploadService.upload(UploadService.java:171)
      at com.liferay.sync.service.UploadService.onHandleIntent(UploadService.java:67)
      at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:135)
      at android.os.HandlerThread.run(HandlerThread.java:61)

      The reason for this is that the permission to access the Google Photos files are granted to the activity that requested them. Since the ShareActivity is finished right after the upload of the first file starts, the read permission for the others are revoked.
      This issue may happens while sharing from other applications.

      Sources:
      http://developer.android.com/guide/topics/providers/content-provider-basics.html

      http://stackoverflow.com/questions/21082708/java-lang-securityexception-permission-denial-opening-provider-com-google-andr

        Attachments

          Activity

            People

            Assignee:
            emanuel.matteo Emanuel Matteo
            Reporter:
            silvio.santos Silvio Santos (Inactive)
            Participants of an Issue:
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:

                Packages

                Version Package