Tweak WeaklyReferencedCallback keep rules

Adjust the semantics so that we only prevent optimization, and we avoid
unnecessary keeps for synthetically generated members.

This should have no effective impact on weakly referenced lifecycle
semantics, though the generated dex code might be slightly different.

Bug: 349245577
Test: FULL_SYSTEM_OPTIMIZE_JAVA=true m services
Flag: EXEMPT refactor
Change-Id: I7a6de2d8db593a5336f94448f18a75482e4ed349
diff --git a/core/proguard.flags b/core/proguard.flags
index 5148e56..367c56d 100644
--- a/core/proguard.flags
+++ b/core/proguard.flags
@@ -41,12 +41,12 @@
 # Needed to ensure callback field references are kept in their respective
 # owning classes when the downstream callback registrars only store weak refs.
 -if @com.android.internal.annotations.WeaklyReferencedCallback class *
--keepclassmembers,allowaccessmodification class * {
-  <1> *;
+-keepclassmembers,allowaccessmodification,allowobfuscation,allowshrinking class * {
+  !synthetic <1> *;
 }
 -if class * extends @com.android.internal.annotations.WeaklyReferencedCallback **
--keepclassmembers,allowaccessmodification class * {
-  <1> *;
+-keepclassmembers,allowaccessmodification,allowobfuscation,allowshrinking class * {
+  !synthetic <1> *;
 }
 
 # Understand the common @Keep annotation from various Android packages: