Loading src/com/android/settings/connecteddevice/audiosharing/AudioSharingUtils.java +9 −11 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import java.util.stream.Collectors; public class AudioSharingUtils { private static final String TAG = "AudioSharingUtils"; private static final boolean DEBUG = BluetoothUtils.D; /** * Fetch {@link CachedBluetoothDevice}s connected to the broadcast assistant. The devices are Loading Loading @@ -77,6 +78,9 @@ public class AudioSharingUtils { } groupedDevices.get(groupId).add(cachedDevice); } if (DEBUG) { Log.d(TAG, "fetchConnectedDevicesByGroupId: " + groupedDevices); } return groupedDevices; } Loading Loading @@ -221,16 +225,7 @@ public class AudioSharingUtils { * @return Whether the device is an active le audio device. */ public static boolean isActiveLeAudioDevice(CachedBluetoothDevice cachedDevice) { if (BluetoothUtils.isActiveLeAudioDevice(cachedDevice)) { return true; } // Return true if member device is an active le audio device. for (CachedBluetoothDevice device : cachedDevice.getMemberDevice()) { if (BluetoothUtils.isActiveLeAudioDevice(device)) { return true; } } return false; return BluetoothUtils.isActiveLeAudioDevice(cachedDevice); } /** Loading Loading @@ -296,7 +291,10 @@ public class AudioSharingUtils { } } if (targetDevice != null && !isActiveLeAudioDevice(targetDevice)) { Log.d(TAG, "Set active device: " + targetDevice.getDevice().getAnonymizedAddress()); Log.d( TAG, "updateActiveDeviceIfNeeded, set active device: " + targetDevice.getDevice().getAnonymizedAddress()); targetDevice.setActive(); } } Loading Loading
src/com/android/settings/connecteddevice/audiosharing/AudioSharingUtils.java +9 −11 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ import java.util.stream.Collectors; public class AudioSharingUtils { private static final String TAG = "AudioSharingUtils"; private static final boolean DEBUG = BluetoothUtils.D; /** * Fetch {@link CachedBluetoothDevice}s connected to the broadcast assistant. The devices are Loading Loading @@ -77,6 +78,9 @@ public class AudioSharingUtils { } groupedDevices.get(groupId).add(cachedDevice); } if (DEBUG) { Log.d(TAG, "fetchConnectedDevicesByGroupId: " + groupedDevices); } return groupedDevices; } Loading Loading @@ -221,16 +225,7 @@ public class AudioSharingUtils { * @return Whether the device is an active le audio device. */ public static boolean isActiveLeAudioDevice(CachedBluetoothDevice cachedDevice) { if (BluetoothUtils.isActiveLeAudioDevice(cachedDevice)) { return true; } // Return true if member device is an active le audio device. for (CachedBluetoothDevice device : cachedDevice.getMemberDevice()) { if (BluetoothUtils.isActiveLeAudioDevice(device)) { return true; } } return false; return BluetoothUtils.isActiveLeAudioDevice(cachedDevice); } /** Loading Loading @@ -296,7 +291,10 @@ public class AudioSharingUtils { } } if (targetDevice != null && !isActiveLeAudioDevice(targetDevice)) { Log.d(TAG, "Set active device: " + targetDevice.getDevice().getAnonymizedAddress()); Log.d( TAG, "updateActiveDeviceIfNeeded, set active device: " + targetDevice.getDevice().getAnonymizedAddress()); targetDevice.setActive(); } } Loading