From 2eb14f53bbb2ebaa8f9857f84a656213288b25a7 Mon Sep 17 00:00:00 2001 From: "alisa.li" Date: Fri, 15 Nov 2024 15:20:33 +0800 Subject: [PATCH] Update the cache of a2dp config before writing config. The created config based on mBluetoothA2dpConfigStore is invalid, so we need to update the cache before writing config. Bug: 3177357791 Test: manual Change-Id: I47774f035509f0cb533209e4e31e7477d5b8e516 --- .../bluetooth/AbstractBluetoothDialogPreferenceController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/com/android/settings/development/bluetooth/AbstractBluetoothDialogPreferenceController.java b/src/com/android/settings/development/bluetooth/AbstractBluetoothDialogPreferenceController.java index c9cc2b79beb..840d2a8a38a 100644 --- a/src/com/android/settings/development/bluetooth/AbstractBluetoothDialogPreferenceController.java +++ b/src/com/android/settings/development/bluetooth/AbstractBluetoothDialogPreferenceController.java @@ -86,6 +86,8 @@ public abstract class AbstractBluetoothDialogPreferenceController extends if (bluetoothA2dp == null) { return; } + // update the cache of a2dp config(mBluetoothA2dpConfigStore) before writing config. + initConfigStore(); writeConfigurationValues(index); final BluetoothCodecConfig codecConfig = mBluetoothA2dpConfigStore.createCodecConfig(); BluetoothDevice activeDevice = getA2dpActiveDevice();