Open Bug 1510661 Opened 6 years ago Updated 1 year ago

Lint Warning: Using inlined constants on older versions

Categories

(GeckoView :: General, enhancement, P5)

Unspecified
Android
enhancement

Tracking

(Not tracked)

People

(Reporter: fluffyemily, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: good-first-bug)

This check scans through all the Android API field references in the application and flags certain constants, such as static final integers and Strings, which were introduced in later versions. These will actually be copied into the class files rather than being referenced, which means that the value is available even when running on older devices. In some cases that's fine, and in other cases it can result in a runtime crash or incorrect behavior. It depends on the context, so consider the code carefully and decide whether it's safe and can be suppressed or whether the code needs to be guarded.

If you really want to use this API and don't need to support older devices just set the minSdkVersion in your build.gradle or AndroidManifest.xml files. If your code is deliberately accessing newer APIs, and you have ensured (e.g. with conditional execution) that this code will only ever be called on a supported platform, then you can annotate your class or method with the @TargetApi annotation specifying the local minimum SDK to apply, such as @TargetApi(11), such that this check considers 11 rather than your manifest file's minimum SDK as the required API level.

Affected classes:

BasicSelectionActionDelegate
Codec
FormatParam
GeckoAppShell
GeckoHlsAudioRenderer
GeckoHLSSample
GeckoHlsVideoRenderer
GeckoMediaDrmBridgeV21
GeckoSystemStateListener
JellyBeanAsyncCodec
LollipopAsyncCodec
SessionAccessibility
VsyncSource
Keywords: good-first-bug
OS: Unspecified → Android
Priority: -- → P5
Product: Firefox for Android → GeckoView
Severity: normal → S3

Enhancements should have severity N/A.

Severity: S3 → N/A
You need to log in before you can comment on or make changes to this bug.