Open Bug 1355616 Opened 8 years ago Updated 2 years ago

Make Android resources match SDK restrictions

Categories

(Firefox Build System :: Android Studio and Gradle Integration, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: nalexander, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Right now, mobile/android/base/resources contains some resources folders that contain qualifiers (like hdpi, xhdpi, etc) but no versions. These are accepted, but they have a "secret" version qualifier -- in the case of hdpi, it's v4, since that's the first Android version that discriminated on screen density. The set of versions is small; I reverse engineered it from [1] and some of the outputs of a Gradle build. In addition, we have resources that we can statically prove will never be accessed because there's a more recent version that is less than the minimum SDK version we run on. For example, drawable-v12/toast_button_background.xml will _always_ be preferred to drawable/toast_button_background.xml, since v12 is less than our minimum SDK version v15 (and since drawable-v12 overrides the unqualified drawable). This ticket tracks adding the version qualifiers, and purging the inaccessible resources. The motivation for doing so is simple: by adding the qualifiers, we get closer to the set of merged resources that the Gradle build process ends up using. Future work will converge the set of resources used by moz.build to exactly the same set used by Gradle, making it easier to "flip the switch". In addition, we save a small amount of APK space by purging the unused resources. [1] https://android.googlesource.com/platform/tools/base/+/588c433884c745cba0e09eb16a7f269dfee2c1aa/sdk-common/src/main/java/com/android/ide/common/resources/configuration/FolderConfiguration.java
Blocks: 1355625
Attachment #8857197 - Attachment is obsolete: true
Attachment #8857197 - Flags: review?(s.kaspari)
Comment on attachment 8857216 [details] Bug 1355616 - Move Android resources to match SDK restrictions. Sorry for the churn -- I found problems with my comparison scripts, so this isn't quite enough just yet.
Attachment #8857216 - Flags: review?(s.kaspari)
I guess we can fold bug 1261037 into this one?
See Also: → 1261037
(In reply to Sebastian Kaspari (:sebastian) from comment #4) > I guess we can fold bug 1261037 into this one? I commented on that ticket. I'd like to keep this one just for the build system stuff, and use that one for general purpose clean up.
No longer blocks: gradle-automation
Product: Firefox for Android → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: