Closed
Bug 1451061
Opened 7 years ago
Closed 7 years ago
Review Permissions usage for Android 8 behaviour changes
Categories
(Firefox for Android Graveyard :: General, enhancement)
Tracking
(firefox63 fixed)
RESOLVED
FIXED
Firefox 63
Tracking | Status | |
---|---|---|
firefox63 | --- | fixed |
People
(Reporter: JanH, Assigned: andrei.a.lazar)
References
()
Details
(Whiteboard: --do_not_change--[priority:high])
Attachments
(2 files)
As per https://developer.android.com/about/versions/oreo/android-8.0-changes.html#rmp, once targetting API26, requesting a certain runtime permission no longer implicitly grants all other permissions within that group [1].
So if we want to both read and write a file on the phone's storage, it's no longer enough to request just the WRITE_EXTERNAL_STORAGE - we need to request the READ_EXTERNAL_STORAGE permission as well.
So we need to review all places where we're requesting runtime permissions and make sure we're requesting the permission(s) that is/are actually required.
E.g. at https://hg.mozilla.org/mozilla-central/annotate/d75d996016dcf325c2db2ed8a47af512d07ffacd/mobile/android/chrome/content/browser.js#l4160 we're actually interested in *reading* the file.
Apart from the issue of read vs. write permissions, the other likely candidate might be ACCESS_COARSE_LOCATION vs. ACCESS_FINE_LOCATION.
[1] Although if a permission within the same group has already been granted, then currently Android won't prompt and automatically grant other permissions within the same group when requested.
Reporter | ||
Comment 1•7 years ago
|
||
Although on the other hand the documentation for READ_EXTERNAL_STORAGE says that "Any app that declares the WRITE_EXTERNAL_STORAGE permission is implicitly granted this permission.", so we might be safe in that case after all.
Updated•7 years ago
|
Whiteboard: --do_not_change--[priority:high]
Updated•7 years ago
|
Assignee: nobody → vlad.baicu
Updated•7 years ago
|
Assignee: vlad.baicu → andrei.a.lazar
Comment hidden (mozreview-request) |
Comment 3•7 years ago
|
||
mozreview-review |
Comment on attachment 8984822 [details]
Bug 1451061 - Review Permissions usage for Android 8 behaviour changes
https://reviewboard.mozilla.org/r/250626/#review256902
Code analysis found 1 defect in this patch:
- 1 defect found by mozlint
You can run this analysis locally with:
- `./mach lint path/to/file` (JS/Python)
If you see a problem in this automated review, please report it here: http://bit.ly/2y9N9Vx
::: mobile/android/modules/RuntimePermissions.jsm:20
(Diff revision 1)
> const ACCESS_COARSE_LOCATION = "android.permission.ACCESS_COARSE_LOCATION";
> const ACCESS_FINE_LOCATION = "android.permission.ACCESS_FINE_LOCATION";
> const CAMERA = "android.permission.CAMERA";
> const RECORD_AUDIO = "android.permission.RECORD_AUDIO";
> const WRITE_EXTERNAL_STORAGE = "android.permission.WRITE_EXTERNAL_STORAGE";
> +const READ_EXTERNAL_STORAGE = ""android.permission.WRITE_EXTERNAL_STORAGE";
Error: Parsing error: unexpected token android [eslint]
Comment hidden (mozreview-request) |
Assignee | ||
Comment 5•7 years ago
|
||
Hello Jan, regarding ACCESS_COARSE_LOCATION vs. ACCESS_FINE_LOCATION situation, as per (https://developer.android.com/reference/android/Manifest.permission.html#ACCESS_COARSE_LOCATION) and (https://developer.android.com/reference/android/Manifest.permission.html#ACCESS_FINE_LOCATION), there are no extra details specified in the documentation, so my presumption is that you have to request permission for either one you use, so here we are covered.
Regarding other permissions, we use only specific permissions (camera and audio record), and we already request permission when it is needed.
Thank you!
Flags: needinfo?(jh+bugzilla)
Updated•7 years ago
|
Status: NEW → ASSIGNED
Attachment #8984822 -
Flags: review?(jh+bugzilla) → review?(nchen)
Comment 6•7 years ago
|
||
mozreview-review |
Comment on attachment 8984822 [details]
Bug 1451061 - Review Permissions usage for Android 8 behaviour changes
https://reviewboard.mozilla.org/r/250626/#review258450
::: mobile/android/modules/RuntimePermissions.jsm:20
(Diff revision 2)
> const ACCESS_COARSE_LOCATION = "android.permission.ACCESS_COARSE_LOCATION";
> const ACCESS_FINE_LOCATION = "android.permission.ACCESS_FINE_LOCATION";
> const CAMERA = "android.permission.CAMERA";
> const RECORD_AUDIO = "android.permission.RECORD_AUDIO";
> const WRITE_EXTERNAL_STORAGE = "android.permission.WRITE_EXTERNAL_STORAGE";
> +const READ_EXTERNAL_STORAGE = "android.permission.WRITE_EXTERNAL_STORAGE";
Should be "android.permission.READ_EXTERNAL_STORAGE"
Attachment #8984822 -
Flags: review?(nchen) → review+
Reporter | ||
Updated•7 years ago
|
Flags: needinfo?(jh+bugzilla)
Comment hidden (mozreview-request) |
Reporter | ||
Comment 8•7 years ago
|
||
mozreview-review |
Comment on attachment 8984822 [details]
Bug 1451061 - Review Permissions usage for Android 8 behaviour changes
https://reviewboard.mozilla.org/r/250626/#review261806
Attachment #8984822 -
Flags: review?(jh+bugzilla) → review+
Updated•7 years ago
|
Keywords: checkin-needed
Updated•7 years ago
|
Keywords: checkin-needed
Comment hidden (mozreview-request) |
Comment 10•7 years ago
|
||
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9f257217209b
Review Permissions usage for Android 8 behaviour changes r=jchen,JanH
Comment 11•7 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
status-firefox63:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Reporter | ||
Updated•7 years ago
|
Attachment #8992036 -
Flags: review?(jh+bugzilla)
Updated•5 years ago
|
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•