AudioDeviceInventory: do not use immutable device lists

Do not add immutable AudioDeviceAttributes lists to strategy
and capture preset preferrences maps as these lists can be
modified after creation.

Bug: 307161477
Test: repro steps in bug.
Change-Id: I746ff492118bcae4a3ff46647d1ed1f9a63e7ba4
diff --git a/services/core/java/com/android/server/audio/AudioDeviceInventory.java b/services/core/java/com/android/server/audio/AudioDeviceInventory.java
index e503f1f..bb16ed6 100644
--- a/services/core/java/com/android/server/audio/AudioDeviceInventory.java
+++ b/services/core/java/com/android/server/audio/AudioDeviceInventory.java
@@ -1384,7 +1384,7 @@
             } else {
                 status = addOp.deviceRoleAction(useCase, role, devices);
                 if (status == AudioSystem.SUCCESS) {
-                    rolesMap.put(key, devices);
+                    rolesMap.put(key, new ArrayList(devices));
                 }
             }
             return status;