Loading android/app/src/com/android/bluetooth/le_audio/LeAudioService.java +22 −15 Original line number Diff line number Diff line Loading @@ -651,9 +651,9 @@ public class LeAudioService extends ProfileService { return null; } private void updateActiveInDevice(BluetoothDevice device, Integer groupId, Integer oldActiveContexts, private boolean updateActiveInDevice(BluetoothDevice device, Integer groupId, Integer oldActiveContexts, Integer newActiveContexts) { Integer oldSupportedAudioDirections = getAudioDirectionsFromActiveContextsMap(oldActiveContexts); Integer newSupportedAudioDirections = Loading Loading @@ -690,13 +690,13 @@ public class LeAudioService extends ProfileService { if (device == null) { Log.d(TAG, " device is null."); return; return inActiveDeviceReplace; } if (inActiveDeviceReplace == false || (oldSupportedByDeviceInput == newSupportedByDeviceInput)) { Log.d(TAG, " Nothing to do."); return; return inActiveDeviceReplace; } /* Connect input: Loading @@ -706,9 +706,10 @@ public class LeAudioService extends ProfileService { mAudioManager.setBluetoothLeAudioInDeviceConnectionState( device, BluetoothProfile.STATE_CONNECTED); return inActiveDeviceReplace; } private void updateActiveOutDevice(BluetoothDevice device, Integer groupId, private boolean updateActiveOutDevice(BluetoothDevice device, Integer groupId, Integer oldActiveContexts, Integer newActiveContexts) { Integer oldSupportedAudioDirections = Loading Loading @@ -752,13 +753,13 @@ public class LeAudioService extends ProfileService { if (device == null) { Log.d(TAG, " device is null."); return; return outActiveDeviceReplace; } if (outActiveDeviceReplace == false || (oldSupportedByDeviceOutput == newSupportedByDeviceOutput)) { Log.d(TAG, " Nothing to do."); return; return outActiveDeviceReplace; } /* Connect output: Loading @@ -767,6 +768,7 @@ public class LeAudioService extends ProfileService { */ mAudioManager.setBluetoothLeAudioOutDeviceConnectionState( device, BluetoothProfile.STATE_CONNECTED, true); return outActiveDeviceReplace; } /** Loading @@ -782,15 +784,20 @@ public class LeAudioService extends ProfileService { if (isActive) device = getFirstDeviceFromGroup(groupId); boolean outReplaced = updateActiveOutDevice(device, groupId, oldActiveContexts, newActiveContexts); boolean inReplaced = updateActiveInDevice(device, groupId, oldActiveContexts, newActiveContexts); if (outReplaced || inReplaced) { Intent intent = new Intent(BluetoothLeAudio.ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mPreviousAudioOutDevice); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); sendBroadcast(intent, BLUETOOTH_CONNECT); } } /** * Set the active device group. Loading Loading
android/app/src/com/android/bluetooth/le_audio/LeAudioService.java +22 −15 Original line number Diff line number Diff line Loading @@ -651,9 +651,9 @@ public class LeAudioService extends ProfileService { return null; } private void updateActiveInDevice(BluetoothDevice device, Integer groupId, Integer oldActiveContexts, private boolean updateActiveInDevice(BluetoothDevice device, Integer groupId, Integer oldActiveContexts, Integer newActiveContexts) { Integer oldSupportedAudioDirections = getAudioDirectionsFromActiveContextsMap(oldActiveContexts); Integer newSupportedAudioDirections = Loading Loading @@ -690,13 +690,13 @@ public class LeAudioService extends ProfileService { if (device == null) { Log.d(TAG, " device is null."); return; return inActiveDeviceReplace; } if (inActiveDeviceReplace == false || (oldSupportedByDeviceInput == newSupportedByDeviceInput)) { Log.d(TAG, " Nothing to do."); return; return inActiveDeviceReplace; } /* Connect input: Loading @@ -706,9 +706,10 @@ public class LeAudioService extends ProfileService { mAudioManager.setBluetoothLeAudioInDeviceConnectionState( device, BluetoothProfile.STATE_CONNECTED); return inActiveDeviceReplace; } private void updateActiveOutDevice(BluetoothDevice device, Integer groupId, private boolean updateActiveOutDevice(BluetoothDevice device, Integer groupId, Integer oldActiveContexts, Integer newActiveContexts) { Integer oldSupportedAudioDirections = Loading Loading @@ -752,13 +753,13 @@ public class LeAudioService extends ProfileService { if (device == null) { Log.d(TAG, " device is null."); return; return outActiveDeviceReplace; } if (outActiveDeviceReplace == false || (oldSupportedByDeviceOutput == newSupportedByDeviceOutput)) { Log.d(TAG, " Nothing to do."); return; return outActiveDeviceReplace; } /* Connect output: Loading @@ -767,6 +768,7 @@ public class LeAudioService extends ProfileService { */ mAudioManager.setBluetoothLeAudioOutDeviceConnectionState( device, BluetoothProfile.STATE_CONNECTED, true); return outActiveDeviceReplace; } /** Loading @@ -782,15 +784,20 @@ public class LeAudioService extends ProfileService { if (isActive) device = getFirstDeviceFromGroup(groupId); boolean outReplaced = updateActiveOutDevice(device, groupId, oldActiveContexts, newActiveContexts); boolean inReplaced = updateActiveInDevice(device, groupId, oldActiveContexts, newActiveContexts); if (outReplaced || inReplaced) { Intent intent = new Intent(BluetoothLeAudio.ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, mPreviousAudioOutDevice); intent.addFlags(Intent.FLAG_RECEIVER_REGISTERED_ONLY_BEFORE_BOOT | Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND); sendBroadcast(intent, BLUETOOTH_CONNECT); } } /** * Set the active device group. Loading