Extend BluetoothRouteController interface with selectRoute method

Bug: b/255495104
Test: N/A
Change-Id: I9fb0c9842c6033c7dcd3176e88b7d3e771ed2fa2
This commit is contained in:
Alex Dadukin
2023-02-23 11:42:17 +00:00
parent cef25ef732
commit ae7dae29cc
3 changed files with 29 additions and 0 deletions

View File

@@ -142,6 +142,12 @@ class AudioPoliciesBluetoothRouteController implements BluetoothRouteController
mContext.unregisterReceiver(mDeviceStateChangedReceiver);
}
@Override
public boolean selectRoute(String deviceAddress) {
// Temporary no-op.
return false;
}
/**
* Transfers to a given bluetooth route.
* The dedicated BT device with the route would be activated.

View File

@@ -68,6 +68,17 @@ import java.util.Objects;
*/
void stop();
/**
* Selects the route with the given {@code deviceAddress}.
*
* @param deviceAddress The physical address of the device to select. May be null to unselect
* the currently selected device.
* @return Whether the selection succeeds. If the selection fails, the state of the instance
* remains unaltered.
*/
boolean selectRoute(@Nullable String deviceAddress);
/**
* Transfers Bluetooth output to the given route.
*
@@ -144,6 +155,12 @@ import java.util.Objects;
// no op
}
@Override
public boolean selectRoute(String deviceAddress) {
// no op
return false;
}
@Override
public void transferTo(String routeId) {
// no op

View File

@@ -132,6 +132,12 @@ class LegacyBluetoothRouteController implements BluetoothRouteController {
mContext.unregisterReceiver(mDeviceStateChangedReceiver);
}
@Override
public boolean selectRoute(String deviceAddress) {
// No-op as the class decides if a route is selected based on Bluetooth events.
return false;
}
/**
* Transfers to a given bluetooth route.
* The dedicated BT device with the route would be activated.