Only keep Parcelables if used

Use `-keepclassmembers` instead of `-keep` for Parcelable types
and their CREATOR members. This allows shrinking of Parcelable types
that aren't referenced while still preserving the necessary CREATOR
member when the classes are kept. This saves ~3MB across various
platform targets.

Bug: 238670321
Test: m + presubmit
Change-Id: I13508073dbc07e28aa93bb6604c8f838bcf72646
This commit is contained in:
Jared Duke 2022-09-19 16:23:16 -07:00
parent 2a9b910bf4
commit 9d27a928f2

View file

@ -53,7 +53,7 @@
# -keep class * extends android.app.BackupAgent
# Parcelable CREATORs must be kept for Parcelable functionality
-keep class * implements android.os.Parcelable {
-keepclassmembers class * implements android.os.Parcelable {
public static final ** CREATOR;
}