[Audiosharing] Fix the primary buds auto pick logic in hysteresis mode
In hysteresis mode, we will receive plenty of onReceiveStateChanged, e.g. play and pause music, system sounds... The onReceiveStateChanged with BIS >= 1, as a replacement of onSourceAdded, will trigger auto pick logic for primary headset. In some cases, when user change primary headset in Call audio section on audio sharing page under the hysteresis mode, the system sound will later trigger a onReceiveStateChanged with BIS >= 1, then the auto pick logic (always pick the earliest connected headset) is possible to override the user change. Thus here we have to save the user preferred primary headset in SettingsProvider and skip the auto pick if user has made changes. Also add to code to do nothing for the work profile. Test: atest Bug: 355222285 Flag: com.android.settingslib.flags.audio_sharing_hysteresis_mode_fix Change-Id: I49e1ef69743fff55e7a558d5076e34ae8c9d11ec
Loading
Please register or sign in to comment