Closed
Bug 1241855
Opened 9 years ago
Closed 9 years ago
[Lint: MissingPermission] Missing check for Permissions
Categories
(Firefox for Android Graveyard :: General, defect)
Firefox for Android Graveyard
General
Tracking
(firefox48 fixed)
RESOLVED
FIXED
Firefox 48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: vivek, Assigned: maurya1985)
References
Details
(Whiteboard: [lang=java][good next bug])
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
nalexander
:
review+
|
Details | Diff | Splinter Review |
Handle permission checks graceful considering that the user may have revoked some permissions in Android 6.0
GPSScanner.java [1], [2], [3]--> Permission checks are handled in StumberService [4], so add annotation for MissingPermission to the respective method block
GekoAppShell.java [5], [6] -> similar to the above, add annotations to method block. The permission are checked for at [7]
[1] https://dxr.mozilla.org/mozilla-central/source/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/stumblerthread/scanners/GPSScanner.java?from=GPSScanner.java#85
[2] https://dxr.mozilla.org/mozilla-central/source/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/stumblerthread/scanners/GPSScanner.java?from=GPSScanner.java#136
[3] https://dxr.mozilla.org/mozilla-central/source/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/stumblerthread/scanners/GPSScanner.java?from=GPSScanner.java#141
[4] https://dxr.mozilla.org/mozilla-central/source/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/stumblerthread/StumblerService.java?from=StumblerService.java#183
[5] https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/GeckoAppShell.java?from=GeckoAppShell.java#484
[6] https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/GeckoAppShell.java?from=GeckoAppShell.java#546
[6] https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/GeckoAppShell.java?from=GeckoAppShell.java#509
Comment 1•9 years ago
|
||
Ah, it's great that we get this from lint.
Comment 2•9 years ago
|
||
(In reply to Sebastian Kaspari (:sebastian) from comment #1)
> Ah, it's great that we get this from lint.
Yeah, this is hot. This and making sure we get the version checking correct is my motivation for improving lint support :)
Assignee | ||
Comment 3•9 years ago
|
||
Could you please assign this bug to me? :)
Comment 4•9 years ago
|
||
We assign bugs once there is a patch attached. The build instructions for Android are at https://developer.mozilla.org/en-US/docs/Simple_Firefox_for_Android_build and if you need help irc://irc.mozilla.org/mobile is a good resource.
Updated•9 years ago
|
Blocks: android-lint
Assignee | ||
Comment 5•9 years ago
|
||
Vivek,I don't get these warnings in the report generated when I run lint (./mach gradle lint). Am I missing something while running lint?
Flags: needinfo?(vivekb.balakrishnan)
Comment 6•9 years ago
|
||
(In reply to Maurya Talisetti from comment #5)
> Vivek,I don't get these warnings in the report generated when I run lint
> (./mach gradle lint). Am I missing something while running lint?
Post Bug 1233882, these may no longer be present. I'll check this and close if necessary. Thanks for digging into it!
Flags: needinfo?(vivekb.balakrishnan)
Reporter | ||
Comment 7•9 years ago
|
||
@Nick: I remember filing the bug after applying your tentative patch for bug 1233882. And I can reproduce the same warnings with latest fx-team.
@Maurya: Can you check the following link after running ./mach gradle lint
path to objdir-droid/gradle/build/mobile/android/app/outputs/lint-results.html#MissingPermission
Assignee | ||
Comment 8•9 years ago
|
||
Vivek, can you help me understand what fx-team is? I don't see any branch with that name in http://hg.mozilla.org/mozilla-central/branches.
I got the latest code from http://hg.mozilla.org/mozilla-central/ and ran `./mach gradle lint` on the default branch.
There's no item classified under MissingPermission. The report is [here](https://pastebin.mozilla.org/8860501) and the command line output is [here](https://pastebin.mozilla.org/8860502).
Flags: needinfo?(vivekb.balakrishnan)
Comment 9•9 years ago
|
||
(In reply to Maurya Talisetti from comment #8)
> Vivek, can you help me understand what fx-team is? I don't see any branch
> with that name in http://hg.mozilla.org/mozilla-central/branches.
Maurya - fx-team is an integration branch. See https://wiki.mozilla.org/Tree_Rules/Integration.
> I got the latest code from http://hg.mozilla.org/mozilla-central/ and ran
> `./mach gradle lint` on the default branch.
I think this is sufficient because the relevant code has merged to mozilla-central, but would you mind reporting what commit your m-c is at? Then we can know for sure. You can find out what your m-c is at by running |hg parent|.
> There's no item classified under MissingPermission. The report is
> [here](https://pastebin.mozilla.org/8860501) and the command line output is
> [here](https://pastebin.mozilla.org/8860502).
That would be great! I think this will be correct, due to the new projects "seeing" the full set of permissions now.
Assignee | ||
Comment 10•9 years ago
|
||
Nick, thanks for those suggestions. My parent wasn't at the tip. I've updated it now.
However, I'm now not able to run `./mach gradle lint` anymore. Not able to run `./mach gradle <target>:lint` either. The the error I see is here (https://pastebin.mozilla.org/8860609) . Any idea if the command options changed?
Assignee | ||
Comment 11•9 years ago
|
||
Never mind my question about not being able to run `./mach gradle lint`. I figured I had to rebuild after pulling the latest changes.
I'm able to see GPSScanner and GeckoAppShell listed in the lint report. I'll add the necessary annotations and regenerate the report to ensure they don't appear again.
Flags: needinfo?(vivekb.balakrishnan)
Assignee | ||
Comment 12•9 years ago
|
||
Attachment #8721948 -
Flags: review?(vivekb.balakrishnan)
Reporter | ||
Comment 13•9 years ago
|
||
Comment on attachment 8721948 [details] [diff] [review]
suppress-lint-permission-check
Review of attachment 8721948 [details] [diff] [review]:
-----------------------------------------------------------------
LGTM
Attachment #8721948 -
Flags: review?(vivekb.balakrishnan)
Attachment #8721948 -
Flags: review?(nalexander)
Attachment #8721948 -
Flags: review+
Comment 14•9 years ago
|
||
Comment on attachment 8721948 [details] [diff] [review]
suppress-lint-permission-check
Review of attachment 8721948 [details] [diff] [review]:
-----------------------------------------------------------------
Can I get some context on why it's okay to suppress the check? I assume we are requesting the permission (or have it in the manifest) and this is guarded by some feature flag?
Attachment #8721948 -
Flags: review?(nalexander)
Reporter | ||
Comment 15•9 years ago
|
||
Hi Nick,
Nick,
It is safe to add the suppress lint annotations for both GeckoAppShell and StumblerService.
* In GeckoAppShell, we explicitly check for the permission using PermissionBlock [1]
* In case of StumblerService, it is not intuitive at first glance, but the permissions are checked for in StumblerService which instantiate the GpsScanner [2].
Please let me know if this needs to be improved
[1] https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/mozilla/gecko/GeckoAppShell.java?from=GeckoAppShell.java#509
[2] https://dxr.mozilla.org/mozilla-central/source/mobile/android/stumbler/java/org/mozilla/mozstumbler/service/stumblerthread/StumblerService.java#183
Comment 16•9 years ago
|
||
(In reply to Vivek Balakrishnan[:vivek] from comment #15)
> Hi Nick,
> Nick,
>
> It is safe to add the suppress lint annotations for both GeckoAppShell and
> StumblerService.
> * In GeckoAppShell, we explicitly check for the permission using
> PermissionBlock [1]
> * In case of StumblerService, it is not intuitive at first glance, but the
> permissions are checked for in StumblerService which instantiate the
> GpsScanner [2].
>
> Please let me know if this needs to be improved
>
> [1]
> https://dxr.mozilla.org/mozilla-central/source/mobile/android/base/java/org/
> mozilla/gecko/GeckoAppShell.java?from=GeckoAppShell.java#509
> [2]
> https://dxr.mozilla.org/mozilla-central/source/mobile/android/stumbler/java/
> org/mozilla/mozstumbler/service/stumblerthread/StumblerService.java#183
Very good -- perhaps add comments to this effect in the patch? Roll on!
Assignee | ||
Comment 17•9 years ago
|
||
Sure I'll add comments and update the patch.
Assignee | ||
Comment 18•9 years ago
|
||
added comments to annotations
Attachment #8726703 -
Flags: review?(nalexander)
Assignee | ||
Updated•9 years ago
|
Attachment #8721948 -
Attachment is obsolete: true
Comment 19•9 years ago
|
||
Comment on attachment 8726703 [details] [diff] [review]
suppress-lint-permission-check
Review of attachment 8726703 [details] [diff] [review]:
-----------------------------------------------------------------
lgmt. Thanks, Maurya!
Attachment #8726703 -
Flags: review?(nalexander) → review+
Assignee | ||
Comment 20•9 years ago
|
||
Thanks Nick! Would you be able to vouch for me so that I can get Level 1 (try server) access?
https://bugzilla.mozilla.org/show_bug.cgi?id=1254409
You'd need to add a comment saying that you support my application. (See https://www.mozilla.org/en-US/about/governance/policies/commit/)
Flags: needinfo?(nalexander)
Updated•9 years ago
|
Keywords: checkin-needed
Comment 22•9 years ago
|
||
Keywords: checkin-needed
Assignee | ||
Comment 23•9 years ago
|
||
Nick, would you be able to assign this to me before marking as resolved!
Comment 24•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox48:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 48
Assignee | ||
Comment 25•9 years ago
|
||
Nick, can you add me to the "Assigned To" field?
Flags: needinfo?(nalexander)
Comment 26•9 years ago
|
||
Drive-by assign! :)
Assignee: nobody → maurya1985
Flags: needinfo?(nalexander)
Assignee | ||
Comment 27•9 years ago
|
||
Thanks Sebastian :)
Comment 28•9 years ago
|
||
(In reply to Maurya Talisetti from comment #25)
> Nick, can you add me to the "Assigned To" field?
Maurya -- thanks for all your help with these lint issues. I've given you canconfirm and editbugs Bugzilla rights. That'll let you assign yourself, and also change most other fields. Use your new powers wisely :)
Assignee | ||
Comment 29•9 years ago
|
||
Awesome, thank you very much Nick :)
Updated•9 years ago
|
Summary: [Lint] Missing check for Permissions → [Lint: MissingPermission] Missing check for Permissions
Updated•4 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
•