From 92da3a16696b1eeb3bfa3d419f186196eebfdf50 Mon Sep 17 00:00:00 2001 From: Ytai Ben-Tsvi Date: Wed, 10 Mar 2021 15:03:45 -0800 Subject: [PATCH] Extract stable AIDL modules These types are intended to be shared with HAL interfaces and are moved to a more generic directory/namespace and a stable build target. There is no semantic change here. Test: m Change-Id: I4cedbab7e87d4895994ce8d26bd7e89f059a0103 --- .../hardware/soundtrigger/ConversionUtil.java | 30 ++--- .../hardware/soundtrigger/SoundTrigger.java | 2 +- .../soundtrigger/SoundTriggerModule.java | 8 +- media/Android.bp | 113 ++++++++++++------ .../media/audio/common/AudioChannelMask.aidl | 76 ++++++------ .../media/audio/common/AudioConfig.aidl | 3 +- .../media/audio/common/AudioFormat.aidl | 1 + .../media/audio/common/AudioOffloadInfo.aidl | 7 +- .../media/audio/common/AudioStreamType.aidl | 6 + .../media/audio/common/AudioUsage.aidl | 6 + .../AudioCapabilities.aidl | 3 +- .../ConfidenceLevel.aidl | 3 +- .../ModelParameter.aidl | 3 +- .../ModelParameterRange.aidl | 3 +- .../Phrase.aidl | 3 +- .../PhraseRecognitionEvent.aidl | 7 +- .../PhraseRecognitionExtra.aidl | 15 ++- .../PhraseSoundModel.aidl | 7 +- .../Properties.aidl} | 7 +- .../RecognitionConfig.aidl | 7 +- .../RecognitionEvent.aidl | 11 +- .../RecognitionMode.aidl | 3 +- .../RecognitionStatus.aidl | 8 +- .../SoundModel.aidl | 7 +- .../SoundModelType.aidl | 10 +- .../Status.aidl | 8 +- .../ISoundTriggerCallback.aidl | 4 +- .../ISoundTriggerModule.aidl | 10 +- .../SoundTriggerModuleDescriptor.aidl | 4 +- .../media/audio/common/AudioChannelMask.aidl | 111 +++++++++++++++++ .../media/audio/common/AudioConfig.aidl | 44 +++++++ .../media/audio/common/AudioFormat.aidl | 109 +++++++++++++++++ .../media/audio/common/AudioOffloadInfo.aidl | 50 ++++++++ .../media/audio/common/AudioStreamType.aidl | 53 ++++++++ .../media/audio/common/AudioUsage.aidl | 53 ++++++++ .../media/soundtrigger/AudioCapabilities.aidl | 40 +++++++ .../media/soundtrigger/ConfidenceLevel.aidl | 40 +++++++ .../media/soundtrigger/ModelParameter.aidl | 40 +++++++ .../soundtrigger/ModelParameterRange.aidl | 40 +++++++ .../android/media/soundtrigger/Phrase.aidl | 43 +++++++ .../soundtrigger/PhraseRecognitionEvent.aidl | 40 +++++++ .../soundtrigger/PhraseRecognitionExtra.aidl | 42 +++++++ .../media/soundtrigger/PhraseSoundModel.aidl | 40 +++++++ .../media/soundtrigger/Properties.aidl | 53 ++++++++ .../media/soundtrigger/RecognitionConfig.aidl | 42 +++++++ .../media/soundtrigger/RecognitionEvent.aidl | 47 ++++++++ .../media/soundtrigger/RecognitionMode.aidl | 42 +++++++ .../media/soundtrigger/RecognitionStatus.aidl | 43 +++++++ .../media/soundtrigger/SoundModel.aidl | 43 +++++++ .../media/soundtrigger/SoundModelType.aidl | 41 +++++++ .../android/media/soundtrigger/Status.aidl | 45 +++++++ .../ConversionUtil.java | 41 ++++--- .../ISoundTriggerHw2.java | 2 +- .../SoundTriggerHw2Compat.java | 4 +- ...undTriggerHw2ConcurrentCaptureHandler.java | 6 +- .../SoundTriggerHw2Enforcer.java | 4 +- .../SoundTriggerHw2MaxModelLimiter.java | 2 +- .../SoundTriggerMiddlewareImpl.java | 4 +- .../SoundTriggerMiddlewareLogging.java | 12 +- .../SoundTriggerMiddlewarePermission.java | 14 +-- .../SoundTriggerMiddlewareService.java | 8 +- .../SoundTriggerMiddlewareValidation.java | 22 ++-- .../SoundTriggerModule.java | 27 ++--- .../ValidationUtil.java | 21 ++-- .../SoundHw2CompatTest.java | 2 +- .../SoundTriggerMiddlewareImplTest.java | 22 ++-- .../soundtrigger_middleware/TestUtil.java | 26 ++-- 67 files changed, 1440 insertions(+), 253 deletions(-) rename media/aidl/android/media/{soundtrigger_middleware => soundtrigger}/AudioCapabilities.aidl (94%) rename media/aidl/android/media/{soundtrigger_middleware => soundtrigger}/ConfidenceLevel.aidl (95%) rename media/aidl/android/media/{soundtrigger_middleware => soundtrigger}/ModelParameter.aidl (95%) rename media/aidl/android/media/{soundtrigger_middleware => soundtrigger}/ModelParameterRange.aidl (94%) rename media/aidl/android/media/{soundtrigger_middleware => soundtrigger}/Phrase.aidl (95%) rename media/aidl/android/media/{soundtrigger_middleware => soundtrigger}/PhraseRecognitionEvent.aidl (84%) rename media/aidl/android/media/{soundtrigger_middleware => soundtrigger}/PhraseRecognitionExtra.aidl (71%) rename media/aidl/android/media/{soundtrigger_middleware => soundtrigger}/PhraseSoundModel.aidl (86%) rename media/aidl/android/media/{soundtrigger_middleware/SoundTriggerModuleProperties.aidl => soundtrigger/Properties.aidl} (93%) rename media/aidl/android/media/{soundtrigger_middleware => soundtrigger}/RecognitionConfig.aidl (85%) rename media/aidl/android/media/{soundtrigger_middleware => soundtrigger}/RecognitionEvent.aidl (87%) rename media/aidl/android/media/{soundtrigger_middleware => soundtrigger}/RecognitionMode.aidl (95%) rename media/aidl/android/media/{soundtrigger_middleware => soundtrigger}/RecognitionStatus.aidl (81%) rename media/aidl/android/media/{soundtrigger_middleware => soundtrigger}/SoundModel.aidl (88%) rename media/aidl/android/media/{soundtrigger_middleware => soundtrigger}/SoundModelType.aidl (75%) rename media/aidl/android/media/{soundtrigger_middleware => soundtrigger}/Status.aidl (83%) create mode 100644 media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioChannelMask.aidl create mode 100644 media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioConfig.aidl create mode 100644 media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioFormat.aidl create mode 100644 media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioOffloadInfo.aidl create mode 100644 media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioStreamType.aidl create mode 100644 media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioUsage.aidl create mode 100644 media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/AudioCapabilities.aidl create mode 100644 media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/ConfidenceLevel.aidl create mode 100644 media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/ModelParameter.aidl create mode 100644 media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/ModelParameterRange.aidl create mode 100644 media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/Phrase.aidl create mode 100644 media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/PhraseRecognitionEvent.aidl create mode 100644 media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/PhraseRecognitionExtra.aidl create mode 100644 media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/PhraseSoundModel.aidl create mode 100644 media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/Properties.aidl create mode 100644 media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/RecognitionConfig.aidl create mode 100644 media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/RecognitionEvent.aidl create mode 100644 media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/RecognitionMode.aidl create mode 100644 media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/RecognitionStatus.aidl create mode 100644 media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/SoundModel.aidl create mode 100644 media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/SoundModelType.aidl create mode 100644 media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/Status.aidl diff --git a/core/java/android/hardware/soundtrigger/ConversionUtil.java b/core/java/android/hardware/soundtrigger/ConversionUtil.java index a5c9a7fafbd86..39efb6a3f2050 100644 --- a/core/java/android/hardware/soundtrigger/ConversionUtil.java +++ b/core/java/android/hardware/soundtrigger/ConversionUtil.java @@ -19,19 +19,19 @@ package android.hardware.soundtrigger; import android.annotation.Nullable; import android.media.AudioFormat; import android.media.audio.common.AudioConfig; -import android.media.soundtrigger_middleware.AudioCapabilities; -import android.media.soundtrigger_middleware.ConfidenceLevel; -import android.media.soundtrigger_middleware.ModelParameterRange; -import android.media.soundtrigger_middleware.Phrase; -import android.media.soundtrigger_middleware.PhraseRecognitionEvent; -import android.media.soundtrigger_middleware.PhraseRecognitionExtra; -import android.media.soundtrigger_middleware.PhraseSoundModel; -import android.media.soundtrigger_middleware.RecognitionConfig; -import android.media.soundtrigger_middleware.RecognitionEvent; -import android.media.soundtrigger_middleware.RecognitionMode; -import android.media.soundtrigger_middleware.SoundModel; +import android.media.soundtrigger.AudioCapabilities; +import android.media.soundtrigger.ConfidenceLevel; +import android.media.soundtrigger.ModelParameterRange; +import android.media.soundtrigger.Phrase; +import android.media.soundtrigger.PhraseRecognitionEvent; +import android.media.soundtrigger.PhraseRecognitionExtra; +import android.media.soundtrigger.PhraseSoundModel; +import android.media.soundtrigger.Properties; +import android.media.soundtrigger.RecognitionConfig; +import android.media.soundtrigger.RecognitionEvent; +import android.media.soundtrigger.RecognitionMode; +import android.media.soundtrigger.SoundModel; import android.media.soundtrigger_middleware.SoundTriggerModuleDescriptor; -import android.media.soundtrigger_middleware.SoundTriggerModuleProperties; import android.os.ParcelFileDescriptor; import android.os.SharedMemory; @@ -43,7 +43,7 @@ import java.util.UUID; class ConversionUtil { public static SoundTrigger.ModuleProperties aidl2apiModuleDescriptor( SoundTriggerModuleDescriptor aidlDesc) { - SoundTriggerModuleProperties properties = aidlDesc.properties; + Properties properties = aidlDesc.properties; return new SoundTrigger.ModuleProperties( aidlDesc.handle, properties.implementor, @@ -328,9 +328,9 @@ class ConversionUtil { public static int api2aidlModelParameter(int apiParam) { switch (apiParam) { case ModelParams.THRESHOLD_FACTOR: - return android.media.soundtrigger_middleware.ModelParameter.THRESHOLD_FACTOR; + return android.media.soundtrigger.ModelParameter.THRESHOLD_FACTOR; default: - return android.media.soundtrigger_middleware.ModelParameter.INVALID; + return android.media.soundtrigger.ModelParameter.INVALID; } } diff --git a/core/java/android/hardware/soundtrigger/SoundTrigger.java b/core/java/android/hardware/soundtrigger/SoundTrigger.java index 79831a181b3f5..163e6f0a01141 100644 --- a/core/java/android/hardware/soundtrigger/SoundTrigger.java +++ b/core/java/android/hardware/soundtrigger/SoundTrigger.java @@ -42,9 +42,9 @@ import android.media.AudioFormat; import android.media.permission.ClearCallingIdentityContext; import android.media.permission.Identity; import android.media.permission.SafeCloseable; +import android.media.soundtrigger.Status; import android.media.soundtrigger_middleware.ISoundTriggerMiddlewareService; import android.media.soundtrigger_middleware.SoundTriggerModuleDescriptor; -import android.media.soundtrigger_middleware.Status; import android.os.Binder; import android.os.Build; import android.os.Handler; diff --git a/core/java/android/hardware/soundtrigger/SoundTriggerModule.java b/core/java/android/hardware/soundtrigger/SoundTriggerModule.java index 62fb999bf55c6..940ec0d5405ad 100644 --- a/core/java/android/hardware/soundtrigger/SoundTriggerModule.java +++ b/core/java/android/hardware/soundtrigger/SoundTriggerModule.java @@ -22,13 +22,13 @@ import android.compat.annotation.UnsupportedAppUsage; import android.media.permission.ClearCallingIdentityContext; import android.media.permission.Identity; import android.media.permission.SafeCloseable; +import android.media.soundtrigger.PhraseRecognitionEvent; +import android.media.soundtrigger.PhraseSoundModel; +import android.media.soundtrigger.RecognitionEvent; +import android.media.soundtrigger.SoundModel; import android.media.soundtrigger_middleware.ISoundTriggerCallback; import android.media.soundtrigger_middleware.ISoundTriggerMiddlewareService; import android.media.soundtrigger_middleware.ISoundTriggerModule; -import android.media.soundtrigger_middleware.PhraseRecognitionEvent; -import android.media.soundtrigger_middleware.PhraseSoundModel; -import android.media.soundtrigger_middleware.RecognitionEvent; -import android.media.soundtrigger_middleware.SoundModel; import android.os.Build; import android.os.Handler; import android.os.IBinder; diff --git a/media/Android.bp b/media/Android.bp index a66236e6f4ea3..cf4a0b1005d70 100644 --- a/media/Android.bp +++ b/media/Android.bp @@ -7,23 +7,6 @@ package { default_applicable_licenses: ["frameworks_base_license"], } -aidl_interface { - name: "audio_common-aidl", - unstable: true, - host_supported: true, - vendor_available: true, - local_include_dir: "aidl", - double_loadable: true, - srcs: [ - "aidl/android/media/audio/common/AudioChannelMask.aidl", - "aidl/android/media/audio/common/AudioConfig.aidl", - "aidl/android/media/audio/common/AudioFormat.aidl", - "aidl/android/media/audio/common/AudioOffloadInfo.aidl", - "aidl/android/media/audio/common/AudioStreamType.aidl", - "aidl/android/media/audio/common/AudioUsage.aidl", - ], -} - aidl_interface { name: "media_permission-aidl", unstable: true, @@ -40,30 +23,92 @@ aidl_interface { name: "soundtrigger_middleware-aidl", unstable: true, local_include_dir: "aidl", + backend: { + java: { + sdk_version: "module_current", + }, + }, srcs: [ - "aidl/android/media/soundtrigger_middleware/AudioCapabilities.aidl", - "aidl/android/media/soundtrigger_middleware/ConfidenceLevel.aidl", "aidl/android/media/soundtrigger_middleware/ISoundTriggerCallback.aidl", "aidl/android/media/soundtrigger_middleware/ISoundTriggerMiddlewareService.aidl", "aidl/android/media/soundtrigger_middleware/ISoundTriggerModule.aidl", - "aidl/android/media/soundtrigger_middleware/ModelParameter.aidl", - "aidl/android/media/soundtrigger_middleware/ModelParameterRange.aidl", - "aidl/android/media/soundtrigger_middleware/Phrase.aidl", - "aidl/android/media/soundtrigger_middleware/PhraseRecognitionEvent.aidl", - "aidl/android/media/soundtrigger_middleware/PhraseRecognitionExtra.aidl", - "aidl/android/media/soundtrigger_middleware/PhraseSoundModel.aidl", - "aidl/android/media/soundtrigger_middleware/RecognitionConfig.aidl", - "aidl/android/media/soundtrigger_middleware/RecognitionEvent.aidl", - "aidl/android/media/soundtrigger_middleware/RecognitionMode.aidl", - "aidl/android/media/soundtrigger_middleware/RecognitionStatus.aidl", - "aidl/android/media/soundtrigger_middleware/SoundModel.aidl", - "aidl/android/media/soundtrigger_middleware/SoundModelType.aidl", "aidl/android/media/soundtrigger_middleware/SoundTriggerModuleDescriptor.aidl", - "aidl/android/media/soundtrigger_middleware/SoundTriggerModuleProperties.aidl", - "aidl/android/media/soundtrigger_middleware/Status.aidl", ], imports: [ - "audio_common-aidl", + "android.media.soundtrigger.types", "media_permission-aidl", ], } + +aidl_interface { + name: "android.media.audio.common.types", + vendor_available: true, + host_supported: true, + double_loadable: true, + flags: ["-Werror", "-Weverything", ], + local_include_dir: "aidl", + srcs: [ + "aidl/android/media/audio/common/AudioChannelMask.aidl", + "aidl/android/media/audio/common/AudioConfig.aidl", + "aidl/android/media/audio/common/AudioFormat.aidl", + "aidl/android/media/audio/common/AudioOffloadInfo.aidl", + "aidl/android/media/audio/common/AudioStreamType.aidl", + "aidl/android/media/audio/common/AudioUsage.aidl", + ], + stability: "vintf", + backend: { + cpp: { + enabled: true, + }, + java: { + sdk_version: "module_current", + }, + ndk: { + vndk: { + enabled: true, + }, + }, + }, +} + +aidl_interface { + name: "android.media.soundtrigger.types", + vendor_available: true, + flags: ["-Werror", "-Weverything", ], + local_include_dir: "aidl", + srcs: [ + "aidl/android/media/soundtrigger/AudioCapabilities.aidl", + "aidl/android/media/soundtrigger/ConfidenceLevel.aidl", + "aidl/android/media/soundtrigger/ModelParameter.aidl", + "aidl/android/media/soundtrigger/ModelParameterRange.aidl", + "aidl/android/media/soundtrigger/Phrase.aidl", + "aidl/android/media/soundtrigger/PhraseRecognitionEvent.aidl", + "aidl/android/media/soundtrigger/PhraseRecognitionExtra.aidl", + "aidl/android/media/soundtrigger/PhraseSoundModel.aidl", + "aidl/android/media/soundtrigger/Properties.aidl", + "aidl/android/media/soundtrigger/RecognitionConfig.aidl", + "aidl/android/media/soundtrigger/RecognitionEvent.aidl", + "aidl/android/media/soundtrigger/RecognitionMode.aidl", + "aidl/android/media/soundtrigger/RecognitionStatus.aidl", + "aidl/android/media/soundtrigger/SoundModel.aidl", + "aidl/android/media/soundtrigger/SoundModelType.aidl", + "aidl/android/media/soundtrigger/Status.aidl", + ], + stability: "vintf", + backend: { + cpp: { + enabled: true, + }, + java: { + sdk_version: "module_current", + }, + ndk: { + vndk: { + enabled: true, + }, + }, + }, + imports: [ + "android.media.audio.common.types", + ], +} diff --git a/media/aidl/android/media/audio/common/AudioChannelMask.aidl b/media/aidl/android/media/audio/common/AudioChannelMask.aidl index b9b08e6921bce..17be8dd5461f7 100644 --- a/media/aidl/android/media/audio/common/AudioChannelMask.aidl +++ b/media/aidl/android/media/audio/common/AudioChannelMask.aidl @@ -57,8 +57,11 @@ package android.media.audio.common; * checking the channel mask, the implementer should look for ways to fix it * with additional information outside of the mask. * + * TODO: this should be replaced with strings or other mechanisms that are easy to extend, in line + * with the audio HAL conventions. * {@hide} */ +@VintfStability @Backing(type="int") enum AudioChannelMask { /** @@ -113,42 +116,43 @@ enum AudioChannelMask { */ OUT_HAPTIC_A = 0x20000000, OUT_HAPTIC_B = 0x10000000, -// TODO(ytai): Aliases not currently supported in AIDL - can inline the values. -// OUT_MONO = OUT_FRONT_LEFT, -// OUT_STEREO = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT), -// OUT_2POINT1 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_LOW_FREQUENCY), -// OUT_2POINT0POINT2 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_TOP_SIDE_LEFT | OUT_TOP_SIDE_RIGHT), -// OUT_2POINT1POINT2 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_TOP_SIDE_LEFT | OUT_TOP_SIDE_RIGHT | OUT_LOW_FREQUENCY), -// OUT_3POINT0POINT2 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_FRONT_CENTER | OUT_TOP_SIDE_LEFT | OUT_TOP_SIDE_RIGHT), -// OUT_3POINT1POINT2 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_FRONT_CENTER | OUT_TOP_SIDE_LEFT | OUT_TOP_SIDE_RIGHT | OUT_LOW_FREQUENCY), -// OUT_QUAD = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_BACK_LEFT | OUT_BACK_RIGHT), -// OUT_QUAD_BACK = OUT_QUAD, -// /** -// * like OUT_QUAD_BACK with *_SIDE_* instead of *_BACK_* -// */ -// OUT_QUAD_SIDE = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_SIDE_LEFT | OUT_SIDE_RIGHT), -// OUT_SURROUND = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_FRONT_CENTER | OUT_BACK_CENTER), -// OUT_PENTA = (OUT_QUAD | OUT_FRONT_CENTER), -// OUT_5POINT1 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_FRONT_CENTER | OUT_LOW_FREQUENCY | OUT_BACK_LEFT | OUT_BACK_RIGHT), -// OUT_5POINT1_BACK = OUT_5POINT1, -// /** -// * like OUT_5POINT1_BACK with *_SIDE_* instead of *_BACK_* -// */ -// OUT_5POINT1_SIDE = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_FRONT_CENTER | OUT_LOW_FREQUENCY | OUT_SIDE_LEFT | OUT_SIDE_RIGHT), -// OUT_5POINT1POINT2 = (OUT_5POINT1 | OUT_TOP_SIDE_LEFT | OUT_TOP_SIDE_RIGHT), -// OUT_5POINT1POINT4 = (OUT_5POINT1 | OUT_TOP_FRONT_LEFT | OUT_TOP_FRONT_RIGHT | OUT_TOP_BACK_LEFT | OUT_TOP_BACK_RIGHT), -// OUT_6POINT1 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_FRONT_CENTER | OUT_LOW_FREQUENCY | OUT_BACK_LEFT | OUT_BACK_RIGHT | OUT_BACK_CENTER), -// /** -// * matches the correct AudioFormat.CHANNEL_OUT_7POINT1_SURROUND -// */ -// OUT_7POINT1 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_FRONT_CENTER | OUT_LOW_FREQUENCY | OUT_BACK_LEFT | OUT_BACK_RIGHT | OUT_SIDE_LEFT | OUT_SIDE_RIGHT), -// OUT_7POINT1POINT2 = (OUT_7POINT1 | OUT_TOP_SIDE_LEFT | OUT_TOP_SIDE_RIGHT), -// OUT_7POINT1POINT4 = (OUT_7POINT1 | OUT_TOP_FRONT_LEFT | OUT_TOP_FRONT_RIGHT | OUT_TOP_BACK_LEFT | OUT_TOP_BACK_RIGHT), -// OUT_MONO_HAPTIC_A = (OUT_FRONT_LEFT | OUT_HAPTIC_A), -// OUT_STEREO_HAPTIC_A = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_HAPTIC_A), -// OUT_HAPTIC_AB = (OUT_HAPTIC_A | OUT_HAPTIC_B), -// OUT_MONO_HAPTIC_AB = (OUT_FRONT_LEFT | OUT_HAPTIC_A | OUT_HAPTIC_B), -// OUT_STEREO_HAPTIC_AB = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_HAPTIC_A | OUT_HAPTIC_B), + + OUT_MONO = OUT_FRONT_LEFT, + OUT_STEREO = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT), + OUT_2POINT1 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_LOW_FREQUENCY), + OUT_2POINT0POINT2 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_TOP_SIDE_LEFT | OUT_TOP_SIDE_RIGHT), + OUT_2POINT1POINT2 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_TOP_SIDE_LEFT | OUT_TOP_SIDE_RIGHT | OUT_LOW_FREQUENCY), + OUT_3POINT0POINT2 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_FRONT_CENTER | OUT_TOP_SIDE_LEFT | OUT_TOP_SIDE_RIGHT), + OUT_3POINT1POINT2 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_FRONT_CENTER | OUT_TOP_SIDE_LEFT | OUT_TOP_SIDE_RIGHT | OUT_LOW_FREQUENCY), + OUT_QUAD = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_BACK_LEFT | OUT_BACK_RIGHT), + OUT_QUAD_BACK = OUT_QUAD, + /** + * like OUT_QUAD_BACK with *_SIDE_* instead of *_BACK_* + */ + OUT_QUAD_SIDE = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_SIDE_LEFT | OUT_SIDE_RIGHT), + OUT_SURROUND = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_FRONT_CENTER | OUT_BACK_CENTER), + OUT_PENTA = (OUT_QUAD | OUT_FRONT_CENTER), + OUT_5POINT1 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_FRONT_CENTER | OUT_LOW_FREQUENCY | OUT_BACK_LEFT | OUT_BACK_RIGHT), + OUT_5POINT1_BACK = OUT_5POINT1, + /** + * like OUT_5POINT1_BACK with *_SIDE_* instead of *_BACK_* + */ + OUT_5POINT1_SIDE = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_FRONT_CENTER | OUT_LOW_FREQUENCY | OUT_SIDE_LEFT | OUT_SIDE_RIGHT), + OUT_5POINT1POINT2 = (OUT_5POINT1 | OUT_TOP_SIDE_LEFT | OUT_TOP_SIDE_RIGHT), + OUT_5POINT1POINT4 = (OUT_5POINT1 | OUT_TOP_FRONT_LEFT | OUT_TOP_FRONT_RIGHT | OUT_TOP_BACK_LEFT | OUT_TOP_BACK_RIGHT), + OUT_6POINT1 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_FRONT_CENTER | OUT_LOW_FREQUENCY | OUT_BACK_LEFT | OUT_BACK_RIGHT | OUT_BACK_CENTER), + /** + * matches the correct AudioFormat.CHANNEL_OUT_7POINT1_SURROUND + */ + OUT_7POINT1 = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_FRONT_CENTER | OUT_LOW_FREQUENCY | OUT_BACK_LEFT | OUT_BACK_RIGHT | OUT_SIDE_LEFT | OUT_SIDE_RIGHT), + OUT_7POINT1POINT2 = (OUT_7POINT1 | OUT_TOP_SIDE_LEFT | OUT_TOP_SIDE_RIGHT), + OUT_7POINT1POINT4 = (OUT_7POINT1 | OUT_TOP_FRONT_LEFT | OUT_TOP_FRONT_RIGHT | OUT_TOP_BACK_LEFT | OUT_TOP_BACK_RIGHT), + OUT_MONO_HAPTIC_A = (OUT_FRONT_LEFT | OUT_HAPTIC_A), + OUT_STEREO_HAPTIC_A = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_HAPTIC_A), + OUT_HAPTIC_AB = (OUT_HAPTIC_A | OUT_HAPTIC_B), + OUT_MONO_HAPTIC_AB = (OUT_FRONT_LEFT | OUT_HAPTIC_A | OUT_HAPTIC_B), + OUT_STEREO_HAPTIC_AB = (OUT_FRONT_LEFT | OUT_FRONT_RIGHT | OUT_HAPTIC_A | OUT_HAPTIC_B), + /** * These are bits only, not complete values * diff --git a/media/aidl/android/media/audio/common/AudioConfig.aidl b/media/aidl/android/media/audio/common/AudioConfig.aidl index 50dd796e1fa00..9119ee5b015ea 100644 --- a/media/aidl/android/media/audio/common/AudioConfig.aidl +++ b/media/aidl/android/media/audio/common/AudioConfig.aidl @@ -27,10 +27,11 @@ import android.media.audio.common.AudioOffloadInfo; * * {@hide} */ +@VintfStability parcelable AudioConfig { int sampleRateHz; int channelMask; - AudioFormat format; + AudioFormat format = AudioFormat.INVALID; AudioOffloadInfo offloadInfo; long frameCount; } diff --git a/media/aidl/android/media/audio/common/AudioFormat.aidl b/media/aidl/android/media/audio/common/AudioFormat.aidl index aadc8e26cce34..73fbca25a578d 100644 --- a/media/aidl/android/media/audio/common/AudioFormat.aidl +++ b/media/aidl/android/media/audio/common/AudioFormat.aidl @@ -32,6 +32,7 @@ package android.media.audio.common; * * {@hide} */ +@VintfStability @Backing(type="int") enum AudioFormat { INVALID = 0xFFFFFFFF, diff --git a/media/aidl/android/media/audio/common/AudioOffloadInfo.aidl b/media/aidl/android/media/audio/common/AudioOffloadInfo.aidl index ec10d71135aee..d1232527a9039 100644 --- a/media/aidl/android/media/audio/common/AudioOffloadInfo.aidl +++ b/media/aidl/android/media/audio/common/AudioOffloadInfo.aidl @@ -28,17 +28,18 @@ import android.media.audio.common.AudioUsage; * * {@hide} */ +@VintfStability parcelable AudioOffloadInfo { int sampleRateHz; int channelMask; - AudioFormat format; - AudioStreamType streamType; + AudioFormat format = AudioFormat.INVALID; + AudioStreamType streamType = AudioStreamType.INVALID; int bitRatePerSecond; long durationMicroseconds; boolean hasVideo; boolean isStreaming; int bitWidth; int bufferSize; - AudioUsage usage; + AudioUsage usage = AudioUsage.INVALID; } diff --git a/media/aidl/android/media/audio/common/AudioStreamType.aidl b/media/aidl/android/media/audio/common/AudioStreamType.aidl index c54566726350c..8b7036705ac5e 100644 --- a/media/aidl/android/media/audio/common/AudioStreamType.aidl +++ b/media/aidl/android/media/audio/common/AudioStreamType.aidl @@ -26,8 +26,14 @@ package android.media.audio.common; * * {@hide} */ +@VintfStability @Backing(type="int") enum AudioStreamType { + /** + * Used as default value in parcelables to indicate that a value was not set. + * Should never be considered a valid setting, except for backward compatibility scenarios. + */ + INVALID = -2, DEFAULT = -1, MIN = 0, VOICE_CALL = 0, diff --git a/media/aidl/android/media/audio/common/AudioUsage.aidl b/media/aidl/android/media/audio/common/AudioUsage.aidl index ef348165b22c1..028eefee180ba 100644 --- a/media/aidl/android/media/audio/common/AudioUsage.aidl +++ b/media/aidl/android/media/audio/common/AudioUsage.aidl @@ -22,8 +22,14 @@ package android.media.audio.common; /** * {@hide} */ +@VintfStability @Backing(type="int") enum AudioUsage { + /** + * Used as default value in parcelables to indicate that a value was not set. + * Should never be considered a valid setting, except for backward compatibility scenarios. + */ + INVALID = -1, UNKNOWN = 0, MEDIA = 1, VOICE_COMMUNICATION = 2, diff --git a/media/aidl/android/media/soundtrigger_middleware/AudioCapabilities.aidl b/media/aidl/android/media/soundtrigger/AudioCapabilities.aidl similarity index 94% rename from media/aidl/android/media/soundtrigger_middleware/AudioCapabilities.aidl rename to media/aidl/android/media/soundtrigger/AudioCapabilities.aidl index 97a8849c7b077..7b0825b1e6cb4 100644 --- a/media/aidl/android/media/soundtrigger_middleware/AudioCapabilities.aidl +++ b/media/aidl/android/media/soundtrigger/AudioCapabilities.aidl @@ -13,12 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.media.soundtrigger_middleware; +package android.media.soundtrigger; /** * AudioCapabilities supported by the implemented HAL driver. * @hide */ +@VintfStability @Backing(type="int") enum AudioCapabilities { /** diff --git a/media/aidl/android/media/soundtrigger_middleware/ConfidenceLevel.aidl b/media/aidl/android/media/soundtrigger/ConfidenceLevel.aidl similarity index 95% rename from media/aidl/android/media/soundtrigger_middleware/ConfidenceLevel.aidl rename to media/aidl/android/media/soundtrigger/ConfidenceLevel.aidl index 3dbc70556bd3d..80567ab8e8f9f 100644 --- a/media/aidl/android/media/soundtrigger_middleware/ConfidenceLevel.aidl +++ b/media/aidl/android/media/soundtrigger/ConfidenceLevel.aidl @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.media.soundtrigger_middleware; +package android.media.soundtrigger; /** * A recognition confidence level. @@ -21,6 +21,7 @@ package android.media.soundtrigger_middleware; * * {@hide} */ +@VintfStability parcelable ConfidenceLevel { /** user ID. */ int userId; diff --git a/media/aidl/android/media/soundtrigger_middleware/ModelParameter.aidl b/media/aidl/android/media/soundtrigger/ModelParameter.aidl similarity index 95% rename from media/aidl/android/media/soundtrigger_middleware/ModelParameter.aidl rename to media/aidl/android/media/soundtrigger/ModelParameter.aidl index 09936278e93a7..9484008837367 100644 --- a/media/aidl/android/media/soundtrigger_middleware/ModelParameter.aidl +++ b/media/aidl/android/media/soundtrigger/ModelParameter.aidl @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.media.soundtrigger_middleware; +package android.media.soundtrigger; /** * Model specific parameters to be used with parameter set and get APIs. * * {@hide} */ +@VintfStability @Backing(type="int") enum ModelParameter { /** diff --git a/media/aidl/android/media/soundtrigger_middleware/ModelParameterRange.aidl b/media/aidl/android/media/soundtrigger/ModelParameterRange.aidl similarity index 94% rename from media/aidl/android/media/soundtrigger_middleware/ModelParameterRange.aidl rename to media/aidl/android/media/soundtrigger/ModelParameterRange.aidl index d6948a87dc6d7..e3c5a46918490 100644 --- a/media/aidl/android/media/soundtrigger_middleware/ModelParameterRange.aidl +++ b/media/aidl/android/media/soundtrigger/ModelParameterRange.aidl @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.media.soundtrigger_middleware; +package android.media.soundtrigger; /** * Value range for a model parameter. * * {@hide} */ +@VintfStability parcelable ModelParameterRange { /** Minimum (inclusive) */ int minInclusive; diff --git a/media/aidl/android/media/soundtrigger_middleware/Phrase.aidl b/media/aidl/android/media/soundtrigger/Phrase.aidl similarity index 95% rename from media/aidl/android/media/soundtrigger_middleware/Phrase.aidl rename to media/aidl/android/media/soundtrigger/Phrase.aidl index 98a489f8a6a9a..03578cfb987b8 100644 --- a/media/aidl/android/media/soundtrigger_middleware/Phrase.aidl +++ b/media/aidl/android/media/soundtrigger/Phrase.aidl @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.media.soundtrigger_middleware; +package android.media.soundtrigger; /** * Key phrase descriptor. * * {@hide} */ +@VintfStability parcelable Phrase { /** Unique keyphrase ID assigned at enrollment time. */ int id; diff --git a/media/aidl/android/media/soundtrigger_middleware/PhraseRecognitionEvent.aidl b/media/aidl/android/media/soundtrigger/PhraseRecognitionEvent.aidl similarity index 84% rename from media/aidl/android/media/soundtrigger_middleware/PhraseRecognitionEvent.aidl rename to media/aidl/android/media/soundtrigger/PhraseRecognitionEvent.aidl index 6a3ec61d1ebff..5f7cdcf327fb7 100644 --- a/media/aidl/android/media/soundtrigger_middleware/PhraseRecognitionEvent.aidl +++ b/media/aidl/android/media/soundtrigger/PhraseRecognitionEvent.aidl @@ -13,16 +13,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.media.soundtrigger_middleware; +package android.media.soundtrigger; -import android.media.soundtrigger_middleware.PhraseRecognitionExtra; -import android.media.soundtrigger_middleware.RecognitionEvent; +import android.media.soundtrigger.PhraseRecognitionExtra; +import android.media.soundtrigger.RecognitionEvent; /** * An event that gets sent to indicate a phrase recognition (or aborting of the recognition process). * {@hide} */ +@VintfStability parcelable PhraseRecognitionEvent { /** Common recognition event. */ RecognitionEvent common; diff --git a/media/aidl/android/media/soundtrigger_middleware/PhraseRecognitionExtra.aidl b/media/aidl/android/media/soundtrigger/PhraseRecognitionExtra.aidl similarity index 71% rename from media/aidl/android/media/soundtrigger_middleware/PhraseRecognitionExtra.aidl rename to media/aidl/android/media/soundtrigger/PhraseRecognitionExtra.aidl index cb96bf37a95d9..9bad7f46fa45f 100644 --- a/media/aidl/android/media/soundtrigger_middleware/PhraseRecognitionExtra.aidl +++ b/media/aidl/android/media/soundtrigger/PhraseRecognitionExtra.aidl @@ -13,23 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.media.soundtrigger_middleware; +package android.media.soundtrigger; -import android.media.soundtrigger_middleware.ConfidenceLevel; +import android.media.soundtrigger.ConfidenceLevel; /** * Specialized recognition event for key phrase detection. * {@hide} */ +@VintfStability parcelable PhraseRecognitionExtra { - // TODO(ytai): Constants / enums. - - /** keyphrase ID */ + /** Keyphrase ID */ int id; - /** recognition modes used for this keyphrase */ + /** Bitfield, indexed by RecognitionMode. */ int recognitionModes; - /** confidence level for mode RECOGNITION_MODE_VOICE_TRIGGER */ + /** Confidence level for mode RECOGNITION_MODE_VOICE_TRIGGER. Value is between 0-100. */ int confidenceLevel; - /** number of user confidence levels */ + /** Number of user confidence levels */ ConfidenceLevel[] levels; } diff --git a/media/aidl/android/media/soundtrigger_middleware/PhraseSoundModel.aidl b/media/aidl/android/media/soundtrigger/PhraseSoundModel.aidl similarity index 86% rename from media/aidl/android/media/soundtrigger_middleware/PhraseSoundModel.aidl rename to media/aidl/android/media/soundtrigger/PhraseSoundModel.aidl index 81028c1608ea6..e20bb3ff56e42 100644 --- a/media/aidl/android/media/soundtrigger_middleware/PhraseSoundModel.aidl +++ b/media/aidl/android/media/soundtrigger/PhraseSoundModel.aidl @@ -13,10 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.media.soundtrigger_middleware; +package android.media.soundtrigger; -import android.media.soundtrigger_middleware.SoundModel; -import android.media.soundtrigger_middleware.Phrase; +import android.media.soundtrigger.SoundModel; +import android.media.soundtrigger.Phrase; /** * Specialized sound model for key phrase detection. @@ -24,6 +24,7 @@ import android.media.soundtrigger_middleware.Phrase; * information indicated by phrases field. * {@hide} */ +@VintfStability parcelable PhraseSoundModel { /** Common part of sound model descriptor */ SoundModel common; diff --git a/media/aidl/android/media/soundtrigger_middleware/SoundTriggerModuleProperties.aidl b/media/aidl/android/media/soundtrigger/Properties.aidl similarity index 93% rename from media/aidl/android/media/soundtrigger_middleware/SoundTriggerModuleProperties.aidl rename to media/aidl/android/media/soundtrigger/Properties.aidl index 9c56e7b98b3f2..093281b13a2b7 100644 --- a/media/aidl/android/media/soundtrigger_middleware/SoundTriggerModuleProperties.aidl +++ b/media/aidl/android/media/soundtrigger/Properties.aidl @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.media.soundtrigger_middleware; +package android.media.soundtrigger; /** * Capabilities of a sound trigger module. * {@hide} */ -parcelable SoundTriggerModuleProperties { +@VintfStability +parcelable Properties { /** Implementor name */ String implementor; /** Implementation description */ @@ -44,7 +45,7 @@ parcelable SoundTriggerModuleProperties { int maxKeyPhrases; /** Maximum number of concurrent users detected */ int maxUsers; - /** All supported modes. e.g RecognitionMode.VOICE_TRIGGER */ + /** All supported modes. Bitfield, indexed by RecognitionMode. */ int recognitionModes; /** Supports seamless transition from detection to capture */ boolean captureTransition; diff --git a/media/aidl/android/media/soundtrigger_middleware/RecognitionConfig.aidl b/media/aidl/android/media/soundtrigger/RecognitionConfig.aidl similarity index 85% rename from media/aidl/android/media/soundtrigger_middleware/RecognitionConfig.aidl rename to media/aidl/android/media/soundtrigger/RecognitionConfig.aidl index 5c0eeb1e32b11..5e88c50178e91 100644 --- a/media/aidl/android/media/soundtrigger_middleware/RecognitionConfig.aidl +++ b/media/aidl/android/media/soundtrigger/RecognitionConfig.aidl @@ -13,14 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.media.soundtrigger_middleware; +package android.media.soundtrigger; -import android.media.soundtrigger_middleware.PhraseRecognitionExtra; +import android.media.soundtrigger.PhraseRecognitionExtra; /** * Configuration for tuning behavior of an active recognition process. * {@hide} */ +@VintfStability parcelable RecognitionConfig { /* Capture and buffer audio for this recognition instance. */ boolean captureRequested; @@ -34,6 +35,6 @@ parcelable RecognitionConfig { */ int audioCapabilities; - /** Opaque capture configuration data. */ + /** Capture configuration data. Content is implementation-defined. */ byte[] data; } diff --git a/media/aidl/android/media/soundtrigger_middleware/RecognitionEvent.aidl b/media/aidl/android/media/soundtrigger/RecognitionEvent.aidl similarity index 87% rename from media/aidl/android/media/soundtrigger_middleware/RecognitionEvent.aidl rename to media/aidl/android/media/soundtrigger/RecognitionEvent.aidl index a237ec1aa3b31..f897ca8bd251d 100644 --- a/media/aidl/android/media/soundtrigger_middleware/RecognitionEvent.aidl +++ b/media/aidl/android/media/soundtrigger/RecognitionEvent.aidl @@ -13,21 +13,22 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.media.soundtrigger_middleware; +package android.media.soundtrigger; import android.media.audio.common.AudioConfig; -import android.media.soundtrigger_middleware.RecognitionStatus; -import android.media.soundtrigger_middleware.SoundModelType; +import android.media.soundtrigger.RecognitionStatus; +import android.media.soundtrigger.SoundModelType; /** * An event that gets sent to indicate a recognition (or aborting of the recognition process). * {@hide} */ +@VintfStability parcelable RecognitionEvent { /** Recognition status. */ - RecognitionStatus status; + RecognitionStatus status = RecognitionStatus.INVALID; /** Event type, same as sound model type. */ - SoundModelType type; + SoundModelType type = SoundModelType.INVALID; /** Is it possible to capture audio from this utterance buffered by the implementation. */ boolean captureAvailable; /* Audio session ID. framework use. */ diff --git a/media/aidl/android/media/soundtrigger_middleware/RecognitionMode.aidl b/media/aidl/android/media/soundtrigger/RecognitionMode.aidl similarity index 95% rename from media/aidl/android/media/soundtrigger_middleware/RecognitionMode.aidl rename to media/aidl/android/media/soundtrigger/RecognitionMode.aidl index d8bfff4bec6f2..ce2cffedda321 100644 --- a/media/aidl/android/media/soundtrigger_middleware/RecognitionMode.aidl +++ b/media/aidl/android/media/soundtrigger/RecognitionMode.aidl @@ -13,12 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.media.soundtrigger_middleware; +package android.media.soundtrigger; /** * Recognition mode. * {@hide} */ +@VintfStability @Backing(type="int") enum RecognitionMode { /** Simple voice trigger. */ diff --git a/media/aidl/android/media/soundtrigger_middleware/RecognitionStatus.aidl b/media/aidl/android/media/soundtrigger/RecognitionStatus.aidl similarity index 81% rename from media/aidl/android/media/soundtrigger_middleware/RecognitionStatus.aidl rename to media/aidl/android/media/soundtrigger/RecognitionStatus.aidl index d563edca547d2..cccf0f3b6d492 100644 --- a/media/aidl/android/media/soundtrigger_middleware/RecognitionStatus.aidl +++ b/media/aidl/android/media/soundtrigger/RecognitionStatus.aidl @@ -13,14 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.media.soundtrigger_middleware; +package android.media.soundtrigger; /** * A status for indicating the type of a recognition event. * {@hide} */ +@VintfStability @Backing(type="int") enum RecognitionStatus { + /** + * Used as default value in parcelables to indicate that a value was not set. + * Should never be considered a valid setting, except for backward compatibility scenarios. + */ + INVALID = -1, /** Recognition success. */ SUCCESS = 0, /** Recognition aborted (e.g. capture preempted by another use-case. */ diff --git a/media/aidl/android/media/soundtrigger_middleware/SoundModel.aidl b/media/aidl/android/media/soundtrigger/SoundModel.aidl similarity index 88% rename from media/aidl/android/media/soundtrigger_middleware/SoundModel.aidl rename to media/aidl/android/media/soundtrigger/SoundModel.aidl index 8186fb741b595..31953e9087ba2 100644 --- a/media/aidl/android/media/soundtrigger_middleware/SoundModel.aidl +++ b/media/aidl/android/media/soundtrigger/SoundModel.aidl @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.media.soundtrigger_middleware; +package android.media.soundtrigger; -import android.media.soundtrigger_middleware.SoundModelType; +import android.media.soundtrigger.SoundModelType; import android.os.ParcelFileDescriptor; /** @@ -23,9 +23,10 @@ import android.os.ParcelFileDescriptor; * aggregation. * {@hide} */ +@VintfStability parcelable SoundModel { /** Model type. */ - SoundModelType type; + SoundModelType type = SoundModelType.INVALID; /** Unique sound model ID. */ String uuid; /** diff --git a/media/aidl/android/media/soundtrigger_middleware/SoundModelType.aidl b/media/aidl/android/media/soundtrigger/SoundModelType.aidl similarity index 75% rename from media/aidl/android/media/soundtrigger_middleware/SoundModelType.aidl rename to media/aidl/android/media/soundtrigger/SoundModelType.aidl index f2abc9af7780a..34a9376a26b9c 100644 --- a/media/aidl/android/media/soundtrigger_middleware/SoundModelType.aidl +++ b/media/aidl/android/media/soundtrigger/SoundModelType.aidl @@ -13,16 +13,20 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.media.soundtrigger_middleware; +package android.media.soundtrigger; /** * Sound model type. * {@hide} */ +@VintfStability @Backing(type="int") enum SoundModelType { - /** Unspecified sound model type */ - UNKNOWN = -1, + /** + * Used as default value in parcelables to indicate that a value was not set. + * Should never be considered a valid setting, except for backward compatibility scenarios. + */ + INVALID = -1, /** Key phrase sound models */ KEYPHRASE = 0, /** All models other than keyphrase */ diff --git a/media/aidl/android/media/soundtrigger_middleware/Status.aidl b/media/aidl/android/media/soundtrigger/Status.aidl similarity index 83% rename from media/aidl/android/media/soundtrigger_middleware/Status.aidl rename to media/aidl/android/media/soundtrigger/Status.aidl index c7623f5bf4910..ca1487fb119f9 100644 --- a/media/aidl/android/media/soundtrigger_middleware/Status.aidl +++ b/media/aidl/android/media/soundtrigger/Status.aidl @@ -13,13 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package android.media.soundtrigger_middleware; +package android.media.soundtrigger; /** * {@hide} */ +@VintfStability @Backing(type="int") enum Status { + /** + * Used as default value in parcelables to indicate that a value was not set. + * Should never be considered a valid setting, except for backward compatibility scenarios. + */ + INVALID = -1, /** Success. */ SUCCESS = 0, /** Failure due to resource contention. This is typically a temporary condition. */ diff --git a/media/aidl/android/media/soundtrigger_middleware/ISoundTriggerCallback.aidl b/media/aidl/android/media/soundtrigger_middleware/ISoundTriggerCallback.aidl index 57f525b7f2241..184997242a98c 100644 --- a/media/aidl/android/media/soundtrigger_middleware/ISoundTriggerCallback.aidl +++ b/media/aidl/android/media/soundtrigger_middleware/ISoundTriggerCallback.aidl @@ -15,8 +15,8 @@ */ package android.media.soundtrigger_middleware; -import android.media.soundtrigger_middleware.RecognitionEvent; -import android.media.soundtrigger_middleware.PhraseRecognitionEvent; +import android.media.soundtrigger.RecognitionEvent; +import android.media.soundtrigger.PhraseRecognitionEvent; /** * Main interface for a client to get notifications of events coming from this module. diff --git a/media/aidl/android/media/soundtrigger_middleware/ISoundTriggerModule.aidl b/media/aidl/android/media/soundtrigger_middleware/ISoundTriggerModule.aidl index d211e96ace927..0b46fd4ef5f01 100644 --- a/media/aidl/android/media/soundtrigger_middleware/ISoundTriggerModule.aidl +++ b/media/aidl/android/media/soundtrigger_middleware/ISoundTriggerModule.aidl @@ -15,11 +15,11 @@ */ package android.media.soundtrigger_middleware; -import android.media.soundtrigger_middleware.ModelParameter; -import android.media.soundtrigger_middleware.ModelParameterRange; -import android.media.soundtrigger_middleware.SoundModel; -import android.media.soundtrigger_middleware.PhraseSoundModel; -import android.media.soundtrigger_middleware.RecognitionConfig; +import android.media.soundtrigger.ModelParameter; +import android.media.soundtrigger.ModelParameterRange; +import android.media.soundtrigger.SoundModel; +import android.media.soundtrigger.PhraseSoundModel; +import android.media.soundtrigger.RecognitionConfig; /** * A sound-trigger module. diff --git a/media/aidl/android/media/soundtrigger_middleware/SoundTriggerModuleDescriptor.aidl b/media/aidl/android/media/soundtrigger_middleware/SoundTriggerModuleDescriptor.aidl index 667135ff61b99..6300e665c0049 100644 --- a/media/aidl/android/media/soundtrigger_middleware/SoundTriggerModuleDescriptor.aidl +++ b/media/aidl/android/media/soundtrigger_middleware/SoundTriggerModuleDescriptor.aidl @@ -15,7 +15,7 @@ */ package android.media.soundtrigger_middleware; -import android.media.soundtrigger_middleware.SoundTriggerModuleProperties; +import android.media.soundtrigger.Properties; /** * A descriptor of an available sound trigger module, containing the handle used to reference the @@ -26,6 +26,6 @@ parcelable SoundTriggerModuleDescriptor { /** Module handle to be used for attaching to it. */ int handle; /** Module capabilities. */ - SoundTriggerModuleProperties properties; + Properties properties; } diff --git a/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioChannelMask.aidl b/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioChannelMask.aidl new file mode 100644 index 0000000000000..c3af3bfdfde74 --- /dev/null +++ b/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioChannelMask.aidl @@ -0,0 +1,111 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */// This file has been semi-automatically generated using hidl2aidl from its counterpart in +// hardware/interfaces/audio/common/5.0/types.hal +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.audio.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum AudioChannelMask { + REPRESENTATION_POSITION = 0, + REPRESENTATION_INDEX = 2, + NONE = 0, + INVALID = -1073741824, + OUT_FRONT_LEFT = 1, + OUT_FRONT_RIGHT = 2, + OUT_FRONT_CENTER = 4, + OUT_LOW_FREQUENCY = 8, + OUT_BACK_LEFT = 16, + OUT_BACK_RIGHT = 32, + OUT_FRONT_LEFT_OF_CENTER = 64, + OUT_FRONT_RIGHT_OF_CENTER = 128, + OUT_BACK_CENTER = 256, + OUT_SIDE_LEFT = 512, + OUT_SIDE_RIGHT = 1024, + OUT_TOP_CENTER = 2048, + OUT_TOP_FRONT_LEFT = 4096, + OUT_TOP_FRONT_CENTER = 8192, + OUT_TOP_FRONT_RIGHT = 16384, + OUT_TOP_BACK_LEFT = 32768, + OUT_TOP_BACK_CENTER = 65536, + OUT_TOP_BACK_RIGHT = 131072, + OUT_TOP_SIDE_LEFT = 262144, + OUT_TOP_SIDE_RIGHT = 524288, + OUT_HAPTIC_A = 536870912, + OUT_HAPTIC_B = 268435456, + OUT_MONO = 1, + OUT_STEREO = 3, + OUT_2POINT1 = 11, + OUT_2POINT0POINT2 = 786435, + OUT_2POINT1POINT2 = 786443, + OUT_3POINT0POINT2 = 786439, + OUT_3POINT1POINT2 = 786447, + OUT_QUAD = 51, + OUT_QUAD_BACK = 51, + OUT_QUAD_SIDE = 1539, + OUT_SURROUND = 263, + OUT_PENTA = 55, + OUT_5POINT1 = 63, + OUT_5POINT1_BACK = 63, + OUT_5POINT1_SIDE = 1551, + OUT_5POINT1POINT2 = 786495, + OUT_5POINT1POINT4 = 184383, + OUT_6POINT1 = 319, + OUT_7POINT1 = 1599, + OUT_7POINT1POINT2 = 788031, + OUT_7POINT1POINT4 = 185919, + OUT_MONO_HAPTIC_A = 536870913, + OUT_STEREO_HAPTIC_A = 536870915, + OUT_HAPTIC_AB = 805306368, + OUT_MONO_HAPTIC_AB = 805306369, + OUT_STEREO_HAPTIC_AB = 805306371, + IN_LEFT = 4, + IN_RIGHT = 8, + IN_FRONT = 16, + IN_BACK = 32, + IN_LEFT_PROCESSED = 64, + IN_RIGHT_PROCESSED = 128, + IN_FRONT_PROCESSED = 256, + IN_BACK_PROCESSED = 512, + IN_PRESSURE = 1024, + IN_X_AXIS = 2048, + IN_Y_AXIS = 4096, + IN_Z_AXIS = 8192, + IN_BACK_LEFT = 65536, + IN_BACK_RIGHT = 131072, + IN_CENTER = 262144, + IN_LOW_FREQUENCY = 1048576, + IN_TOP_LEFT = 2097152, + IN_TOP_RIGHT = 4194304, + IN_VOICE_UPLINK = 16384, + IN_VOICE_DNLINK = 32768, +} diff --git a/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioConfig.aidl b/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioConfig.aidl new file mode 100644 index 0000000000000..9e0ea0abd3c60 --- /dev/null +++ b/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioConfig.aidl @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */// This file has been semi-automatically generated using hidl2aidl from its counterpart in +// hardware/interfaces/audio/common/5.0/types.hal +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.audio.common; +/* @hide */ +@VintfStability +parcelable AudioConfig { + int sampleRateHz; + int channelMask; + android.media.audio.common.AudioFormat format = android.media.audio.common.AudioFormat.INVALID; + android.media.audio.common.AudioOffloadInfo offloadInfo; + long frameCount; +} diff --git a/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioFormat.aidl b/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioFormat.aidl new file mode 100644 index 0000000000000..b7c86599a2c4e --- /dev/null +++ b/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioFormat.aidl @@ -0,0 +1,109 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */// This file has been semi-automatically generated using hidl2aidl from its counterpart in +// hardware/interfaces/audio/common/5.0/types.hal +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.audio.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum AudioFormat { + INVALID = -1, + DEFAULT = 0, + PCM = 0, + MP3 = 16777216, + AMR_NB = 33554432, + AMR_WB = 50331648, + AAC = 67108864, + HE_AAC_V1 = 83886080, + HE_AAC_V2 = 100663296, + VORBIS = 117440512, + OPUS = 134217728, + AC3 = 150994944, + E_AC3 = 167772160, + DTS = 184549376, + DTS_HD = 201326592, + IEC61937 = 218103808, + DOLBY_TRUEHD = 234881024, + EVRC = 268435456, + EVRCB = 285212672, + EVRCWB = 301989888, + EVRCNW = 318767104, + AAC_ADIF = 335544320, + WMA = 352321536, + WMA_PRO = 369098752, + AMR_WB_PLUS = 385875968, + MP2 = 402653184, + QCELP = 419430400, + DSD = 436207616, + FLAC = 452984832, + ALAC = 469762048, + APE = 486539264, + AAC_ADTS = 503316480, + SBC = 520093696, + APTX = 536870912, + APTX_HD = 553648128, + AC4 = 570425344, + LDAC = 587202560, + MAT = 603979776, + AAC_LATM = 620756992, + CELT = 637534208, + APTX_ADAPTIVE = 654311424, + LHDC = 671088640, + LHDC_LL = 687865856, + APTX_TWSP = 704643072, + MAIN_MASK = -16777216, + SUB_MASK = 16777215, + PCM_SUB_16_BIT = 1, + PCM_SUB_8_BIT = 2, + PCM_SUB_32_BIT = 3, + PCM_SUB_8_24_BIT = 4, + PCM_SUB_FLOAT = 5, + PCM_SUB_24_BIT_PACKED = 6, + MP3_SUB_NONE = 0, + AMR_SUB_NONE = 0, + AAC_SUB_MAIN = 1, + AAC_SUB_LC = 2, + AAC_SUB_SSR = 4, + AAC_SUB_LTP = 8, + AAC_SUB_HE_V1 = 16, + AAC_SUB_SCALABLE = 32, + AAC_SUB_ERLC = 64, + AAC_SUB_LD = 128, + AAC_SUB_HE_V2 = 256, + AAC_SUB_ELD = 512, + AAC_SUB_XHE = 768, + VORBIS_SUB_NONE = 0, + E_AC3_SUB_JOC = 1, + MAT_SUB_1_0 = 1, + MAT_SUB_2_0 = 2, + MAT_SUB_2_1 = 3, +} diff --git a/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioOffloadInfo.aidl b/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioOffloadInfo.aidl new file mode 100644 index 0000000000000..50c01e7aeaf70 --- /dev/null +++ b/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioOffloadInfo.aidl @@ -0,0 +1,50 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */// This file has been semi-automatically generated using hidl2aidl from its counterpart in +// hardware/interfaces/audio/common/5.0/types.hal +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.audio.common; +/* @hide */ +@VintfStability +parcelable AudioOffloadInfo { + int sampleRateHz; + int channelMask; + android.media.audio.common.AudioFormat format = android.media.audio.common.AudioFormat.INVALID; + android.media.audio.common.AudioStreamType streamType = android.media.audio.common.AudioStreamType.INVALID; + int bitRatePerSecond; + long durationMicroseconds; + boolean hasVideo; + boolean isStreaming; + int bitWidth; + int bufferSize; + android.media.audio.common.AudioUsage usage = android.media.audio.common.AudioUsage.INVALID; +} diff --git a/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioStreamType.aidl b/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioStreamType.aidl new file mode 100644 index 0000000000000..915c66814aa83 --- /dev/null +++ b/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioStreamType.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */// This file has been semi-automatically generated using hidl2aidl from its counterpart in +// hardware/interfaces/audio/common/5.0/types.hal +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.audio.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum AudioStreamType { + INVALID = -2, + DEFAULT = -1, + MIN = 0, + VOICE_CALL = 0, + SYSTEM = 1, + RING = 2, + MUSIC = 3, + ALARM = 4, + NOTIFICATION = 5, + BLUETOOTH_SCO = 6, + ENFORCED_AUDIBLE = 7, + DTMF = 8, + TTS = 9, + ACCESSIBILITY = 10, +} diff --git a/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioUsage.aidl b/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioUsage.aidl new file mode 100644 index 0000000000000..f5130a4d02314 --- /dev/null +++ b/media/aidl_api/android.media.audio.common.types/current/android/media/audio/common/AudioUsage.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */// This file has been semi-automatically generated using hidl2aidl from its counterpart in +// hardware/interfaces/audio/common/5.0/types.hal +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.audio.common; +/* @hide */ +@Backing(type="int") @VintfStability +enum AudioUsage { + INVALID = -1, + UNKNOWN = 0, + MEDIA = 1, + VOICE_COMMUNICATION = 2, + VOICE_COMMUNICATION_SIGNALLING = 3, + ALARM = 4, + NOTIFICATION = 5, + NOTIFICATION_TELEPHONY_RINGTONE = 6, + ASSISTANCE_ACCESSIBILITY = 11, + ASSISTANCE_NAVIGATION_GUIDANCE = 12, + ASSISTANCE_SONIFICATION = 13, + GAME = 14, + VIRTUAL_SOURCE = 15, + ASSISTANT = 16, +} diff --git a/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/AudioCapabilities.aidl b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/AudioCapabilities.aidl new file mode 100644 index 0000000000000..5d88305484d04 --- /dev/null +++ b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/AudioCapabilities.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.soundtrigger; +/* @hide */ +@Backing(type="int") @VintfStability +enum AudioCapabilities { + ECHO_CANCELLATION = 1, + NOISE_SUPPRESSION = 2, +} diff --git a/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/ConfidenceLevel.aidl b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/ConfidenceLevel.aidl new file mode 100644 index 0000000000000..f16fe0465cf8b --- /dev/null +++ b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/ConfidenceLevel.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.soundtrigger; +/* @hide */ +@VintfStability +parcelable ConfidenceLevel { + int userId; + int levelPercent; +} diff --git a/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/ModelParameter.aidl b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/ModelParameter.aidl new file mode 100644 index 0000000000000..aadbf80b4f969 --- /dev/null +++ b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/ModelParameter.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.soundtrigger; +/* @hide */ +@Backing(type="int") @VintfStability +enum ModelParameter { + INVALID = -1, + THRESHOLD_FACTOR = 0, +} diff --git a/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/ModelParameterRange.aidl b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/ModelParameterRange.aidl new file mode 100644 index 0000000000000..77b872aa41a91 --- /dev/null +++ b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/ModelParameterRange.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.soundtrigger; +/* @hide */ +@VintfStability +parcelable ModelParameterRange { + int minInclusive; + int maxInclusive; +} diff --git a/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/Phrase.aidl b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/Phrase.aidl new file mode 100644 index 0000000000000..991261df815f8 --- /dev/null +++ b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/Phrase.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.soundtrigger; +/* @hide */ +@VintfStability +parcelable Phrase { + int id; + int recognitionModes; + int[] users; + String locale; + String text; +} diff --git a/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/PhraseRecognitionEvent.aidl b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/PhraseRecognitionEvent.aidl new file mode 100644 index 0000000000000..b409e4f8b95d9 --- /dev/null +++ b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/PhraseRecognitionEvent.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.soundtrigger; +/* @hide */ +@VintfStability +parcelable PhraseRecognitionEvent { + android.media.soundtrigger.RecognitionEvent common; + android.media.soundtrigger.PhraseRecognitionExtra[] phraseExtras; +} diff --git a/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/PhraseRecognitionExtra.aidl b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/PhraseRecognitionExtra.aidl new file mode 100644 index 0000000000000..1f739af933d39 --- /dev/null +++ b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/PhraseRecognitionExtra.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.soundtrigger; +/* @hide */ +@VintfStability +parcelable PhraseRecognitionExtra { + int id; + int recognitionModes; + int confidenceLevel; + android.media.soundtrigger.ConfidenceLevel[] levels; +} diff --git a/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/PhraseSoundModel.aidl b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/PhraseSoundModel.aidl new file mode 100644 index 0000000000000..3f1b588642990 --- /dev/null +++ b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/PhraseSoundModel.aidl @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.soundtrigger; +/* @hide */ +@VintfStability +parcelable PhraseSoundModel { + android.media.soundtrigger.SoundModel common; + android.media.soundtrigger.Phrase[] phrases; +} diff --git a/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/Properties.aidl b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/Properties.aidl new file mode 100644 index 0000000000000..d61840d8eea1b --- /dev/null +++ b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/Properties.aidl @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.soundtrigger; +/* @hide */ +@VintfStability +parcelable Properties { + String implementor; + String description; + int version; + String uuid; + String supportedModelArch; + int maxSoundModels; + int maxKeyPhrases; + int maxUsers; + int recognitionModes; + boolean captureTransition; + int maxBufferMs; + boolean concurrentCapture; + boolean triggerInEvent; + int powerConsumptionMw; + int audioCapabilities; +} diff --git a/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/RecognitionConfig.aidl b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/RecognitionConfig.aidl new file mode 100644 index 0000000000000..191b123f9aaa9 --- /dev/null +++ b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/RecognitionConfig.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.soundtrigger; +/* @hide */ +@VintfStability +parcelable RecognitionConfig { + boolean captureRequested; + android.media.soundtrigger.PhraseRecognitionExtra[] phraseRecognitionExtras; + int audioCapabilities; + byte[] data; +} diff --git a/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/RecognitionEvent.aidl b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/RecognitionEvent.aidl new file mode 100644 index 0000000000000..d09233c3ce5d8 --- /dev/null +++ b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/RecognitionEvent.aidl @@ -0,0 +1,47 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.soundtrigger; +/* @hide */ +@VintfStability +parcelable RecognitionEvent { + android.media.soundtrigger.RecognitionStatus status = android.media.soundtrigger.RecognitionStatus.INVALID; + android.media.soundtrigger.SoundModelType type = android.media.soundtrigger.SoundModelType.INVALID; + boolean captureAvailable; + int captureSession; + int captureDelayMs; + int capturePreambleMs; + boolean triggerInData; + @nullable android.media.audio.common.AudioConfig audioConfig; + byte[] data; +} diff --git a/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/RecognitionMode.aidl b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/RecognitionMode.aidl new file mode 100644 index 0000000000000..588291084f4a2 --- /dev/null +++ b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/RecognitionMode.aidl @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.soundtrigger; +/* @hide */ +@Backing(type="int") @VintfStability +enum RecognitionMode { + VOICE_TRIGGER = 1, + USER_IDENTIFICATION = 2, + USER_AUTHENTICATION = 4, + GENERIC_TRIGGER = 8, +} diff --git a/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/RecognitionStatus.aidl b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/RecognitionStatus.aidl new file mode 100644 index 0000000000000..7881c28c7ecf5 --- /dev/null +++ b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/RecognitionStatus.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.soundtrigger; +/* @hide */ +@Backing(type="int") @VintfStability +enum RecognitionStatus { + INVALID = -1, + SUCCESS = 0, + ABORTED = 1, + FAILURE = 2, + FORCED = 3, +} diff --git a/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/SoundModel.aidl b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/SoundModel.aidl new file mode 100644 index 0000000000000..57964029ac1bd --- /dev/null +++ b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/SoundModel.aidl @@ -0,0 +1,43 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.soundtrigger; +/* @hide */ +@VintfStability +parcelable SoundModel { + android.media.soundtrigger.SoundModelType type = android.media.soundtrigger.SoundModelType.INVALID; + String uuid; + String vendorUuid; + @nullable ParcelFileDescriptor data; + int dataSize; +} diff --git a/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/SoundModelType.aidl b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/SoundModelType.aidl new file mode 100644 index 0000000000000..ac78641705353 --- /dev/null +++ b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/SoundModelType.aidl @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.soundtrigger; +/* @hide */ +@Backing(type="int") @VintfStability +enum SoundModelType { + INVALID = -1, + KEYPHRASE = 0, + GENERIC = 1, +} diff --git a/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/Status.aidl b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/Status.aidl new file mode 100644 index 0000000000000..29f3167ac196d --- /dev/null +++ b/media/aidl_api/android.media.soundtrigger.types/current/android/media/soundtrigger/Status.aidl @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2019 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/////////////////////////////////////////////////////////////////////////////// +// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // +/////////////////////////////////////////////////////////////////////////////// + +// This file is a snapshot of an AIDL file. Do not edit it manually. There are +// two cases: +// 1). this is a frozen version file - do not edit this in any case. +// 2). this is a 'current' file. If you make a backwards compatible change to +// the interface (from the latest frozen version), the build system will +// prompt you to update this file with `m -update-api`. +// +// You must not make a backward incompatible change to any AIDL file built +// with the aidl_interface module type with versions property set. The module +// type is used to build AIDL files in a way that they can be used across +// independently updatable components of the system. If a device is shipped +// with such a backward incompatible change, it has a high risk of breaking +// later when a module using the interface is updated, e.g., Mainline modules. + +package android.media.soundtrigger; +/* @hide */ +@Backing(type="int") @VintfStability +enum Status { + INVALID = -1, + SUCCESS = 0, + RESOURCE_CONTENTION = 1, + OPERATION_NOT_SUPPORTED = 2, + TEMPORARY_PERMISSION_DENIED = 3, + DEAD_OBJECT = 4, + INTERNAL_ERROR = 5, +} diff --git a/services/core/java/com/android/server/soundtrigger_middleware/ConversionUtil.java b/services/core/java/com/android/server/soundtrigger_middleware/ConversionUtil.java index 6366280e17625..8236ef9d14f9a 100644 --- a/services/core/java/com/android/server/soundtrigger_middleware/ConversionUtil.java +++ b/services/core/java/com/android/server/soundtrigger_middleware/ConversionUtil.java @@ -21,24 +21,23 @@ import android.annotation.Nullable; import android.hardware.audio.common.V2_0.Uuid; import android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback; import android.hardware.soundtrigger.V2_3.ISoundTriggerHw; -import android.hardware.soundtrigger.V2_3.Properties; +import android.media.soundtrigger.AudioCapabilities; +import android.media.soundtrigger.ConfidenceLevel; +import android.media.soundtrigger.ModelParameter; +import android.media.soundtrigger.ModelParameterRange; +import android.media.soundtrigger.Phrase; +import android.media.soundtrigger.PhraseRecognitionEvent; +import android.media.soundtrigger.PhraseRecognitionExtra; +import android.media.soundtrigger.PhraseSoundModel; +import android.media.soundtrigger.Properties; +import android.media.soundtrigger.RecognitionConfig; +import android.media.soundtrigger.RecognitionEvent; +import android.media.soundtrigger.RecognitionMode; +import android.media.soundtrigger.RecognitionStatus; +import android.media.soundtrigger.SoundModel; +import android.media.soundtrigger.SoundModelType; import android.media.audio.common.AudioConfig; import android.media.audio.common.AudioOffloadInfo; -import android.media.soundtrigger_middleware.AudioCapabilities; -import android.media.soundtrigger_middleware.ConfidenceLevel; -import android.media.soundtrigger_middleware.ModelParameter; -import android.media.soundtrigger_middleware.ModelParameterRange; -import android.media.soundtrigger_middleware.Phrase; -import android.media.soundtrigger_middleware.PhraseRecognitionEvent; -import android.media.soundtrigger_middleware.PhraseRecognitionExtra; -import android.media.soundtrigger_middleware.PhraseSoundModel; -import android.media.soundtrigger_middleware.RecognitionConfig; -import android.media.soundtrigger_middleware.RecognitionEvent; -import android.media.soundtrigger_middleware.RecognitionMode; -import android.media.soundtrigger_middleware.RecognitionStatus; -import android.media.soundtrigger_middleware.SoundModel; -import android.media.soundtrigger_middleware.SoundModelType; -import android.media.soundtrigger_middleware.SoundTriggerModuleProperties; import android.os.HidlMemory; import android.os.HidlMemoryUtil; import android.os.ParcelFileDescriptor; @@ -55,9 +54,9 @@ import java.util.regex.Matcher; */ class ConversionUtil { static @NonNull - SoundTriggerModuleProperties hidl2aidlProperties( + Properties hidl2aidlProperties( @NonNull ISoundTriggerHw.Properties hidlProperties) { - SoundTriggerModuleProperties aidlProperties = new SoundTriggerModuleProperties(); + Properties aidlProperties = new Properties(); aidlProperties.implementor = hidlProperties.implementor; aidlProperties.description = hidlProperties.description; aidlProperties.version = hidlProperties.version; @@ -75,9 +74,9 @@ class ConversionUtil { return aidlProperties; } - static @NonNull SoundTriggerModuleProperties hidl2aidlProperties( - @NonNull Properties hidlProperties) { - SoundTriggerModuleProperties aidlProperties = hidl2aidlProperties(hidlProperties.base); + static @NonNull Properties hidl2aidlProperties( + @NonNull android.hardware.soundtrigger.V2_3.Properties hidlProperties) { + Properties aidlProperties = hidl2aidlProperties(hidlProperties.base); aidlProperties.supportedModelArch = hidlProperties.supportedModelArch; aidlProperties.audioCapabilities = hidl2aidlAudioCapabilities(hidlProperties.audioCapabilities); diff --git a/services/core/java/com/android/server/soundtrigger_middleware/ISoundTriggerHw2.java b/services/core/java/com/android/server/soundtrigger_middleware/ISoundTriggerHw2.java index d04e31489662f..883b730fc1fb0 100644 --- a/services/core/java/com/android/server/soundtrigger_middleware/ISoundTriggerHw2.java +++ b/services/core/java/com/android/server/soundtrigger_middleware/ISoundTriggerHw2.java @@ -36,7 +36,7 @@ import android.os.IHwBinder; *
  • This interface will always include all the methods from the latest 2.x version (and thus * from every 2.x version) interface, with the convention that unsupported methods throw a * {@link RecoverableException} with a - * {@link android.media.soundtrigger_middleware.Status#OPERATION_NOT_SUPPORTED} + * {@link android.media.soundtrigger.Status#OPERATION_NOT_SUPPORTED} * code. *
  • Cases where the original interface had multiple versions of a method representing the exact * thing, or there exists a trivial conversion between the new and old version, this interface diff --git a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerHw2Compat.java b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerHw2Compat.java index 9da6562a40ac4..04b128cf95b5c 100644 --- a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerHw2Compat.java +++ b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerHw2Compat.java @@ -19,7 +19,7 @@ package com.android.server.soundtrigger_middleware; import android.annotation.NonNull; import android.annotation.Nullable; import android.hardware.soundtrigger.V2_0.ISoundTriggerHw; -import android.media.soundtrigger_middleware.Status; +import android.media.soundtrigger.Status; import android.os.IHwBinder; import android.os.RemoteException; import android.system.OsConstants; @@ -41,7 +41,7 @@ import java.util.concurrent.atomic.AtomicReference; *
  • All {@link RemoteException}s get rethrown as {@link RuntimeException}. *
  • All HAL malfunctions get thrown as {@link HalException}. *
  • All unsupported operations get thrown as {@link RecoverableException} with a - * {@link android.media.soundtrigger_middleware.Status#OPERATION_NOT_SUPPORTED} + * {@link android.media.soundtrigger.Status#OPERATION_NOT_SUPPORTED} * code. * */ diff --git a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerHw2ConcurrentCaptureHandler.java b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerHw2ConcurrentCaptureHandler.java index 429f2a8ab5e95..e89f4bc8e21f4 100644 --- a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerHw2ConcurrentCaptureHandler.java +++ b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerHw2ConcurrentCaptureHandler.java @@ -22,10 +22,10 @@ import android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback; import android.hardware.soundtrigger.V2_3.ModelParameterRange; import android.hardware.soundtrigger.V2_3.Properties; import android.hardware.soundtrigger.V2_3.RecognitionConfig; +import android.media.soundtrigger.RecognitionStatus; +import android.media.soundtrigger.SoundModelType; +import android.media.soundtrigger.Status; import android.media.permission.SafeCloseable; -import android.media.soundtrigger_middleware.RecognitionStatus; -import android.media.soundtrigger_middleware.SoundModelType; -import android.media.soundtrigger_middleware.Status; import android.os.IHwBinder; import android.os.RemoteException; diff --git a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerHw2Enforcer.java b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerHw2Enforcer.java index 6276b996045c2..5253471eca751 100644 --- a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerHw2Enforcer.java +++ b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerHw2Enforcer.java @@ -21,8 +21,8 @@ import android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback; import android.hardware.soundtrigger.V2_3.ModelParameterRange; import android.hardware.soundtrigger.V2_3.Properties; import android.hardware.soundtrigger.V2_3.RecognitionConfig; -import android.media.soundtrigger_middleware.RecognitionStatus; -import android.media.soundtrigger_middleware.Status; +import android.media.soundtrigger.RecognitionStatus; +import android.media.soundtrigger.Status; import android.os.DeadObjectException; import android.os.IHwBinder; import android.os.RemoteException; diff --git a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerHw2MaxModelLimiter.java b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerHw2MaxModelLimiter.java index 7b1dedd9e3469..3d1b10c250710 100644 --- a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerHw2MaxModelLimiter.java +++ b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerHw2MaxModelLimiter.java @@ -21,7 +21,7 @@ import android.hardware.soundtrigger.V2_1.ISoundTriggerHw; import android.hardware.soundtrigger.V2_3.ModelParameterRange; import android.hardware.soundtrigger.V2_3.Properties; import android.hardware.soundtrigger.V2_3.RecognitionConfig; -import android.media.soundtrigger_middleware.Status; +import android.media.soundtrigger.Status; import android.os.IHwBinder; import android.os.RemoteException; diff --git a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareImpl.java b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareImpl.java index 9495e01391f0a..c8c0f3d00cbf4 100644 --- a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareImpl.java +++ b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareImpl.java @@ -36,7 +36,7 @@ import java.util.List; *
  • There is no binder instance associated with this implementation. Do not call asBinder(). *
  • The implementation may throw a {@link RecoverableException} to indicate non-fatal, * recoverable faults. The error code would one of the - * {@link android.media.soundtrigger_middleware.Status} + * {@link android.media.soundtrigger.Status} * constants. Any other exception thrown should be regarded as a bug in the implementation or one * of its dependencies (assuming correct usage). *
  • The implementation is designed for testibility by featuring dependency injection (the @@ -119,4 +119,4 @@ public class SoundTriggerMiddlewareImpl implements ISoundTriggerMiddlewareIntern ISoundTriggerModule attach(int handle, @NonNull ISoundTriggerCallback callback) { return mModules[handle].attach(callback); } -} \ No newline at end of file +} diff --git a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareLogging.java b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareLogging.java index e3dd360ab6fc9..9ab4b8b79971e 100644 --- a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareLogging.java +++ b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareLogging.java @@ -18,16 +18,16 @@ package com.android.server.soundtrigger_middleware; import android.annotation.NonNull; import android.annotation.Nullable; +import android.media.soundtrigger.ModelParameterRange; +import android.media.soundtrigger.PhraseRecognitionEvent; +import android.media.soundtrigger.PhraseSoundModel; +import android.media.soundtrigger.RecognitionConfig; +import android.media.soundtrigger.RecognitionEvent; +import android.media.soundtrigger.SoundModel; import android.media.permission.Identity; import android.media.permission.IdentityContext; import android.media.soundtrigger_middleware.ISoundTriggerCallback; import android.media.soundtrigger_middleware.ISoundTriggerModule; -import android.media.soundtrigger_middleware.ModelParameterRange; -import android.media.soundtrigger_middleware.PhraseRecognitionEvent; -import android.media.soundtrigger_middleware.PhraseSoundModel; -import android.media.soundtrigger_middleware.RecognitionConfig; -import android.media.soundtrigger_middleware.RecognitionEvent; -import android.media.soundtrigger_middleware.SoundModel; import android.media.soundtrigger_middleware.SoundTriggerModuleDescriptor; import android.os.IBinder; import android.os.RemoteException; diff --git a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewarePermission.java b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewarePermission.java index 38e4bc272e7cc..530c2d3bad14e 100644 --- a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewarePermission.java +++ b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewarePermission.java @@ -23,20 +23,20 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.content.Context; import android.content.PermissionChecker; +import android.media.soundtrigger.ModelParameterRange; +import android.media.soundtrigger.PhraseRecognitionEvent; +import android.media.soundtrigger.PhraseSoundModel; +import android.media.soundtrigger.RecognitionConfig; +import android.media.soundtrigger.RecognitionEvent; +import android.media.soundtrigger.SoundModel; +import android.media.soundtrigger.Status; import android.media.permission.Identity; import android.media.permission.IdentityContext; import android.media.permission.PermissionUtil; import android.media.soundtrigger_middleware.ISoundTriggerCallback; import android.media.soundtrigger_middleware.ISoundTriggerMiddlewareService; import android.media.soundtrigger_middleware.ISoundTriggerModule; -import android.media.soundtrigger_middleware.ModelParameterRange; -import android.media.soundtrigger_middleware.PhraseRecognitionEvent; -import android.media.soundtrigger_middleware.PhraseSoundModel; -import android.media.soundtrigger_middleware.RecognitionConfig; -import android.media.soundtrigger_middleware.RecognitionEvent; -import android.media.soundtrigger_middleware.SoundModel; import android.media.soundtrigger_middleware.SoundTriggerModuleDescriptor; -import android.media.soundtrigger_middleware.Status; import android.os.IBinder; import android.os.RemoteException; import android.os.ServiceSpecificException; diff --git a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareService.java b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareService.java index bf3af7151fd28..c1ce929bdc529 100644 --- a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareService.java +++ b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareService.java @@ -21,6 +21,10 @@ import static android.Manifest.permission.SOUNDTRIGGER_DELEGATE_IDENTITY; import android.annotation.NonNull; import android.content.Context; import android.hardware.soundtrigger.V2_0.ISoundTriggerHw; +import android.media.soundtrigger.ModelParameterRange; +import android.media.soundtrigger.PhraseSoundModel; +import android.media.soundtrigger.RecognitionConfig; +import android.media.soundtrigger.SoundModel; import android.media.permission.ClearCallingIdentityContext; import android.media.permission.Identity; import android.media.permission.PermissionUtil; @@ -28,10 +32,6 @@ import android.media.permission.SafeCloseable; import android.media.soundtrigger_middleware.ISoundTriggerCallback; import android.media.soundtrigger_middleware.ISoundTriggerMiddlewareService; import android.media.soundtrigger_middleware.ISoundTriggerModule; -import android.media.soundtrigger_middleware.ModelParameterRange; -import android.media.soundtrigger_middleware.PhraseSoundModel; -import android.media.soundtrigger_middleware.RecognitionConfig; -import android.media.soundtrigger_middleware.SoundModel; import android.media.soundtrigger_middleware.SoundTriggerModuleDescriptor; import android.os.HwBinder; import android.os.RemoteException; diff --git a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareValidation.java b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareValidation.java index b5cc0ff81a15b..51cd7af614803 100644 --- a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareValidation.java +++ b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareValidation.java @@ -18,21 +18,21 @@ package com.android.server.soundtrigger_middleware; import android.annotation.NonNull; import android.annotation.Nullable; +import android.media.soundtrigger.ModelParameterRange; +import android.media.soundtrigger.PhraseRecognitionEvent; +import android.media.soundtrigger.PhraseSoundModel; +import android.media.soundtrigger.Properties; +import android.media.soundtrigger.RecognitionConfig; +import android.media.soundtrigger.RecognitionEvent; +import android.media.soundtrigger.RecognitionStatus; +import android.media.soundtrigger.SoundModel; +import android.media.soundtrigger.Status; import android.media.permission.Identity; import android.media.permission.IdentityContext; import android.media.soundtrigger_middleware.ISoundTriggerCallback; import android.media.soundtrigger_middleware.ISoundTriggerMiddlewareService; import android.media.soundtrigger_middleware.ISoundTriggerModule; -import android.media.soundtrigger_middleware.ModelParameterRange; -import android.media.soundtrigger_middleware.PhraseRecognitionEvent; -import android.media.soundtrigger_middleware.PhraseSoundModel; -import android.media.soundtrigger_middleware.RecognitionConfig; -import android.media.soundtrigger_middleware.RecognitionEvent; -import android.media.soundtrigger_middleware.RecognitionStatus; -import android.media.soundtrigger_middleware.SoundModel; import android.media.soundtrigger_middleware.SoundTriggerModuleDescriptor; -import android.media.soundtrigger_middleware.SoundTriggerModuleProperties; -import android.media.soundtrigger_middleware.Status; import android.os.IBinder; import android.os.RemoteException; import android.os.ServiceSpecificException; @@ -112,10 +112,10 @@ public class SoundTriggerMiddlewareValidation implements ISoundTriggerMiddleware } private class ModuleState { - public @NonNull SoundTriggerModuleProperties properties; + public @NonNull Properties properties; public Set sessions = new HashSet<>(); - private ModuleState(@NonNull SoundTriggerModuleProperties properties) { + private ModuleState(@NonNull Properties properties) { this.properties = properties; } } diff --git a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerModule.java b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerModule.java index ef8cf6949900d..fab0b0eaba14d 100644 --- a/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerModule.java +++ b/services/core/java/com/android/server/soundtrigger_middleware/SoundTriggerModule.java @@ -20,17 +20,17 @@ import android.annotation.NonNull; import android.annotation.Nullable; import android.hardware.soundtrigger.V2_1.ISoundTriggerHwCallback; import android.hardware.soundtrigger.V2_2.ISoundTriggerHw; +import android.media.soundtrigger.ModelParameterRange; +import android.media.soundtrigger.PhraseRecognitionEvent; +import android.media.soundtrigger.PhraseSoundModel; +import android.media.soundtrigger.Properties; +import android.media.soundtrigger.RecognitionConfig; +import android.media.soundtrigger.RecognitionEvent; +import android.media.soundtrigger.RecognitionStatus; +import android.media.soundtrigger.SoundModel; +import android.media.soundtrigger.Status; import android.media.soundtrigger_middleware.ISoundTriggerCallback; import android.media.soundtrigger_middleware.ISoundTriggerModule; -import android.media.soundtrigger_middleware.ModelParameterRange; -import android.media.soundtrigger_middleware.PhraseRecognitionEvent; -import android.media.soundtrigger_middleware.PhraseSoundModel; -import android.media.soundtrigger_middleware.RecognitionConfig; -import android.media.soundtrigger_middleware.RecognitionEvent; -import android.media.soundtrigger_middleware.RecognitionStatus; -import android.media.soundtrigger_middleware.SoundModel; -import android.media.soundtrigger_middleware.SoundTriggerModuleProperties; -import android.media.soundtrigger_middleware.Status; import android.os.IBinder; import android.os.IHwBinder; import android.os.RemoteException; @@ -68,9 +68,8 @@ import java.util.Set; *
  • There is no binder instance associated with this implementation. Do not call asBinder(). *
  • The implementation may throw a {@link RecoverableException} to indicate non-fatal, * recoverable faults. The error code would one of the - * {@link android.media.soundtrigger_middleware.Status} constants. Any other exception - * thrown should be regarded as a bug in the implementation or one of its dependencies - * (assuming correct usage). + * {@link android.media.soundtrigger.Status} constants. Any other exception thrown should be + * regarded as a bug in the implementation or one of its dependencies (assuming correct usage). *
  • The implementation is designed for testability by featuring dependency injection (the * underlying HAL driver instances are passed to the ctor) and by minimizing dependencies * on Android runtime. @@ -91,7 +90,7 @@ class SoundTriggerModule implements IHwBinder.DeathRecipient, ISoundTriggerHw2.G @NonNull private ISoundTriggerHw2 mHalService; @NonNull private final SoundTriggerMiddlewareImpl.AudioSessionProvider mAudioSessionProvider; private final Set mActiveSessions = new HashSet<>(); - private SoundTriggerModuleProperties mProperties; + private Properties mProperties; /** * Ctor. @@ -132,7 +131,7 @@ class SoundTriggerModule implements IHwBinder.DeathRecipient, ISoundTriggerHw2.G * @return The properties structure. */ synchronized @NonNull - SoundTriggerModuleProperties getProperties() { + Properties getProperties() { return mProperties; } diff --git a/services/core/java/com/android/server/soundtrigger_middleware/ValidationUtil.java b/services/core/java/com/android/server/soundtrigger_middleware/ValidationUtil.java index e05c468186ed7..4d52121149072 100644 --- a/services/core/java/com/android/server/soundtrigger_middleware/ValidationUtil.java +++ b/services/core/java/com/android/server/soundtrigger_middleware/ValidationUtil.java @@ -17,21 +17,18 @@ package com.android.server.soundtrigger_middleware; import android.annotation.Nullable; -import android.media.soundtrigger_middleware.ConfidenceLevel; -import android.media.soundtrigger_middleware.ModelParameter; -import android.media.soundtrigger_middleware.Phrase; -import android.media.soundtrigger_middleware.PhraseRecognitionExtra; -import android.media.soundtrigger_middleware.PhraseSoundModel; -import android.media.soundtrigger_middleware.RecognitionConfig; -import android.media.soundtrigger_middleware.RecognitionMode; -import android.media.soundtrigger_middleware.SoundModel; -import android.media.soundtrigger_middleware.SoundModelType; - -import com.android.internal.util.Preconditions; +import android.media.soundtrigger.ConfidenceLevel; +import android.media.soundtrigger.ModelParameter; +import android.media.soundtrigger.Phrase; +import android.media.soundtrigger.PhraseRecognitionExtra; +import android.media.soundtrigger.PhraseSoundModel; +import android.media.soundtrigger.RecognitionConfig; +import android.media.soundtrigger.RecognitionMode; +import android.media.soundtrigger.SoundModel; +import android.media.soundtrigger.SoundModelType; import java.util.Objects; import java.util.regex.Matcher; -import java.util.regex.Pattern; /** * Utilities for asserting the validity of various data types used by this module. diff --git a/services/tests/servicestests/src/com/android/server/soundtrigger_middleware/SoundHw2CompatTest.java b/services/tests/servicestests/src/com/android/server/soundtrigger_middleware/SoundHw2CompatTest.java index 5cd0adb6b4837..504e3af28d3e1 100644 --- a/services/tests/servicestests/src/com/android/server/soundtrigger_middleware/SoundHw2CompatTest.java +++ b/services/tests/servicestests/src/com/android/server/soundtrigger_middleware/SoundHw2CompatTest.java @@ -37,7 +37,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; -import android.media.soundtrigger_middleware.Status; +import android.media.soundtrigger.Status; import android.os.HwParcel; import android.os.IHwBinder; import android.os.IHwInterface; diff --git a/services/tests/servicestests/src/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareImplTest.java b/services/tests/servicestests/src/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareImplTest.java index c8986d53e6969..74f93e501deb0 100644 --- a/services/tests/servicestests/src/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareImplTest.java +++ b/services/tests/servicestests/src/com/android/server/soundtrigger_middleware/SoundTriggerMiddlewareImplTest.java @@ -30,19 +30,19 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import android.hardware.soundtrigger.V2_0.ISoundTriggerHwCallback; +import android.media.soundtrigger.ModelParameter; +import android.media.soundtrigger.ModelParameterRange; +import android.media.soundtrigger.PhraseRecognitionEvent; +import android.media.soundtrigger.PhraseSoundModel; +import android.media.soundtrigger.Properties; +import android.media.soundtrigger.RecognitionConfig; +import android.media.soundtrigger.RecognitionEvent; +import android.media.soundtrigger.RecognitionStatus; +import android.media.soundtrigger.SoundModel; +import android.media.soundtrigger.Status; import android.media.soundtrigger_middleware.ISoundTriggerCallback; import android.media.soundtrigger_middleware.ISoundTriggerModule; -import android.media.soundtrigger_middleware.ModelParameter; -import android.media.soundtrigger_middleware.ModelParameterRange; -import android.media.soundtrigger_middleware.PhraseRecognitionEvent; -import android.media.soundtrigger_middleware.PhraseSoundModel; -import android.media.soundtrigger_middleware.RecognitionConfig; -import android.media.soundtrigger_middleware.RecognitionEvent; -import android.media.soundtrigger_middleware.RecognitionStatus; -import android.media.soundtrigger_middleware.SoundModel; import android.media.soundtrigger_middleware.SoundTriggerModuleDescriptor; -import android.media.soundtrigger_middleware.SoundTriggerModuleProperties; -import android.media.soundtrigger_middleware.Status; import android.os.RemoteException; import android.util.Pair; @@ -163,7 +163,7 @@ public class SoundTriggerMiddlewareImplTest { SoundTriggerModuleDescriptor[] allDescriptors = mService.listModules(); assertEquals(1, allDescriptors.length); - SoundTriggerModuleProperties properties = allDescriptors[0].properties; + Properties properties = allDescriptors[0].properties; TestUtil.validateDefaultProperties(properties, false); } diff --git a/services/tests/servicestests/src/com/android/server/soundtrigger_middleware/TestUtil.java b/services/tests/servicestests/src/com/android/server/soundtrigger_middleware/TestUtil.java index a2b0c45d4a37d..fdca5585240dd 100644 --- a/services/tests/servicestests/src/com/android/server/soundtrigger_middleware/TestUtil.java +++ b/services/tests/servicestests/src/com/android/server/soundtrigger_middleware/TestUtil.java @@ -26,18 +26,18 @@ import android.hardware.soundtrigger.V2_1.ISoundTriggerHw; import android.hardware.soundtrigger.V2_4.ISoundTriggerHwCallback; import android.media.audio.common.AudioChannelMask; import android.media.audio.common.AudioFormat; -import android.media.soundtrigger_middleware.AudioCapabilities; -import android.media.soundtrigger_middleware.ConfidenceLevel; -import android.media.soundtrigger_middleware.Phrase; -import android.media.soundtrigger_middleware.PhraseRecognitionEvent; -import android.media.soundtrigger_middleware.PhraseRecognitionExtra; -import android.media.soundtrigger_middleware.PhraseSoundModel; -import android.media.soundtrigger_middleware.RecognitionConfig; -import android.media.soundtrigger_middleware.RecognitionEvent; -import android.media.soundtrigger_middleware.RecognitionMode; -import android.media.soundtrigger_middleware.SoundModel; -import android.media.soundtrigger_middleware.SoundModelType; -import android.media.soundtrigger_middleware.SoundTriggerModuleProperties; +import android.media.soundtrigger.AudioCapabilities; +import android.media.soundtrigger.ConfidenceLevel; +import android.media.soundtrigger.Phrase; +import android.media.soundtrigger.PhraseRecognitionEvent; +import android.media.soundtrigger.PhraseRecognitionExtra; +import android.media.soundtrigger.PhraseSoundModel; +import android.media.soundtrigger.Properties; +import android.media.soundtrigger.RecognitionConfig; +import android.media.soundtrigger.RecognitionEvent; +import android.media.soundtrigger.RecognitionMode; +import android.media.soundtrigger.SoundModel; +import android.media.soundtrigger.SoundModelType; import android.os.HidlMemoryUtil; import android.os.ParcelFileDescriptor; import android.os.SharedMemory; @@ -184,7 +184,7 @@ public class TestUtil { return properties; } - public static void validateDefaultProperties(SoundTriggerModuleProperties properties, + public static void validateDefaultProperties(Properties properties, boolean supportConcurrentCapture) { assertEquals("implementor", properties.implementor); assertEquals("description", properties.description);