summaryrefslogtreecommitdiff
path: root/libs/androidfw/StringPool.cpp
diff options
context:
space:
mode:
author Caitlin Shkuratov <caitlinshk@google.com> 2024-07-02 15:49:56 +0000
committer Caitlin Shkuratov <caitlinshk@google.com> 2024-07-03 15:04:04 +0000
commit44f678756600d59398d33cb49382077b28ed13f5 (patch)
tree1147fdc69b6953cc23c16d27505e5d53d7bd90b7 /libs/androidfw/StringPool.cpp
parent72cd9a534461b7e2ed7bf4e6561b29c9fd96279f (diff)
[SB][Screen Chips] Show cast chip even if audio-only casting.
When casting to another device, you can either cast your screen, or just your audio. - When casting just audio, only MediaRouter APIs fire. - When casting screen, both MediaRouter APIs and MediaProjection APIs fire. Previously, we were only listening to MediaProjection APIs, so we weren't showing the cast chip if you're just casting audio. This CL adds listening to MediaRouter events so that we also show the cast chip if you're casting just audio. This gets tricky when casting your screen though, because both the MediaProjection APIs and the MediaRouter APIs fire when screen casting but they fire at different times (see b/269975671): - The MediaRouter APIs fire as soon as you select a device to cast to, even if you haven't confirmed you want to start casting. - The MediaProjection APIs only fire once you've confirmed casting should start. This CL also includes disambiguation logic between these two API surfaces. Key changes: 1) Adds new MediaRouterRepository, which listens to the existing CastController for MediaRouter events. 2) Adds new MediaRouterChipInteractor, which filters those media router events down to just active casts. 3) Updates CastToOtherDeviceChipViewModel to listen to the new interactor and use either MediaRouter or MediaProjection as the datasource, depending on what's available. 2) Updates the stop dialog to have screen-specific strings or generic strings, depending on whether MediaProjection is active. Bug: 332662551 Flag: com.android.systemui.status_bar_screen_sharing_chips Test: Cast to an audio-only device -> verify cast chip appears. Tap chip -> verify dialog text is audio-specific. Tap "Stop casting" in dialog -> verify casting stops. Test: Cast to an audio-only device, then also start sharing your screen to an app -> verify the cast-to-other-device chip is replaced by the share-to-app chip. Tap chip -> verify dialog is about sharing, not casting. Stop sharing to app -> verify cast-to-other-device chip re-appears. Tap chip -> verify dialog is about casting. Test: Cast screen to a device -> verify cast chip appears. Verify timer doesn't reset between selecting the device and starting casting. Tap chip -> verify dialog text is screen-specific. Tap "Stop casting" in dialog -> verify casting stops. Test: atest MediaRouterRepositoryTest MediaRouterChipInteractorTest CastToOtherDeviceChipViewModelTest Change-Id: I4a1c6ea9e1089d3780b6e0a5d6cb88675e6a7aa0
Diffstat (limited to 'libs/androidfw/StringPool.cpp')
0 files changed, 0 insertions, 0 deletions