Merge "Enable transfer to hearing aid routes." into rvc-dev am: 149dc814a6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11886081 Change-Id: I5f14215892a4982001b02b2a70b1c5be6c36d786
This commit is contained in:
@@ -52,6 +52,7 @@ class BluetoothRouteProvider {
|
|||||||
private static BluetoothRouteProvider sInstance;
|
private static BluetoothRouteProvider sInstance;
|
||||||
|
|
||||||
@SuppressWarnings("WeakerAccess") /* synthetic access */
|
@SuppressWarnings("WeakerAccess") /* synthetic access */
|
||||||
|
// Maps hardware address to BluetoothRouteInfo
|
||||||
final Map<String, BluetoothRouteInfo> mBluetoothRoutes = new HashMap<>();
|
final Map<String, BluetoothRouteInfo> mBluetoothRoutes = new HashMap<>();
|
||||||
@SuppressWarnings("WeakerAccess") /* synthetic access */
|
@SuppressWarnings("WeakerAccess") /* synthetic access */
|
||||||
BluetoothRouteInfo mSelectedRoute = null;
|
BluetoothRouteInfo mSelectedRoute = null;
|
||||||
@@ -127,9 +128,10 @@ class BluetoothRouteProvider {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
BluetoothRouteInfo btRouteInfo = mBluetoothRoutes.get(routeId);
|
BluetoothRouteInfo btRouteInfo = findBluetoothRouteWithRouteId(routeId);
|
||||||
|
|
||||||
if (btRouteInfo == null) {
|
if (btRouteInfo == null) {
|
||||||
Slog.w(TAG, "transferTo: unknown route id=" + routeId);
|
Slog.w(TAG, "transferTo: Unknown route. ID=" + routeId);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -194,6 +196,18 @@ class BluetoothRouteProvider {
|
|||||||
return routes;
|
return routes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BluetoothRouteInfo findBluetoothRouteWithRouteId(String routeId) {
|
||||||
|
if (routeId == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (BluetoothRouteInfo btRouteInfo : mBluetoothRoutes.values()) {
|
||||||
|
if (TextUtils.equals(btRouteInfo.route.getId(), routeId)) {
|
||||||
|
return btRouteInfo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the volume for {@link AudioManager#getDevicesForStream(int) devices}.
|
* Updates the volume for {@link AudioManager#getDevicesForStream(int) devices}.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user