Loading media/java/android/media/audio/common/AidlConversion.java +4 −0 Original line number Diff line number Diff line Loading @@ -705,6 +705,10 @@ public class AidlConversion { aidl.type = AudioDeviceType.OUT_BROADCAST; aidl.connection = AudioDeviceDescription.CONNECTION_BT_LE; break; case AudioSystem.DEVICE_OUT_MULTICHANNEL_GROUP: aidl.type = AudioDeviceType.OUT_MULTICHANNEL_GROUP; aidl.connection = AudioDeviceDescription.CONNECTION_VIRTUAL; break; case AudioSystem.DEVICE_IN_BUILTIN_MIC: aidl.type = AudioDeviceType.IN_MICROPHONE; break; Loading media/tests/aidltests/src/com/android/media/AidlConversionUnitTests.java +22 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading Loading
media/java/android/media/audio/common/AidlConversion.java +4 −0 Original line number Diff line number Diff line Loading @@ -705,6 +705,10 @@ public class AidlConversion { aidl.type = AudioDeviceType.OUT_BROADCAST; aidl.connection = AudioDeviceDescription.CONNECTION_BT_LE; break; case AudioSystem.DEVICE_OUT_MULTICHANNEL_GROUP: aidl.type = AudioDeviceType.OUT_MULTICHANNEL_GROUP; aidl.connection = AudioDeviceDescription.CONNECTION_VIRTUAL; break; case AudioSystem.DEVICE_IN_BUILTIN_MIC: aidl.type = AudioDeviceType.IN_MICROPHONE; break; Loading
media/tests/aidltests/src/com/android/media/AidlConversionUnitTests.java +22 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading