Issue to PromptDelegate.FileCallback.confirm not handling URIs from content://com.android.providers
Categories
(GeckoView :: General, enhancement, P3)
Tracking
(Not tracked)
People
(Reporter: amejia, Unassigned)
Details
(Whiteboard: [geckoview:2023?])
I'm implementing onFilePrompt(GeckoSession session, String title, int type, String[] mimeTypes, FileCallback callback) from GeckoSession and I'm having some issues with GeckoSession.PromptDelegate.FileCallback when calling void confirm(Context context, Uri uri); with an URI from the Android File Chooser, I get a log saying "Only file URI is supported" but when I do the same exercise with the Webview API it works without any problems. It is only working with URIs that are from the photo app, below an example of which one pass and fail. Pass content://com.google.android.apps.photos.contentprovider/0/1/content%3A%2F%2Fmedia%2Fexternal%2Fimages%2Fmedia%2F13845/ORIGINAL/NONE/934029267 Fail `"Only file URI is supported"` content://com.android.providers.downloads.documents/document/raw%3A%2Fstorage%2Femulated%2F0%2FDownload%2Fimg_20181201_143745~2.jpg Another issue is that when I select an image from the photo gallery, the name of the file is shown in the input type file but when pressing the submit button to upload the file, it does nothing and the input type file button doesn't work anymore, it doesn't call to onFilePrompt anymore.
Updated•6 years ago
|
Comment 1•6 years ago
|
||
Dylan says he can look at this bug because he's working on some other PromptDelegate issues.
Reporter | ||
Comment 2•6 years ago
|
||
Awesome!
Comment 3•6 years ago
|
||
Just hopping in to flag that we are exploring a GV implementation of Firefox Send for Android and this appears to be a blocker for us. Do you have an ETA on this work?
Comment 4•6 years ago
|
||
I've been preoccupied with some other bugs; I should be able to start seriously investigating this bug later this week or next week.
Updated•6 years ago
|
Comment 5•6 years ago
|
||
(In reply to [:jgruen] from comment #3)
Just hopping in to flag that we are exploring a GV implementation of Firefox Send for Android and this appears to be a blocker for us. Do you have an ETA on this work?
No ETA at this time. This bug is not on the GV team's 2019 H1 roadmap because it doesn't block Fenix MVP.
Comment 6•6 years ago
|
||
Comment 7•6 years ago
|
||
[:jgruen] a workaround could be done using a temp file or cache.
That will also allow any file from any source (including online sources) to be used/sent.
////////////////
File myFile = new File(this.getFilesDir(),"temp.cube");
try {
FileInputStream in = (FileInputStream) getContentResolver().openInputStream(data.getData());
FileOutputStream out = new FileOutputStream(myFile);
FileChannel inChannel = in.getChannel();
FileChannel outChannel = out.getChannel();
inChannel.transferTo(0, inChannel.size(), outChannel);
in.close();
out.close();
} catch (Exception e) {}
final Uri uri = Uri.parse("file:///"+myFile.getAbsolutePath());
callback.confirm(this, uri);
/////////////////
Reporter | ||
Comment 8•5 years ago
|
||
Thanks @colormath, the workaround is working!
This is probably pretty close to what we'd be doing in GeckoView anyway, so seems like a reasonable way to go until this is fixed.
Comment 10•5 years ago
|
||
I'm editing a bunch of GeckoView bugs. If you'd like to filter all this bugmail, search and destroy emails containing this UUID:
e88a5094-0fc0-4b7c-b7c5-aef00a11dbc9
Updated•5 years ago
|
Comment 11•3 years ago
|
||
The bug assignee didn't login in Bugzilla in the last 7 months.
:amoya, could you have a look please?
For more information, please visit auto_nag documentation.
Updated•2 years ago
|
Comment 12•2 years ago
|
||
Makoto says this bug has a workaround that browser app resolves content:// data by own (using content provider) then pass it.
Updated•2 years ago
|
Updated•2 years ago
|
Description
•