Update the Bluetooth Active Device state in the Device Manager

The Bluetooth Active Device state should be updated for all
CachedBluetoothDevice entries.
This should be done inside CachedBluetoothDeviceManager in SettingsLib
instead of BluetoothDeviceUpdater in the Settings app.

Bug: 72316092
Test: Manual - two headsets and switching the active device
Change-Id: If379bb0853dcd78385430cf14192e9adfae4ecd0
This commit is contained in:
Pavlin Radoslavov
2018-02-06 13:58:20 -08:00
parent a42bfa83df
commit c7715a5519

View File

@@ -185,14 +185,6 @@ public abstract class BluetoothDeviceUpdater implements BluetoothCallback {
@Override
public void onActiveDeviceChanged(CachedBluetoothDevice activeDevice, int bluetoothProfile) {
Collection<CachedBluetoothDevice> cachedDevices =
mLocalManager.getCachedDeviceManager().getCachedDevicesCopy();
// TODO: The state update of the Cached Bluetooth Devices should be
// moved to the device manager: b/72316092
for (CachedBluetoothDevice cachedBluetoothDevice : cachedDevices) {
boolean isActive = Objects.equals(cachedBluetoothDevice, activeDevice);
cachedBluetoothDevice.setActiveDevice(isActive, bluetoothProfile);
}
}
/**