Merge "Add keep rules for @KeepForWeakReference annotation"

This commit is contained in:
Treehugger Robot 2022-05-16 21:19:03 +00:00 committed by Gerrit Code Review
commit 3eb3ca0c9b

View file

@ -15,6 +15,12 @@
@**.VisibleForTesting *;
}
# Keep rule for members that are needed solely to keep alive downstream weak
# references, and could otherwise be removed after tree shaking optimizations.
-keepclassmembers,allowaccessmodification,allowobfuscation,allowshrinking class * {
@com.android.internal.annotations.KeepForWeakReference <fields>;
}
# Understand the common @Keep annotation from various Android packages:
# * android.support.annotation
# * androidx.annotation