summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author TreeHugger Robot <treehugger-gerrit@google.com> 2021-12-03 09:03:45 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-12-03 09:03:45 +0000
commitc24976db3fa2ff4a7ee98243ea7f56582c1ca5ec (patch)
tree6d75f8010eb0bdf687b2f656123462e2d5356637
parent7834387feba83c6e9c26d142ea52d671f934fe07 (diff)
parent81f71862ba677f84f6ca68179386ee56d0b2a42b (diff)
Merge "SpatializerHelper: fix routing check in canBeSpatialized" into sc-v2-dev
-rw-r--r--services/core/java/com/android/server/audio/SpatializerHelper.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/audio/SpatializerHelper.java b/services/core/java/com/android/server/audio/SpatializerHelper.java
index 6a26bea6f8f0..b47ea4f7a4b8 100644
--- a/services/core/java/com/android/server/audio/SpatializerHelper.java
+++ b/services/core/java/com/android/server/audio/SpatializerHelper.java
@@ -551,9 +551,9 @@ public class SpatializerHelper {
logd("canBeSpatialized false due to usage:" + attributes.getUsage());
return false;
}
- AudioDeviceAttributes[] devices =
- // going through adapter to take advantage of routing cache
- (AudioDeviceAttributes[]) mASA.getDevicesForAttributes(attributes).toArray();
+ AudioDeviceAttributes[] devices = new AudioDeviceAttributes[1];
+ // going through adapter to take advantage of routing cache
+ mASA.getDevicesForAttributes(attributes).toArray(devices);
final boolean able = AudioSystem.canBeSpatialized(attributes, format, devices);
logd("canBeSpatialized returning " + able);
return able;