Merge "Update the cache of a2dp config before writing config." into main
diff --git a/src/com/android/settings/development/bluetooth/AbstractBluetoothDialogPreferenceController.java b/src/com/android/settings/development/bluetooth/AbstractBluetoothDialogPreferenceController.java
index 04dfc79..ac42ee3 100644
--- a/src/com/android/settings/development/bluetooth/AbstractBluetoothDialogPreferenceController.java
+++ b/src/com/android/settings/development/bluetooth/AbstractBluetoothDialogPreferenceController.java
@@ -85,6 +85,8 @@
         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();