Don't use local path file on Android 11+
Categories
(GeckoView :: General, defect, P1)
Tracking
(firefox142 fixed, firefox143 fixed)
People
(Reporter: m_kato, Assigned: m_kato)
References
Details
(Keywords: webcompat:platform-bug, Whiteboard: [fxdroid])
Attachments
(2 files)
48 bytes,
text/x-phabricator-request
|
diannaS
:
approval-mozilla-beta+
|
Details | Review |
48 bytes,
text/x-phabricator-request
|
diannaS
:
approval-mozilla-beta+
|
Details | Review |
https://developer.android.com/reference/android/provider/MediaStore.MediaColumns.html#DATA
From Android 11 onwards, this column is read-only for apps that target R and higher. On those devices, when creating or updating a uri, this column's value is not accepted. Instead, to update the filesystem location of a file, use the values of the DISPLAY_NAME and RELATIVE_PATH columns.
Though direct file operations are supported, ContentResolver.openFileDescriptor(Uri, String) API is recommended for better performance.
Updated•24 days ago
|
Assignee | ||
Updated•23 days ago
|
Updated•23 days ago
|
Assignee | ||
Comment 1•23 days ago
|
||
From Android 11, the local path from file may not be accessible. So if
11 or later, we should always use the content URI when using folder picker.
Assignee | ||
Comment 2•23 days ago
|
||
After we use input stream for content:// uri, we should close immediately to
release object soon.
https://hg.mozilla.org/mozilla-central/rev/dd82e985dae0
https://hg.mozilla.org/mozilla-central/rev/cc7810f86e80
Assignee | ||
Comment 5•10 days ago
|
||
Comment on attachment 9500840 [details]
Bug 1977304 - Part 1. Don't use local path file on Android 11+. r=#geckoview-reviewers
Beta/Release Uplift Approval Request
- User impact if declined/Reason for urgency: When using Android 11 or later, user cannot upload files using folder picker on www.dropbox.com.
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: Yes
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Low. This code only runs on Android 11 or later.
If Android 11, we use Android API to read file instead of reading local file by file path. Android 11 or later doesn't allow to access local file directly under user data folders.
- String changes made/needed: No
- Is Android affected?: Yes
Assignee | ||
Updated•10 days ago
|
Comment 6•10 days ago
|
||
Comment on attachment 9500840 [details]
Bug 1977304 - Part 1. Don't use local path file on Android 11+. r=#geckoview-reviewers
Approved for 142.0b5
Updated•10 days ago
|
Updated•10 days ago
|
Description
•