summaryrefslogtreecommitdiff
path: root/media/tests
diff options
context:
space:
mode:
author Treehugger Robot <android-test-infra-autosubmit@system.gserviceaccount.com> 2024-11-07 18:56:14 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-11-07 18:56:14 +0000
commitb1221ae0815610b0575a2b7e3878aba70b55f4ec (patch)
tree7d3d13cd7d8b90d666896aa61553f652fbd8d15f /media/tests
parent6cbb391b1027af5d3b0b29a08f5f2da7bfca3c9b (diff)
parente688f6306105f40bf61f776c8bb7300a15c23f26 (diff)
Merge "Add MULTICHANNEL_GROUP to AidlConversion" into main
Diffstat (limited to 'media/tests')
-rw-r--r--media/tests/aidltests/src/com/android/media/AidlConversionUnitTests.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/media/tests/aidltests/src/com/android/media/AidlConversionUnitTests.java b/media/tests/aidltests/src/com/android/media/AidlConversionUnitTests.java
index 09573909c288..d9a1221e529c 100644
--- a/media/tests/aidltests/src/com/android/media/AidlConversionUnitTests.java
+++ b/media/tests/aidltests/src/com/android/media/AidlConversionUnitTests.java
@@ -18,6 +18,7 @@ package android.media.audio.common;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertThrows;
import static org.junit.Assert.assertTrue;
@@ -504,6 +505,27 @@ public final class AidlConversionUnitTests {
assertEquals(AudioDeviceType.OUT_DEVICE, port.ext.getDevice().device.type.type);
}
+ @Test
+ public void testAudioDeviceDescriptionConversion() {
+ for (int nativeDeviceType : AudioSystem.DEVICE_OUT_ALL_SET) {
+ assertNotEquals(
+ AidlConversion.api2aidl_NativeType_AudioDeviceDescription(nativeDeviceType)
+ .type,
+ AudioDeviceType.NONE);
+ }
+
+ for (int nativeDeviceType : AudioSystem.DEVICE_IN_ALL_SET) {
+ if (nativeDeviceType == AudioSystem.DEVICE_IN_COMMUNICATION
+ || nativeDeviceType == AudioSystem.DEVICE_IN_AMBIENT) {
+ continue;
+ }
+ assertNotEquals(
+ AidlConversion.api2aidl_NativeType_AudioDeviceDescription(nativeDeviceType)
+ .type,
+ AudioDeviceType.NONE);
+ }
+ }
+
private static AudioFormatDescription createPcm16FormatAidl() {
final AudioFormatDescription aidl = new AudioFormatDescription();
aidl.type = AudioFormatType.PCM;