[SB][Notif] Don't re-compose chips if it's un-necessary.
Whenever `StatusBarNotificationChipsInteractor.allNotificationChips` has
a new value, `NotifChipsViewModel` will re-create all the chip models,
which is guaranteed to create new click listeners. This will cause the
chips to definitely re-compose. However, `NotifChipsViewModel` doesn't
always need to re-create the chip models:
- If fields in `promotedContent` are changed but those fields aren't
used by the status bar chips, we don't need to re-compose.
- If the time of the notification changed but we aren't showing the
time anyway, we don't need to re-compose.
This CL creates a new intermediate data model that only saves the
relevant fields so we don't re-compose the chips if we don't need to.
Fixes: 393456147
Bug: 372657935
Flag: android.app.ui_rich_ongoing
Test: Verify via logging that notification chips get re-composed less
often
Test: atest NotifChipsViewModelTest
Change-Id: I625893ff13b5d6e2c6d667fad15480737d8d5093
2 files changed