Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java +20 −10 Original line number Diff line number Diff line Loading @@ -292,7 +292,6 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { + ", sourceId = " + sourceId); } updateFallbackActiveDeviceIfNeeded(); } @Override Loading @@ -314,7 +313,18 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { public void onSourceAddFailed( @NonNull BluetoothDevice sink, @NonNull BluetoothLeBroadcastMetadata source, int reason) {} int reason) { if (DEBUG) { Log.d( TAG, "onSourceAddFailed(), sink = " + sink + ", reason = " + reason + ", source = " + source); } } @Override public void onSourceModified( Loading Loading @@ -369,6 +379,9 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { + ", state = " + state); } if (BluetoothUtils.isConnected(state)) { updateFallbackActiveDeviceIfNeeded(); } } }; Loading Loading @@ -1056,7 +1069,9 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { List<BluetoothLeBroadcastReceiveState> sourceList = mServiceBroadcastAssistant.getAllSources( bluetoothDevice); return !sourceList.isEmpty(); return !sourceList.isEmpty() && sourceList.stream() .anyMatch(BluetoothUtils::isConnected); }) .collect(Collectors.toList()); if (devicesInSharing.isEmpty()) { Loading Loading @@ -1091,7 +1106,8 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { return; } int fallbackActiveGroupId = getFallbackActiveGroupId(); if (getGroupId(targetCachedDevice) == fallbackActiveGroupId) { if (fallbackActiveGroupId != BluetoothCsipSetCoordinator.GROUP_ID_INVALID && getGroupId(targetCachedDevice) == fallbackActiveGroupId) { Log.d( TAG, "Skip updateFallbackActiveDeviceIfNeeded, already is fallback: " Loading @@ -1101,12 +1117,6 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { targetCachedDevice.setActive(); } private boolean isDecryptedSource(BluetoothLeBroadcastReceiveState state) { return state.getPaSyncState() == BluetoothLeBroadcastReceiveState.PA_SYNC_STATE_SYNCHRONIZED && state.getBigEncryptionState() == BluetoothLeBroadcastReceiveState.BIG_ENCRYPTION_STATE_DECRYPTING; } private int getFallbackActiveGroupId() { return Settings.Secure.getInt( mContext.getContentResolver(), Loading Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/LocalBluetoothLeBroadcast.java +20 −10 Original line number Diff line number Diff line Loading @@ -292,7 +292,6 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { + ", sourceId = " + sourceId); } updateFallbackActiveDeviceIfNeeded(); } @Override Loading @@ -314,7 +313,18 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { public void onSourceAddFailed( @NonNull BluetoothDevice sink, @NonNull BluetoothLeBroadcastMetadata source, int reason) {} int reason) { if (DEBUG) { Log.d( TAG, "onSourceAddFailed(), sink = " + sink + ", reason = " + reason + ", source = " + source); } } @Override public void onSourceModified( Loading Loading @@ -369,6 +379,9 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { + ", state = " + state); } if (BluetoothUtils.isConnected(state)) { updateFallbackActiveDeviceIfNeeded(); } } }; Loading Loading @@ -1056,7 +1069,9 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { List<BluetoothLeBroadcastReceiveState> sourceList = mServiceBroadcastAssistant.getAllSources( bluetoothDevice); return !sourceList.isEmpty(); return !sourceList.isEmpty() && sourceList.stream() .anyMatch(BluetoothUtils::isConnected); }) .collect(Collectors.toList()); if (devicesInSharing.isEmpty()) { Loading Loading @@ -1091,7 +1106,8 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { return; } int fallbackActiveGroupId = getFallbackActiveGroupId(); if (getGroupId(targetCachedDevice) == fallbackActiveGroupId) { if (fallbackActiveGroupId != BluetoothCsipSetCoordinator.GROUP_ID_INVALID && getGroupId(targetCachedDevice) == fallbackActiveGroupId) { Log.d( TAG, "Skip updateFallbackActiveDeviceIfNeeded, already is fallback: " Loading @@ -1101,12 +1117,6 @@ public class LocalBluetoothLeBroadcast implements LocalBluetoothProfile { targetCachedDevice.setActive(); } private boolean isDecryptedSource(BluetoothLeBroadcastReceiveState state) { return state.getPaSyncState() == BluetoothLeBroadcastReceiveState.PA_SYNC_STATE_SYNCHRONIZED && state.getBigEncryptionState() == BluetoothLeBroadcastReceiveState.BIG_ENCRYPTION_STATE_DECRYPTING; } private int getFallbackActiveGroupId() { return Settings.Secure.getInt( mContext.getContentResolver(), Loading