AudioService: Add makeLeAudioDeviceUnavailableLater
Currently, when LE Audio device becomes unavaliable due to BT adapter disable, user can hear audio from device speaker for a split second. This is because we make device unavaliable immediately for LE Audio. Instead, it should become unavaliable after AUDIO_BECOMING_NOISY intent is sent. Since this is working correctly for A2DP, fix is to copy solution from there for LE Audio code path, and split makeLeAudioDeviceUnavailable into *Now and *Later versions. With this fix, the device becomes unavaliable after the noisy intent, and audio glitch is not heard from speaker. Example dumpsys audio logs after fix is applied: 02-16 11:25:43:022 broadcast ACTION_AUDIO_BECOMING_NOISY 02-16 11:25:44:050 LE Audio device addr=14:3F:A6:60:0A:A5 made unavailable Bug: 263209656 Test: play music in Spotfiy, listen on LE Audio device, then disable Bluetooth. Verify that audio is not heard from the phoen speaker Merged-In: I0ff85798c3672b2d6862460c2f2d914f705aac2c Change-Id: I0ff85798c3672b2d6862460c2f2d914f705aac2c
Loading
Please register or sign in to comment