diff options
| author | 2025-02-03 15:01:22 +0000 | |
|---|---|---|
| committer | 2025-02-04 17:17:26 +0000 | |
| commit | 313f64551060faf0f0a5468e7a2bb3e9d7151405 (patch) | |
| tree | e3703e92c0ee52617d79acb9da78dbfa80206446 /api/api_test.go | |
| parent | 24969842598397b541d307e41c0f75a907394ced (diff) | |
[SB][Chips] Fix Compose chips that use notification icons.
If a chip that was using a notification icon moved from the primary chip
to the secondary chip or vice versa, there were two problems:
1) Sometimes, SysUI would crash beacuse the notification icon view is
already attached to the primary chip view, and then we tried to
attach it to the secondary chip view without first detaching it.
2) A chip could be missing the notification icon because the
OngoingActivityChip composable doesn't use the icon's
AndroidView#update method to re-bind the icon if the chip is now tied
to a different notification.
For #1, this is fixed by calling `parent.removeView` in the
OngoingActivityChip Composable.
For #2, this is mostly? fixed by using `key` when laying out the
OngoingActivityChips Composable so that the OngoingActivityChip
Composable mostly stays connected to the same notification.
I'm not sure this CL fixes all cases yet, though. I'm going to build a test
app that changes the icon while keeping the rest of the notification the
same, and we can use that to make sure all cases are handled correctly.
Fixes: 390231934
Fixes: 393456151
Bug: 364653005
Bug: 372657935
Flag: com.android.systemui.status_bar_notification_chips
Flag: com.android.systemui.status_bar_chips_modernization
Test: Post 2 promoted ongoing notifications, then dismiss one -> verify
no crash (b/390231934)
Test: Post 2 promoted ongoing notifications -> verify both chips show
the right icons
Test: Add & remove various chips -> verify the chips always show the
right icon, and SysUI never crashes
Change-Id: I3bcf409fbe43c4588bbd38c8249db80c2bfe3fd7
Diffstat (limited to 'api/api_test.go')
0 files changed, 0 insertions, 0 deletions