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)

All
Android
enhancement
Not set
normal

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.
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.
Whiteboard: --do_not_change--[priority:high]
Assignee: nobody → vlad.baicu
Assignee: vlad.baicu → andrei.a.lazar
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]
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)
Status: NEW → ASSIGNED
Attachment #8984822 - Flags: review?(jh+bugzilla) → review?(nchen)
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+
Flags: needinfo?(jh+bugzilla)
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+
Keywords: checkin-needed
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
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 63
Attachment #8992036 - Flags: review?(jh+bugzilla)
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: