Loading flags/telecom_bluetoothdevicemanager_flags.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -8,3 +8,10 @@ flag { description: "Fix for Log.wtf in the BinderProxy" bug: "333417369" } # OWNER=huiwang TARGET=25Q1 flag { name: "keep_bt_devices_cache_updated" namespace: "telecom" description: "Fix the devices cache issue of BluetoothDeviceManager" bug: "380320985" } src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java +8 −2 Original line number Diff line number Diff line Loading @@ -519,10 +519,13 @@ public class BluetoothDeviceManager { Log.i(this, "onDeviceConnected: Adding device with address: %s and devicetype=%s", device, getDeviceTypeString(deviceType)); targetDeviceMap.put(device.getAddress(), device); if (!mFeatureFlags.keepBtDevicesCacheUpdated() || !mFeatureFlags.useRefactoredAudioRouteSwitching()) { mBluetoothRouteManager.onDeviceAdded(device.getAddress()); } } } } void clearDeviceFromDeviceMaps(String deviceAddress) { for (LinkedHashMap<String, BluetoothDevice> deviceMap : mDevicesByAddressMaps) { Loading Loading @@ -551,10 +554,13 @@ public class BluetoothDeviceManager { Log.i(this, "onDeviceDisconnected: Removing device with address: %s, devicetype=%s", device, getDeviceTypeString(deviceType)); targetDeviceMap.remove(device.getAddress()); if (!mFeatureFlags.keepBtDevicesCacheUpdated() || !mFeatureFlags.useRefactoredAudioRouteSwitching()) { mBluetoothRouteManager.onDeviceLost(device.getAddress()); } } } } public void disconnectAudio() { if (mFeatureFlags.callAudioCommunicationDeviceRefactor()) { Loading src/com/android/server/telecom/bluetooth/BluetoothStateReceiver.java +6 −0 Original line number Diff line number Diff line Loading @@ -211,6 +211,9 @@ public class BluetoothStateReceiver extends BroadcastReceiver { if (mFeatureFlags.useRefactoredAudioRouteSwitching()) { mCallAudioRouteAdapter.sendMessageWithSessionInfo(BT_DEVICE_ADDED, audioRouteType, device); if (mFeatureFlags.keepBtDevicesCacheUpdated()) { mBluetoothDeviceManager.onDeviceConnected(device, deviceType); } } else { mBluetoothDeviceManager.onDeviceConnected(device, deviceType); } Loading @@ -219,6 +222,9 @@ public class BluetoothStateReceiver extends BroadcastReceiver { if (mFeatureFlags.useRefactoredAudioRouteSwitching()) { mCallAudioRouteAdapter.sendMessageWithSessionInfo(BT_DEVICE_REMOVED, audioRouteType, device); if (mFeatureFlags.keepBtDevicesCacheUpdated()) { mBluetoothDeviceManager.onDeviceDisconnected(device, deviceType); } } else { mBluetoothDeviceManager.onDeviceDisconnected(device, deviceType); } Loading Loading
flags/telecom_bluetoothdevicemanager_flags.aconfig +7 −0 Original line number Diff line number Diff line Loading @@ -8,3 +8,10 @@ flag { description: "Fix for Log.wtf in the BinderProxy" bug: "333417369" } # OWNER=huiwang TARGET=25Q1 flag { name: "keep_bt_devices_cache_updated" namespace: "telecom" description: "Fix the devices cache issue of BluetoothDeviceManager" bug: "380320985" }
src/com/android/server/telecom/bluetooth/BluetoothDeviceManager.java +8 −2 Original line number Diff line number Diff line Loading @@ -519,10 +519,13 @@ public class BluetoothDeviceManager { Log.i(this, "onDeviceConnected: Adding device with address: %s and devicetype=%s", device, getDeviceTypeString(deviceType)); targetDeviceMap.put(device.getAddress(), device); if (!mFeatureFlags.keepBtDevicesCacheUpdated() || !mFeatureFlags.useRefactoredAudioRouteSwitching()) { mBluetoothRouteManager.onDeviceAdded(device.getAddress()); } } } } void clearDeviceFromDeviceMaps(String deviceAddress) { for (LinkedHashMap<String, BluetoothDevice> deviceMap : mDevicesByAddressMaps) { Loading Loading @@ -551,10 +554,13 @@ public class BluetoothDeviceManager { Log.i(this, "onDeviceDisconnected: Removing device with address: %s, devicetype=%s", device, getDeviceTypeString(deviceType)); targetDeviceMap.remove(device.getAddress()); if (!mFeatureFlags.keepBtDevicesCacheUpdated() || !mFeatureFlags.useRefactoredAudioRouteSwitching()) { mBluetoothRouteManager.onDeviceLost(device.getAddress()); } } } } public void disconnectAudio() { if (mFeatureFlags.callAudioCommunicationDeviceRefactor()) { Loading
src/com/android/server/telecom/bluetooth/BluetoothStateReceiver.java +6 −0 Original line number Diff line number Diff line Loading @@ -211,6 +211,9 @@ public class BluetoothStateReceiver extends BroadcastReceiver { if (mFeatureFlags.useRefactoredAudioRouteSwitching()) { mCallAudioRouteAdapter.sendMessageWithSessionInfo(BT_DEVICE_ADDED, audioRouteType, device); if (mFeatureFlags.keepBtDevicesCacheUpdated()) { mBluetoothDeviceManager.onDeviceConnected(device, deviceType); } } else { mBluetoothDeviceManager.onDeviceConnected(device, deviceType); } Loading @@ -219,6 +222,9 @@ public class BluetoothStateReceiver extends BroadcastReceiver { if (mFeatureFlags.useRefactoredAudioRouteSwitching()) { mCallAudioRouteAdapter.sendMessageWithSessionInfo(BT_DEVICE_REMOVED, audioRouteType, device); if (mFeatureFlags.keepBtDevicesCacheUpdated()) { mBluetoothDeviceManager.onDeviceDisconnected(device, deviceType); } } else { mBluetoothDeviceManager.onDeviceDisconnected(device, deviceType); } Loading