Merge "[Bugfix]audio:fix NPE when buildBluetoothRoutes" am: b801d3549f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1519791 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I849ac5c7d88cbde748881d4aa85f5bacf9345d91
This commit is contained in:
@@ -165,11 +165,13 @@ class BluetoothRouteProvider {
|
||||
|
||||
private void buildBluetoothRoutes() {
|
||||
mBluetoothRoutes.clear();
|
||||
for (BluetoothDevice device : mBluetoothAdapter.getBondedDevices()) {
|
||||
if (device.isConnected()) {
|
||||
BluetoothRouteInfo newBtRoute = createBluetoothRoute(device);
|
||||
if (newBtRoute.connectedProfiles.size() > 0) {
|
||||
mBluetoothRoutes.put(device.getAddress(), newBtRoute);
|
||||
if (mBluetoothAdapter.getBondedDevices() != null) {
|
||||
for (BluetoothDevice device : mBluetoothAdapter.getBondedDevices()) {
|
||||
if (device.isConnected()) {
|
||||
BluetoothRouteInfo newBtRoute = createBluetoothRoute(device);
|
||||
if (newBtRoute.connectedProfiles.size() > 0) {
|
||||
mBluetoothRoutes.put(device.getAddress(), newBtRoute);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user