Refactor weakly referenced callback keep rules
Annotate callback types that use weak reference semantics with a new @WeaklyReferencedCallback annotation. Apply keep rules to fields that implement types with this annotation, ensuring such fields are kept during optimization and can provide a strong ref anchor at runtime. Note that we only do this *only* on SysUISingleton-annotated classes, as all other types should explicitly unregister any registered callbacks, and aren't subject to fields being optimized away if only referenced in the constructor. This saves ~40-50s from the SystemUI R8 optimization pass. Test: time m SystemUI + inspect dex diff Bug: 300478836 Bug: 264686688 Change-Id: I6ca8b60460991c12436841a275e180beaf16cdb8
Loading
Please register or sign in to comment