[LE Audio] To remove the broadcast source item that created by receive

state

    - When the user clicks another broadcast source and wants to join,
      we will remove the previous item that created by getAllSource().
      And trigger the search again.

Bug: 242267719
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothBroadcastSourcePreferenceTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=BluetoothFindBroadcastsFragmentTest
Change-Id: I416f0a39e31276876e63360664555f99dd7297c9
Merged-In: I416f0a39e31276876e63360664555f99dd7297c9
This commit is contained in:
changbetty
2022-09-19 08:34:53 +00:00
parent 19ca5d6a6e
commit 85dd572f18
4 changed files with 247 additions and 5 deletions

View File

@@ -170,6 +170,16 @@ class BluetoothBroadcastSourcePreference extends Preference {
return mIsEncrypted;
}
/**
* Whether the broadcast source is connected at the beginging. We will get the
* BluetoothLeBroadcastReceiveState from the broadcast source.
* See {@link BluetoothFindBroadcastsFragment#addConnectedSourcePreference}
* @return If true, the broadcast source is already connected by the broadcast sink.
*/
public boolean isCreatedByReceiveState() {
return mBluetoothLeBroadcastReceiveState != null;
}
/**
* Clear the BluetoothLeBroadcastReceiveState and reset the state when the user clicks the
* "leave broadcast" button.