Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java +5 −15 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.settingslib.bluetooth; import static android.bluetooth.BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; import static com.android.settingslib.Utils.isAudioModeOngoingCall; import static java.util.stream.Collectors.toList; import android.annotation.CallbackExecutor; Loading Loading @@ -302,6 +304,7 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { + ", sourceId = " + sourceId); } updateFallbackActiveDeviceIfNeeded(); } @Override Loading Loading @@ -389,9 +392,6 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { + ", state = " + state); } if (BluetoothUtils.isConnected(state)) { updateFallbackActiveDeviceIfNeeded(); } } }; Loading Loading @@ -1129,18 +1129,8 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { Log.d(TAG, "Skip updateFallbackActiveDeviceIfNeeded for work profile."); return; } 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"); if (isAudioModeOngoingCall(mContext)) { Log.d(TAG, "Skip updateFallbackActiveDeviceIfNeeded due to ongoing call"); return; } Map<Integer, List<BluetoothDevice>> deviceGroupsInBroadcast = getDeviceGroupsInBroadcast(); Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcastAssistantCallbackExt.kt +4 −6 Original line number Diff line number Diff line Loading @@ -35,11 +35,7 @@ val LocalBluetoothLeBroadcastAssistant.onSourceConnectedOrRemoved: Flow<Unit> sink: BluetoothDevice, sourceId: Int, state: BluetoothLeBroadcastReceiveState ) { if (BluetoothUtils.isConnected(state)) { launch { send(Unit) } } } ) {} override fun onSourceRemoved(sink: BluetoothDevice, sourceId: Int, reason: Int) { launch { send(Unit) } Loading @@ -55,7 +51,9 @@ val LocalBluetoothLeBroadcastAssistant.onSourceConnectedOrRemoved: Flow<Unit> override fun onSourceFound(source: BluetoothLeBroadcastMetadata) {} override fun onSourceAdded(sink: BluetoothDevice, sourceId: Int, reason: Int) {} override fun onSourceAdded(sink: BluetoothDevice, sourceId: Int, reason: Int) { launch { send(Unit) } } override fun onSourceAddFailed( sink: BluetoothDevice, Loading Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java +5 −15 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.settingslib.bluetooth; import static android.bluetooth.BluetoothProfile.CONNECTION_POLICY_FORBIDDEN; import static com.android.settingslib.Utils.isAudioModeOngoingCall; import static java.util.stream.Collectors.toList; import android.annotation.CallbackExecutor; Loading Loading @@ -302,6 +304,7 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { + ", sourceId = " + sourceId); } updateFallbackActiveDeviceIfNeeded(); } @Override Loading Loading @@ -389,9 +392,6 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { + ", state = " + state); } if (BluetoothUtils.isConnected(state)) { updateFallbackActiveDeviceIfNeeded(); } } }; Loading Loading @@ -1129,18 +1129,8 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { Log.d(TAG, "Skip updateFallbackActiveDeviceIfNeeded for work profile."); return; } 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"); if (isAudioModeOngoingCall(mContext)) { Log.d(TAG, "Skip updateFallbackActiveDeviceIfNeeded due to ongoing call"); return; } Map<Integer, List<BluetoothDevice>> deviceGroupsInBroadcast = getDeviceGroupsInBroadcast(); Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcastAssistantCallbackExt.kt +4 −6 Original line number Diff line number Diff line Loading @@ -35,11 +35,7 @@ val LocalBluetoothLeBroadcastAssistant.onSourceConnectedOrRemoved: Flow<Unit> sink: BluetoothDevice, sourceId: Int, state: BluetoothLeBroadcastReceiveState ) { if (BluetoothUtils.isConnected(state)) { launch { send(Unit) } } } ) {} override fun onSourceRemoved(sink: BluetoothDevice, sourceId: Int, reason: Int) { launch { send(Unit) } Loading @@ -55,7 +51,9 @@ val LocalBluetoothLeBroadcastAssistant.onSourceConnectedOrRemoved: Flow<Unit> override fun onSourceFound(source: BluetoothLeBroadcastMetadata) {} override fun onSourceAdded(sink: BluetoothDevice, sourceId: Int, reason: Int) {} override fun onSourceAdded(sink: BluetoothDevice, sourceId: Int, reason: Int) { launch { send(Unit) } } override fun onSourceAddFailed( sink: BluetoothDevice, Loading