diff options
author | 2025-03-11 03:46:48 -0700 | |
---|---|---|
committer | 2025-03-11 03:46:48 -0700 | |
commit | 0131dc875ab3182127abb3d26a0608bbdf1f2c06 (patch) | |
tree | dd951b95d21339293df88a51558dd753609684e8 | |
parent | 23876b63c42bc1004561491e54bb67c6aca06459 (diff) | |
parent | 0e455aa58a6aa010dafd0dc3024223af8857857a (diff) |
Merge "[Audiosharing] Check broadcast id before return cached metadata" into main
-rw-r--r-- | packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java index f22bdaf55ce4..01d8694256f3 100644 --- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java +++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java @@ -724,7 +724,10 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { Log.d(TAG, "The BluetoothLeBroadcast is null"); return null; } - if (mBluetoothLeBroadcastMetadata == null) { + if (mBluetoothLeBroadcastMetadata == null + // mBroadcastId is updated when onBroadcastStarted, which is always before + // onBroadcastMetadataChanged, so mBroadcastId is always the latest broadcast info + || mBluetoothLeBroadcastMetadata.getBroadcastId() != mBroadcastId) { final List<BluetoothLeBroadcastMetadata> metadataList = mServiceBroadcast.getAllBroadcastMetadata(); mBluetoothLeBroadcastMetadata = @@ -732,6 +735,7 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { .filter(i -> i.getBroadcastId() == mBroadcastId) .findFirst() .orElse(null); + Log.d(TAG, "getLatestBluetoothLeBroadcastMetadata for broadcast id " + mBroadcastId); } return mBluetoothLeBroadcastMetadata; } |