Merge "audio: Fix possible NullPointerException when DEBUG is true" am: 4d7383001f am: 18b3180f5e

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1814782

Change-Id: I1542f0660b984382a3876e70c642e2bb22800f3f
This commit is contained in:
Treehugger Robot
2022-01-21 15:10:48 +00:00
committed by Automerger Merge Worker

View File

@@ -344,10 +344,19 @@ class BluetoothRouteProvider {
}
private void addActiveRoute(BluetoothRouteInfo btRoute) {
if (btRoute == null) {
if (DEBUG) {
Log.d(TAG, " btRoute is null");
}
return;
}
if (DEBUG) {
Log.d(TAG, "Adding active route: " + btRoute.route);
}
if (btRoute == null || mActiveRoutes.contains(btRoute)) {
if (mActiveRoutes.contains(btRoute)) {
if (DEBUG) {
Log.d(TAG, " btRoute is already added.");
}
return;
}
setRouteConnectionState(btRoute, STATE_CONNECTED);