Closed
Bug 1218477
(lint-newapi)
Opened 9 years ago
Closed 4 years ago
[meta] Fix lint: NewApi issues in app module
Categories
(Firefox for Android Graveyard :: General, defect, P5)
Firefox for Android Graveyard
General
Tracking
(fennec+)
RESOLVED
INCOMPLETE
Tracking | Status | |
---|---|---|
fennec | + | --- |
People
(Reporter: nalexander, Unassigned)
References
Details
(Keywords: meta)
Right now, mobile/android's Java code base has a huge number of lint warnings due to Android SDK version mismatches. This ticket tracks using standard practices to minimize the warnings, with the belief that we may find some real positives in the warning soup.
We have rolled our own AppConstants.Versions flags, which foils the linter. Perhaps there's an equivalent construct that the linter understands? Perhaps we can make our own linter extension to handle our construct?
Comment 1•9 years ago
|
||
The simple fix is probably to liberally scatter @TargetApi(21) etc. all over the codebase, wherever an API isn't available in an earlier release.
Comment 2•9 years ago
|
||
Also, apparently this was improved recently (July):
https://code.google.com/p/android/issues/detail?id=178686
https://android-review.googlesource.com/#/c/157845/
so perhaps we just need a more recent linter.
Comment 3•9 years ago
|
||
Worth noting that it is possible to write custom rules:
https://github.com/googlesamples/android-custom-lint-rules
However, if Richard is correct, this shouldn't be necessary. Unfortunately, I loaded fennec into Android Studio and found the warnings still present – perhaps I need to update my android SDK (updated maybe a week ago?) or these changes haven't been released into the mainline lint yet.
NI self to investigate.
Blocks: android-lint
Flags: needinfo?(michael.l.comella)
Updated•9 years ago
|
Summary: Avoid SDK version lint warnings in mobile/android Java code → [lint: TargetApi] Avoid SDK version lint warnings in mobile/android Java code
Comment 4•9 years ago
|
||
nalexander mentioned elsewhere that IJ15 gets features from AS1.3 – maybe this just works?
Comment 5•9 years ago
|
||
This is not fixed in IJ 15.0.3.
Nick, I hear you run AS with fennec – does this just work?
Flags: needinfo?(michael.l.comella) → needinfo?(nalexander)
Summary: [lint: TargetApi] Avoid SDK version lint warnings in mobile/android Java code → [lint: NewApi] Avoid SDK version lint warnings in mobile/android Java code
Reporter | ||
Comment 6•9 years ago
|
||
(In reply to Michael Comella (:mcomella) from comment #5)
> This is not fixed in IJ 15.0.3.
>
> Nick, I hear you run AS with fennec – does this just work?
I remember being disappointed that it does not get better. I dug into the lint code and it's looking for a very specific if guard, which we don't meet with our fancy Version constants. I think we should confirm that and then inline all of those tests. Lint is more valuable than an unsubstantiated Proguard win.
Flags: needinfo?(nalexander)
Updated•7 years ago
|
tracking-fennec: --- → +
Priority: -- → P2
Updated•7 years ago
|
Comment 8•7 years ago
|
||
Need to unassign myself atm since shift to some other works.
Assignee: osimpleo → nobody
Status: ASSIGNED → NEW
Updated•7 years ago
|
Alias: lint-newapi
Comment 9•7 years ago
|
||
bug 1369631 is resolved so we can safely remove
<ignore path="**/mobile/android/base/java/org/mozilla/gecko/activitystream/ActivityStreamPreference.java"/>
Comment 10•7 years ago
|
||
The dependencies here all seem related to Android, and the linting file seems to be related to android, so moving across to there, as it doesn't feel like a general build configuration issue.
Component: Build Config → General
Product: Core → Firefox for Android
Comment 11•6 years ago
|
||
Re-triaging per https://bugzilla.mozilla.org/show_bug.cgi?id=1473195
Needinfo :susheel if you think this bug should be re-triaged.
Priority: P2 → P5
Comment 12•4 years ago
|
||
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly](https://play.google.com/store/apps/details?id=org.mozilla.fenix) an issue can be reported at the [Fenix GitHub project](https://github.com/mozilla-mobile/fenix/). If you want to discuss your report please use [Mozilla's chat](https://wiki.mozilla.org/Matrix#Connect_to_Matrix) server https://chat.mozilla.org and join the [#fenix](https://chat.mozilla.org/#/room/#fenix:mozilla.org) channel.
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE
Assignee | ||
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
•