Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java +19 −1 Original line number Diff line number Diff line Loading @@ -337,7 +337,6 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { + ", sourceId = " + sourceId); } updateFallbackActiveDeviceIfNeeded(); } @Override Loading Loading @@ -469,6 +468,15 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { mServiceBroadcast.startBroadcast(settings); } /** Checks if the broadcast is playing. */ public boolean isPlaying(int broadcastId) { if (mServiceBroadcast == null) { Log.d(TAG, "check isPlaying failed, the BluetoothLeBroadcast is null."); return false; } return mServiceBroadcast.isPlaying(broadcastId); } private BluetoothLeBroadcastSettings buildBroadcastSettings( boolean isPublic, @Nullable String broadcastName, Loading Loading @@ -1026,6 +1034,16 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { /** Update fallback active device if needed. */ public void updateFallbackActiveDeviceIfNeeded() { if (mServiceBroadcast == null) { Log.d(TAG, "Skip updateFallbackActiveDeviceIfNeeded due to broadcast profile is null"); return; } List<BluetoothLeBroadcastMetadata> sources = mServiceBroadcast.getAllBroadcastMetadata(); if (sources.stream() .noneMatch(source -> mServiceBroadcast.isPlaying(source.getBroadcastId()))) { Log.d(TAG, "Skip updateFallbackActiveDeviceIfNeeded due to no broadcast ongoing"); return; } if (mServiceBroadcastAssistant == null) { Log.d(TAG, "Skip updateFallbackActiveDeviceIfNeeded due to assistant profile is null"); return; Loading Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java +19 −1 Original line number Diff line number Diff line Loading @@ -337,7 +337,6 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { + ", sourceId = " + sourceId); } updateFallbackActiveDeviceIfNeeded(); } @Override Loading Loading @@ -469,6 +468,15 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { mServiceBroadcast.startBroadcast(settings); } /** Checks if the broadcast is playing. */ public boolean isPlaying(int broadcastId) { if (mServiceBroadcast == null) { Log.d(TAG, "check isPlaying failed, the BluetoothLeBroadcast is null."); return false; } return mServiceBroadcast.isPlaying(broadcastId); } private BluetoothLeBroadcastSettings buildBroadcastSettings( boolean isPublic, @Nullable String broadcastName, Loading Loading @@ -1026,6 +1034,16 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { /** Update fallback active device if needed. */ public void updateFallbackActiveDeviceIfNeeded() { if (mServiceBroadcast == null) { Log.d(TAG, "Skip updateFallbackActiveDeviceIfNeeded due to broadcast profile is null"); return; } List<BluetoothLeBroadcastMetadata> sources = mServiceBroadcast.getAllBroadcastMetadata(); if (sources.stream() .noneMatch(source -> mServiceBroadcast.isPlaying(source.getBroadcastId()))) { Log.d(TAG, "Skip updateFallbackActiveDeviceIfNeeded due to no broadcast ongoing"); return; } if (mServiceBroadcastAssistant == null) { Log.d(TAG, "Skip updateFallbackActiveDeviceIfNeeded due to assistant profile is null"); return; Loading