Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit b2e6859a authored by Caitlin Shkuratov's avatar Caitlin Shkuratov
Browse files

[SB][Call chip] Listen to ActiveNotificationsInteractor for call info.

The current OngoingCallController listens to
NotifCollectionListener#onEntryUpdated to determine what call
notifications are active and when to show the ongoing call chip. This
has two problems:

1) #onEntryUpdated does not take users into account. If you start a call
   on User 1, then switch to User 2, User 2 would still see the call
   chip even though there's no call notification shown to User 2. User 2
   has no way to stop the call either, and User 2 can't tap the chip
   because the intent isn't valid for this user.

2) For b/354930838, we want to update the call chip to use
   `Notification.smallIcon` as the icon in the chip. However,
   #onEntryUpdated is invoked before we've actually inflated the small
   icon, so the chip would show no icon (see b/355288215).

Listening to ActivteNotificationsInteractor solves both these problems:

1) The interactor automatically filters the notification list to just
   notifications for the current user.

2) The interactor only emits notifications that are currently presented
   to the user in the shade, which means we know we've already inflated
   the icon.

Bug: 328584859
Flag: com.android.systemui.status_bar_use_repos_for_call_chip

Test: Start ongoing call on one user, switch to another user -> verify
chip no longer shows up
Test: Start ongoing call in one app, then start another call in a second
app -> verify chip still shows fist app call time. End first call ->
verify chip starts showing second app call time.
Test: General smoke test of ongoing call CUJs
Test: Verify above with status_bar_screen_sharing_chips flag both
disabled and enabled

Test: atest ActiveNotificationsInteractorTest
OngoingCallControllerViaListenerTest OngoingCallControllerViaRepoTest

Change-Id: I5615cea679b4cff075390d1da4c9a918419fc76a
parent 2c4b5b9c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment