Commit b122f929 authored by Andrew Grieve's avatar Andrew Grieve Committed by Commit Bot

Android: Fix Proguard removing fragment constructors.

These started getting discarded when we switched to r8.
Two of these were previously fixed by adding @UsedByReflection,
but it seems safer to just keep all fragment constructors and
does not seem to keep anything unused.

Bug: 983904

Change-Id: I60bbc5a32dc49732aebd8048d674375cbc133f7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1703595
Commit-Queue: Andrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarBoris Sazonov <bsazonov@chromium.org>
Cr-Commit-Position: refs/heads/master@{#678277}
parent b6c1d887
...@@ -15,6 +15,14 @@ ...@@ -15,6 +15,14 @@
public static *** CREATOR; public static *** CREATOR;
} }
# Keep all Fragment constructors since they are only usable via reflection.
-keepclassmembers class * extends android.support.v4.app.Fragment {
public <init>();
}
-keepclassmembers class * extends androidx.fragment.app.Fragment {
public <init>();
}
# Don't obfuscate Parcelables as they might be marshalled outside Chrome. # Don't obfuscate Parcelables as they might be marshalled outside Chrome.
# If we annotated all Parcelables that get put into Bundles other than # If we annotated all Parcelables that get put into Bundles other than
# for saveInstanceState (e.g. PendingIntents), then we could actually keep the # for saveInstanceState (e.g. PendingIntents), then we could actually keep the
......
...@@ -117,6 +117,14 @@ ...@@ -117,6 +117,14 @@
public static *** CREATOR; public static *** CREATOR;
} }
# Keep all Fragment constructors since they are only usable via reflection.
-keepclassmembers class * extends android.support.v4.app.Fragment {
public <init>();
}
-keepclassmembers class * extends androidx.fragment.app.Fragment {
public <init>();
}
# Don't obfuscate Parcelables as they might be marshalled outside Chrome. # Don't obfuscate Parcelables as they might be marshalled outside Chrome.
# If we annotated all Parcelables that get put into Bundles other than # If we annotated all Parcelables that get put into Bundles other than
# for saveInstanceState (e.g. PendingIntents), then we could actually keep the # for saveInstanceState (e.g. PendingIntents), then we could actually keep the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment