Register listener on `onBroadcastMetadataChanged` when audio sharing is...
Register listener on `onBroadcastMetadataChanged` when audio sharing is triggered instead of after `isAudioSharingOn`. There are two reasons for this change: 1) there is a chance that `onBroadcastMetadataChanged` callback is missed if it's registered after audio sharing is turned on, as it's fires right after `onBroadcastStarted` (`isAudioSharingOn` emits true) 2) this will also fix a race condition where the settings app triggered `onBroadcastMetadataChanged` before the bluetooth dialog is fully closed. This could happen when user clicks on the "Share Audio" button on the dialog (which leads them to settings and starts audio sharing automatically, in this case, both settings and systemui would perform addSource). Test: atest Bug: b/381927583 b/390343739 Flag: com.android.settingslib.flags.enable_le_audio_sharing Change-Id: I6deed1046ec7d4c5543306a20558c29d68a1e2d7
Loading
Please register or sign in to comment