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:
@@ -185,14 +185,6 @@ public abstract class BluetoothDeviceUpdater implements BluetoothCallback {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActiveDeviceChanged(CachedBluetoothDevice activeDevice, int bluetoothProfile) {
|
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user