Skip to content
This repository has been archived by the owner on Oct 19, 2021. It is now read-only.

Sharing Through Google Photos & Chrome Fails #97

Open
velitasali opened this issue Jul 11, 2019 · 3 comments
Open

Sharing Through Google Photos & Chrome Fails #97

velitasali opened this issue Jul 11, 2019 · 3 comments
Labels

Comments

@velitasali
Copy link
Member

velitasali commented Jul 11, 2019

Describe the bug
When the content from Downloads in Google Chrome or any photo from Google Photos and similar apps is shared, the process fails with the below error

java.io.FileNotFoundException: Failed to create right connection for content://com.google.android.apps.photos.contentprovider/0/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F110326/REQUIRE_ORIGINAL/NONE/257810451
    at com.genonbeta.android.framework.io.DocumentFile.fromUri(DocumentFile.java:52)
    at com.genonbeta.android.framework.util.FileUtils.fromUri(FileUtils.java:132)
    at com.genonbeta.TrebleShot.adapter.TransferListAdapter.onLoad(TransferListAdapter.java:194)
    at com.genonbeta.TrebleShot.widget.GroupEditableListAdapter.onLoad(GroupEditableListAdapter.java:74)
    at com.genonbeta.android.framework.app.ListFragment$ListLoader.loadInBackground(ListFragment.java:361)
    at com.genonbeta.android.framework.app.ListFragment$ListLoader.loadInBackground(ListFragment.java:341)
    at androidx.loader.content.AsyncTaskLoader.onLoadInBackground(AsyncTaskLoader.java:307)
    at androidx.loader.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:60)
    at androidx.loader.content.AsyncTaskLoader$LoadTask.doInBackground(AsyncTaskLoader.java:48)
    at androidx.loader.content.ModernAsyncTask$2.call(ModernAsyncTask.java:141)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
    at java.lang.Thread.run(Thread.java:764)

To Reproduce
Select and share any item as described above. The error can easily be seen when the file information is shown in the transfer activity

Expected behavior
Share the files

Environment (please complete the following information):

  • Android version: Android 9
  • Language: EN/US
  • App version 1.4.2
  • Device Model and Brand: Asus Zenfone 3
@velitasali velitasali changed the title Sharing Through Google Photos or GoogleChrome Fails Sharing Through Google Photos & Chrome Fails Jul 11, 2019
velitasali added a commit that referenced this issue Jul 11, 2019
@velitasali velitasali added the bug label Sep 4, 2019
@mubashir-rehman
Copy link
Contributor

mubashir-rehman commented Apr 14, 2020

Describe the Isuue

The same happens with Files app. If we open Files app, select a file and then via share button share ti through TrebleShot. It gives error.
04-14 14:31:53.666 32617 1754 W System.err: java.lang.SecurityException: Permission Denial: opening provider com.android.externalstorage.ExternalStorageProvider from ProcessRecord{494e96b 32617:com.genonbeta.TrebleShot:transfer/u0a151} (pid=32617, uid=10151) requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs 04-14 14:31:53.675

Environment (please complete the following information):

Android version: Android 10
ROM: Extendid UI
Language: EN/US
App version 1.4.2
Device Model and Brand: Nexus 6p

@velitasali
Copy link
Member Author

@mubashir-rehman edited your comment to only include the necessary part. Thanks for the report.

@velitasali
Copy link
Member Author

New findings:

This error occurs because intent validity is bound to the activity that receives it (SharingActivity in this case). As soon as the receiver activity finishes, the permission to open the URIs is revoked unless one of the URIs is still open. In order words, leaving the activity and without starting the transfer will result in this error (which will not be recoverable).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants