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.

Also:
 * Added a new CachedBluetoothDeviceManagerTest.java unit test
 * Added a new method CachedBluetoothDevice.isActiveDevice()
   for testing.

Bug: 72316092
Test: Manual - two headsets and switching the active device
      Unit tests - "make RunSettingsLibRoboTests -j 40"
Change-Id: Ic3fbf667c66ed2de8e5c3352bc1ffd829a9052cf
diff --git a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java
index 3cda9c9..784c714 100755
--- a/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java
+++ b/packages/SettingsLib/src/com/android/settingslib/bluetooth/BluetoothEventManager.java
@@ -444,6 +444,7 @@
 
     private void dispatchActiveDeviceChanged(CachedBluetoothDevice activeDevice,
                                              int bluetoothProfile) {
+        mDeviceManager.onActiveDeviceChanged(activeDevice, bluetoothProfile);
         synchronized (mCallbacks) {
             for (BluetoothCallback callback : mCallbacks) {
                 callback.onActiveDeviceChanged(activeDevice, bluetoothProfile);