Merge "Challenge is expected in timestamp token in case 2"
diff --git a/TEST_MAPPING b/TEST_MAPPING
index acae4f3..25246d8 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -12,6 +12,11 @@
{
"name": "VtsHalTvInputV1_0TargetTest"
}
+ ],
+ "auto-presubmit": [
+ {
+ "name": "hal_implementation_test"
+ }
]
}
diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp
index 515787e..4038ab5 100644
--- a/audio/aidl/Android.bp
+++ b/audio/aidl/Android.bp
@@ -42,7 +42,7 @@
"android/hardware/audio/common/SinkMetadata.aidl",
"android/hardware/audio/common/SourceMetadata.aidl",
],
- frozen: false,
+ frozen: true,
imports: [
"android.media.audio.common.types-V2",
],
@@ -71,6 +71,11 @@
version: "1",
imports: ["android.media.audio.common.types-V2"],
},
+ {
+ version: "2",
+ imports: ["android.media.audio.common.types-V2"],
+ },
+
// IMPORTANT: Update latest_android_hardware_audio_common every time you
// add the latest frozen version to versions_with_info
],
@@ -147,9 +152,22 @@
},
},
versions_with_info: [
+ {
+ version: "1",
+ imports: [
+ "android.hardware.common-V2",
+ "android.hardware.common.fmq-V1",
+ "android.hardware.audio.common-V2",
+ "android.hardware.audio.core.sounddose-V1",
+ "android.hardware.audio.effect-V1",
+ "android.media.audio.common.types-V2",
+ ],
+ },
+
// IMPORTANT: Update latest_android_hardware_audio_core every time you
// add the latest frozen version to versions_with_info
],
+ frozen: true,
}
// Note: This should always be one version ahead of the last frozen version
@@ -194,9 +212,15 @@
},
},
versions_with_info: [
+ {
+ version: "1",
+ imports: ["android.media.audio.common.types-V2"],
+ },
+
// IMPORTANT: Update latest_android_hardware_audio_core_sounddose every time you
// add the latest frozen version to versions_with_info
],
+ frozen: true,
}
// Note: This should always be one version ahead of the last frozen version
@@ -268,6 +292,19 @@
sdk_version: "module_current",
},
},
+ frozen: true,
+ versions_with_info: [
+ {
+ version: "1",
+ imports: [
+ "android.hardware.common-V2",
+ "android.hardware.common.fmq-V1",
+ "android.hardware.audio.common-V2",
+ "android.media.audio.common.types-V2",
+ ],
+ },
+ ],
+
}
latest_android_hardware_audio_effect = "android.hardware.audio.effect-V1"
diff --git a/audio/aidl/aidl_api/android.hardware.audio.common/2/.hash b/audio/aidl/aidl_api/android.hardware.audio.common/2/.hash
new file mode 100644
index 0000000..6f56a4c
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.common/2/.hash
@@ -0,0 +1 @@
+6780ccb29120b4c7d3ed60f55a23c13b0431f3a4
diff --git a/audio/aidl/aidl_api/android.hardware.audio.common/2/android/hardware/audio/common/AudioOffloadMetadata.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/2/android/hardware/audio/common/AudioOffloadMetadata.aidl
new file mode 100644
index 0000000..000504b
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.common/2/android/hardware/audio/common/AudioOffloadMetadata.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2023 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 <name>-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.hardware.audio.common;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable AudioOffloadMetadata {
+ int sampleRate;
+ android.media.audio.common.AudioChannelLayout channelMask;
+ int averageBitRatePerSecond;
+ int delayFrames;
+ int paddingFrames;
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.common/2/android/hardware/audio/common/PlaybackTrackMetadata.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/2/android/hardware/audio/common/PlaybackTrackMetadata.aidl
new file mode 100644
index 0000000..be4941c
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.common/2/android/hardware/audio/common/PlaybackTrackMetadata.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2021 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 <name>-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.hardware.audio.common;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable PlaybackTrackMetadata {
+ android.media.audio.common.AudioUsage usage = android.media.audio.common.AudioUsage.INVALID;
+ android.media.audio.common.AudioContentType contentType = android.media.audio.common.AudioContentType.UNKNOWN;
+ float gain;
+ android.media.audio.common.AudioChannelLayout channelMask;
+ @nullable android.media.audio.common.AudioDevice sourceDevice;
+ @utf8InCpp String[] tags;
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.common/2/android/hardware/audio/common/RecordTrackMetadata.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/2/android/hardware/audio/common/RecordTrackMetadata.aidl
new file mode 100644
index 0000000..8f667d1
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.common/2/android/hardware/audio/common/RecordTrackMetadata.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2021 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 <name>-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.hardware.audio.common;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable RecordTrackMetadata {
+ android.media.audio.common.AudioSource source = android.media.audio.common.AudioSource.SYS_RESERVED_INVALID;
+ float gain;
+ @nullable android.media.audio.common.AudioDevice destinationDevice;
+ android.media.audio.common.AudioChannelLayout channelMask;
+ @utf8InCpp String[] tags;
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.common/2/android/hardware/audio/common/SinkMetadata.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/2/android/hardware/audio/common/SinkMetadata.aidl
new file mode 100644
index 0000000..270147d
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.common/2/android/hardware/audio/common/SinkMetadata.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2021 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 <name>-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.hardware.audio.common;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable SinkMetadata {
+ android.hardware.audio.common.RecordTrackMetadata[] tracks;
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.common/2/android/hardware/audio/common/SourceMetadata.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/2/android/hardware/audio/common/SourceMetadata.aidl
new file mode 100644
index 0000000..2d4a982
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.common/2/android/hardware/audio/common/SourceMetadata.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2021 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 <name>-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.hardware.audio.common;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable SourceMetadata {
+ android.hardware.audio.common.PlaybackTrackMetadata[] tracks;
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/1/.hash b/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/1/.hash
new file mode 100644
index 0000000..270b1c9
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/1/.hash
@@ -0,0 +1 @@
+7913a7ff584002e6889416e5dddbe46878d0a51e
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/1/android/hardware/audio/core/sounddose/ISoundDose.aidl b/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/1/android/hardware/audio/core/sounddose/ISoundDose.aidl
new file mode 100644
index 0000000..5800091
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/1/android/hardware/audio/core/sounddose/ISoundDose.aidl
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core.sounddose;
+@VintfStability
+interface ISoundDose {
+ void setOutputRs2UpperBound(float rs2ValueDbA);
+ float getOutputRs2UpperBound();
+ void registerSoundDoseCallback(in android.hardware.audio.core.sounddose.ISoundDose.IHalSoundDoseCallback callback);
+ const int DEFAULT_MAX_RS2 = 100;
+ const int MIN_RS2 = 80;
+ @VintfStability
+ interface IHalSoundDoseCallback {
+ oneway void onMomentaryExposureWarning(float currentDbA, in android.media.audio.common.AudioDevice audioDevice);
+ oneway void onNewMelValues(in android.hardware.audio.core.sounddose.ISoundDose.IHalSoundDoseCallback.MelRecord melRecord, in android.media.audio.common.AudioDevice audioDevice);
+ @VintfStability
+ parcelable MelRecord {
+ float[] melValues;
+ long timestamp;
+ }
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/current/android/hardware/audio/core/sounddose/ISoundDose.aidl b/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/current/android/hardware/audio/core/sounddose/ISoundDose.aidl
index 3b5d2d0..5800091 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/current/android/hardware/audio/core/sounddose/ISoundDose.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/current/android/hardware/audio/core/sounddose/ISoundDose.aidl
@@ -34,8 +34,8 @@
package android.hardware.audio.core.sounddose;
@VintfStability
interface ISoundDose {
- void setOutputRs2(float rs2ValueDbA);
- float getOutputRs2();
+ void setOutputRs2UpperBound(float rs2ValueDbA);
+ float getOutputRs2UpperBound();
void registerSoundDoseCallback(in android.hardware.audio.core.sounddose.ISoundDose.IHalSoundDoseCallback callback);
const int DEFAULT_MAX_RS2 = 100;
const int MIN_RS2 = 80;
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/.hash b/audio/aidl/aidl_api/android.hardware.audio.core/1/.hash
new file mode 100644
index 0000000..8eb6be5
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/.hash
@@ -0,0 +1 @@
+1cec1e67515bdd2b896d80d20a64bf899b2470bf
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/AudioPatch.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/AudioPatch.aidl
new file mode 100644
index 0000000..078b5ea
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/AudioPatch.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable AudioPatch {
+ int id;
+ int[] sourcePortConfigIds;
+ int[] sinkPortConfigIds;
+ int minimumStreamBufferSizeFrames;
+ int[] latenciesMs;
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/AudioRoute.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/AudioRoute.aidl
new file mode 100644
index 0000000..deeef87
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/AudioRoute.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable AudioRoute {
+ int[] sourcePortIds;
+ int sinkPortId;
+ boolean isExclusive;
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IBluetooth.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IBluetooth.aidl
new file mode 100644
index 0000000..9357a15
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IBluetooth.aidl
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core;
+@VintfStability
+interface IBluetooth {
+ android.hardware.audio.core.IBluetooth.ScoConfig setScoConfig(in android.hardware.audio.core.IBluetooth.ScoConfig config);
+ android.hardware.audio.core.IBluetooth.HfpConfig setHfpConfig(in android.hardware.audio.core.IBluetooth.HfpConfig config);
+ @JavaDerive(equals=true, toString=true) @VintfStability
+ parcelable ScoConfig {
+ @nullable android.media.audio.common.Boolean isEnabled;
+ @nullable android.media.audio.common.Boolean isNrecEnabled;
+ android.hardware.audio.core.IBluetooth.ScoConfig.Mode mode = android.hardware.audio.core.IBluetooth.ScoConfig.Mode.UNSPECIFIED;
+ @nullable @utf8InCpp String debugName;
+ @VintfStability
+ enum Mode {
+ UNSPECIFIED,
+ SCO,
+ SCO_WB,
+ SCO_SWB,
+ }
+ }
+ @JavaDerive(equals=true, toString=true) @VintfStability
+ parcelable HfpConfig {
+ @nullable android.media.audio.common.Boolean isEnabled;
+ @nullable android.media.audio.common.Int sampleRate;
+ @nullable android.media.audio.common.Float volume;
+ const int VOLUME_MIN = 0;
+ const int VOLUME_MAX = 1;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IBluetoothA2dp.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IBluetoothA2dp.aidl
new file mode 100644
index 0000000..0f4c46d
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IBluetoothA2dp.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2023 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 <name>-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.hardware.audio.core;
+@VintfStability
+interface IBluetoothA2dp {
+ boolean isEnabled();
+ void setEnabled(boolean enabled);
+ boolean supportsOffloadReconfiguration();
+ void reconfigureOffload(in android.hardware.audio.core.VendorParameter[] parameters);
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IBluetoothLe.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IBluetoothLe.aidl
new file mode 100644
index 0000000..2068daf
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IBluetoothLe.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2023 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 <name>-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.hardware.audio.core;
+@VintfStability
+interface IBluetoothLe {
+ boolean isEnabled();
+ void setEnabled(boolean enabled);
+ boolean supportsOffloadReconfiguration();
+ void reconfigureOffload(in android.hardware.audio.core.VendorParameter[] parameters);
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IConfig.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IConfig.aidl
new file mode 100644
index 0000000..9ce45bb
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IConfig.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core;
+@VintfStability
+interface IConfig {
+ android.hardware.audio.core.SurroundSoundConfig getSurroundSoundConfig();
+ android.media.audio.common.AudioHalEngineConfig getEngineConfig();
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IModule.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IModule.aidl
new file mode 100644
index 0000000..e14e9c0
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IModule.aidl
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core;
+@VintfStability
+interface IModule {
+ void setModuleDebug(in android.hardware.audio.core.ModuleDebug debug);
+ @nullable android.hardware.audio.core.ITelephony getTelephony();
+ @nullable android.hardware.audio.core.IBluetooth getBluetooth();
+ @nullable android.hardware.audio.core.IBluetoothA2dp getBluetoothA2dp();
+ @nullable android.hardware.audio.core.IBluetoothLe getBluetoothLe();
+ android.media.audio.common.AudioPort connectExternalDevice(in android.media.audio.common.AudioPort templateIdAndAdditionalData);
+ void disconnectExternalDevice(int portId);
+ android.hardware.audio.core.AudioPatch[] getAudioPatches();
+ android.media.audio.common.AudioPort getAudioPort(int portId);
+ android.media.audio.common.AudioPortConfig[] getAudioPortConfigs();
+ android.media.audio.common.AudioPort[] getAudioPorts();
+ android.hardware.audio.core.AudioRoute[] getAudioRoutes();
+ android.hardware.audio.core.AudioRoute[] getAudioRoutesForAudioPort(int portId);
+ android.hardware.audio.core.IModule.OpenInputStreamReturn openInputStream(in android.hardware.audio.core.IModule.OpenInputStreamArguments args);
+ android.hardware.audio.core.IModule.OpenOutputStreamReturn openOutputStream(in android.hardware.audio.core.IModule.OpenOutputStreamArguments args);
+ android.hardware.audio.core.IModule.SupportedPlaybackRateFactors getSupportedPlaybackRateFactors();
+ android.hardware.audio.core.AudioPatch setAudioPatch(in android.hardware.audio.core.AudioPatch requested);
+ boolean setAudioPortConfig(in android.media.audio.common.AudioPortConfig requested, out android.media.audio.common.AudioPortConfig suggested);
+ void resetAudioPatch(int patchId);
+ void resetAudioPortConfig(int portConfigId);
+ boolean getMasterMute();
+ void setMasterMute(boolean mute);
+ float getMasterVolume();
+ void setMasterVolume(float volume);
+ boolean getMicMute();
+ void setMicMute(boolean mute);
+ android.media.audio.common.MicrophoneInfo[] getMicrophones();
+ void updateAudioMode(android.media.audio.common.AudioMode mode);
+ void updateScreenRotation(android.hardware.audio.core.IModule.ScreenRotation rotation);
+ void updateScreenState(boolean isTurnedOn);
+ @nullable android.hardware.audio.core.sounddose.ISoundDose getSoundDose();
+ int generateHwAvSyncId();
+ android.hardware.audio.core.VendorParameter[] getVendorParameters(in @utf8InCpp String[] ids);
+ void setVendorParameters(in android.hardware.audio.core.VendorParameter[] parameters, boolean async);
+ void addDeviceEffect(int portConfigId, in android.hardware.audio.effect.IEffect effect);
+ void removeDeviceEffect(int portConfigId, in android.hardware.audio.effect.IEffect effect);
+ android.media.audio.common.AudioMMapPolicyInfo[] getMmapPolicyInfos(android.media.audio.common.AudioMMapPolicyType mmapPolicyType);
+ boolean supportsVariableLatency();
+ int getAAudioMixerBurstCount();
+ int getAAudioHardwareBurstMinUsec();
+ const int DEFAULT_AAUDIO_MIXER_BURST_COUNT = 2;
+ const int DEFAULT_AAUDIO_HARDWARE_BURST_MIN_DURATION_US = 1000;
+ @VintfStability
+ parcelable OpenInputStreamArguments {
+ int portConfigId;
+ android.hardware.audio.common.SinkMetadata sinkMetadata;
+ long bufferSizeFrames;
+ }
+ @VintfStability
+ parcelable OpenInputStreamReturn {
+ android.hardware.audio.core.IStreamIn stream;
+ android.hardware.audio.core.StreamDescriptor desc;
+ }
+ @VintfStability
+ parcelable OpenOutputStreamArguments {
+ int portConfigId;
+ android.hardware.audio.common.SourceMetadata sourceMetadata;
+ @nullable android.media.audio.common.AudioOffloadInfo offloadInfo;
+ long bufferSizeFrames;
+ @nullable android.hardware.audio.core.IStreamCallback callback;
+ @nullable android.hardware.audio.core.IStreamOutEventCallback eventCallback;
+ }
+ @VintfStability
+ parcelable OpenOutputStreamReturn {
+ android.hardware.audio.core.IStreamOut stream;
+ android.hardware.audio.core.StreamDescriptor desc;
+ }
+ @VintfStability
+ parcelable SupportedPlaybackRateFactors {
+ float minSpeed;
+ float maxSpeed;
+ float minPitch;
+ float maxPitch;
+ }
+ @Backing(type="int") @VintfStability
+ enum ScreenRotation {
+ DEG_0 = 0,
+ DEG_90 = 1,
+ DEG_180 = 2,
+ DEG_270 = 3,
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IStreamCallback.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IStreamCallback.aidl
new file mode 100644
index 0000000..5a2ab78
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IStreamCallback.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core;
+@VintfStability
+interface IStreamCallback {
+ oneway void onTransferReady();
+ oneway void onError();
+ oneway void onDrainReady();
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IStreamCommon.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IStreamCommon.aidl
new file mode 100644
index 0000000..65a2ee4
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IStreamCommon.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core;
+@VintfStability
+interface IStreamCommon {
+ void close();
+ void prepareToClose();
+ void updateHwAvSyncId(int hwAvSyncId);
+ android.hardware.audio.core.VendorParameter[] getVendorParameters(in @utf8InCpp String[] ids);
+ void setVendorParameters(in android.hardware.audio.core.VendorParameter[] parameters, boolean async);
+ void addEffect(in android.hardware.audio.effect.IEffect effect);
+ void removeEffect(in android.hardware.audio.effect.IEffect effect);
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IStreamIn.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IStreamIn.aidl
new file mode 100644
index 0000000..a01f877
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IStreamIn.aidl
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core;
+@VintfStability
+interface IStreamIn {
+ android.hardware.audio.core.IStreamCommon getStreamCommon();
+ android.media.audio.common.MicrophoneDynamicInfo[] getActiveMicrophones();
+ android.hardware.audio.core.IStreamIn.MicrophoneDirection getMicrophoneDirection();
+ void setMicrophoneDirection(android.hardware.audio.core.IStreamIn.MicrophoneDirection direction);
+ float getMicrophoneFieldDimension();
+ void setMicrophoneFieldDimension(float zoom);
+ void updateMetadata(in android.hardware.audio.common.SinkMetadata sinkMetadata);
+ float[] getHwGain();
+ void setHwGain(in float[] channelGains);
+ const int MIC_FIELD_DIMENSION_WIDE_ANGLE = (-1) /* -1 */;
+ const int MIC_FIELD_DIMENSION_NO_ZOOM = 0;
+ const int MIC_FIELD_DIMENSION_MAX_ZOOM = 1;
+ const int HW_GAIN_MIN = 0;
+ const int HW_GAIN_MAX = 1;
+ @Backing(type="int") @VintfStability
+ enum MicrophoneDirection {
+ UNSPECIFIED = 0,
+ FRONT = 1,
+ BACK = 2,
+ EXTERNAL = 3,
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IStreamOut.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IStreamOut.aidl
new file mode 100644
index 0000000..ec3078e
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IStreamOut.aidl
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core;
+@VintfStability
+interface IStreamOut {
+ android.hardware.audio.core.IStreamCommon getStreamCommon();
+ void updateMetadata(in android.hardware.audio.common.SourceMetadata sourceMetadata);
+ void updateOffloadMetadata(in android.hardware.audio.common.AudioOffloadMetadata offloadMetadata);
+ float[] getHwVolume();
+ void setHwVolume(in float[] channelVolumes);
+ float getAudioDescriptionMixLevel();
+ void setAudioDescriptionMixLevel(float leveldB);
+ android.media.audio.common.AudioDualMonoMode getDualMonoMode();
+ void setDualMonoMode(android.media.audio.common.AudioDualMonoMode mode);
+ android.media.audio.common.AudioLatencyMode[] getRecommendedLatencyModes();
+ void setLatencyMode(android.media.audio.common.AudioLatencyMode mode);
+ android.media.audio.common.AudioPlaybackRate getPlaybackRateParameters();
+ void setPlaybackRateParameters(in android.media.audio.common.AudioPlaybackRate playbackRate);
+ void selectPresentation(int presentationId, int programId);
+ const int HW_VOLUME_MIN = 0;
+ const int HW_VOLUME_MAX = 1;
+ const int AUDIO_DESCRIPTION_MIX_LEVEL_MAX = 48;
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IStreamOutEventCallback.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IStreamOutEventCallback.aidl
new file mode 100644
index 0000000..31cf0b7
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/IStreamOutEventCallback.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core;
+@VintfStability
+interface IStreamOutEventCallback {
+ oneway void onCodecFormatChanged(in byte[] audioMetadata);
+ oneway void onRecommendedLatencyModeChanged(in android.media.audio.common.AudioLatencyMode[] modes);
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/ITelephony.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/ITelephony.aidl
new file mode 100644
index 0000000..84d7aa1
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/ITelephony.aidl
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core;
+@VintfStability
+interface ITelephony {
+ android.media.audio.common.AudioMode[] getSupportedAudioModes();
+ void switchAudioMode(android.media.audio.common.AudioMode mode);
+ android.hardware.audio.core.ITelephony.TelecomConfig setTelecomConfig(in android.hardware.audio.core.ITelephony.TelecomConfig config);
+ @JavaDerive(equals=true, toString=true) @VintfStability
+ parcelable TelecomConfig {
+ @nullable android.media.audio.common.Float voiceVolume;
+ android.hardware.audio.core.ITelephony.TelecomConfig.TtyMode ttyMode = android.hardware.audio.core.ITelephony.TelecomConfig.TtyMode.UNSPECIFIED;
+ @nullable android.media.audio.common.Boolean isHacEnabled;
+ const int VOICE_VOLUME_MIN = 0;
+ const int VOICE_VOLUME_MAX = 1;
+ @Backing(type="int") @VintfStability
+ enum TtyMode {
+ UNSPECIFIED = (-1) /* -1 */,
+ OFF = 0,
+ FULL = 1,
+ HCO = 2,
+ VCO = 3,
+ }
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/MmapBufferDescriptor.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/MmapBufferDescriptor.aidl
new file mode 100644
index 0000000..6ea1c69
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/MmapBufferDescriptor.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable MmapBufferDescriptor {
+ android.hardware.common.Ashmem sharedMemory;
+ long burstSizeFrames;
+ int flags;
+ const int FLAG_INDEX_APPLICATION_SHAREABLE = 0;
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/ModuleDebug.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/ModuleDebug.aidl
new file mode 100644
index 0000000..467d37b
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/ModuleDebug.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable ModuleDebug {
+ boolean simulateDeviceConnections;
+ int streamTransientStateDelayMs;
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/StreamDescriptor.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/StreamDescriptor.aidl
new file mode 100644
index 0000000..3e3dc38
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/StreamDescriptor.aidl
@@ -0,0 +1,93 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable StreamDescriptor {
+ android.hardware.common.fmq.MQDescriptor<android.hardware.audio.core.StreamDescriptor.Command,android.hardware.common.fmq.SynchronizedReadWrite> command;
+ android.hardware.common.fmq.MQDescriptor<android.hardware.audio.core.StreamDescriptor.Reply,android.hardware.common.fmq.SynchronizedReadWrite> reply;
+ int frameSizeBytes;
+ long bufferSizeFrames;
+ android.hardware.audio.core.StreamDescriptor.AudioBuffer audio;
+ const int LATENCY_UNKNOWN = (-1) /* -1 */;
+ @FixedSize @VintfStability
+ parcelable Position {
+ long frames = UNKNOWN /* -1 */;
+ long timeNs = UNKNOWN /* -1 */;
+ const long UNKNOWN = (-1) /* -1 */;
+ }
+ @Backing(type="int") @VintfStability
+ enum State {
+ STANDBY = 1,
+ IDLE = 2,
+ ACTIVE = 3,
+ PAUSED = 4,
+ DRAINING = 5,
+ DRAIN_PAUSED = 6,
+ TRANSFERRING = 7,
+ TRANSFER_PAUSED = 8,
+ ERROR = 100,
+ }
+ @Backing(type="byte") @VintfStability
+ enum DrainMode {
+ DRAIN_UNSPECIFIED = 0,
+ DRAIN_ALL = 1,
+ DRAIN_EARLY_NOTIFY = 2,
+ }
+ @FixedSize @VintfStability
+ union Command {
+ int halReservedExit;
+ android.media.audio.common.Void getStatus;
+ android.media.audio.common.Void start;
+ int burst;
+ android.hardware.audio.core.StreamDescriptor.DrainMode drain;
+ android.media.audio.common.Void standby;
+ android.media.audio.common.Void pause;
+ android.media.audio.common.Void flush;
+ }
+ @FixedSize @VintfStability
+ parcelable Reply {
+ int status;
+ int fmqByteCount;
+ android.hardware.audio.core.StreamDescriptor.Position observable;
+ android.hardware.audio.core.StreamDescriptor.Position hardware;
+ int latencyMs;
+ int xrunFrames;
+ android.hardware.audio.core.StreamDescriptor.State state = android.hardware.audio.core.StreamDescriptor.State.STANDBY;
+ }
+ @VintfStability
+ union AudioBuffer {
+ android.hardware.common.fmq.MQDescriptor<byte,android.hardware.common.fmq.SynchronizedReadWrite> fmq;
+ android.hardware.audio.core.MmapBufferDescriptor mmap;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/SurroundSoundConfig.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/SurroundSoundConfig.aidl
new file mode 100644
index 0000000..08a1537
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/SurroundSoundConfig.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable SurroundSoundConfig {
+ android.hardware.audio.core.SurroundSoundConfig.SurroundFormatFamily[] formatFamilies;
+ @VintfStability
+ parcelable SurroundFormatFamily {
+ android.media.audio.common.AudioFormatDescription primaryFormat;
+ android.media.audio.common.AudioFormatDescription[] subFormats;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/VendorParameter.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/VendorParameter.aidl
new file mode 100644
index 0000000..bfe33ee
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/1/android/hardware/audio/core/VendorParameter.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.core;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable VendorParameter {
+ @utf8InCpp String id;
+ ParcelableHolder ext;
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/.hash b/audio/aidl/aidl_api/android.hardware.audio.effect/1/.hash
new file mode 100644
index 0000000..b71ab29
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/.hash
@@ -0,0 +1 @@
+34b618a587cb9977ee0cd13b173e699d2dcdb320
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/AcousticEchoCanceler.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/AcousticEchoCanceler.aidl
new file mode 100644
index 0000000..16367c0
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/AcousticEchoCanceler.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union AcousticEchoCanceler {
+ android.hardware.audio.effect.VendorExtension vendor;
+ int echoDelayUs;
+ boolean mobileMode;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.AcousticEchoCanceler.Tag commonTag;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/AutomaticGainControlV1.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/AutomaticGainControlV1.aidl
new file mode 100644
index 0000000..e69e2bd
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/AutomaticGainControlV1.aidl
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2023 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union AutomaticGainControlV1 {
+ android.hardware.audio.effect.VendorExtension vendor;
+ int targetPeakLevelDbFs;
+ int maxCompressionGainDb;
+ boolean enableLimiter;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.AutomaticGainControlV1.Tag commonTag;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/AutomaticGainControlV2.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/AutomaticGainControlV2.aidl
new file mode 100644
index 0000000..46ffcaf
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/AutomaticGainControlV2.aidl
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union AutomaticGainControlV2 {
+ android.hardware.audio.effect.VendorExtension vendor;
+ int fixedDigitalGainMb;
+ android.hardware.audio.effect.AutomaticGainControlV2.LevelEstimator levelEstimator;
+ int saturationMarginMb;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.AutomaticGainControlV2.Tag commonTag;
+ }
+ @Backing(type="int") @VintfStability
+ enum LevelEstimator {
+ RMS = 0,
+ PEAK = 1,
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/BassBoost.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/BassBoost.aidl
new file mode 100644
index 0000000..c248ce8
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/BassBoost.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union BassBoost {
+ android.hardware.audio.effect.VendorExtension vendor;
+ int strengthPm;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.BassBoost.Tag commonTag;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Capability.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Capability.aidl
new file mode 100644
index 0000000..c9df073
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Capability.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+parcelable Capability {
+ android.hardware.audio.effect.VendorExtension vendorExtension;
+ android.hardware.audio.effect.Range range;
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/CommandId.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/CommandId.aidl
new file mode 100644
index 0000000..86b69fa
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/CommandId.aidl
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@Backing(type="int") @VintfStability
+enum CommandId {
+ START = 0,
+ STOP = 1,
+ RESET = 2,
+ VENDOR_COMMAND_0 = 0x100,
+ VENDOR_COMMAND_1,
+ VENDOR_COMMAND_2,
+ VENDOR_COMMAND_3,
+ VENDOR_COMMAND_4,
+ VENDOR_COMMAND_5,
+ VENDOR_COMMAND_6,
+ VENDOR_COMMAND_7,
+ VENDOR_COMMAND_8,
+ VENDOR_COMMAND_9,
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/DefaultExtension.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/DefaultExtension.aidl
new file mode 100644
index 0000000..f1cf389
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/DefaultExtension.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2023 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 <name>-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.hardware.audio.effect;
+@VintfStability
+parcelable DefaultExtension {
+ byte[] bytes;
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Descriptor.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Descriptor.aidl
new file mode 100644
index 0000000..115da1d
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Descriptor.aidl
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+parcelable Descriptor {
+ android.hardware.audio.effect.Descriptor.Common common;
+ android.hardware.audio.effect.Capability capability;
+ const String EFFECT_TYPE_UUID_AEC = "7b491460-8d4d-11e0-bd61-0002a5d5c51b";
+ const String EFFECT_TYPE_UUID_AGC1 = "0a8abfe0-654c-11e0-ba26-0002a5d5c51b";
+ const String EFFECT_TYPE_UUID_AGC2 = "ae3c653b-be18-4ab8-8938-418f0a7f06ac";
+ const String EFFECT_TYPE_UUID_BASS_BOOST = "0634f220-ddd4-11db-a0fc-0002a5d5c51b";
+ const String EFFECT_TYPE_UUID_DOWNMIX = "381e49cc-a858-4aa2-87f6-e8388e7601b2";
+ const String EFFECT_TYPE_UUID_DYNAMICS_PROCESSING = "7261676f-6d75-7369-6364-28e2fd3ac39e";
+ const String EFFECT_TYPE_UUID_ENV_REVERB = "c2e5d5f0-94bd-4763-9cac-4e234d06839e";
+ const String EFFECT_TYPE_UUID_EQUALIZER = "0bed4300-ddd6-11db-8f34-0002a5d5c51b";
+ const String EFFECT_TYPE_UUID_HAPTIC_GENERATOR = "1411e6d6-aecd-4021-a1cf-a6aceb0d71e5";
+ const String EFFECT_TYPE_UUID_LOUDNESS_ENHANCER = "fe3199be-aed0-413f-87bb-11260eb63cf1";
+ const String EFFECT_TYPE_UUID_NS = "58b4b260-8e06-11e0-aa8e-0002a5d5c51b";
+ const String EFFECT_TYPE_UUID_PRESET_REVERB = "47382d60-ddd8-11db-bf3a-0002a5d5c51b";
+ const String EFFECT_TYPE_UUID_SPATIALIZER = "ccd4cf09-a79d-46c2-9aae-06a1698d6c8f";
+ const String EFFECT_TYPE_UUID_VIRTUALIZER = "37cc2c00-dddd-11db-8577-0002a5d5c51b";
+ const String EFFECT_TYPE_UUID_VISUALIZER = "e46b26a0-dddd-11db-8afd-0002a5d5c51b";
+ const String EFFECT_TYPE_UUID_VOLUME = "09e8ede0-ddde-11db-b4f6-0002a5d5c51b";
+ @VintfStability
+ parcelable Identity {
+ android.media.audio.common.AudioUuid type;
+ android.media.audio.common.AudioUuid uuid;
+ @nullable android.media.audio.common.AudioUuid proxy;
+ }
+ @VintfStability
+ parcelable Common {
+ android.hardware.audio.effect.Descriptor.Identity id;
+ android.hardware.audio.effect.Flags flags;
+ int cpuLoad;
+ int memoryUsage;
+ @utf8InCpp String name;
+ @utf8InCpp String implementor;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Downmix.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Downmix.aidl
new file mode 100644
index 0000000..ce0a7df
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Downmix.aidl
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union Downmix {
+ android.hardware.audio.effect.VendorExtension vendor;
+ android.hardware.audio.effect.Downmix.Type type;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.Downmix.Tag commonTag;
+ }
+ @VintfStability
+ enum Type {
+ STRIP,
+ FOLD,
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/DynamicsProcessing.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/DynamicsProcessing.aidl
new file mode 100644
index 0000000..04f627d
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/DynamicsProcessing.aidl
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union DynamicsProcessing {
+ android.hardware.audio.effect.VendorExtension vendor;
+ android.hardware.audio.effect.DynamicsProcessing.EngineArchitecture engineArchitecture;
+ android.hardware.audio.effect.DynamicsProcessing.ChannelConfig[] preEq;
+ android.hardware.audio.effect.DynamicsProcessing.ChannelConfig[] postEq;
+ android.hardware.audio.effect.DynamicsProcessing.EqBandConfig[] preEqBand;
+ android.hardware.audio.effect.DynamicsProcessing.EqBandConfig[] postEqBand;
+ android.hardware.audio.effect.DynamicsProcessing.ChannelConfig[] mbc;
+ android.hardware.audio.effect.DynamicsProcessing.MbcBandConfig[] mbcBand;
+ android.hardware.audio.effect.DynamicsProcessing.LimiterConfig[] limiter;
+ android.hardware.audio.effect.DynamicsProcessing.InputGain[] inputGain;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.DynamicsProcessing.Tag commonTag;
+ }
+ enum ResolutionPreference {
+ FAVOR_FREQUENCY_RESOLUTION,
+ FAVOR_TIME_RESOLUTION,
+ }
+ @VintfStability
+ parcelable StageEnablement {
+ boolean inUse;
+ int bandCount;
+ }
+ @VintfStability
+ parcelable EngineArchitecture {
+ android.hardware.audio.effect.DynamicsProcessing.ResolutionPreference resolutionPreference = android.hardware.audio.effect.DynamicsProcessing.ResolutionPreference.FAVOR_FREQUENCY_RESOLUTION;
+ float preferredProcessingDurationMs;
+ android.hardware.audio.effect.DynamicsProcessing.StageEnablement preEqStage;
+ android.hardware.audio.effect.DynamicsProcessing.StageEnablement postEqStage;
+ android.hardware.audio.effect.DynamicsProcessing.StageEnablement mbcStage;
+ boolean limiterInUse;
+ }
+ @VintfStability
+ parcelable ChannelConfig {
+ int channel;
+ boolean enable;
+ }
+ @VintfStability
+ parcelable EqBandConfig {
+ int channel;
+ int band;
+ boolean enable;
+ float cutoffFrequencyHz;
+ float gainDb;
+ }
+ @VintfStability
+ parcelable MbcBandConfig {
+ int channel;
+ int band;
+ boolean enable;
+ float cutoffFrequencyHz;
+ float attackTimeMs;
+ float releaseTimeMs;
+ float ratio;
+ float thresholdDb;
+ float kneeWidthDb;
+ float noiseGateThresholdDb;
+ float expanderRatio;
+ float preGainDb;
+ float postGainDb;
+ }
+ @VintfStability
+ parcelable LimiterConfig {
+ int channel;
+ boolean enable;
+ int linkGroup;
+ float attackTimeMs;
+ float releaseTimeMs;
+ float ratio;
+ float thresholdDb;
+ float postGainDb;
+ }
+ @VintfStability
+ parcelable InputGain {
+ int channel;
+ float gainDb;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/EnvironmentalReverb.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/EnvironmentalReverb.aidl
new file mode 100644
index 0000000..00b7d1a
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/EnvironmentalReverb.aidl
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union EnvironmentalReverb {
+ android.hardware.audio.effect.VendorExtension vendor;
+ int roomLevelMb;
+ int roomHfLevelMb;
+ int decayTimeMs;
+ int decayHfRatioPm;
+ int reflectionsLevelMb;
+ int reflectionsDelayMs;
+ int levelMb;
+ int delayMs;
+ int diffusionPm;
+ int densityPm;
+ boolean bypass;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.EnvironmentalReverb.Tag commonTag;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Equalizer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Equalizer.aidl
new file mode 100644
index 0000000..80f7c7e
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Equalizer.aidl
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union Equalizer {
+ android.hardware.audio.effect.VendorExtension vendor;
+ android.hardware.audio.effect.Equalizer.BandLevel[] bandLevels;
+ int preset;
+ int[] centerFreqMh;
+ android.hardware.audio.effect.Equalizer.BandFrequency[] bandFrequencies;
+ android.hardware.audio.effect.Equalizer.Preset[] presets;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.Equalizer.Tag commonTag;
+ }
+ @VintfStability
+ parcelable BandLevel {
+ int index;
+ int levelMb;
+ }
+ @VintfStability
+ parcelable BandFrequency {
+ int index;
+ int minMh;
+ int maxMh;
+ }
+ @VintfStability
+ parcelable Preset {
+ int index;
+ @utf8InCpp String name;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Flags.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Flags.aidl
new file mode 100644
index 0000000..bcbf870
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Flags.aidl
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+parcelable Flags {
+ android.hardware.audio.effect.Flags.Type type = android.hardware.audio.effect.Flags.Type.INSERT;
+ android.hardware.audio.effect.Flags.Insert insert = android.hardware.audio.effect.Flags.Insert.ANY;
+ android.hardware.audio.effect.Flags.Volume volume = android.hardware.audio.effect.Flags.Volume.NONE;
+ android.hardware.audio.effect.Flags.HardwareAccelerator hwAcceleratorMode = android.hardware.audio.effect.Flags.HardwareAccelerator.NONE;
+ boolean offloadIndication;
+ boolean deviceIndication;
+ boolean audioModeIndication;
+ boolean audioSourceIndication;
+ boolean bypass;
+ @Backing(type="byte") @VintfStability
+ enum Type {
+ INSERT = 0,
+ AUXILIARY = 1,
+ REPLACE = 2,
+ PRE_PROC = 3,
+ POST_PROC = 4,
+ }
+ @Backing(type="byte") @VintfStability
+ enum Insert {
+ ANY = 0,
+ FIRST = 1,
+ LAST = 2,
+ EXCLUSIVE = 3,
+ }
+ @Backing(type="byte") @VintfStability
+ enum Volume {
+ NONE = 0,
+ CTRL = 1,
+ IND = 2,
+ MONITOR = 3,
+ }
+ @Backing(type="byte") @VintfStability
+ enum HardwareAccelerator {
+ NONE = 0,
+ SIMPLE = 1,
+ TUNNEL = 2,
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/HapticGenerator.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/HapticGenerator.aidl
new file mode 100644
index 0000000..8addab7
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/HapticGenerator.aidl
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union HapticGenerator {
+ android.hardware.audio.effect.VendorExtension vendor;
+ android.hardware.audio.effect.HapticGenerator.HapticScale[] hapticScales;
+ android.hardware.audio.effect.HapticGenerator.VibratorInformation vibratorInfo;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.HapticGenerator.Tag commonTag;
+ }
+ @Backing(type="int") @VintfStability
+ enum VibratorScale {
+ MUTE = (-100) /* -100 */,
+ VERY_LOW = (-2) /* -2 */,
+ LOW = (-1) /* -1 */,
+ NONE = 0,
+ HIGH = 1,
+ VERY_HIGH = 2,
+ }
+ @VintfStability
+ parcelable HapticScale {
+ int id;
+ android.hardware.audio.effect.HapticGenerator.VibratorScale scale = android.hardware.audio.effect.HapticGenerator.VibratorScale.MUTE;
+ }
+ @VintfStability
+ parcelable VibratorInformation {
+ float resonantFrequencyHz;
+ float qFactor;
+ float maxAmplitude;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/IEffect.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/IEffect.aidl
new file mode 100644
index 0000000..8c196e7
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/IEffect.aidl
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+interface IEffect {
+ android.hardware.audio.effect.IEffect.OpenEffectReturn open(in android.hardware.audio.effect.Parameter.Common common, in @nullable android.hardware.audio.effect.Parameter.Specific specific);
+ void close();
+ android.hardware.audio.effect.Descriptor getDescriptor();
+ void command(in android.hardware.audio.effect.CommandId commandId);
+ android.hardware.audio.effect.State getState();
+ void setParameter(in android.hardware.audio.effect.Parameter param);
+ android.hardware.audio.effect.Parameter getParameter(in android.hardware.audio.effect.Parameter.Id paramId);
+ @FixedSize @VintfStability
+ parcelable Status {
+ int status;
+ int fmqConsumed;
+ int fmqProduced;
+ }
+ @VintfStability
+ parcelable OpenEffectReturn {
+ android.hardware.common.fmq.MQDescriptor<android.hardware.audio.effect.IEffect.Status,android.hardware.common.fmq.SynchronizedReadWrite> statusMQ;
+ android.hardware.common.fmq.MQDescriptor<float,android.hardware.common.fmq.SynchronizedReadWrite> inputDataMQ;
+ android.hardware.common.fmq.MQDescriptor<float,android.hardware.common.fmq.SynchronizedReadWrite> outputDataMQ;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/IFactory.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/IFactory.aidl
new file mode 100644
index 0000000..a6c138c
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/IFactory.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+interface IFactory {
+ android.hardware.audio.effect.Descriptor[] queryEffects(in @nullable android.media.audio.common.AudioUuid type, in @nullable android.media.audio.common.AudioUuid implementation, in @nullable android.media.audio.common.AudioUuid proxy);
+ android.hardware.audio.effect.Processing[] queryProcessing(in @nullable android.hardware.audio.effect.Processing.Type type);
+ android.hardware.audio.effect.IEffect createEffect(in android.media.audio.common.AudioUuid implUuid);
+ void destroyEffect(in android.hardware.audio.effect.IEffect handle);
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/LoudnessEnhancer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/LoudnessEnhancer.aidl
new file mode 100644
index 0000000..fc276d6
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/LoudnessEnhancer.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union LoudnessEnhancer {
+ android.hardware.audio.effect.VendorExtension vendor;
+ int gainMb;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.LoudnessEnhancer.Tag commonTag;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/NoiseSuppression.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/NoiseSuppression.aidl
new file mode 100644
index 0000000..7f30fe2
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/NoiseSuppression.aidl
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union NoiseSuppression {
+ android.hardware.audio.effect.VendorExtension vendor;
+ android.hardware.audio.effect.NoiseSuppression.Level level;
+ android.hardware.audio.effect.NoiseSuppression.Type type;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.NoiseSuppression.Tag commonTag;
+ }
+ @Backing(type="int") @VintfStability
+ enum Level {
+ LOW,
+ MEDIUM,
+ HIGH,
+ VERY_HIGH,
+ }
+ @Backing(type="int") @VintfStability
+ enum Type {
+ SINGLE_CHANNEL,
+ MULTI_CHANNEL,
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Parameter.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Parameter.aidl
new file mode 100644
index 0000000..0422bd9
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Parameter.aidl
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union Parameter {
+ android.hardware.audio.effect.Parameter.Common common;
+ android.media.audio.common.AudioDeviceDescription[] deviceDescription;
+ android.media.audio.common.AudioMode mode;
+ android.media.audio.common.AudioSource source;
+ boolean offload;
+ android.hardware.audio.effect.Parameter.VolumeStereo volumeStereo;
+ android.hardware.audio.effect.Parameter.Specific specific;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorEffectTag;
+ android.hardware.audio.effect.AcousticEchoCanceler.Id acousticEchoCancelerTag;
+ android.hardware.audio.effect.AutomaticGainControlV1.Id automaticGainControlV1Tag;
+ android.hardware.audio.effect.AutomaticGainControlV2.Id automaticGainControlV2Tag;
+ android.hardware.audio.effect.BassBoost.Id bassBoostTag;
+ android.hardware.audio.effect.Downmix.Id downmixTag;
+ android.hardware.audio.effect.DynamicsProcessing.Id dynamicsProcessingTag;
+ android.hardware.audio.effect.EnvironmentalReverb.Id environmentalReverbTag;
+ android.hardware.audio.effect.Equalizer.Id equalizerTag;
+ android.hardware.audio.effect.HapticGenerator.Id hapticGeneratorTag;
+ android.hardware.audio.effect.LoudnessEnhancer.Id loudnessEnhancerTag;
+ android.hardware.audio.effect.NoiseSuppression.Id noiseSuppressionTag;
+ android.hardware.audio.effect.PresetReverb.Id presetReverbTag;
+ android.hardware.audio.effect.Virtualizer.Id virtualizerTag;
+ android.hardware.audio.effect.Visualizer.Id visualizerTag;
+ android.hardware.audio.effect.Volume.Id volumeTag;
+ android.hardware.audio.effect.Parameter.Tag commonTag;
+ }
+ @VintfStability
+ parcelable Common {
+ int session;
+ int ioHandle;
+ android.media.audio.common.AudioConfig input;
+ android.media.audio.common.AudioConfig output;
+ }
+ @VintfStability
+ parcelable VolumeStereo {
+ float left;
+ float right;
+ }
+ @VintfStability
+ union Specific {
+ android.hardware.audio.effect.VendorExtension vendorEffect;
+ android.hardware.audio.effect.AcousticEchoCanceler acousticEchoCanceler;
+ android.hardware.audio.effect.AutomaticGainControlV1 automaticGainControlV1;
+ android.hardware.audio.effect.AutomaticGainControlV2 automaticGainControlV2;
+ android.hardware.audio.effect.BassBoost bassBoost;
+ android.hardware.audio.effect.Downmix downmix;
+ android.hardware.audio.effect.DynamicsProcessing dynamicsProcessing;
+ android.hardware.audio.effect.EnvironmentalReverb environmentalReverb;
+ android.hardware.audio.effect.Equalizer equalizer;
+ android.hardware.audio.effect.HapticGenerator hapticGenerator;
+ android.hardware.audio.effect.LoudnessEnhancer loudnessEnhancer;
+ android.hardware.audio.effect.NoiseSuppression noiseSuppression;
+ android.hardware.audio.effect.PresetReverb presetReverb;
+ android.hardware.audio.effect.Virtualizer virtualizer;
+ android.hardware.audio.effect.Visualizer visualizer;
+ android.hardware.audio.effect.Volume volume;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/PresetReverb.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/PresetReverb.aidl
new file mode 100644
index 0000000..26d96b5
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/PresetReverb.aidl
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union PresetReverb {
+ android.hardware.audio.effect.VendorExtension vendor;
+ android.hardware.audio.effect.PresetReverb.Presets[] supportedPresets;
+ android.hardware.audio.effect.PresetReverb.Presets preset;
+ @Backing(type="int") @VintfStability
+ enum Presets {
+ NONE,
+ SMALLROOM,
+ MEDIUMROOM,
+ LARGEROOM,
+ MEDIUMHALL,
+ LARGEHALL,
+ PLATE,
+ }
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.PresetReverb.Tag commonTag;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Processing.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Processing.aidl
new file mode 100644
index 0000000..f6d6ee2
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Processing.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+parcelable Processing {
+ android.hardware.audio.effect.Processing.Type type;
+ android.hardware.audio.effect.Descriptor[] ids;
+ @VintfStability
+ union Type {
+ android.media.audio.common.AudioStreamType streamType = android.media.audio.common.AudioStreamType.INVALID;
+ android.media.audio.common.AudioSource source;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Range.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Range.aidl
new file mode 100644
index 0000000..93edc5e
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Range.aidl
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2023 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union Range {
+ android.hardware.audio.effect.Range.VendorExtensionRange[] vendorExtension = {};
+ android.hardware.audio.effect.Range.AcousticEchoCancelerRange[] acousticEchoCanceler;
+ android.hardware.audio.effect.Range.AutomaticGainControlV1Range[] automaticGainControlV1;
+ android.hardware.audio.effect.Range.AutomaticGainControlV2Range[] automaticGainControlV2;
+ android.hardware.audio.effect.Range.BassBoostRange[] bassBoost;
+ android.hardware.audio.effect.Range.DownmixRange[] downmix;
+ android.hardware.audio.effect.Range.DynamicsProcessingRange[] dynamicsProcessing;
+ android.hardware.audio.effect.Range.EnvironmentalReverbRange[] environmentalReverb;
+ android.hardware.audio.effect.Range.EqualizerRange[] equalizer;
+ android.hardware.audio.effect.Range.HapticGeneratorRange[] hapticGenerator;
+ android.hardware.audio.effect.Range.LoudnessEnhancerRange[] loudnessEnhancer;
+ android.hardware.audio.effect.Range.NoiseSuppressionRange[] noiseSuppression;
+ android.hardware.audio.effect.Range.PresetReverbRange[] presetReverb;
+ android.hardware.audio.effect.Range.VirtualizerRange[] virtualizer;
+ android.hardware.audio.effect.Range.VisualizerRange[] visualizer;
+ android.hardware.audio.effect.Range.VolumeRange[] volume;
+ @VintfStability
+ parcelable AcousticEchoCancelerRange {
+ android.hardware.audio.effect.AcousticEchoCanceler min;
+ android.hardware.audio.effect.AcousticEchoCanceler max;
+ }
+ @VintfStability
+ parcelable AutomaticGainControlV1Range {
+ android.hardware.audio.effect.AutomaticGainControlV1 min;
+ android.hardware.audio.effect.AutomaticGainControlV1 max;
+ }
+ @VintfStability
+ parcelable AutomaticGainControlV2Range {
+ android.hardware.audio.effect.AutomaticGainControlV2 min;
+ android.hardware.audio.effect.AutomaticGainControlV2 max;
+ }
+ @VintfStability
+ parcelable BassBoostRange {
+ android.hardware.audio.effect.BassBoost min;
+ android.hardware.audio.effect.BassBoost max;
+ }
+ @VintfStability
+ parcelable DownmixRange {
+ android.hardware.audio.effect.Downmix min;
+ android.hardware.audio.effect.Downmix max;
+ }
+ @VintfStability
+ parcelable DynamicsProcessingRange {
+ android.hardware.audio.effect.DynamicsProcessing min;
+ android.hardware.audio.effect.DynamicsProcessing max;
+ }
+ @VintfStability
+ parcelable EnvironmentalReverbRange {
+ android.hardware.audio.effect.EnvironmentalReverb min;
+ android.hardware.audio.effect.EnvironmentalReverb max;
+ }
+ @VintfStability
+ parcelable EqualizerRange {
+ android.hardware.audio.effect.Equalizer min;
+ android.hardware.audio.effect.Equalizer max;
+ }
+ @VintfStability
+ parcelable HapticGeneratorRange {
+ android.hardware.audio.effect.HapticGenerator min;
+ android.hardware.audio.effect.HapticGenerator max;
+ }
+ @VintfStability
+ parcelable LoudnessEnhancerRange {
+ android.hardware.audio.effect.LoudnessEnhancer min;
+ android.hardware.audio.effect.LoudnessEnhancer max;
+ }
+ @VintfStability
+ parcelable NoiseSuppressionRange {
+ android.hardware.audio.effect.NoiseSuppression min;
+ android.hardware.audio.effect.NoiseSuppression max;
+ }
+ @VintfStability
+ parcelable PresetReverbRange {
+ android.hardware.audio.effect.PresetReverb min;
+ android.hardware.audio.effect.PresetReverb max;
+ }
+ @VintfStability
+ parcelable VendorExtensionRange {
+ android.hardware.audio.effect.VendorExtension min;
+ android.hardware.audio.effect.VendorExtension max;
+ }
+ @VintfStability
+ parcelable VirtualizerRange {
+ android.hardware.audio.effect.Virtualizer min;
+ android.hardware.audio.effect.Virtualizer max;
+ }
+ @VintfStability
+ parcelable VisualizerRange {
+ android.hardware.audio.effect.Visualizer min;
+ android.hardware.audio.effect.Visualizer max;
+ }
+ @VintfStability
+ parcelable VolumeRange {
+ android.hardware.audio.effect.Volume min;
+ android.hardware.audio.effect.Volume max;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/State.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/State.aidl
new file mode 100644
index 0000000..17f9814
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/State.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@Backing(type="byte") @VintfStability
+enum State {
+ INIT,
+ IDLE,
+ PROCESSING,
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/VendorExtension.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/VendorExtension.aidl
new file mode 100644
index 0000000..b806334
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/VendorExtension.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+parcelable VendorExtension {
+ ParcelableHolder extension;
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Virtualizer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Virtualizer.aidl
new file mode 100644
index 0000000..6092b14
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Virtualizer.aidl
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union Virtualizer {
+ android.hardware.audio.effect.VendorExtension vendor;
+ int strengthPm;
+ android.hardware.audio.effect.Virtualizer.ChannelAngle[] speakerAngles;
+ android.media.audio.common.AudioDeviceDescription device;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.Virtualizer.Tag commonTag;
+ android.hardware.audio.effect.Virtualizer.SpeakerAnglesPayload speakerAnglesPayload;
+ }
+ @VintfStability
+ parcelable SpeakerAnglesPayload {
+ android.media.audio.common.AudioChannelLayout layout;
+ android.media.audio.common.AudioDeviceDescription device;
+ }
+ @VintfStability
+ parcelable ChannelAngle {
+ int channel;
+ int azimuthDegree;
+ int elevationDegree;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Visualizer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Visualizer.aidl
new file mode 100644
index 0000000..7d319da
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Visualizer.aidl
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union Visualizer {
+ android.hardware.audio.effect.Visualizer.Id id;
+ android.hardware.audio.effect.VendorExtension vendor;
+ android.hardware.audio.effect.Visualizer.Measurement measurement;
+ byte[] captureSampleBuffer;
+ int latencyMs;
+ int captureSamples;
+ android.hardware.audio.effect.Visualizer.ScalingMode scalingMode;
+ android.hardware.audio.effect.Visualizer.MeasurementMode measurementMode;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.Visualizer.Tag commonTag;
+ }
+ @VintfStability
+ enum ScalingMode {
+ NORMALIZED = 0,
+ AS_PLAYED,
+ }
+ @VintfStability
+ enum MeasurementMode {
+ NONE = 0,
+ PEAK_RMS,
+ }
+ @VintfStability
+ parcelable Measurement {
+ int rms;
+ int peak;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Volume.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Volume.aidl
new file mode 100644
index 0000000..8227118
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/1/android/hardware/audio/effect/Volume.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2022 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 <name>-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.hardware.audio.effect;
+@VintfStability
+union Volume {
+ android.hardware.audio.effect.VendorExtension vendor;
+ int levelDb;
+ boolean mute;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.Volume.Tag commonTag;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Descriptor.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Descriptor.aidl
index 82dae97..115da1d 100644
--- a/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Descriptor.aidl
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/current/android/hardware/audio/effect/Descriptor.aidl
@@ -50,8 +50,8 @@
const String EFFECT_TYPE_UUID_PRESET_REVERB = "47382d60-ddd8-11db-bf3a-0002a5d5c51b";
const String EFFECT_TYPE_UUID_SPATIALIZER = "ccd4cf09-a79d-46c2-9aae-06a1698d6c8f";
const String EFFECT_TYPE_UUID_VIRTUALIZER = "37cc2c00-dddd-11db-8577-0002a5d5c51b";
- const String EFFECT_TYPE_UUID_VISUALIZER = "d069d9e0-8329-11df-9168-0002a5d5c51b";
- const String EFFECT_TYPE_UUID_VOLUME = "fa81a2b8-588b-11ed-9b6a-0242ac120002";
+ const String EFFECT_TYPE_UUID_VISUALIZER = "e46b26a0-dddd-11db-8afd-0002a5d5c51b";
+ const String EFFECT_TYPE_UUID_VOLUME = "09e8ede0-ddde-11db-b4f6-0002a5d5c51b";
@VintfStability
parcelable Identity {
android.media.audio.common.AudioUuid type;
diff --git a/audio/aidl/android/hardware/audio/core/IModule.aidl b/audio/aidl/android/hardware/audio/core/IModule.aidl
index 7830501..e736c32 100644
--- a/audio/aidl/android/hardware/audio/core/IModule.aidl
+++ b/audio/aidl/android/hardware/audio/core/IModule.aidl
@@ -192,6 +192,19 @@
* device address is specified for a point-to-multipoint external device
* connection.
*
+ * Since not all modules have a DSP that could perform sample rate and
+ * format conversions, behavior related to mix port configurations may vary.
+ * For modules with a DSP, mix ports can be pre-configured and have a fixed
+ * set of audio profiles supported by the DSP. For modules without a DSP,
+ * audio profiles of mix ports may change after connecting an external
+ * device. The typical case is that the mix port has an empty set of
+ * profiles when no external devices are connected, and after external
+ * device connection it receives the same set of profiles as the device
+ * ports that they can be routed to. The client will re-query current port
+ * configurations using 'getAudioPorts'. All mix ports that can be routed to
+ * the connected device port must have a non-empty set of audio profiles
+ * after successful connection of an external device.
+ *
* Handling of a disconnect is done in a reverse order:
* 1. Reset port configuration using the 'resetAudioPortConfig' method.
* 2. Release the connected device port by calling the 'disconnectExternalDevice'
@@ -221,6 +234,12 @@
* instance previously instantiated using the 'connectExternalDevice'
* method.
*
+ * The framework will call this method before closing streams and resetting
+ * patches. This call can be used by the HAL module to prepare itself to
+ * device disconnection. If the HAL module indicates an error after the first
+ * call, the framework will call this method once again after closing associated
+ * streams and patches.
+ *
* @throws EX_ILLEGAL_ARGUMENT In the following cases:
* - If the port can not be found by the ID.
* - If this is not a connected device port.
diff --git a/audio/aidl/android/hardware/audio/core/sounddose/ISoundDose.aidl b/audio/aidl/android/hardware/audio/core/sounddose/ISoundDose.aidl
index 953ab62..b442ac5 100644
--- a/audio/aidl/android/hardware/audio/core/sounddose/ISoundDose.aidl
+++ b/audio/aidl/android/hardware/audio/core/sounddose/ISoundDose.aidl
@@ -35,21 +35,21 @@
const int MIN_RS2 = 80;
/**
- * Sets the RS2 value used for momentary exposure warnings. Default value is
+ * Sets the RS2 upper bound used for momentary exposure warnings. Default value is
* DEFAULT_MAX_RS2 as specified in IEC62368-1 3rd edition.
*
- * @param rs2ValueDbA custom RS2 value to use. Must not be higher than DEFAULT_MAX_RS2
+ * @param rs2ValueDbA custom RS2 upper bound to use
* @throws EX_ILLEGAL_ARGUMENT if rs2ValueDbA is greater than DEFAULT_MAX_RS2 or lower
- * than 80dBA
+ * than MIN_RS2
*/
- void setOutputRs2(float rs2ValueDbA);
+ void setOutputRs2UpperBound(float rs2ValueDbA);
/**
- * Gets the RS2 value used for momentary exposure warnings.
+ * Gets the RS2 upper bound used for momentary exposure warnings.
*
- * @return the RS2 value in dBA
+ * @return the RS2 upper bound in dBA
*/
- float getOutputRs2();
+ float getOutputRs2UpperBound();
/**
* Registers the HAL callback for sound dose computation. If sound dose is supported
@@ -68,9 +68,9 @@
@VintfStability
oneway interface IHalSoundDoseCallback {
/**
- * Called whenever the current MEL value exceeds the set RS2 value.
+ * Called whenever the current MEL value exceeds the set RS2 upper bound.
*
- * @param currentDbA the current MEL value which exceeds the RS2 value
+ * @param currentDbA the current MEL value which exceeds the RS2 upper bound
* @param audioDevice the audio device where the MEL exposure warning was recorded
*/
void onMomentaryExposureWarning(float currentDbA, in AudioDevice audioDevice);
@@ -78,14 +78,15 @@
@VintfStability
parcelable MelRecord {
/**
- * Array of continuously recorded MEL values >= RS1 (1 per second).
+ * Array of continuously recorded MEL values >= MIN_RS2 (1 per second).
* First value in the array was recorded at 'timestamp'.
*/
float[] melValues;
/**
- * Corresponds to the time in seconds when the first MEL entry in melValues
- * was recorded. The timestamp values have to be consistent throughout all
- * audio ports, equal timestamp values will be aggregated.
+ * Corresponds to the time in seconds, as reported by CLOCK_MONOTONIC, when
+ * the first MEL entry in melValues was recorded. The timestamp values have
+ * to be consistent throughout all audio ports, equal timestamp values will
+ * be aggregated.
*/
long timestamp;
}
diff --git a/audio/aidl/android/hardware/audio/effect/Descriptor.aidl b/audio/aidl/android/hardware/audio/effect/Descriptor.aidl
index 2fbc401..b152f76 100644
--- a/audio/aidl/android/hardware/audio/effect/Descriptor.aidl
+++ b/audio/aidl/android/hardware/audio/effect/Descriptor.aidl
@@ -96,11 +96,11 @@
/**
* UUID for visualizer effect type.
*/
- const String EFFECT_TYPE_UUID_VISUALIZER = "d069d9e0-8329-11df-9168-0002a5d5c51b";
+ const String EFFECT_TYPE_UUID_VISUALIZER = "e46b26a0-dddd-11db-8afd-0002a5d5c51b";
/**
* UUID for Volume effect type.
*/
- const String EFFECT_TYPE_UUID_VOLUME = "fa81a2b8-588b-11ed-9b6a-0242ac120002";
+ const String EFFECT_TYPE_UUID_VOLUME = "09e8ede0-ddde-11db-b4f6-0002a5d5c51b";
/**
* This structure completely identifies an effect implementation.
diff --git a/audio/aidl/common/Android.bp b/audio/aidl/common/Android.bp
index a3f7f0b..4c6a74e 100644
--- a/audio/aidl/common/Android.bp
+++ b/audio/aidl/common/Android.bp
@@ -41,6 +41,20 @@
],
}
+cc_library {
+ name: "libaudioaidlranges",
+ host_supported: true,
+ vendor_available: true,
+ static_libs: [
+ "android.hardware.audio.effect-V1-ndk",
+ ],
+ export_include_dirs: ["include"],
+ header_libs: ["libaudioaidl_headers"],
+ srcs: [
+ "EffectRangeSpecific.cpp",
+ ],
+}
+
cc_test {
name: "libaudioaidlcommon_test",
host_supported: true,
diff --git a/audio/aidl/common/EffectRangeSpecific.cpp b/audio/aidl/common/EffectRangeSpecific.cpp
new file mode 100644
index 0000000..bd78ea0
--- /dev/null
+++ b/audio/aidl/common/EffectRangeSpecific.cpp
@@ -0,0 +1,161 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+#include <aidl/android/hardware/audio/effect/DynamicsProcessing.h>
+#include <aidl/android/hardware/audio/effect/Range.h>
+
+#include "EffectRangeSpecific.h"
+#include "effect-impl/EffectRange.h"
+
+namespace aidl::android::hardware::audio::effect {
+
+namespace DynamicsProcessingRanges {
+
+static bool isInputGainConfigInRange(const std::vector<DynamicsProcessing::InputGain>& cfgs,
+ const DynamicsProcessing::InputGain& min,
+ const DynamicsProcessing::InputGain& max) {
+ auto func = [](const DynamicsProcessing::InputGain& arg) {
+ return std::make_tuple(arg.channel, arg.gainDb);
+ };
+ return isTupleInRange(cfgs, min, max, func);
+}
+
+static bool isLimiterConfigInRange(const std::vector<DynamicsProcessing::LimiterConfig>& cfgs,
+ const DynamicsProcessing::LimiterConfig& min,
+ const DynamicsProcessing::LimiterConfig& max) {
+ auto func = [](const DynamicsProcessing::LimiterConfig& arg) {
+ return std::make_tuple(arg.channel, arg.enable, arg.linkGroup, arg.attackTimeMs,
+ arg.releaseTimeMs, arg.ratio, arg.thresholdDb, arg.postGainDb);
+ };
+ return isTupleInRange(cfgs, min, max, func);
+}
+
+static bool isMbcBandConfigInRange(const std::vector<DynamicsProcessing::MbcBandConfig>& cfgs,
+ const DynamicsProcessing::MbcBandConfig& min,
+ const DynamicsProcessing::MbcBandConfig& max) {
+ auto func = [](const DynamicsProcessing::MbcBandConfig& arg) {
+ return std::make_tuple(arg.channel, arg.band, arg.enable, arg.cutoffFrequencyHz,
+ arg.attackTimeMs, arg.releaseTimeMs, arg.ratio, arg.thresholdDb,
+ arg.kneeWidthDb, arg.noiseGateThresholdDb, arg.expanderRatio,
+ arg.preGainDb, arg.postGainDb);
+ };
+ return isTupleInRange(cfgs, min, max, func);
+}
+
+static bool isEqBandConfigInRange(const std::vector<DynamicsProcessing::EqBandConfig>& cfgs,
+ const DynamicsProcessing::EqBandConfig& min,
+ const DynamicsProcessing::EqBandConfig& max) {
+ auto func = [](const DynamicsProcessing::EqBandConfig& arg) {
+ return std::make_tuple(arg.channel, arg.band, arg.enable, arg.cutoffFrequencyHz,
+ arg.gainDb);
+ };
+ return isTupleInRange(cfgs, min, max, func);
+}
+
+static bool isChannelConfigInRange(const std::vector<DynamicsProcessing::ChannelConfig>& cfgs,
+ const DynamicsProcessing::ChannelConfig& min,
+ const DynamicsProcessing::ChannelConfig& max) {
+ auto func = [](const DynamicsProcessing::ChannelConfig& arg) {
+ return std::make_tuple(arg.channel, arg.enable);
+ };
+ return isTupleInRange(cfgs, min, max, func);
+}
+
+static bool isEngineConfigInRange(const DynamicsProcessing::EngineArchitecture& cfg,
+ const DynamicsProcessing::EngineArchitecture& min,
+ const DynamicsProcessing::EngineArchitecture& max) {
+ auto func = [](const DynamicsProcessing::EngineArchitecture& arg) {
+ return std::make_tuple(arg.resolutionPreference, arg.preferredProcessingDurationMs,
+ arg.preEqStage.inUse, arg.preEqStage.bandCount,
+ arg.postEqStage.inUse, arg.postEqStage.bandCount, arg.mbcStage.inUse,
+ arg.mbcStage.bandCount, arg.limiterInUse);
+ };
+ return isTupleInRange(func(cfg), func(min), func(max));
+}
+
+static int locateMinMaxForTag(DynamicsProcessing::Tag tag,
+ const std::vector<Range::DynamicsProcessingRange>& ranges) {
+ for (int i = 0; i < (int)ranges.size(); i++) {
+ if (tag == ranges[i].min.getTag() && tag == ranges[i].max.getTag()) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+bool isParamInRange(const DynamicsProcessing& dp,
+ const std::vector<Range::DynamicsProcessingRange>& ranges) {
+ auto tag = dp.getTag();
+ int i = locateMinMaxForTag(tag, ranges);
+ if (i == -1) return true;
+
+ switch (tag) {
+ case DynamicsProcessing::engineArchitecture: {
+ return isEngineConfigInRange(
+ dp.get<DynamicsProcessing::engineArchitecture>(),
+ ranges[i].min.get<DynamicsProcessing::engineArchitecture>(),
+ ranges[i].max.get<DynamicsProcessing::engineArchitecture>());
+ }
+ case DynamicsProcessing::preEq: {
+ return isChannelConfigInRange(dp.get<DynamicsProcessing::preEq>(),
+ ranges[i].min.get<DynamicsProcessing::preEq>()[0],
+ ranges[i].max.get<DynamicsProcessing::preEq>()[0]);
+ }
+ case DynamicsProcessing::postEq: {
+ return isChannelConfigInRange(dp.get<DynamicsProcessing::postEq>(),
+ ranges[i].min.get<DynamicsProcessing::postEq>()[0],
+ ranges[i].max.get<DynamicsProcessing::postEq>()[0]);
+ }
+ case DynamicsProcessing::mbc: {
+ return isChannelConfigInRange(dp.get<DynamicsProcessing::mbc>(),
+ ranges[i].min.get<DynamicsProcessing::mbc>()[0],
+ ranges[i].max.get<DynamicsProcessing::mbc>()[0]);
+ }
+ case DynamicsProcessing::preEqBand: {
+ return isEqBandConfigInRange(dp.get<DynamicsProcessing::preEqBand>(),
+ ranges[i].min.get<DynamicsProcessing::preEqBand>()[0],
+ ranges[i].max.get<DynamicsProcessing::preEqBand>()[0]);
+ }
+ case DynamicsProcessing::postEqBand: {
+ return isEqBandConfigInRange(dp.get<DynamicsProcessing::postEqBand>(),
+ ranges[i].min.get<DynamicsProcessing::postEqBand>()[0],
+ ranges[i].max.get<DynamicsProcessing::postEqBand>()[0]);
+ }
+ case DynamicsProcessing::mbcBand: {
+ return isMbcBandConfigInRange(dp.get<DynamicsProcessing::mbcBand>(),
+ ranges[i].min.get<DynamicsProcessing::mbcBand>()[0],
+ ranges[i].max.get<DynamicsProcessing::mbcBand>()[0]);
+ }
+ case DynamicsProcessing::limiter: {
+ return isLimiterConfigInRange(dp.get<DynamicsProcessing::limiter>(),
+ ranges[i].min.get<DynamicsProcessing::limiter>()[0],
+ ranges[i].max.get<DynamicsProcessing::limiter>()[0]);
+ }
+ case DynamicsProcessing::inputGain: {
+ return isInputGainConfigInRange(dp.get<DynamicsProcessing::inputGain>(),
+ ranges[i].min.get<DynamicsProcessing::inputGain>()[0],
+ ranges[i].max.get<DynamicsProcessing::inputGain>()[0]);
+ }
+ default: {
+ return true;
+ }
+ }
+ return true;
+}
+
+} // namespace DynamicsProcessingRanges
+
+} // namespace aidl::android::hardware::audio::effect
\ No newline at end of file
diff --git a/audio/aidl/common/include/EffectRangeSpecific.h b/audio/aidl/common/include/EffectRangeSpecific.h
new file mode 100644
index 0000000..c7262bb
--- /dev/null
+++ b/audio/aidl/common/include/EffectRangeSpecific.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+#pragma once
+
+namespace aidl::android::hardware::audio::effect {
+
+namespace DynamicsProcessingRanges {
+
+bool isParamInRange(const DynamicsProcessing& dp,
+ const std::vector<Range::DynamicsProcessingRange>& ranges);
+
+} // namespace DynamicsProcessingRanges
+
+} // namespace aidl::android::hardware::audio::effect
\ No newline at end of file
diff --git a/audio/aidl/common/include/Utils.h b/audio/aidl/common/include/Utils.h
index 2cf862c..652d63c 100644
--- a/audio/aidl/common/include/Utils.h
+++ b/audio/aidl/common/include/Utils.h
@@ -99,36 +99,18 @@
return 0;
}
+constexpr bool isDefaultAudioFormat(
+ const ::aidl::android::media::audio::common::AudioFormatDescription& desc) {
+ return desc.type == ::aidl::android::media::audio::common::AudioFormatType::DEFAULT &&
+ desc.pcm == ::aidl::android::media::audio::common::PcmType::DEFAULT;
+}
+
constexpr bool isTelephonyDeviceType(
::aidl::android::media::audio::common::AudioDeviceType device) {
return device == ::aidl::android::media::audio::common::AudioDeviceType::IN_TELEPHONY_RX ||
device == ::aidl::android::media::audio::common::AudioDeviceType::OUT_TELEPHONY_TX;
}
-constexpr bool isUsbInputDeviceType(::aidl::android::media::audio::common::AudioDeviceType type) {
- switch (type) {
- case ::aidl::android::media::audio::common::AudioDeviceType::IN_DOCK:
- case ::aidl::android::media::audio::common::AudioDeviceType::IN_ACCESSORY:
- case ::aidl::android::media::audio::common::AudioDeviceType::IN_DEVICE:
- case ::aidl::android::media::audio::common::AudioDeviceType::IN_HEADSET:
- return true;
- default:
- return false;
- }
-}
-
-constexpr bool isUsbOutputtDeviceType(::aidl::android::media::audio::common::AudioDeviceType type) {
- switch (type) {
- case ::aidl::android::media::audio::common::AudioDeviceType::OUT_DOCK:
- case ::aidl::android::media::audio::common::AudioDeviceType::OUT_ACCESSORY:
- case ::aidl::android::media::audio::common::AudioDeviceType::OUT_DEVICE:
- case ::aidl::android::media::audio::common::AudioDeviceType::OUT_HEADSET:
- return true;
- default:
- return false;
- }
-}
-
constexpr bool isValidAudioMode(::aidl::android::media::audio::common::AudioMode mode) {
return std::find(kValidAudioModes.begin(), kValidAudioModes.end(), mode) !=
kValidAudioModes.end();
diff --git a/audio/aidl/default/Android.bp b/audio/aidl/default/Android.bp
index 8bacbb3..c9edae0 100644
--- a/audio/aidl/default/Android.bp
+++ b/audio/aidl/default/Android.bp
@@ -92,9 +92,6 @@
"audio_policy_configuration_aidl_default",
"audio_policy_engine_configuration_aidl_default",
],
- visibility: [
- ":__subpackages__",
- ],
}
cc_binary {
diff --git a/audio/aidl/default/EffectConfig.cpp b/audio/aidl/default/EffectConfig.cpp
index c030b7a..5a83fef 100644
--- a/audio/aidl/default/EffectConfig.cpp
+++ b/audio/aidl/default/EffectConfig.cpp
@@ -16,6 +16,7 @@
#define LOG_TAG "AHAL_EffectConfig"
#include <android-base/logging.h>
+#include <system/audio_effects/effect_uuid.h>
#include "effectFactory-impl/EffectConfig.h"
@@ -163,15 +164,53 @@
libraryUuid.name = name;
}
- const char* uuid = xml.Attribute("uuid");
- RETURN_VALUE_IF(!uuid, false, "noUuidAttribute");
- RETURN_VALUE_IF(!stringToUuid(uuid, &libraryUuid.uuid), false, "invalidUuidAttribute");
+ const char* uuidStr = xml.Attribute("uuid");
+ RETURN_VALUE_IF(!uuidStr, false, "noUuidAttribute");
+ libraryUuid.uuid = stringToUuid(uuidStr);
+ RETURN_VALUE_IF((libraryUuid.uuid == getEffectUuidZero()), false, "invalidUuidAttribute");
LOG(DEBUG) << __func__ << (isProxy ? " proxy " : libraryUuid.name) << " : "
<< libraryUuid.uuid.toString();
return true;
}
+bool EffectConfig::findUuid(const std::string& xmlEffectName, AudioUuid* uuid) {
+// Difference from EFFECT_TYPE_LIST_DEF, there could be multiple name mapping to same Effect Type
+#define EFFECT_XML_TYPE_LIST_DEF(V) \
+ V("acoustic_echo_canceler", AcousticEchoCanceler) \
+ V("automatic_gain_control_v1", AutomaticGainControlV1) \
+ V("automatic_gain_control_v2", AutomaticGainControlV2) \
+ V("bassboost", BassBoost) \
+ V("downmix", Downmix) \
+ V("dynamics_processing", DynamicsProcessing) \
+ V("equalizer", Equalizer) \
+ V("haptic_generator", HapticGenerator) \
+ V("loudness_enhancer", LoudnessEnhancer) \
+ V("env_reverb", EnvReverb) \
+ V("reverb_env_aux", EnvReverb) \
+ V("reverb_env_ins", EnvReverb) \
+ V("preset_reverb", PresetReverb) \
+ V("reverb_pre_aux", PresetReverb) \
+ V("reverb_pre_ins", PresetReverb) \
+ V("noise_suppression", NoiseSuppression) \
+ V("spatializer", Spatializer) \
+ V("virtualizer", Virtualizer) \
+ V("visualizer", Visualizer) \
+ V("volume", Volume)
+
+#define GENERATE_MAP_ENTRY_V(s, symbol) {s, &getEffectTypeUuid##symbol},
+
+ typedef const AudioUuid& (*UuidGetter)(void);
+ static const std::map<std::string, UuidGetter> uuidMap{
+ // std::make_pair("s", &getEffectTypeUuidExtension)};
+ {EFFECT_XML_TYPE_LIST_DEF(GENERATE_MAP_ENTRY_V)}};
+ if (auto it = uuidMap.find(xmlEffectName); it != uuidMap.end()) {
+ *uuid = (*it->second)();
+ return true;
+ }
+ return false;
+}
+
const char* EffectConfig::dump(const tinyxml2::XMLElement& element,
tinyxml2::XMLPrinter&& printer) const {
element.Accept(&printer);
diff --git a/audio/aidl/default/EffectFactory.cpp b/audio/aidl/default/EffectFactory.cpp
index 638fa7f..f0687cc 100644
--- a/audio/aidl/default/EffectFactory.cpp
+++ b/audio/aidl/default/EffectFactory.cpp
@@ -14,20 +14,19 @@
* limitations under the License.
*/
+#include <dlfcn.h>
#include <iterator>
#include <memory>
#include <tuple>
-#include "include/effect-impl/EffectTypes.h"
-#define LOG_TAG "AHAL_EffectFactory"
-#include <dlfcn.h>
#include <unordered_set>
+#define LOG_TAG "AHAL_EffectFactory"
#include <android-base/logging.h>
#include <android/binder_ibinder_platform.h>
+#include <system/audio_effects/effect_uuid.h>
#include <system/thread_defs.h>
#include "effect-impl/EffectTypes.h"
-#include "effect-impl/EffectUUID.h"
#include "effectFactory-impl/EffectFactory.h"
using aidl::android::media::audio::common::AudioUuid;
@@ -76,6 +75,8 @@
RETURN_IF(!libInterface || !libInterface->queryEffectFunc, EX_NULL_POINTER,
"dlNullQueryEffectFunc");
RETURN_IF_BINDER_EXCEPTION(libInterface->queryEffectFunc(&id.uuid, &desc));
+ // update proxy UUID with information from config xml
+ desc.common.id.proxy = id.proxy;
_aidl_return->emplace_back(std::move(desc));
}
}
@@ -214,8 +215,8 @@
void Factory::loadEffectLibs() {
const auto& configEffectsMap = mConfig.getEffectsMap();
for (const auto& configEffects : configEffectsMap) {
- if (auto typeUuid = kUuidNameTypeMap.find(configEffects.first /* effect name */);
- typeUuid != kUuidNameTypeMap.end()) {
+ if (AudioUuid uuid;
+ EffectConfig::findUuid(configEffects.first /* xml effect name */, &uuid)) {
const auto& configLibs = configEffects.second;
std::optional<AudioUuid> proxyUuid;
if (configLibs.proxyLibrary.has_value()) {
@@ -223,7 +224,7 @@
proxyUuid = proxyLib.uuid;
}
for (const auto& configLib : configLibs.libraries) {
- createIdentityWithConfig(configLib, typeUuid->second, proxyUuid);
+ createIdentityWithConfig(configLib, uuid, proxyUuid);
}
} else {
LOG(ERROR) << __func__ << ": can not find type UUID for effect " << configEffects.first
diff --git a/audio/aidl/default/EffectImpl.cpp b/audio/aidl/default/EffectImpl.cpp
index e90fe35..da1ad11 100644
--- a/audio/aidl/default/EffectImpl.cpp
+++ b/audio/aidl/default/EffectImpl.cpp
@@ -40,7 +40,7 @@
ndk::ScopedAStatus EffectImpl::open(const Parameter::Common& common,
const std::optional<Parameter::Specific>& specific,
OpenEffectReturn* ret) {
- LOG(DEBUG) << __func__;
+ LOG(DEBUG) << getEffectName() << __func__;
// effect only support 32bits float
RETURN_IF(common.input.base.format.pcm != common.output.base.format.pcm ||
common.input.base.format.pcm != PcmType::FLOAT_32_BIT,
@@ -71,12 +71,12 @@
RETURN_IF(releaseContext() != RetCode::SUCCESS, EX_UNSUPPORTED_OPERATION,
"FailedToCreateWorker");
- LOG(DEBUG) << __func__;
+ LOG(DEBUG) << getEffectName() << __func__;
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus EffectImpl::setParameter(const Parameter& param) {
- LOG(DEBUG) << __func__ << " with: " << param.toString();
+ LOG(DEBUG) << getEffectName() << __func__ << " with: " << param.toString();
const auto tag = param.getTag();
switch (tag) {
@@ -91,7 +91,8 @@
return setParameterSpecific(param.get<Parameter::specific>());
}
default: {
- LOG(ERROR) << __func__ << " unsupportedParameterTag " << toString(tag);
+ LOG(ERROR) << getEffectName() << __func__ << " unsupportedParameterTag "
+ << toString(tag);
return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
"ParameterNotSupported");
}
@@ -99,7 +100,7 @@
}
ndk::ScopedAStatus EffectImpl::getParameter(const Parameter::Id& id, Parameter* param) {
- LOG(DEBUG) << __func__ << id.toString();
+ LOG(DEBUG) << getEffectName() << __func__ << id.toString();
auto tag = id.getTag();
switch (tag) {
case Parameter::Id::commonTag: {
@@ -116,7 +117,7 @@
break;
}
}
- LOG(DEBUG) << __func__ << param->toString();
+ LOG(DEBUG) << getEffectName() << __func__ << param->toString();
return ndk::ScopedAStatus::ok();
}
@@ -149,7 +150,8 @@
EX_ILLEGAL_ARGUMENT, "setVolumeStereoFailed");
break;
default: {
- LOG(ERROR) << __func__ << " unsupportedParameterTag " << toString(tag);
+ LOG(ERROR) << getEffectName() << __func__ << " unsupportedParameterTag "
+ << toString(tag);
return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
"commonParamNotSupported");
}
@@ -183,7 +185,7 @@
break;
}
default: {
- LOG(DEBUG) << __func__ << " unsupported tag " << toString(tag);
+ LOG(DEBUG) << getEffectName() << __func__ << " unsupported tag " << toString(tag);
return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
"tagNotSupported");
}
@@ -198,8 +200,8 @@
ndk::ScopedAStatus EffectImpl::command(CommandId command) {
RETURN_IF(mState == State::INIT, EX_ILLEGAL_STATE, "CommandStateError");
- LOG(DEBUG) << __func__ << ": receive command: " << toString(command) << " at state "
- << toString(mState);
+ LOG(DEBUG) << getEffectName() << __func__ << ": receive command: " << toString(command)
+ << " at state " << toString(mState);
switch (command) {
case CommandId::START:
@@ -217,11 +219,11 @@
mState = State::IDLE;
break;
default:
- LOG(ERROR) << __func__ << " instance still processing";
+ LOG(ERROR) << getEffectName() << __func__ << " instance still processing";
return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
"CommandIdNotSupported");
}
- LOG(DEBUG) << __func__ << " transfer to state: " << toString(mState);
+ LOG(DEBUG) << getEffectName() << __func__ << " transfer to state: " << toString(mState);
return ndk::ScopedAStatus::ok();
}
@@ -252,7 +254,7 @@
for (int i = 0; i < samples; i++) {
*out++ = *in++;
}
- LOG(DEBUG) << __func__ << " done processing " << samples << " samples";
+ LOG(DEBUG) << getEffectName() << __func__ << " done processing " << samples << " samples";
return {STATUS_OK, samples, samples};
}
diff --git a/audio/aidl/default/EffectThread.cpp b/audio/aidl/default/EffectThread.cpp
index 4f8fb3c..574dc69 100644
--- a/audio/aidl/default/EffectThread.cpp
+++ b/audio/aidl/default/EffectThread.cpp
@@ -14,13 +14,18 @@
* limitations under the License.
*/
+#include <cstddef>
#include <memory>
+
#define LOG_TAG "AHAL_EffectThread"
#include <android-base/logging.h>
#include <pthread.h>
#include <sys/resource.h>
#include "effect-impl/EffectThread.h"
+#include "effect-impl/EffectTypes.h"
+
+using ::android::hardware::EventFlag;
namespace aidl::android::hardware::audio::effect {
@@ -31,23 +36,35 @@
EffectThread::~EffectThread() {
destroyThread();
LOG(DEBUG) << __func__ << " done";
-};
+}
RetCode EffectThread::createThread(std::shared_ptr<EffectContext> context, const std::string& name,
- int priority, int sleepUs /* kSleepTimeUs */) {
+ int priority) {
if (mThread.joinable()) {
- LOG(WARNING) << __func__ << " thread already created, no-op";
+ LOG(WARNING) << mName << __func__ << " thread already created, no-op";
return RetCode::SUCCESS;
}
mName = name;
mPriority = priority;
- mSleepTimeUs = sleepUs;
{
std::lock_guard lg(mThreadMutex);
mThreadContext = std::move(context);
+ auto statusMQ = mThreadContext->getStatusFmq();
+ EventFlag* efGroup = nullptr;
+ ::android::status_t status =
+ EventFlag::createEventFlag(statusMQ->getEventFlagWord(), &efGroup);
+ if (status != ::android::OK || !efGroup) {
+ LOG(ERROR) << mName << __func__ << " create EventFlagGroup failed " << status
+ << " efGroup " << efGroup;
+ return RetCode::ERROR_THREAD;
+ }
+ mEfGroup.reset(efGroup);
+ // kickoff and wait for commands (CommandId::START/STOP) or IEffect.close from client
+ mEfGroup->wake(kEventFlagNotEmpty);
}
+
mThread = std::thread(&EffectThread::threadLoop, this);
- LOG(DEBUG) << __func__ << " " << name << " priority " << mPriority << " done";
+ LOG(DEBUG) << mName << __func__ << " priority " << mPriority << " done";
return RetCode::SUCCESS;
}
@@ -66,35 +83,31 @@
std::lock_guard lg(mThreadMutex);
mThreadContext.reset();
}
- LOG(DEBUG) << __func__ << " done";
+ LOG(DEBUG) << mName << __func__;
return RetCode::SUCCESS;
}
RetCode EffectThread::startThread() {
- return handleStartStop(false /* stop */);
+ {
+ std::lock_guard lg(mThreadMutex);
+ mStop = false;
+ mCv.notify_one();
+ }
+
+ mEfGroup->wake(kEventFlagNotEmpty);
+ LOG(DEBUG) << mName << __func__;
+ return RetCode::SUCCESS;
}
RetCode EffectThread::stopThread() {
- return handleStartStop(true /* stop */);
-}
-
-RetCode EffectThread::handleStartStop(bool stop) {
- if (!mThread.joinable()) {
- LOG(ERROR) << __func__ << " thread already destroyed";
- return RetCode::ERROR_THREAD;
- }
-
{
std::lock_guard lg(mThreadMutex);
- if (stop == mStop) {
- LOG(WARNING) << __func__ << " already " << (stop ? "stop" : "start");
- return RetCode::SUCCESS;
- }
- mStop = stop;
+ mStop = true;
+ mCv.notify_one();
}
- mCv.notify_one();
- LOG(DEBUG) << (stop ? "stop done" : "start done");
+ mEfGroup->wake(kEventFlagNotEmpty);
+ LOG(DEBUG) << mName << __func__;
return RetCode::SUCCESS;
}
@@ -102,40 +115,42 @@
pthread_setname_np(pthread_self(), mName.substr(0, kMaxTaskNameLen - 1).c_str());
setpriority(PRIO_PROCESS, 0, mPriority);
while (true) {
- std::unique_lock l(mThreadMutex);
- ::android::base::ScopedLockAssertion lock_assertion(mThreadMutex);
- mCv.wait(l, [&]() REQUIRES(mThreadMutex) { return mExit || !mStop; });
- if (mExit) {
- LOG(WARNING) << __func__ << " EXIT!";
- return;
+ /**
+ * wait for the EventFlag without lock, it's ok because the mEfGroup pointer will not change
+ * in the life cycle of workerThread (threadLoop).
+ */
+ uint32_t efState = 0;
+ mEfGroup->wait(kEventFlagNotEmpty, &efState);
+
+ {
+ std::unique_lock l(mThreadMutex);
+ ::android::base::ScopedLockAssertion lock_assertion(mThreadMutex);
+ mCv.wait(l, [&]() REQUIRES(mThreadMutex) { return mExit || !mStop; });
+ if (mExit) {
+ LOG(INFO) << __func__ << " EXIT!";
+ return;
+ }
+ process_l();
}
- process_l();
}
}
void EffectThread::process_l() {
RETURN_VALUE_IF(!mThreadContext, void(), "nullContext");
- std::shared_ptr<EffectContext::StatusMQ> statusMQ = mThreadContext->getStatusFmq();
- std::shared_ptr<EffectContext::DataMQ> inputMQ = mThreadContext->getInputDataFmq();
- std::shared_ptr<EffectContext::DataMQ> outputMQ = mThreadContext->getOutputDataFmq();
+
+ auto statusMQ = mThreadContext->getStatusFmq();
+ auto inputMQ = mThreadContext->getInputDataFmq();
+ auto outputMQ = mThreadContext->getOutputDataFmq();
auto buffer = mThreadContext->getWorkBuffer();
- // Only this worker will read from input data MQ and write to output data MQ.
- auto readSamples = inputMQ->availableToRead(), writeSamples = outputMQ->availableToWrite();
- if (readSamples && writeSamples) {
- auto processSamples = std::min(readSamples, writeSamples);
- LOG(DEBUG) << __func__ << " available to read " << readSamples << " available to write "
- << writeSamples << " process " << processSamples;
-
+ auto processSamples = inputMQ->availableToRead();
+ if (processSamples) {
inputMQ->read(buffer, processSamples);
-
IEffect::Status status = effectProcessImpl(buffer, buffer, processSamples);
outputMQ->write(buffer, status.fmqProduced);
statusMQ->writeBlocking(&status, 1);
- LOG(DEBUG) << __func__ << " done processing, effect consumed " << status.fmqConsumed
- << " produced " << status.fmqProduced;
- } else {
- usleep(mSleepTimeUs);
+ LOG(DEBUG) << mName << __func__ << ": done processing, effect consumed "
+ << status.fmqConsumed << " produced " << status.fmqProduced;
}
}
diff --git a/audio/aidl/default/Module.cpp b/audio/aidl/default/Module.cpp
index 984b9a1..6b417a4 100644
--- a/audio/aidl/default/Module.cpp
+++ b/audio/aidl/default/Module.cpp
@@ -143,6 +143,21 @@
}
}
+std::ostream& operator<<(std::ostream& os, Module::Type t) {
+ switch (t) {
+ case Module::Type::DEFAULT:
+ os << "default";
+ break;
+ case Module::Type::R_SUBMIX:
+ os << "r_submix";
+ break;
+ case Module::Type::USB:
+ os << "usb";
+ break;
+ }
+ return os;
+}
+
void Module::cleanUpPatch(int32_t patchId) {
erase_all_values(mPatches, std::set<int32_t>{patchId});
}
@@ -352,16 +367,17 @@
ndk::ScopedAStatus Module::setModuleDebug(
const ::aidl::android::hardware::audio::core::ModuleDebug& in_debug) {
- LOG(DEBUG) << __func__ << ": old flags:" << mDebug.toString()
+ LOG(DEBUG) << __func__ << ": " << mType << ": old flags:" << mDebug.toString()
<< ", new flags: " << in_debug.toString();
if (mDebug.simulateDeviceConnections != in_debug.simulateDeviceConnections &&
!mConnectedDevicePorts.empty()) {
- LOG(ERROR) << __func__ << ": attempting to change device connections simulation "
- << "while having external devices connected";
+ LOG(ERROR) << __func__ << ": " << mType
+ << ": attempting to change device connections simulation while having external "
+ << "devices connected";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
if (in_debug.streamTransientStateDelayMs < 0) {
- LOG(ERROR) << __func__ << ": streamTransientStateDelayMs is negative: "
+ LOG(ERROR) << __func__ << ": " << mType << ": streamTransientStateDelayMs is negative: "
<< in_debug.streamTransientStateDelayMs;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
@@ -440,38 +456,45 @@
LOG(DEBUG) << __func__ << ": device port " << connectedPort.id << " device set to "
<< connectedDevicePort.device.toString();
// Check if there is already a connected port with for the same external device.
- for (auto connectedPortId : mConnectedDevicePorts) {
- auto connectedPortIt = findById<AudioPort>(ports, connectedPortId);
+ for (auto connectedPortPair : mConnectedDevicePorts) {
+ auto connectedPortIt = findById<AudioPort>(ports, connectedPortPair.first);
if (connectedPortIt->ext.get<AudioPortExt::Tag::device>().device ==
connectedDevicePort.device) {
LOG(ERROR) << __func__ << ": device " << connectedDevicePort.device.toString()
- << " is already connected at the device port id " << connectedPortId;
+ << " is already connected at the device port id "
+ << connectedPortPair.first;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
}
}
if (!mDebug.simulateDeviceConnections) {
- // In a real HAL here we would attempt querying the profiles from the device.
- LOG(ERROR) << __func__ << ": failed to query supported device profiles";
- // TODO: Check the return value when it is ready for actual devices.
- populateConnectedDevicePort(&connectedPort);
+ if (ndk::ScopedAStatus status = populateConnectedDevicePort(&connectedPort);
+ !status.isOk()) {
+ return status;
+ }
+ } else {
+ auto& connectedProfiles = getConfig().connectedProfiles;
+ if (auto connectedProfilesIt = connectedProfiles.find(templateId);
+ connectedProfilesIt != connectedProfiles.end()) {
+ connectedPort.profiles = connectedProfilesIt->second;
+ }
+ }
+ if (connectedPort.profiles.empty()) {
+ LOG(ERROR) << "Profiles of a connected port still empty after connecting external device "
+ << connectedPort.toString();
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
connectedPort.id = ++getConfig().nextPortId;
- mConnectedDevicePorts.insert(connectedPort.id);
+ auto [connectedPortsIt, _] =
+ mConnectedDevicePorts.insert(std::pair(connectedPort.id, std::vector<int32_t>()));
LOG(DEBUG) << __func__ << ": template port " << templateId << " external device connected, "
<< "connected port ID " << connectedPort.id;
- auto& connectedProfiles = getConfig().connectedProfiles;
- if (auto connectedProfilesIt = connectedProfiles.find(templateId);
- connectedProfilesIt != connectedProfiles.end()) {
- connectedPort.profiles = connectedProfilesIt->second;
- }
ports.push_back(connectedPort);
onExternalDeviceConnectionChanged(connectedPort, true /*connected*/);
- *_aidl_return = std::move(connectedPort);
+ std::vector<int32_t> routablePortIds;
std::vector<AudioRoute> newRoutes;
auto& routes = getConfig().routes;
for (auto& r : routes) {
@@ -481,15 +504,30 @@
newRoute.sinkPortId = connectedPort.id;
newRoute.isExclusive = r.isExclusive;
newRoutes.push_back(std::move(newRoute));
+ routablePortIds.insert(routablePortIds.end(), r.sourcePortIds.begin(),
+ r.sourcePortIds.end());
} else {
auto& srcs = r.sourcePortIds;
if (std::find(srcs.begin(), srcs.end(), templateId) != srcs.end()) {
srcs.push_back(connectedPort.id);
+ routablePortIds.push_back(r.sinkPortId);
}
}
}
routes.insert(routes.end(), newRoutes.begin(), newRoutes.end());
+ // Note: this is a simplistic approach assuming that a mix port can only be populated
+ // from a single device port. Implementing support for stuffing dynamic profiles with a superset
+ // of all profiles from all routable dynamic device ports would be more involved.
+ for (const auto mixPortId : routablePortIds) {
+ auto portsIt = findById<AudioPort>(ports, mixPortId);
+ if (portsIt != ports.end() && portsIt->profiles.empty()) {
+ portsIt->profiles = connectedPort.profiles;
+ connectedPortsIt->second.push_back(portsIt->id);
+ }
+ }
+ *_aidl_return = std::move(connectedPort);
+
return ndk::ScopedAStatus::ok();
}
@@ -504,7 +542,8 @@
LOG(ERROR) << __func__ << ": port id " << in_portId << " is not a device port";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
- if (mConnectedDevicePorts.count(in_portId) == 0) {
+ auto connectedPortsIt = mConnectedDevicePorts.find(in_portId);
+ if (connectedPortsIt == mConnectedDevicePorts.end()) {
LOG(ERROR) << __func__ << ": port id " << in_portId << " is not a connected device port";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
@@ -525,7 +564,6 @@
}
onExternalDeviceConnectionChanged(*portIt, false /*connected*/);
ports.erase(portIt);
- mConnectedDevicePorts.erase(in_portId);
LOG(DEBUG) << __func__ << ": connected device port " << in_portId << " released";
auto& routes = getConfig().routes;
@@ -540,6 +578,14 @@
}
}
+ for (const auto mixPortId : connectedPortsIt->second) {
+ auto mixPortIt = findById<AudioPort>(ports, mixPortId);
+ if (mixPortIt != ports.end()) {
+ mixPortIt->profiles = {};
+ }
+ }
+ mConnectedDevicePorts.erase(connectedPortsIt);
+
return ndk::ScopedAStatus::ok();
}
diff --git a/audio/aidl/default/SoundDose.cpp b/audio/aidl/default/SoundDose.cpp
index be9f93a..f12ce5d 100644
--- a/audio/aidl/default/SoundDose.cpp
+++ b/audio/aidl/default/SoundDose.cpp
@@ -22,7 +22,7 @@
namespace aidl::android::hardware::audio::core::sounddose {
-ndk::ScopedAStatus SoundDose::setOutputRs2(float in_rs2ValueDbA) {
+ndk::ScopedAStatus SoundDose::setOutputRs2UpperBound(float in_rs2ValueDbA) {
if (in_rs2ValueDbA < MIN_RS2 || in_rs2ValueDbA > DEFAULT_MAX_RS2) {
LOG(ERROR) << __func__ << ": RS2 value is invalid: " << in_rs2ValueDbA;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
@@ -32,7 +32,7 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus SoundDose::getOutputRs2(float* _aidl_return) {
+ndk::ScopedAStatus SoundDose::getOutputRs2UpperBound(float* _aidl_return) {
*_aidl_return = mRs2Value;
LOG(DEBUG) << __func__ << ": returning " << *_aidl_return;
return ndk::ScopedAStatus::ok();
diff --git a/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.cpp b/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.cpp
index 561f9a3..63a014a 100644
--- a/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.cpp
+++ b/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.cpp
@@ -22,19 +22,21 @@
#define LOG_TAG "AHAL_AcousticEchoCancelerSw"
#include <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#include "AcousticEchoCancelerSw.h"
using aidl::android::hardware::audio::effect::AcousticEchoCancelerSw;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectImplUuidAcousticEchoCancelerSw;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidAcousticEchoCanceler;
using aidl::android::hardware::audio::effect::IEffect;
-using aidl::android::hardware::audio::effect::kAcousticEchoCancelerSwImplUUID;
using aidl::android::hardware::audio::effect::Range;
using aidl::android::media::audio::common::AudioUuid;
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* instanceSpp) {
- if (!in_impl_uuid || *in_impl_uuid != kAcousticEchoCancelerSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidAcousticEchoCancelerSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -49,7 +51,7 @@
}
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
- if (!in_impl_uuid || *in_impl_uuid != kAcousticEchoCancelerSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidAcousticEchoCancelerSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -69,8 +71,8 @@
const Capability AcousticEchoCancelerSw::kCapability = {.range = AcousticEchoCancelerSw::kRanges};
const Descriptor AcousticEchoCancelerSw::kDescriptor = {
- .common = {.id = {.type = kAcousticEchoCancelerTypeUUID,
- .uuid = kAcousticEchoCancelerSwImplUUID,
+ .common = {.id = {.type = getEffectTypeUuidAcousticEchoCanceler(),
+ .uuid = getEffectImplUuidAcousticEchoCancelerSw(),
.proxy = std::nullopt},
.flags = {.type = Flags::Type::INSERT,
.insert = Flags::Insert::FIRST,
diff --git a/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.h b/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.h
index 753207d..73cf42b 100644
--- a/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.h
+++ b/audio/aidl/default/acousticEchoCanceler/AcousticEchoCancelerSw.h
@@ -23,7 +23,6 @@
#include <memory>
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {
diff --git a/audio/aidl/default/automaticGainControlV1/AutomaticGainControlV1Sw.cpp b/audio/aidl/default/automaticGainControlV1/AutomaticGainControlV1Sw.cpp
index 39290b4..ce10ae1 100644
--- a/audio/aidl/default/automaticGainControlV1/AutomaticGainControlV1Sw.cpp
+++ b/audio/aidl/default/automaticGainControlV1/AutomaticGainControlV1Sw.cpp
@@ -17,18 +17,20 @@
#define LOG_TAG "AHAL_AutomaticGainControlV1Sw"
#include <android-base/logging.h>
+#include <system/audio_effects/effect_uuid.h>
#include "AutomaticGainControlV1Sw.h"
using aidl::android::hardware::audio::effect::AutomaticGainControlV1Sw;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectImplUuidAutomaticGainControlV1Sw;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidAutomaticGainControlV1;
using aidl::android::hardware::audio::effect::IEffect;
-using aidl::android::hardware::audio::effect::kAutomaticGainControlV1SwImplUUID;
using aidl::android::media::audio::common::AudioUuid;
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* instanceSpp) {
- if (!in_impl_uuid || *in_impl_uuid != kAutomaticGainControlV1SwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidAutomaticGainControlV1Sw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -43,7 +45,7 @@
}
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
- if (!in_impl_uuid || *in_impl_uuid != kAutomaticGainControlV1SwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidAutomaticGainControlV1Sw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -63,8 +65,8 @@
.range = AutomaticGainControlV1Sw::kRanges};
const Descriptor AutomaticGainControlV1Sw::kDescriptor = {
- .common = {.id = {.type = kAutomaticGainControlV1TypeUUID,
- .uuid = kAutomaticGainControlV1SwImplUUID,
+ .common = {.id = {.type = getEffectTypeUuidAutomaticGainControlV1(),
+ .uuid = getEffectImplUuidAutomaticGainControlV1Sw(),
.proxy = std::nullopt},
.flags = {.type = Flags::Type::INSERT,
.insert = Flags::Insert::FIRST,
diff --git a/audio/aidl/default/automaticGainControlV1/AutomaticGainControlV1Sw.h b/audio/aidl/default/automaticGainControlV1/AutomaticGainControlV1Sw.h
index 6ba7328..7d2a69f 100644
--- a/audio/aidl/default/automaticGainControlV1/AutomaticGainControlV1Sw.h
+++ b/audio/aidl/default/automaticGainControlV1/AutomaticGainControlV1Sw.h
@@ -17,7 +17,6 @@
#pragma once
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {
diff --git a/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.cpp b/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.cpp
index 50712a4..1e336ac 100644
--- a/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.cpp
+++ b/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.cpp
@@ -17,22 +17,24 @@
#include <algorithm>
#include <cstddef>
#include <memory>
-
#define LOG_TAG "AHAL_AutomaticGainControlV2Sw"
+
#include <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#include "AutomaticGainControlV2Sw.h"
using aidl::android::hardware::audio::effect::AutomaticGainControlV2Sw;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectImplUuidAutomaticGainControlV2Sw;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidAutomaticGainControlV2;
using aidl::android::hardware::audio::effect::IEffect;
-using aidl::android::hardware::audio::effect::kAutomaticGainControlV2SwImplUUID;
using aidl::android::media::audio::common::AudioUuid;
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* instanceSpp) {
- if (!in_impl_uuid || *in_impl_uuid != kAutomaticGainControlV2SwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidAutomaticGainControlV2Sw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -47,7 +49,7 @@
}
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
- if (!in_impl_uuid || *in_impl_uuid != kAutomaticGainControlV2SwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidAutomaticGainControlV2Sw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -67,8 +69,8 @@
.range = AutomaticGainControlV2Sw::kRanges};
const Descriptor AutomaticGainControlV2Sw::kDescriptor = {
- .common = {.id = {.type = kAutomaticGainControlV2TypeUUID,
- .uuid = kAutomaticGainControlV2SwImplUUID,
+ .common = {.id = {.type = getEffectTypeUuidAutomaticGainControlV2(),
+ .uuid = getEffectImplUuidAutomaticGainControlV2Sw(),
.proxy = std::nullopt},
.flags = {.type = Flags::Type::INSERT,
.insert = Flags::Insert::FIRST,
diff --git a/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.h b/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.h
index 0b50f4d..9aa60ea 100644
--- a/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.h
+++ b/audio/aidl/default/automaticGainControlV2/AutomaticGainControlV2Sw.h
@@ -22,7 +22,6 @@
#include <memory>
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {
diff --git a/audio/aidl/default/bassboost/BassBoostSw.cpp b/audio/aidl/default/bassboost/BassBoostSw.cpp
index fb5374f..dbf2e15 100644
--- a/audio/aidl/default/bassboost/BassBoostSw.cpp
+++ b/audio/aidl/default/bassboost/BassBoostSw.cpp
@@ -21,19 +21,22 @@
#define LOG_TAG "AHAL_BassBoostSw"
#include <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#include "BassBoostSw.h"
using aidl::android::hardware::audio::effect::BassBoostSw;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectImplUuidBassBoostProxy;
+using aidl::android::hardware::audio::effect::getEffectImplUuidBassBoostSw;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidBassBoost;
using aidl::android::hardware::audio::effect::IEffect;
-using aidl::android::hardware::audio::effect::kBassBoostSwImplUUID;
using aidl::android::hardware::audio::effect::State;
using aidl::android::media::audio::common::AudioUuid;
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* instanceSpp) {
- if (!in_impl_uuid || *in_impl_uuid != kBassBoostSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidBassBoostSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -48,7 +51,7 @@
}
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
- if (!in_impl_uuid || *in_impl_uuid != kBassBoostSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidBassBoostSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -64,9 +67,9 @@
MAKE_RANGE(BassBoost, strengthPm, 0, 1000)};
const Capability BassBoostSw::kCapability = {.range = {BassBoostSw::kRanges}};
const Descriptor BassBoostSw::kDescriptor = {
- .common = {.id = {.type = kBassBoostTypeUUID,
- .uuid = kBassBoostSwImplUUID,
- .proxy = kBassBoostProxyUUID},
+ .common = {.id = {.type = getEffectTypeUuidBassBoost(),
+ .uuid = getEffectImplUuidBassBoostSw(),
+ .proxy = getEffectImplUuidBassBoostProxy()},
.flags = {.type = Flags::Type::INSERT,
.insert = Flags::Insert::FIRST,
.volume = Flags::Volume::CTRL},
diff --git a/audio/aidl/default/bassboost/BassBoostSw.h b/audio/aidl/default/bassboost/BassBoostSw.h
index 8d183dd..1132472 100644
--- a/audio/aidl/default/bassboost/BassBoostSw.h
+++ b/audio/aidl/default/bassboost/BassBoostSw.h
@@ -22,7 +22,6 @@
#include <memory>
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {
diff --git a/audio/aidl/default/downmix/DownmixSw.cpp b/audio/aidl/default/downmix/DownmixSw.cpp
index 81a4c89..ce5fe20 100644
--- a/audio/aidl/default/downmix/DownmixSw.cpp
+++ b/audio/aidl/default/downmix/DownmixSw.cpp
@@ -20,19 +20,21 @@
#define LOG_TAG "AHAL_DownmixSw"
#include <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#include "DownmixSw.h"
using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::DownmixSw;
+using aidl::android::hardware::audio::effect::getEffectImplUuidDownmixSw;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidDownmix;
using aidl::android::hardware::audio::effect::IEffect;
-using aidl::android::hardware::audio::effect::kDownmixSwImplUUID;
using aidl::android::hardware::audio::effect::State;
using aidl::android::media::audio::common::AudioUuid;
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* instanceSpp) {
- if (!in_impl_uuid || *in_impl_uuid != kDownmixSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidDownmixSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -47,7 +49,7 @@
}
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
- if (!in_impl_uuid || *in_impl_uuid != kDownmixSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidDownmixSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -59,13 +61,14 @@
const std::string DownmixSw::kEffectName = "DownmixSw";
const Descriptor DownmixSw::kDescriptor = {
- .common = {
- .id = {.type = kDownmixTypeUUID, .uuid = kDownmixSwImplUUID, .proxy = std::nullopt},
- .flags = {.type = Flags::Type::INSERT,
- .insert = Flags::Insert::FIRST,
- .volume = Flags::Volume::CTRL},
- .name = kEffectName,
- .implementor = "The Android Open Source Project"}};
+ .common = {.id = {.type = getEffectTypeUuidDownmix(),
+ .uuid = getEffectImplUuidDownmixSw(),
+ .proxy = std::nullopt},
+ .flags = {.type = Flags::Type::INSERT,
+ .insert = Flags::Insert::FIRST,
+ .volume = Flags::Volume::CTRL},
+ .name = kEffectName,
+ .implementor = "The Android Open Source Project"}};
ndk::ScopedAStatus DownmixSw::getDescriptor(Descriptor* _aidl_return) {
LOG(DEBUG) << __func__ << kDescriptor.toString();
diff --git a/audio/aidl/default/downmix/DownmixSw.h b/audio/aidl/default/downmix/DownmixSw.h
index 37c978b..3f8a09b 100644
--- a/audio/aidl/default/downmix/DownmixSw.h
+++ b/audio/aidl/default/downmix/DownmixSw.h
@@ -22,7 +22,6 @@
#include <memory>
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {
diff --git a/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.cpp b/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.cpp
index 1dda6d1..ed6cfa0 100644
--- a/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.cpp
+++ b/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.cpp
@@ -22,19 +22,21 @@
#define LOG_TAG "AHAL_DynamicsProcessingSw"
#include <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#include "DynamicsProcessingSw.h"
using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::DynamicsProcessingSw;
+using aidl::android::hardware::audio::effect::getEffectImplUuidDynamicsProcessingSw;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidDynamicsProcessing;
using aidl::android::hardware::audio::effect::IEffect;
-using aidl::android::hardware::audio::effect::kDynamicsProcessingSwImplUUID;
using aidl::android::hardware::audio::effect::State;
using aidl::android::media::audio::common::AudioUuid;
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* instanceSpp) {
- if (!in_impl_uuid || *in_impl_uuid != kDynamicsProcessingSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidDynamicsProcessingSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -49,7 +51,7 @@
}
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
- if (!in_impl_uuid || *in_impl_uuid != kDynamicsProcessingSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidDynamicsProcessingSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -88,8 +90,8 @@
const Capability DynamicsProcessingSw::kCapability = {.range = DynamicsProcessingSw::kRanges};
const Descriptor DynamicsProcessingSw::kDescriptor = {
- .common = {.id = {.type = kDynamicsProcessingTypeUUID,
- .uuid = kDynamicsProcessingSwImplUUID,
+ .common = {.id = {.type = getEffectTypeUuidDynamicsProcessing(),
+ .uuid = getEffectImplUuidDynamicsProcessingSw(),
.proxy = std::nullopt},
.flags = {.type = Flags::Type::INSERT,
.insert = Flags::Insert::FIRST,
diff --git a/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.h b/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.h
index 769f9ef..641cf71 100644
--- a/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.h
+++ b/audio/aidl/default/dynamicProcessing/DynamicsProcessingSw.h
@@ -25,7 +25,6 @@
#include <fmq/AidlMessageQueue.h>
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {
diff --git a/audio/aidl/default/envReverb/EnvReverbSw.cpp b/audio/aidl/default/envReverb/EnvReverbSw.cpp
index 29288ca..73975c6 100644
--- a/audio/aidl/default/envReverb/EnvReverbSw.cpp
+++ b/audio/aidl/default/envReverb/EnvReverbSw.cpp
@@ -21,19 +21,21 @@
#define LOG_TAG "AHAL_EnvReverbSw"
#include <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#include "EnvReverbSw.h"
using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::EnvReverbSw;
+using aidl::android::hardware::audio::effect::getEffectImplUuidEnvReverbSw;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidEnvReverb;
using aidl::android::hardware::audio::effect::IEffect;
-using aidl::android::hardware::audio::effect::kEnvReverbSwImplUUID;
using aidl::android::hardware::audio::effect::State;
using aidl::android::media::audio::common::AudioUuid;
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* instanceSpp) {
- if (!in_impl_uuid || *in_impl_uuid != kEnvReverbSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidEnvReverbSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -48,7 +50,7 @@
}
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
- if (!in_impl_uuid || *in_impl_uuid != kEnvReverbSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidEnvReverbSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -76,8 +78,8 @@
.range = Range::make<Range::environmentalReverb>(EnvReverbSw::kRanges)};
const Descriptor EnvReverbSw::kDescriptor = {
- .common = {.id = {.type = kEnvReverbTypeUUID,
- .uuid = kEnvReverbSwImplUUID,
+ .common = {.id = {.type = getEffectTypeUuidEnvReverb(),
+ .uuid = getEffectImplUuidEnvReverbSw(),
.proxy = std::nullopt},
.flags = {.type = Flags::Type::INSERT,
.insert = Flags::Insert::FIRST,
diff --git a/audio/aidl/default/envReverb/EnvReverbSw.h b/audio/aidl/default/envReverb/EnvReverbSw.h
index dd2cf5d..5e31e2f 100644
--- a/audio/aidl/default/envReverb/EnvReverbSw.h
+++ b/audio/aidl/default/envReverb/EnvReverbSw.h
@@ -22,7 +22,6 @@
#include <memory>
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {
diff --git a/audio/aidl/default/equalizer/EqualizerSw.cpp b/audio/aidl/default/equalizer/EqualizerSw.cpp
index 0fa7a11..9769924 100644
--- a/audio/aidl/default/equalizer/EqualizerSw.cpp
+++ b/audio/aidl/default/equalizer/EqualizerSw.cpp
@@ -20,19 +20,21 @@
#define LOG_TAG "AHAL_EqualizerSw"
#include <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#include "EqualizerSw.h"
using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::EqualizerSw;
+using aidl::android::hardware::audio::effect::getEffectImplUuidEqualizerSw;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidEqualizer;
using aidl::android::hardware::audio::effect::IEffect;
-using aidl::android::hardware::audio::effect::kEqualizerSwImplUUID;
using aidl::android::hardware::audio::effect::State;
using aidl::android::media::audio::common::AudioUuid;
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* instanceSpp) {
- if (!in_impl_uuid || *in_impl_uuid != kEqualizerSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidEqualizerSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -47,7 +49,7 @@
}
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
- if (!in_impl_uuid || *in_impl_uuid != kEqualizerSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidEqualizerSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -86,15 +88,16 @@
MAKE_RANGE(Equalizer, centerFreqMh, std::vector<int>({1}), std::vector<int>({0}))};
const Capability EqualizerSw::kEqCap = {.range = EqualizerSw::kRanges};
-const Descriptor EqualizerSw::kDesc = {.common = {.id = {.type = kEqualizerTypeUUID,
- .uuid = kEqualizerSwImplUUID,
- .proxy = kEqualizerProxyUUID},
- .flags = {.type = Flags::Type::INSERT,
- .insert = Flags::Insert::FIRST,
- .volume = Flags::Volume::CTRL},
- .name = EqualizerSw::kEffectName,
- .implementor = "The Android Open Source Project"},
- .capability = EqualizerSw::kEqCap};
+const Descriptor EqualizerSw::kDesc = {
+ .common = {.id = {.type = getEffectTypeUuidEqualizer(),
+ .uuid = getEffectImplUuidEqualizerSw(),
+ .proxy = getEffectImplUuidEqualizerProxy()},
+ .flags = {.type = Flags::Type::INSERT,
+ .insert = Flags::Insert::FIRST,
+ .volume = Flags::Volume::CTRL},
+ .name = EqualizerSw::kEffectName,
+ .implementor = "The Android Open Source Project"},
+ .capability = EqualizerSw::kEqCap};
ndk::ScopedAStatus EqualizerSw::getDescriptor(Descriptor* _aidl_return) {
LOG(DEBUG) << __func__ << kDesc.toString();
diff --git a/audio/aidl/default/equalizer/EqualizerSw.h b/audio/aidl/default/equalizer/EqualizerSw.h
index f8987c7..56af3b5 100644
--- a/audio/aidl/default/equalizer/EqualizerSw.h
+++ b/audio/aidl/default/equalizer/EqualizerSw.h
@@ -22,7 +22,6 @@
#include <memory>
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {
diff --git a/audio/aidl/default/extension/ExtensionEffect.cpp b/audio/aidl/default/extension/ExtensionEffect.cpp
index db1e4a4..c4eebc0 100644
--- a/audio/aidl/default/extension/ExtensionEffect.cpp
+++ b/audio/aidl/default/extension/ExtensionEffect.cpp
@@ -23,22 +23,23 @@
#define LOG_TAG "AHAL_ExtensionEffect"
#include <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#include "ExtensionEffect.h"
using aidl::android::hardware::audio::effect::DefaultExtension;
using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::ExtensionEffect;
+using aidl::android::hardware::audio::effect::getEffectUuidExtensionImpl;
+using aidl::android::hardware::audio::effect::getEffectUuidExtensionType;
using aidl::android::hardware::audio::effect::IEffect;
-using aidl::android::hardware::audio::effect::kExtensionEffectImplUUID;
-using aidl::android::hardware::audio::effect::kExtensionEffectTypeUUID;
using aidl::android::hardware::audio::effect::Range;
using aidl::android::hardware::audio::effect::VendorExtension;
using aidl::android::media::audio::common::AudioUuid;
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* instanceSpp) {
- if (!in_impl_uuid || *in_impl_uuid != kExtensionEffectImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectUuidExtensionImpl()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -53,7 +54,7 @@
}
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
- if (!in_impl_uuid || *in_impl_uuid != kExtensionEffectImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectUuidExtensionImpl()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -66,8 +67,8 @@
const std::string ExtensionEffect::kEffectName = "ExtensionEffectExample";
const Descriptor ExtensionEffect::kDescriptor = {
- .common = {.id = {.type = kExtensionEffectTypeUUID,
- .uuid = kExtensionEffectImplUUID,
+ .common = {.id = {.type = getEffectUuidExtensionType(),
+ .uuid = getEffectUuidExtensionImpl(),
.proxy = std::nullopt},
.name = ExtensionEffect::kEffectName,
.implementor = "The Android Open Source Project"}};
diff --git a/audio/aidl/default/extension/ExtensionEffect.h b/audio/aidl/default/extension/ExtensionEffect.h
index f432d40..e7a068b 100644
--- a/audio/aidl/default/extension/ExtensionEffect.h
+++ b/audio/aidl/default/extension/ExtensionEffect.h
@@ -22,7 +22,6 @@
#include <vector>
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {
diff --git a/audio/aidl/default/hapticGenerator/HapticGeneratorSw.cpp b/audio/aidl/default/hapticGenerator/HapticGeneratorSw.cpp
index 944f715..27cdac8 100644
--- a/audio/aidl/default/hapticGenerator/HapticGeneratorSw.cpp
+++ b/audio/aidl/default/hapticGenerator/HapticGeneratorSw.cpp
@@ -20,19 +20,21 @@
#define LOG_TAG "AHAL_HapticGeneratorSw"
#include <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#include "HapticGeneratorSw.h"
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectImplUuidHapticGeneratorSw;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidHapticGenerator;
using aidl::android::hardware::audio::effect::HapticGeneratorSw;
using aidl::android::hardware::audio::effect::IEffect;
-using aidl::android::hardware::audio::effect::kHapticGeneratorSwImplUUID;
using aidl::android::hardware::audio::effect::State;
using aidl::android::media::audio::common::AudioUuid;
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* instanceSpp) {
- if (!in_impl_uuid || *in_impl_uuid != kHapticGeneratorSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidHapticGeneratorSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -47,7 +49,7 @@
}
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
- if (!in_impl_uuid || *in_impl_uuid != kHapticGeneratorSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidHapticGeneratorSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -60,8 +62,8 @@
const std::string HapticGeneratorSw::kEffectName = "HapticGeneratorSw";
/* Effect descriptor */
const Descriptor HapticGeneratorSw::kDescriptor = {
- .common = {.id = {.type = kHapticGeneratorTypeUUID,
- .uuid = kHapticGeneratorSwImplUUID,
+ .common = {.id = {.type = getEffectTypeUuidHapticGenerator(),
+ .uuid = getEffectImplUuidHapticGeneratorSw(),
.proxy = std::nullopt},
.flags = {.type = Flags::Type::INSERT,
.insert = Flags::Insert::FIRST,
diff --git a/audio/aidl/default/hapticGenerator/HapticGeneratorSw.h b/audio/aidl/default/hapticGenerator/HapticGeneratorSw.h
index 428f460..3bbe41a 100644
--- a/audio/aidl/default/hapticGenerator/HapticGeneratorSw.h
+++ b/audio/aidl/default/hapticGenerator/HapticGeneratorSw.h
@@ -16,13 +16,14 @@
#pragma once
-#include <aidl/android/hardware/audio/effect/BnEffect.h>
-#include <fmq/AidlMessageQueue.h>
#include <cstdlib>
+#include <map>
#include <memory>
+#include <aidl/android/hardware/audio/effect/BnEffect.h>
+#include <fmq/AidlMessageQueue.h>
+
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {
diff --git a/audio/aidl/default/include/core-impl/Configuration.h b/audio/aidl/default/include/core-impl/Configuration.h
index 4dd0133..70320e4 100644
--- a/audio/aidl/default/include/core-impl/Configuration.h
+++ b/audio/aidl/default/include/core-impl/Configuration.h
@@ -33,7 +33,8 @@
std::vector<::aidl::android::media::audio::common::AudioPort> ports;
std::vector<::aidl::android::media::audio::common::AudioPortConfig> portConfigs;
std::vector<::aidl::android::media::audio::common::AudioPortConfig> initialConfigs;
- // Port id -> List of profiles to use when the device port state is set to 'connected'.
+ // Port id -> List of profiles to use when the device port state is set to 'connected'
+ // in connection simulation mode.
std::map<int32_t, std::vector<::aidl::android::media::audio::common::AudioProfile>>
connectedProfiles;
std::vector<AudioRoute> routes;
diff --git a/audio/aidl/default/include/core-impl/Module.h b/audio/aidl/default/include/core-impl/Module.h
index 2cbda7d..83ecfaa 100644
--- a/audio/aidl/default/include/core-impl/Module.h
+++ b/audio/aidl/default/include/core-impl/Module.h
@@ -177,8 +177,10 @@
ChildInterface<IBluetooth> mBluetooth;
ChildInterface<IBluetoothA2dp> mBluetoothA2dp;
ChildInterface<IBluetoothLe> mBluetoothLe;
- // ids of ports created at runtime via 'connectExternalDevice'.
- std::set<int32_t> mConnectedDevicePorts;
+ // ids of device ports created at runtime via 'connectExternalDevice'.
+ // Also stores ids of mix ports with dynamic profiles which got populated from the connected
+ // port.
+ std::map<int32_t, std::vector<int32_t>> mConnectedDevicePorts;
Streams mStreams;
// Maps port ids and port config ids to patch ids.
// Multimap because both ports and configs can be used by multiple patches.
diff --git a/audio/aidl/default/include/core-impl/SoundDose.h b/audio/aidl/default/include/core-impl/SoundDose.h
index 306aa04..2a069d9 100644
--- a/audio/aidl/default/include/core-impl/SoundDose.h
+++ b/audio/aidl/default/include/core-impl/SoundDose.h
@@ -29,8 +29,8 @@
public:
SoundDose() : mRs2Value(DEFAULT_MAX_RS2){};
- ndk::ScopedAStatus setOutputRs2(float in_rs2ValueDbA) override;
- ndk::ScopedAStatus getOutputRs2(float* _aidl_return) override;
+ ndk::ScopedAStatus setOutputRs2UpperBound(float in_rs2ValueDbA) override;
+ ndk::ScopedAStatus getOutputRs2UpperBound(float* _aidl_return) override;
ndk::ScopedAStatus registerSoundDoseCallback(
const std::shared_ptr<ISoundDose::IHalSoundDoseCallback>& in_callback) override;
diff --git a/audio/aidl/default/include/core-impl/StreamUsb.h b/audio/aidl/default/include/core-impl/StreamUsb.h
index f1815dd..36e64cb 100644
--- a/audio/aidl/default/include/core-impl/StreamUsb.h
+++ b/audio/aidl/default/include/core-impl/StreamUsb.h
@@ -56,7 +56,7 @@
std::vector<::aidl::android::media::audio::common::AudioDeviceAddress> mConnectedDevices
GUARDED_BY(mLock);
std::vector<std::shared_ptr<alsa_device_proxy>> mAlsaDeviceProxies GUARDED_BY(mLock);
- bool mIsStandby = false;
+ bool mIsStandby = true;
};
class StreamInUsb final : public StreamIn {
diff --git a/audio/aidl/default/include/effect-impl/EffectContext.h b/audio/aidl/default/include/effect-impl/EffectContext.h
index 8b4a7d2..22cdb6b 100644
--- a/audio/aidl/default/include/effect-impl/EffectContext.h
+++ b/audio/aidl/default/include/effect-impl/EffectContext.h
@@ -54,6 +54,7 @@
size_t inBufferSizeInFloat = input.frameCount * mInputFrameSize / sizeof(float);
size_t outBufferSizeInFloat = output.frameCount * mOutputFrameSize / sizeof(float);
+ // only status FMQ use the EventFlag
mStatusMQ = std::make_shared<StatusMQ>(statusDepth, true /*configureEventFlagWord*/);
mInputMQ = std::make_shared<DataMQ>(inBufferSizeInFloat);
mOutputMQ = std::make_shared<DataMQ>(outBufferSizeInFloat);
@@ -127,7 +128,7 @@
return RetCode::SUCCESS;
}
virtual Parameter::Common getCommon() {
- LOG(INFO) << __func__ << mCommon.toString();
+ LOG(DEBUG) << __func__ << mCommon.toString();
return mCommon;
}
diff --git a/audio/aidl/default/include/effect-impl/EffectRange.h b/audio/aidl/default/include/effect-impl/EffectRange.h
new file mode 100644
index 0000000..a3ea01f
--- /dev/null
+++ b/audio/aidl/default/include/effect-impl/EffectRange.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+#pragma once
+
+#include <algorithm>
+#include <tuple>
+#include <utility>
+#include <vector>
+
+namespace aidl::android::hardware::audio::effect {
+
+template <typename T>
+bool isInRange(const T& value, const T& low, const T& high) {
+ return (value >= low) && (value <= high);
+}
+
+template <typename T, std::size_t... Is>
+bool isTupleInRange(const T& test, const T& min, const T& max, std::index_sequence<Is...>) {
+ return (isInRange(std::get<Is>(test), std::get<Is>(min), std::get<Is>(max)) && ...);
+}
+
+template <typename T, std::size_t TupSize = std::tuple_size_v<T>>
+bool isTupleInRange(const T& test, const T& min, const T& max) {
+ return isTupleInRange(test, min, max, std::make_index_sequence<TupSize>{});
+}
+
+template <typename T, typename F>
+bool isTupleInRange(const std::vector<T>& cfgs, const T& min, const T& max, const F& func) {
+ auto minT = func(min), maxT = func(max);
+ return std::all_of(cfgs.cbegin(), cfgs.cend(),
+ [&](const T& cfg) { return isTupleInRange(func(cfg), minT, maxT); });
+}
+
+} // namespace aidl::android::hardware::audio::effect
diff --git a/audio/aidl/default/include/effect-impl/EffectThread.h b/audio/aidl/default/include/effect-impl/EffectThread.h
index f9c6a31..ae51ef7 100644
--- a/audio/aidl/default/include/effect-impl/EffectThread.h
+++ b/audio/aidl/default/include/effect-impl/EffectThread.h
@@ -16,10 +16,12 @@
#pragma once
#include <atomic>
+#include <memory>
#include <string>
#include <thread>
#include <android-base/thread_annotations.h>
+#include <fmq/EventFlag.h>
#include <system/thread_defs.h>
#include "effect-impl/EffectContext.h"
@@ -35,7 +37,7 @@
// called by effect implementation.
RetCode createThread(std::shared_ptr<EffectContext> context, const std::string& name,
- int priority = ANDROID_PRIORITY_URGENT_AUDIO, int sleepUs = kSleepTimeUs);
+ int priority = ANDROID_PRIORITY_URGENT_AUDIO);
RetCode destroyThread();
RetCode startThread();
RetCode stopThread();
@@ -73,17 +75,23 @@
private:
static constexpr int kMaxTaskNameLen = 15;
- static constexpr int kSleepTimeUs = 2000; // in micro-second
+
std::mutex mThreadMutex;
std::condition_variable mCv;
- bool mExit GUARDED_BY(mThreadMutex) = false;
bool mStop GUARDED_BY(mThreadMutex) = true;
+ bool mExit GUARDED_BY(mThreadMutex) = false;
std::shared_ptr<EffectContext> mThreadContext GUARDED_BY(mThreadMutex);
+
+ struct EventFlagDeleter {
+ void operator()(::android::hardware::EventFlag* flag) const {
+ if (flag) {
+ ::android::hardware::EventFlag::deleteEventFlag(&flag);
+ }
+ }
+ };
+ std::unique_ptr<::android::hardware::EventFlag, EventFlagDeleter> mEfGroup;
std::thread mThread;
int mPriority;
- int mSleepTimeUs = kSleepTimeUs; // sleep time in micro-second
std::string mName;
-
- RetCode handleStartStop(bool stop);
};
} // namespace aidl::android::hardware::audio::effect
diff --git a/audio/aidl/default/include/effect-impl/EffectTypes.h b/audio/aidl/default/include/effect-impl/EffectTypes.h
index fe534d7..4bda7be 100644
--- a/audio/aidl/default/include/effect-impl/EffectTypes.h
+++ b/audio/aidl/default/include/effect-impl/EffectTypes.h
@@ -15,7 +15,6 @@
*/
#pragma once
-#include <ostream>
#include <string>
#include <aidl/android/hardware/audio/effect/BnEffect.h>
@@ -128,23 +127,4 @@
#define MAKE_RANGE(T, Tag, l, r) \
{ .min = T::make<T::Tag>(l), .max = T::make<T::Tag>(r) }
-static inline bool stringToUuid(const char* str,
- ::aidl::android::media::audio::common::AudioUuid* uuid) {
- RETURN_VALUE_IF(!uuid || !str, false, "nullPtr");
-
- uint32_t tmp[10];
- if (sscanf(str, "%08x-%04x-%04x-%04x-%02x%02x%02x%02x%02x%02x", tmp, tmp + 1, tmp + 2, tmp + 3,
- tmp + 4, tmp + 5, tmp + 6, tmp + 7, tmp + 8, tmp + 9) < 10) {
- return false;
- }
-
- uuid->timeLow = (uint32_t)tmp[0];
- uuid->timeMid = (uint16_t)tmp[1];
- uuid->timeHiAndVersion = (uint16_t)tmp[2];
- uuid->clockSeq = (uint16_t)tmp[3];
- uuid->node.insert(uuid->node.end(), {(uint8_t)tmp[4], (uint8_t)tmp[5], (uint8_t)tmp[6],
- (uint8_t)tmp[7], (uint8_t)tmp[8], (uint8_t)tmp[9]});
- return true;
-}
-
} // namespace aidl::android::hardware::audio::effect
diff --git a/audio/aidl/default/include/effect-impl/EffectUUID.h b/audio/aidl/default/include/effect-impl/EffectUUID.h
deleted file mode 100644
index bc61c0f..0000000
--- a/audio/aidl/default/include/effect-impl/EffectUUID.h
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
- * Copyright (C) 2022 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.
- */
-
-#pragma once
-#include <map>
-
-#include <aidl/android/media/audio/common/AudioUuid.h>
-
-namespace aidl::android::hardware::audio::effect {
-
-using ::aidl::android::media::audio::common::AudioUuid;
-
-// ec7178ec-e5e1-4432-a3f4-4657e6795210
-static const AudioUuid kEffectNullUuid = {static_cast<int32_t>(0xec7178ec),
- 0xe5e1,
- 0x4432,
- 0xa3f4,
- {0x46, 0x57, 0xe6, 0x79, 0x52, 0x10}};
-// Zero UUID
-static const AudioUuid kEffectZeroUuid = {
- static_cast<int32_t>(0x0), 0x0, 0x0, 0x0, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}};
-
-// 7b491460-8d4d-11e0-bd61-0002a5d5c51b.
-static const AudioUuid kAcousticEchoCancelerTypeUUID = {static_cast<int32_t>(0x7b491460),
- 0x8d4d,
- 0x11e0,
- 0xbd61,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// bb392ec0-8d4d-11e0-a896-0002a5d5c51b
-static const AudioUuid kAcousticEchoCancelerSwImplUUID = {static_cast<int32_t>(0xbb392ec0),
- 0x8d4d,
- 0x11e0,
- 0xa896,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 0a8abfe0-654c-11e0-ba26-0002a5d5c51b
-static const AudioUuid kAutomaticGainControlV1TypeUUID = {static_cast<int32_t>(0x0a8abfe0),
- 0x654c,
- 0x11e0,
- 0xba26,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// aa8130e0-66fc-11e0-bad0-0002a5d5c51b
-static const AudioUuid kAutomaticGainControlV1SwImplUUID = {static_cast<int32_t>(0xaa8130e0),
- 0x66fc,
- 0x11e0,
- 0xbad0,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// ae3c653b-be18-4ab8-8938-418f0a7f06ac
-static const AudioUuid kAutomaticGainControlV2TypeUUID = {static_cast<int32_t>(0xae3c653b),
- 0xbe18,
- 0x4ab8,
- 0x8938,
- {0x41, 0x8f, 0x0a, 0x7f, 0x06, 0xac}};
-// 89f38e65-d4d2-4d64-ad0e-2b3e799ea886
-static const AudioUuid kAutomaticGainControlV2SwImplUUID = {static_cast<int32_t>(0x89f38e65),
- 0xd4d2,
- 0x4d64,
- 0xad0e,
- {0x2b, 0x3e, 0x79, 0x9e, 0xa8, 0x86}};
-// 0634f220-ddd4-11db-a0fc-0002a5d5c51b
-static const AudioUuid kBassBoostTypeUUID = {static_cast<int32_t>(0x0634f220),
- 0xddd4,
- 0x11db,
- 0xa0fc,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// fa8181f2-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kBassBoostSwImplUUID = {static_cast<int32_t>(0xfa8181f2),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// 8631f300-72e2-11df-b57e-0002a5d5c51b
-static const AudioUuid kBassBoostBundleImplUUID = {static_cast<int32_t>(0x8631f300),
- 0x72e2,
- 0x11df,
- 0xb57e,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 14804144-a5ee-4d24-aa88-0002a5d5c51b
-static const AudioUuid kBassBoostProxyUUID = {static_cast<int32_t>(0x14804144),
- 0xa5ee,
- 0x4d24,
- 0xaa88,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 381e49cc-a858-4aa2-87f6-e8388e7601b2
-static const AudioUuid kDownmixTypeUUID = {static_cast<int32_t>(0x381e49cc),
- 0xa858,
- 0x4aa2,
- 0x87f6,
- {0xe8, 0x38, 0x8e, 0x76, 0x01, 0xb2}};
-// fa8187ba-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kDownmixSwImplUUID = {static_cast<int32_t>(0xfa8187ba),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// 93f04452-e4fe-41cc-91f9-e475b6d1d69f
-static const AudioUuid kDownmixImplUUID = {static_cast<int32_t>(0x93f04452),
- 0xe4fe,
- 0x41cc,
- 0x91f9,
- {0xe4, 0x75, 0xb6, 0xd1, 0xd6, 0x9f}};
-// 0bed4300-ddd6-11db-8f34-0002a5d5c51b.
-static const AudioUuid kEqualizerTypeUUID = {static_cast<int32_t>(0x0bed4300),
- 0xddd6,
- 0x11db,
- 0x8f34,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 0bed4300-847d-11df-bb17-0002a5d5c51b
-static const AudioUuid kEqualizerSwImplUUID = {static_cast<int32_t>(0x0bed4300),
- 0x847d,
- 0x11df,
- 0xbb17,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// ce772f20-847d-11df-bb17-0002a5d5c51b
-static const AudioUuid kEqualizerBundleImplUUID = {static_cast<int32_t>(0xce772f20),
- 0x847d,
- 0x11df,
- 0xbb17,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// c8e70ecd-48ca-456e-8a4f-0002a5d5c51b
-static const AudioUuid kEqualizerProxyUUID = {static_cast<int32_t>(0xc8e70ecd),
- 0x48ca,
- 0x456e,
- 0x8a4f,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 7261676f-6d75-7369-6364-28e2fd3ac39e
-static const AudioUuid kDynamicsProcessingTypeUUID = {static_cast<int32_t>(0x7261676f),
- 0x6d75,
- 0x7369,
- 0x6364,
- {0x28, 0xe2, 0xfd, 0x3a, 0xc3, 0x9e}};
-// fa818d78-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kDynamicsProcessingSwImplUUID = {static_cast<int32_t>(0xfa818d78),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// e0e6539b-1781-7261-676f-6d7573696340
-static const AudioUuid kDynamicsProcessingImplUUID = {static_cast<int32_t>(0xe0e6539b),
- 0x1781,
- 0x7261,
- 0x676f,
- {0x6d, 0x75, 0x73, 0x69, 0x63, 0x40}};
-// 1411e6d6-aecd-4021-a1cf-a6aceb0d71e5
-static const AudioUuid kHapticGeneratorTypeUUID = {static_cast<int32_t>(0x1411e6d6),
- 0xaecd,
- 0x4021,
- 0xa1cf,
- {0xa6, 0xac, 0xeb, 0x0d, 0x71, 0xe5}};
-// fa819110-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kHapticGeneratorSwImplUUID = {static_cast<int32_t>(0xfa819110),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// 97c4acd1-8b82-4f2f-832e-c2fe5d7a9931
-static const AudioUuid kHapticGeneratorImplUUID = {static_cast<int32_t>(0x97c4acd1),
- 0x8b82,
- 0x4f2f,
- 0x832e,
- {0xc2, 0xfe, 0x5d, 0x7a, 0x99, 0x31}};
-// fe3199be-aed0-413f-87bb-11260eb63cf1
-static const AudioUuid kLoudnessEnhancerTypeUUID = {static_cast<int32_t>(0xfe3199be),
- 0xaed0,
- 0x413f,
- 0x87bb,
- {0x11, 0x26, 0x0e, 0xb6, 0x3c, 0xf1}};
-// fa819610-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kLoudnessEnhancerSwImplUUID = {static_cast<int32_t>(0xfa819610),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// fa415329-2034-4bea-b5dc-5b381c8d1e2c
-static const AudioUuid kLoudnessEnhancerImplUUID = {static_cast<int32_t>(0xfa415329),
- 0x2034,
- 0x4bea,
- 0xb5dc,
- {0x5b, 0x38, 0x1c, 0x8d, 0x1e, 0x2c}};
-// c2e5d5f0-94bd-4763-9cac-4e234d06839e
-static const AudioUuid kEnvReverbTypeUUID = {static_cast<int32_t>(0xc2e5d5f0),
- 0x94bd,
- 0x4763,
- 0x9cac,
- {0x4e, 0x23, 0x4d, 0x06, 0x83, 0x9e}};
-// fa819886-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kEnvReverbSwImplUUID = {static_cast<int32_t>(0xfa819886),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// 4a387fc0-8ab3-11df-8bad-0002a5d5c51b
-static const AudioUuid kAuxEnvReverbImplUUID = {static_cast<int32_t>(0x4a387fc0),
- 0x8ab3,
- 0x11df,
- 0x8bad,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// c7a511a0-a3bb-11df-860e-0002a5d5c51b
-static const AudioUuid kInsertEnvReverbImplUUID = {static_cast<int32_t>(0xc7a511a0),
- 0xa3bb,
- 0x11df,
- 0x860e,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 58b4b260-8e06-11e0-aa8e-0002a5d5c51b
-static const AudioUuid kNoiseSuppressionTypeUUID = {static_cast<int32_t>(0x58b4b260),
- 0x8e06,
- 0x11e0,
- 0xaa8e,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// c06c8400-8e06-11e0-9cb6-0002a5d5c51b
-static const AudioUuid kNoiseSuppressionSwImplUUID = {static_cast<int32_t>(0xc06c8400),
- 0x8e06,
- 0x11e0,
- 0x9cb6,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 47382d60-ddd8-11db-bf3a-0002a5d5c51b
-static const AudioUuid kPresetReverbTypeUUID = {static_cast<int32_t>(0x47382d60),
- 0xddd8,
- 0x11db,
- 0xbf3a,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// fa8199c6-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kPresetReverbSwImplUUID = {static_cast<int32_t>(0xfa8199c6),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// f29a1400-a3bb-11df-8ddc-0002a5d5c51b
-static const AudioUuid kAuxPresetReverbImplUUID = {static_cast<int32_t>(0xf29a1400),
- 0xa3bb,
- 0x11df,
- 0x8ddc,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 172cdf00-a3bc-11df-a72f-0002a5d5c51b
-static const AudioUuid kInsertPresetReverbImplUUID = {static_cast<int32_t>(0x172cdf00),
- 0xa3bc,
- 0x11df,
- 0xa72f,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// 37cc2c00-dddd-11db-8577-0002a5d5c51b
-static const AudioUuid kVirtualizerTypeUUID = {static_cast<int32_t>(0x37cc2c00),
- 0xdddd,
- 0x11db,
- 0x8577,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// fa819d86-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kVirtualizerSwImplUUID = {static_cast<int32_t>(0xfa819d86),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// 1d4033c0-8557-11df-9f2d-0002a5d5c51b
-static const AudioUuid kVirtualizerBundleImplUUID = {static_cast<int32_t>(0x1d4033c0),
- 0x8557,
- 0x11df,
- 0x9f2d,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// d3467faa-acc7-4d34-acaf-0002a5d5c51b
-static const AudioUuid kVirtualizerProxyUUID = {static_cast<int32_t>(0xd3467faa),
- 0xacc7,
- 0x4d34,
- 0xacaf,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// e46b26a0-dddd-11db-8afd-0002a5d5c51b
-static const AudioUuid kVisualizerTypeUUID = {static_cast<int32_t>(0xe46b26a0),
- 0xdddd,
- 0x11db,
- 0x8afd,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// fa81a0f6-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kVisualizerSwImplUUID = {static_cast<int32_t>(0xfa81a0f6),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// d069d9e0-8329-11df-9168-0002a5d5c51b
-// {0xd069d9e0, 0x8329, 0x11df, 0x9168, {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}},
-static const AudioUuid kVisualizerImplUUID = {static_cast<int32_t>(0xd069d9e0),
- 0x8329,
- 0x11df,
- 0x9168,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-// fa81a2b8-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kVolumeTypeUUID = {static_cast<int32_t>(0xfa81a2b8),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// fa81a718-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kVolumeSwImplUUID = {static_cast<int32_t>(0xfa81a718),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// 119341a0-8469-11df-81f9-0002a5d5c51b
-static const AudioUuid kVolumeBundleImplUUID = {static_cast<int32_t>(0x119341a0),
- 0x8469,
- 0x11df,
- 0x81f9,
- {0x00, 0x02, 0xa5, 0xd5, 0xc5, 0x1b}};
-
-// fa81dbde-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kExtensionEffectTypeUUID = {static_cast<int32_t>(0xfa81dbde),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-// fa81dd00-588b-11ed-9b6a-0242ac120002
-static const AudioUuid kExtensionEffectImplUUID = {static_cast<int32_t>(0xfa81dd00),
- 0x588b,
- 0x11ed,
- 0x9b6a,
- {0x02, 0x42, 0xac, 0x12, 0x00, 0x02}};
-/**
- * @brief A map between effect name and effect type UUID.
- * All <name> attribution in effect/effectProxy of audio_effects.xml should be listed in this map.
- * We need this map is because existing audio_effects.xml don't have a type UUID defined.
- */
-static const std::map<const std::string /* effect type */, const AudioUuid&> kUuidNameTypeMap = {
- {"acoustic_echo_canceler", kAcousticEchoCancelerTypeUUID},
- {"automatic_gain_control_v1", kAutomaticGainControlV1TypeUUID},
- {"automatic_gain_control_v2", kAutomaticGainControlV2TypeUUID},
- {"bassboost", kBassBoostTypeUUID},
- {"downmix", kDownmixTypeUUID},
- {"dynamics_processing", kDynamicsProcessingTypeUUID},
- {"equalizer", kEqualizerTypeUUID},
- {"extensioneffect", kExtensionEffectTypeUUID},
- {"haptic_generator", kHapticGeneratorTypeUUID},
- {"loudness_enhancer", kLoudnessEnhancerTypeUUID},
- {"env_reverb", kEnvReverbTypeUUID},
- {"noise_suppression", kNoiseSuppressionTypeUUID},
- {"preset_reverb", kPresetReverbTypeUUID},
- {"reverb_env_aux", kEnvReverbTypeUUID},
- {"reverb_env_ins", kEnvReverbTypeUUID},
- {"reverb_pre_aux", kPresetReverbTypeUUID},
- {"reverb_pre_ins", kPresetReverbTypeUUID},
- {"virtualizer", kVirtualizerTypeUUID},
- {"visualizer", kVisualizerTypeUUID},
- {"volume", kVolumeTypeUUID},
-};
-
-} // namespace aidl::android::hardware::audio::effect
diff --git a/audio/aidl/default/include/effectFactory-impl/EffectConfig.h b/audio/aidl/default/include/effectFactory-impl/EffectConfig.h
index c499811..c627a27 100644
--- a/audio/aidl/default/include/effectFactory-impl/EffectConfig.h
+++ b/audio/aidl/default/include/effectFactory-impl/EffectConfig.h
@@ -17,6 +17,7 @@
#pragma once
#include <functional>
+#include <map>
#include <memory>
#include <string>
#include <unordered_map>
@@ -62,6 +63,9 @@
return mProcessingMap;
}
+ static bool findUuid(const std::string& xmlEffectName,
+ ::aidl::android::media::audio::common::AudioUuid* uuid);
+
private:
static constexpr const char* kEffectLibPath[] =
#ifdef __LP64__
diff --git a/audio/aidl/default/include/effectFactory-impl/EffectFactory.h b/audio/aidl/default/include/effectFactory-impl/EffectFactory.h
index fc9ef02..b7f63af 100644
--- a/audio/aidl/default/include/effectFactory-impl/EffectFactory.h
+++ b/audio/aidl/default/include/effectFactory-impl/EffectFactory.h
@@ -105,7 +105,7 @@
const std::string& path);
void createIdentityWithConfig(
const EffectConfig::LibraryUuid& configLib,
- const ::aidl::android::media::audio::common::AudioUuid& typeUuid,
+ const ::aidl::android::media::audio::common::AudioUuid& typeUuidStr,
const std::optional<::aidl::android::media::audio::common::AudioUuid> proxyUuid);
void loadEffectLibs();
/* Get effect_dl_interface_s from library handle */
diff --git a/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.cpp b/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.cpp
index f115cc5..7954316 100644
--- a/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.cpp
+++ b/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.cpp
@@ -20,19 +20,21 @@
#define LOG_TAG "AHAL_LoudnessEnhancerSw"
#include <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#include "LoudnessEnhancerSw.h"
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectImplUuidLoudnessEnhancerSw;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidLoudnessEnhancer;
using aidl::android::hardware::audio::effect::IEffect;
-using aidl::android::hardware::audio::effect::kLoudnessEnhancerSwImplUUID;
using aidl::android::hardware::audio::effect::LoudnessEnhancerSw;
using aidl::android::hardware::audio::effect::State;
using aidl::android::media::audio::common::AudioUuid;
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* instanceSpp) {
- if (!in_impl_uuid || *in_impl_uuid != kLoudnessEnhancerSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidLoudnessEnhancerSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -47,7 +49,7 @@
}
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
- if (!in_impl_uuid || *in_impl_uuid != kLoudnessEnhancerSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidLoudnessEnhancerSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -59,8 +61,8 @@
const std::string LoudnessEnhancerSw::kEffectName = "LoudnessEnhancerSw";
const Descriptor LoudnessEnhancerSw::kDescriptor = {
- .common = {.id = {.type = kLoudnessEnhancerTypeUUID,
- .uuid = kLoudnessEnhancerSwImplUUID,
+ .common = {.id = {.type = getEffectTypeUuidLoudnessEnhancer(),
+ .uuid = getEffectImplUuidLoudnessEnhancerSw(),
.proxy = std::nullopt},
.flags = {.type = Flags::Type::INSERT,
.insert = Flags::Insert::FIRST,
diff --git a/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.h b/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.h
index e252f4a..25824f2 100644
--- a/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.h
+++ b/audio/aidl/default/loudnessEnhancer/LoudnessEnhancerSw.h
@@ -22,7 +22,6 @@
#include <memory>
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {
diff --git a/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.cpp b/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.cpp
index ba39b16..9b2cb7c 100644
--- a/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.cpp
+++ b/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.cpp
@@ -17,22 +17,25 @@
#include <algorithm>
#include <cstddef>
#include <memory>
+#define LOG_TAG "AHAL_NoiseSuppressionSw"
#define LOG_TAG "AHAL_NoiseSuppressionSw"
#include <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#include "NoiseSuppressionSw.h"
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectImplUuidNoiseSuppressionSw;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidNoiseSuppression;
using aidl::android::hardware::audio::effect::IEffect;
-using aidl::android::hardware::audio::effect::kNoiseSuppressionSwImplUUID;
using aidl::android::hardware::audio::effect::NoiseSuppressionSw;
using aidl::android::media::audio::common::AudioUuid;
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* instanceSpp) {
- if (!in_impl_uuid || *in_impl_uuid != kNoiseSuppressionSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidNoiseSuppressionSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -47,7 +50,7 @@
}
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
- if (!in_impl_uuid || *in_impl_uuid != kNoiseSuppressionSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidNoiseSuppressionSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -59,8 +62,8 @@
const std::string NoiseSuppressionSw::kEffectName = "NoiseSuppressionSw";
const Descriptor NoiseSuppressionSw::kDescriptor = {
- .common = {.id = {.type = kNoiseSuppressionTypeUUID,
- .uuid = kNoiseSuppressionSwImplUUID,
+ .common = {.id = {.type = getEffectTypeUuidNoiseSuppression(),
+ .uuid = getEffectImplUuidNoiseSuppressionSw(),
.proxy = std::nullopt},
.flags = {.type = Flags::Type::INSERT,
.insert = Flags::Insert::FIRST,
diff --git a/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.h b/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.h
index 22bf066..fc1e028 100644
--- a/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.h
+++ b/audio/aidl/default/noiseSuppression/NoiseSuppressionSw.h
@@ -16,13 +16,13 @@
#pragma once
-#include <aidl/android/hardware/audio/effect/BnEffect.h>
-#include <fmq/AidlMessageQueue.h>
#include <cstdlib>
#include <memory>
+#include <aidl/android/hardware/audio/effect/BnEffect.h>
+#include <fmq/AidlMessageQueue.h>
+
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {
diff --git a/audio/aidl/default/presetReverb/PresetReverbSw.cpp b/audio/aidl/default/presetReverb/PresetReverbSw.cpp
index 14546a4..3f02eb7 100644
--- a/audio/aidl/default/presetReverb/PresetReverbSw.cpp
+++ b/audio/aidl/default/presetReverb/PresetReverbSw.cpp
@@ -21,19 +21,21 @@
#include <android-base/logging.h>
#include <android/binder_enums.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#include "PresetReverbSw.h"
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectImplUuidPresetReverbSw;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidPresetReverb;
using aidl::android::hardware::audio::effect::IEffect;
-using aidl::android::hardware::audio::effect::kPresetReverbSwImplUUID;
using aidl::android::hardware::audio::effect::PresetReverbSw;
using aidl::android::hardware::audio::effect::State;
using aidl::android::media::audio::common::AudioUuid;
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* instanceSpp) {
- if (!in_impl_uuid || *in_impl_uuid != kPresetReverbSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidPresetReverbSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -48,7 +50,7 @@
}
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
- if (!in_impl_uuid || *in_impl_uuid != kPresetReverbSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidPresetReverbSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -72,8 +74,8 @@
.range = Range::make<Range::presetReverb>(PresetReverbSw::kRanges)};
const Descriptor PresetReverbSw::kDescriptor = {
- .common = {.id = {.type = kPresetReverbTypeUUID,
- .uuid = kPresetReverbSwImplUUID,
+ .common = {.id = {.type = getEffectTypeUuidPresetReverb(),
+ .uuid = getEffectImplUuidPresetReverbSw(),
.proxy = std::nullopt},
.flags = {.type = Flags::Type::INSERT,
.insert = Flags::Insert::FIRST,
diff --git a/audio/aidl/default/presetReverb/PresetReverbSw.h b/audio/aidl/default/presetReverb/PresetReverbSw.h
index 5061475..9ceee7c 100644
--- a/audio/aidl/default/presetReverb/PresetReverbSw.h
+++ b/audio/aidl/default/presetReverb/PresetReverbSw.h
@@ -22,7 +22,6 @@
#include <memory>
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {
diff --git a/audio/aidl/default/usb/ModuleUsb.cpp b/audio/aidl/default/usb/ModuleUsb.cpp
index 80b0a5b..28116ae 100644
--- a/audio/aidl/default/usb/ModuleUsb.cpp
+++ b/audio/aidl/default/usb/ModuleUsb.cpp
@@ -30,13 +30,13 @@
#include "alsa_device_profile.h"
}
-using aidl::android::hardware::audio::common::isUsbInputDeviceType;
using aidl::android::media::audio::common::AudioChannelLayout;
using aidl::android::media::audio::common::AudioDeviceAddress;
using aidl::android::media::audio::common::AudioDeviceDescription;
using aidl::android::media::audio::common::AudioDeviceType;
using aidl::android::media::audio::common::AudioFormatDescription;
using aidl::android::media::audio::common::AudioFormatType;
+using aidl::android::media::audio::common::AudioIoFlags;
using aidl::android::media::audio::common::AudioPort;
using aidl::android::media::audio::common::AudioPortConfig;
using aidl::android::media::audio::common::AudioPortExt;
@@ -117,10 +117,14 @@
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
- const bool isInput = isUsbInputDeviceType(devicePort.device.type.type);
+ const bool isInput = audioPort->flags.getTag() == AudioIoFlags::input;
alsa_device_profile profile;
profile_init(&profile, isInput ? PCM_IN : PCM_OUT);
+ profile.card = alsaAddress[0];
+ profile.device = alsaAddress[1];
if (!profile_read_device_info(&profile)) {
+ LOG(ERROR) << __func__ << ": failed to read device info, card=" << profile.card
+ << ", device=" << profile.device;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
@@ -128,7 +132,7 @@
std::vector<int> sampleRates = populateSampleRatesFromProfile(&profile);
for (size_t i = 0; i < std::min(MAX_PROFILE_FORMATS, AUDIO_PORT_MAX_AUDIO_PROFILES) &&
- profile.formats[i] != 0;
+ profile.formats[i] != PCM_FORMAT_INVALID;
++i) {
auto audioFormatDescription =
usb::legacy2aidl_pcm_format_AudioFormatDescription(profile.formats[i]);
diff --git a/audio/aidl/default/usb/StreamUsb.cpp b/audio/aidl/default/usb/StreamUsb.cpp
index fbfe0f1..5d1d7fe 100644
--- a/audio/aidl/default/usb/StreamUsb.cpp
+++ b/audio/aidl/default/usb/StreamUsb.cpp
@@ -107,10 +107,13 @@
::android::status_t DriverUsb::transfer(void* buffer, size_t frameCount, size_t* actualFrameCount,
int32_t* latencyMs) {
if (!mConfig.has_value() || mConnectedDevices.empty()) {
+ LOG(ERROR) << __func__ << ": failed, has config: " << mConfig.has_value()
+ << ", has connected devices: " << mConnectedDevices.empty();
return ::android::NO_INIT;
}
if (mIsStandby) {
if (::android::status_t status = exitStandby(); status != ::android::OK) {
+ LOG(ERROR) << __func__ << ": failed to exit standby, status=" << status;
return status;
}
}
@@ -151,6 +154,7 @@
std::vector<std::shared_ptr<alsa_device_proxy>> alsaDeviceProxies;
for (const auto& device : connectedDevices) {
alsa_device_profile profile;
+ profile_init(&profile, mIsInput ? PCM_IN : PCM_OUT);
profile.card = device.get<AudioDeviceAddress::alsa>()[0];
profile.device = device.get<AudioDeviceAddress::alsa>()[1];
if (!profile_read_device_info(&profile)) {
@@ -174,6 +178,11 @@
<< " error=" << err;
return ::android::UNKNOWN_ERROR;
}
+ if (int err = proxy_open(proxy.get()); err != 0) {
+ LOG(ERROR) << __func__ << ": failed to open device, address=" << device.toString()
+ << " error=" << err;
+ return ::android::UNKNOWN_ERROR;
+ }
alsaDeviceProxies.push_back(std::move(proxy));
}
{
diff --git a/audio/aidl/default/usb/UsbAlsaUtils.cpp b/audio/aidl/default/usb/UsbAlsaUtils.cpp
index 3a74c2a..74d9c28 100644
--- a/audio/aidl/default/usb/UsbAlsaUtils.cpp
+++ b/audio/aidl/default/usb/UsbAlsaUtils.cpp
@@ -114,8 +114,8 @@
static const AudioFormatDescToPcmFormatMap formatDescToPcmFormatMap = {
{make_AudioFormatDescription(PcmType::UINT_8_BIT), PCM_FORMAT_S8},
{make_AudioFormatDescription(PcmType::INT_16_BIT), PCM_FORMAT_S16_LE},
- {make_AudioFormatDescription(PcmType::INT_24_BIT), PCM_FORMAT_S24_LE},
- {make_AudioFormatDescription(PcmType::FIXED_Q_8_24), PCM_FORMAT_S24_3LE},
+ {make_AudioFormatDescription(PcmType::FIXED_Q_8_24), PCM_FORMAT_S24_LE},
+ {make_AudioFormatDescription(PcmType::INT_24_BIT), PCM_FORMAT_S24_3LE},
{make_AudioFormatDescription(PcmType::INT_32_BIT), PCM_FORMAT_S32_LE},
{make_AudioFormatDescription(PcmType::FLOAT_32_BIT), PCM_FORMAT_FLOAT_LE},
};
diff --git a/audio/aidl/default/virtualizer/VirtualizerSw.cpp b/audio/aidl/default/virtualizer/VirtualizerSw.cpp
index c5a0e8d..e34464f 100644
--- a/audio/aidl/default/virtualizer/VirtualizerSw.cpp
+++ b/audio/aidl/default/virtualizer/VirtualizerSw.cpp
@@ -21,12 +21,14 @@
#include <Utils.h>
#include <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#include "VirtualizerSw.h"
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectImplUuidVirtualizerSw;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidVirtualizer;
using aidl::android::hardware::audio::effect::IEffect;
-using aidl::android::hardware::audio::effect::kVirtualizerSwImplUUID;
using aidl::android::hardware::audio::effect::State;
using aidl::android::hardware::audio::effect::VirtualizerSw;
using aidl::android::media::audio::common::AudioChannelLayout;
@@ -36,7 +38,7 @@
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* instanceSpp) {
- if (!in_impl_uuid || *in_impl_uuid != kVirtualizerSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidVirtualizerSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -51,7 +53,7 @@
}
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
- if (!in_impl_uuid || *in_impl_uuid != kVirtualizerSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidVirtualizerSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -73,9 +75,9 @@
.range = Range::make<Range::virtualizer>(VirtualizerSw::kRanges)};
const Descriptor VirtualizerSw::kDescriptor = {
- .common = {.id = {.type = kVirtualizerTypeUUID,
- .uuid = kVirtualizerSwImplUUID,
- .proxy = kVirtualizerProxyUUID},
+ .common = {.id = {.type = getEffectTypeUuidVirtualizer(),
+ .uuid = getEffectImplUuidVirtualizerSw(),
+ .proxy = getEffectImplUuidVirtualizerProxy()},
.flags = {.type = Flags::Type::INSERT,
.insert = Flags::Insert::FIRST,
.volume = Flags::Volume::CTRL},
diff --git a/audio/aidl/default/virtualizer/VirtualizerSw.h b/audio/aidl/default/virtualizer/VirtualizerSw.h
index 5c5b616..5e114d9 100644
--- a/audio/aidl/default/virtualizer/VirtualizerSw.h
+++ b/audio/aidl/default/virtualizer/VirtualizerSw.h
@@ -22,7 +22,6 @@
#include <memory>
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {
diff --git a/audio/aidl/default/visualizer/VisualizerSw.cpp b/audio/aidl/default/visualizer/VisualizerSw.cpp
index deb3204..0909f25 100644
--- a/audio/aidl/default/visualizer/VisualizerSw.cpp
+++ b/audio/aidl/default/visualizer/VisualizerSw.cpp
@@ -17,19 +17,21 @@
#define LOG_TAG "AHAL_VisualizerSw"
#include <android-base/logging.h>
+#include <system/audio_effects/effect_uuid.h>
#include "VisualizerSw.h"
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectImplUuidVisualizerSw;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidVisualizer;
using aidl::android::hardware::audio::effect::IEffect;
-using aidl::android::hardware::audio::effect::kVisualizerSwImplUUID;
using aidl::android::hardware::audio::effect::State;
using aidl::android::hardware::audio::effect::VisualizerSw;
using aidl::android::media::audio::common::AudioUuid;
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* instanceSpp) {
- if (!in_impl_uuid || *in_impl_uuid != kVisualizerSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidVisualizerSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -44,7 +46,7 @@
}
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
- if (!in_impl_uuid || *in_impl_uuid != kVisualizerSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidVisualizerSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -66,8 +68,8 @@
.range = Range::make<Range::visualizer>(VisualizerSw::kRanges)};
const Descriptor VisualizerSw::kDescriptor = {
- .common = {.id = {.type = kVisualizerTypeUUID,
- .uuid = kVisualizerSwImplUUID,
+ .common = {.id = {.type = getEffectTypeUuidVisualizer(),
+ .uuid = getEffectImplUuidVisualizerSw(),
.proxy = std::nullopt},
.flags = {.type = Flags::Type::INSERT,
.insert = Flags::Insert::FIRST,
diff --git a/audio/aidl/default/visualizer/VisualizerSw.h b/audio/aidl/default/visualizer/VisualizerSw.h
index ee7276a..995774e 100644
--- a/audio/aidl/default/visualizer/VisualizerSw.h
+++ b/audio/aidl/default/visualizer/VisualizerSw.h
@@ -16,11 +16,10 @@
#pragma once
-#include <aidl/android/hardware/audio/effect/BnEffect.h>
#include <vector>
+#include <aidl/android/hardware/audio/effect/BnEffect.h>
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {
diff --git a/audio/aidl/default/volume/VolumeSw.cpp b/audio/aidl/default/volume/VolumeSw.cpp
index 44cac44..8902584 100644
--- a/audio/aidl/default/volume/VolumeSw.cpp
+++ b/audio/aidl/default/volume/VolumeSw.cpp
@@ -20,19 +20,21 @@
#define LOG_TAG "AHAL_VolumeSw"
#include <android-base/logging.h>
#include <fmq/AidlMessageQueue.h>
+#include <system/audio_effects/effect_uuid.h>
#include "VolumeSw.h"
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectImplUuidVolumeSw;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidVolume;
using aidl::android::hardware::audio::effect::IEffect;
-using aidl::android::hardware::audio::effect::kVolumeSwImplUUID;
using aidl::android::hardware::audio::effect::State;
using aidl::android::hardware::audio::effect::VolumeSw;
using aidl::android::media::audio::common::AudioUuid;
extern "C" binder_exception_t createEffect(const AudioUuid* in_impl_uuid,
std::shared_ptr<IEffect>* instanceSpp) {
- if (!in_impl_uuid || *in_impl_uuid != kVolumeSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidVolumeSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -47,7 +49,7 @@
}
extern "C" binder_exception_t queryEffect(const AudioUuid* in_impl_uuid, Descriptor* _aidl_return) {
- if (!in_impl_uuid || *in_impl_uuid != kVolumeSwImplUUID) {
+ if (!in_impl_uuid || *in_impl_uuid != getEffectImplUuidVolumeSw()) {
LOG(ERROR) << __func__ << "uuid not supported";
return EX_ILLEGAL_ARGUMENT;
}
@@ -64,8 +66,8 @@
const Capability VolumeSw::kCapability = {.range = Range::make<Range::volume>(VolumeSw::kRanges)};
const Descriptor VolumeSw::kDescriptor = {
- .common = {.id = {.type = kVolumeTypeUUID,
- .uuid = kVolumeSwImplUUID,
+ .common = {.id = {.type = getEffectTypeUuidVolume(),
+ .uuid = getEffectImplUuidVolumeSw(),
.proxy = std::nullopt},
.flags = {.type = Flags::Type::INSERT,
.insert = Flags::Insert::FIRST,
diff --git a/audio/aidl/default/volume/VolumeSw.h b/audio/aidl/default/volume/VolumeSw.h
index 2dd4324..1432b2b 100644
--- a/audio/aidl/default/volume/VolumeSw.h
+++ b/audio/aidl/default/volume/VolumeSw.h
@@ -22,7 +22,6 @@
#include <memory>
#include "effect-impl/EffectImpl.h"
-#include "effect-impl/EffectUUID.h"
namespace aidl::android::hardware::audio::effect {
diff --git a/audio/aidl/vts/Android.bp b/audio/aidl/vts/Android.bp
index 8db8eaf..852255d 100644
--- a/audio/aidl/vts/Android.bp
+++ b/audio/aidl/vts/Android.bp
@@ -37,6 +37,7 @@
"general-tests",
"vts",
],
+ srcs: [":effectCommonFile"],
}
cc_test {
@@ -83,6 +84,7 @@
cc_test {
name: "VtsHalDynamicsProcessingTargetTest",
defaults: ["VtsHalAudioTargetTestDefaults"],
+ static_libs: ["libaudioaidlranges"],
srcs: ["VtsHalDynamicsProcessingTest.cpp"],
}
diff --git a/audio/aidl/vts/EffectFactoryHelper.h b/audio/aidl/vts/EffectFactoryHelper.h
index 4add844..a2499fd 100644
--- a/audio/aidl/vts/EffectFactoryHelper.h
+++ b/audio/aidl/vts/EffectFactoryHelper.h
@@ -24,7 +24,6 @@
#include <android/binder_auto_utils.h>
#include "TestUtils.h"
-#include "effect-impl/EffectUUID.h"
using namespace android;
diff --git a/audio/aidl/vts/EffectHelper.h b/audio/aidl/vts/EffectHelper.h
index a128f7c..4e84f6b 100644
--- a/audio/aidl/vts/EffectHelper.h
+++ b/audio/aidl/vts/EffectHelper.h
@@ -31,6 +31,7 @@
#include <fmq/AidlMessageQueue.h>
#include <gtest/gtest.h>
#include <system/audio_effects/aidl_effects_utils.h>
+#include <system/audio_effects/effect_uuid.h>
#include "AudioHalBinderServiceUtil.h"
#include "EffectFactoryHelper.h"
@@ -40,6 +41,7 @@
using aidl::android::hardware::audio::effect::CommandId;
using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::IEffect;
+using aidl::android::hardware::audio::effect::kEventFlagNotEmpty;
using aidl::android::hardware::audio::effect::Parameter;
using aidl::android::hardware::audio::effect::Range;
using aidl::android::hardware::audio::effect::State;
@@ -49,6 +51,7 @@
using aidl::android::media::audio::common::AudioFormatType;
using aidl::android::media::audio::common::AudioUuid;
using aidl::android::media::audio::common::PcmType;
+using ::android::hardware::EventFlag;
const AudioFormatDescription kDefaultFormatDescription = {
.type = AudioFormatType::PCM, .pcm = PcmType::FLOAT_32_BIT, .encoding = ""};
@@ -144,12 +147,20 @@
buffer.resize(floatsToWrite);
std::fill(buffer.begin(), buffer.end(), 0x5a);
}
- static void writeToFmq(std::unique_ptr<DataMQ>& mq, const std::vector<float>& buffer) {
- const size_t available = mq->availableToWrite();
+ static void writeToFmq(std::unique_ptr<StatusMQ>& statusMq, std::unique_ptr<DataMQ>& dataMq,
+ const std::vector<float>& buffer) {
+ const size_t available = dataMq->availableToWrite();
ASSERT_NE(0Ul, available);
auto bufferFloats = buffer.size();
auto floatsToWrite = std::min(available, bufferFloats);
- ASSERT_TRUE(mq->write(buffer.data(), floatsToWrite));
+ ASSERT_TRUE(dataMq->write(buffer.data(), floatsToWrite));
+
+ EventFlag* efGroup;
+ ASSERT_EQ(::android::OK,
+ EventFlag::createEventFlag(statusMq->getEventFlagWord(), &efGroup));
+ ASSERT_NE(nullptr, efGroup);
+ efGroup->wake(kEventFlagNotEmpty);
+ ASSERT_EQ(::android::OK, EventFlag::deleteEventFlag(&efGroup));
}
static void readFromFmq(std::unique_ptr<StatusMQ>& statusMq, size_t statusNum,
std::unique_ptr<DataMQ>& dataMq, size_t expectFloats,
@@ -227,10 +238,10 @@
*/
template <typename S, typename = std::enable_if_t<std::is_arithmetic_v<S>>>
static std::set<S> expandTestValueBasic(std::set<S>& s) {
- const auto min = *s.begin(), max = *s.rbegin();
const auto minLimit = std::numeric_limits<S>::min(),
maxLimit = std::numeric_limits<S>::max();
if (s.size()) {
+ const auto min = *s.begin(), max = *s.rbegin();
s.insert(min + (max - min) / 2);
if (min != minLimit) {
s.insert(min - 1);
diff --git a/audio/aidl/vts/VtsHalAECTargetTest.cpp b/audio/aidl/vts/VtsHalAECTargetTest.cpp
index 2d36cbb..8828c41 100644
--- a/audio/aidl/vts/VtsHalAECTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAECTargetTest.cpp
@@ -29,9 +29,9 @@
using aidl::android::hardware::audio::effect::AcousticEchoCanceler;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidAcousticEchoCanceler;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
-using aidl::android::hardware::audio::effect::kAcousticEchoCancelerTypeUUID;
using aidl::android::hardware::audio::effect::Parameter;
using aidl::android::hardware::audio::effect::Range;
@@ -148,7 +148,8 @@
AECParamTest, AECParamTest,
::testing::Combine(
testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kAcousticEchoCancelerTypeUUID)),
+ IFactory::descriptor,
+ getEffectTypeUuidAcousticEchoCanceler())),
testing::ValuesIn(EffectHelper::getTestValueSet<AcousticEchoCanceler, int,
Range::acousticEchoCanceler,
AcousticEchoCanceler::echoDelayUs>(
diff --git a/audio/aidl/vts/VtsHalAGC1TargetTest.cpp b/audio/aidl/vts/VtsHalAGC1TargetTest.cpp
index 15a9374..edfcdf6 100644
--- a/audio/aidl/vts/VtsHalAGC1TargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAGC1TargetTest.cpp
@@ -24,9 +24,9 @@
using aidl::android::hardware::audio::effect::AutomaticGainControlV1;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidAutomaticGainControlV1;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
-using aidl::android::hardware::audio::effect::kAutomaticGainControlV1TypeUUID;
using aidl::android::hardware::audio::effect::Parameter;
enum ParamName {
@@ -158,7 +158,8 @@
AGC1ParamTest, AGC1ParamTest,
::testing::Combine(
testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kAutomaticGainControlV1TypeUUID)),
+ IFactory::descriptor,
+ getEffectTypeUuidAutomaticGainControlV1())),
testing::ValuesIn(EffectHelper::getTestValueSet<
AutomaticGainControlV1, int, Range::automaticGainControlV1,
AutomaticGainControlV1::targetPeakLevelDbFs>(
diff --git a/audio/aidl/vts/VtsHalAGC2TargetTest.cpp b/audio/aidl/vts/VtsHalAGC2TargetTest.cpp
index 140537e..8ba8e45 100644
--- a/audio/aidl/vts/VtsHalAGC2TargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAGC2TargetTest.cpp
@@ -25,9 +25,9 @@
using aidl::android::hardware::audio::effect::AutomaticGainControlV2;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidAutomaticGainControlV2;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
-using aidl::android::hardware::audio::effect::kAutomaticGainControlV2TypeUUID;
using aidl::android::hardware::audio::effect::Parameter;
enum ParamName {
@@ -164,7 +164,8 @@
AGC2ParamTest, AGC2ParamTest,
::testing::Combine(
testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kAutomaticGainControlV2TypeUUID)),
+ IFactory::descriptor,
+ getEffectTypeUuidAutomaticGainControlV2())),
testing::ValuesIn(EffectHelper::getTestValueSet<
AutomaticGainControlV2, int, Range::automaticGainControlV2,
AutomaticGainControlV2::fixedDigitalGainMb>(
diff --git a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
index 5d522a3..0ae8cfc 100644
--- a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
@@ -129,7 +129,9 @@
using Tag = AudioDeviceAddress::Tag;
if (std::string_view connection = description.connection;
connection == AudioDeviceDescription::CONNECTION_BT_A2DP ||
- connection == AudioDeviceDescription::CONNECTION_BT_LE ||
+ // Note: BT LE Broadcast uses a "group id".
+ (description.type != AudioDeviceType::OUT_BROADCAST &&
+ connection == AudioDeviceDescription::CONNECTION_BT_LE) ||
connection == AudioDeviceDescription::CONNECTION_BT_SCO ||
connection == AudioDeviceDescription::CONNECTION_WIRELESS) {
return Tag::mac;
@@ -1778,6 +1780,42 @@
}
}
+// Note: This test relies on simulation of external device connections by the HAL module.
+TEST_P(AudioCoreModule, ExternalDeviceMixPortConfigs) {
+ // After an external device has been connected, all mix ports that can be routed
+ // to the device port for the connected device must have non-empty profiles.
+ ASSERT_NO_FATAL_FAILURE(SetUpModuleConfig());
+ std::vector<AudioPort> externalDevicePorts = moduleConfig->getExternalDevicePorts();
+ if (externalDevicePorts.empty()) {
+ GTEST_SKIP() << "No external devices in the module.";
+ }
+ for (const auto& port : externalDevicePorts) {
+ WithDevicePortConnectedState portConnected(GenerateUniqueDeviceAddress(port));
+ ASSERT_NO_FATAL_FAILURE(portConnected.SetUp(module.get()));
+ std::vector<AudioRoute> routes;
+ ASSERT_IS_OK(module->getAudioRoutesForAudioPort(portConnected.getId(), &routes));
+ std::vector<AudioPort> allPorts;
+ ASSERT_IS_OK(module->getAudioPorts(&allPorts));
+ for (const auto& r : routes) {
+ if (r.sinkPortId == portConnected.getId()) {
+ for (const auto& srcPortId : r.sourcePortIds) {
+ const auto srcPortIt = findById(allPorts, srcPortId);
+ ASSERT_NE(allPorts.end(), srcPortIt) << "port ID " << srcPortId;
+ EXPECT_NE(0UL, srcPortIt->profiles.size())
+ << " source port " << srcPortIt->toString() << " must have its profiles"
+ << " populated following external device connection";
+ }
+ } else {
+ const auto sinkPortIt = findById(allPorts, r.sinkPortId);
+ ASSERT_NE(allPorts.end(), sinkPortIt) << "port ID " << r.sinkPortId;
+ EXPECT_NE(0UL, sinkPortIt->profiles.size())
+ << " source port " << sinkPortIt->toString() << " must have its"
+ << " profiles populated following external device connection";
+ }
+ }
+ }
+}
+
TEST_P(AudioCoreModule, MasterMute) {
bool isSupported = false;
EXPECT_NO_FATAL_FAILURE(TestAccessors<bool>(module.get(), &IModule::getMasterMute,
@@ -3543,26 +3581,27 @@
<< "getSoundDose must return the same interface instance across invocations";
}
-TEST_P(AudioCoreSoundDose, GetSetOutputRs2) {
+TEST_P(AudioCoreSoundDose, GetSetOutputRs2UpperBound) {
if (soundDose == nullptr) {
GTEST_SKIP() << "SoundDose is not supported";
}
bool isSupported = false;
- EXPECT_NO_FATAL_FAILURE(TestAccessors<float>(soundDose.get(), &ISoundDose::getOutputRs2,
- &ISoundDose::setOutputRs2,
+ EXPECT_NO_FATAL_FAILURE(TestAccessors<float>(soundDose.get(),
+ &ISoundDose::getOutputRs2UpperBound,
+ &ISoundDose::setOutputRs2UpperBound,
/*validValues=*/{80.f, 90.f, 100.f},
/*invalidValues=*/{79.f, 101.f}, &isSupported));
- EXPECT_TRUE(isSupported) << "Getting/Setting RS2 must be supported";
+ EXPECT_TRUE(isSupported) << "Getting/Setting RS2 upper bound must be supported";
}
-TEST_P(AudioCoreSoundDose, CheckDefaultRs2Value) {
+TEST_P(AudioCoreSoundDose, CheckDefaultRs2UpperBound) {
if (soundDose == nullptr) {
GTEST_SKIP() << "SoundDose is not supported";
}
float rs2Value;
- ASSERT_IS_OK(soundDose->getOutputRs2(&rs2Value));
+ ASSERT_IS_OK(soundDose->getOutputRs2UpperBound(&rs2Value));
EXPECT_EQ(rs2Value, ISoundDose::DEFAULT_MAX_RS2);
}
diff --git a/audio/aidl/vts/VtsHalAudioCoreTargetTest.xml b/audio/aidl/vts/VtsHalAudioCoreTargetTest.xml
new file mode 100644
index 0000000..dfc1039
--- /dev/null
+++ b/audio/aidl/vts/VtsHalAudioCoreTargetTest.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2023 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.
+-->
+<configuration description="Runs VtsHalAudioCoreTargetTest.">
+ <option name="test-suite-tag" value="apct" />
+ <option name="test-suite-tag" value="apct-native" />
+
+ <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer"/>
+ <target_preparer class="com.android.tradefed.targetprep.StopServicesSetup"/>
+
+ <target_preparer class="com.android.tradefed.targetprep.RunCommandTargetPreparer">
+ <option name="run-command" value="setprop vts.native_server.on 1"/>
+ <option name="teardown-command" value="setprop vts.native_server.on 0"/>
+ </target_preparer>
+
+ <test class="com.android.tradefed.testtype.GTest" >
+ <option name="native-test-device-path" value="/data/local/tmp" />
+ <option name="module-name" value="VtsHalAudioCoreTargetTest" />
+ <option name="native-test-timeout" value="10m" />
+ </test>
+</configuration>
diff --git a/audio/aidl/vts/VtsHalAudioEffectFactoryTargetTest.cpp b/audio/aidl/vts/VtsHalAudioEffectFactoryTargetTest.cpp
index 21f5eb5..7b9477d 100644
--- a/audio/aidl/vts/VtsHalAudioEffectFactoryTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioEffectFactoryTargetTest.cpp
@@ -28,6 +28,7 @@
#include <android/binder_interface_utils.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
+#include <system/audio_effects/effect_uuid.h>
#include <aidl/android/hardware/audio/effect/IFactory.h>
@@ -38,10 +39,10 @@
using namespace android;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectUuidNull;
+using aidl::android::hardware::audio::effect::getEffectUuidZero;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
-using aidl::android::hardware::audio::effect::kEffectNullUuid;
-using aidl::android::hardware::audio::effect::kEffectZeroUuid;
using aidl::android::hardware::audio::effect::Processing;
using aidl::android::media::audio::common::AudioSource;
using aidl::android::media::audio::common::AudioStreamType;
@@ -65,8 +66,8 @@
std::unique_ptr<EffectFactoryHelper> mFactoryHelper;
std::shared_ptr<IFactory> mEffectFactory;
std::vector<std::shared_ptr<IEffect>> mEffects;
- const Descriptor::Identity kNullId = {.uuid = kEffectNullUuid};
- const Descriptor::Identity kZeroId = {.uuid = kEffectZeroUuid};
+ const Descriptor::Identity kNullId = {.uuid = getEffectUuidNull()};
+ const Descriptor::Identity kZeroId = {.uuid = getEffectUuidZero()};
const Descriptor kNullDesc = {.common.id = kNullId};
const Descriptor kZeroDesc = {.common.id = kZeroId};
@@ -132,13 +133,13 @@
TEST_P(EffectFactoryTest, ExpectAllAospEffectTypes) {
std::vector<Descriptor> descs;
std::set<AudioUuid> typeUuidSet(
- {aidl::android::hardware::audio::effect::kBassBoostTypeUUID,
- aidl::android::hardware::audio::effect::kEqualizerTypeUUID,
- aidl::android::hardware::audio::effect::kEnvReverbTypeUUID,
- aidl::android::hardware::audio::effect::kPresetReverbTypeUUID,
- aidl::android::hardware::audio::effect::kDynamicsProcessingTypeUUID,
- aidl::android::hardware::audio::effect::kHapticGeneratorTypeUUID,
- aidl::android::hardware::audio::effect::kVirtualizerTypeUUID});
+ {aidl::android::hardware::audio::effect::getEffectTypeUuidBassBoost(),
+ aidl::android::hardware::audio::effect::getEffectTypeUuidEqualizer(),
+ aidl::android::hardware::audio::effect::getEffectTypeUuidEnvReverb(),
+ aidl::android::hardware::audio::effect::getEffectTypeUuidPresetReverb(),
+ aidl::android::hardware::audio::effect::getEffectTypeUuidDynamicsProcessing(),
+ aidl::android::hardware::audio::effect::getEffectTypeUuidHapticGenerator(),
+ aidl::android::hardware::audio::effect::getEffectTypeUuidVirtualizer()});
EXPECT_IS_OK(mEffectFactory->queryEffects(std::nullopt, std::nullopt, std::nullopt, &descs));
EXPECT_TRUE(descs.size() >= typeUuidSet.size());
@@ -155,19 +156,22 @@
TEST_P(EffectFactoryTest, QueryNullTypeUuid) {
std::vector<Descriptor> descs;
- EXPECT_IS_OK(mEffectFactory->queryEffects(kEffectNullUuid, std::nullopt, std::nullopt, &descs));
+ EXPECT_IS_OK(
+ mEffectFactory->queryEffects(getEffectUuidNull(), std::nullopt, std::nullopt, &descs));
EXPECT_EQ(descs.size(), 0UL);
}
TEST_P(EffectFactoryTest, QueriedNullImplUuid) {
std::vector<Descriptor> descs;
- EXPECT_IS_OK(mEffectFactory->queryEffects(std::nullopt, kEffectNullUuid, std::nullopt, &descs));
+ EXPECT_IS_OK(
+ mEffectFactory->queryEffects(std::nullopt, getEffectUuidNull(), std::nullopt, &descs));
EXPECT_EQ(descs.size(), 0UL);
}
TEST_P(EffectFactoryTest, QueriedNullProxyUuid) {
std::vector<Descriptor> descs;
- EXPECT_IS_OK(mEffectFactory->queryEffects(std::nullopt, std::nullopt, kEffectNullUuid, &descs));
+ EXPECT_IS_OK(
+ mEffectFactory->queryEffects(std::nullopt, std::nullopt, getEffectUuidNull(), &descs));
EXPECT_EQ(descs.size(), 0UL);
}
diff --git a/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp b/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
index df66bd3..436f2a3 100644
--- a/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
@@ -139,7 +139,10 @@
Descriptor desc;
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
ASSERT_NO_FATAL_FAILURE(getDescriptor(mEffect, desc));
- EXPECT_EQ(mDescriptor.common, desc.common);
+ EXPECT_EQ(mDescriptor.common.id.type, desc.common.id.type);
+ EXPECT_EQ(mDescriptor.common.id.uuid, desc.common.id.uuid);
+ EXPECT_EQ(mDescriptor.common.name, desc.common.name);
+ EXPECT_EQ(mDescriptor.common.implementor, desc.common.implementor);
// Effect implementation Must fill in implementor and name
EXPECT_NE("", desc.common.name);
EXPECT_NE("", desc.common.implementor);
@@ -176,7 +179,11 @@
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
ASSERT_NO_FATAL_FAILURE(getDescriptor(mEffect, desc));
- EXPECT_EQ(1ul, idSet.count(desc.common.id));
+ int uuidCount = std::count_if(idSet.begin(), idSet.end(), [&](const auto& id) {
+ return id.uuid == desc.common.id.uuid && id.type == desc.common.id.type;
+ });
+
+ EXPECT_EQ(1, uuidCount);
ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
}
@@ -590,7 +597,7 @@
std::vector<float> buffer;
EXPECT_NO_FATAL_FAILURE(EffectHelper::allocateInputData(common, inputMQ, buffer));
- EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(inputMQ, buffer));
+ EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(statusMQ, inputMQ, buffer));
EXPECT_NO_FATAL_FAILURE(
EffectHelper::readFromFmq(statusMQ, 1, outputMQ, buffer.size(), buffer));
@@ -629,7 +636,7 @@
ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::PROCESSING));
EXPECT_NO_FATAL_FAILURE(EffectHelper::allocateInputData(common, inputMQ, buffer));
- EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(inputMQ, buffer));
+ EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(statusMQ, inputMQ, buffer));
EXPECT_NO_FATAL_FAILURE(
EffectHelper::readFromFmq(statusMQ, 1, outputMQ, buffer.size(), buffer));
@@ -659,7 +666,7 @@
std::vector<float> buffer;
EXPECT_NO_FATAL_FAILURE(EffectHelper::allocateInputData(common, inputMQ, buffer));
- EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(inputMQ, buffer));
+ EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(statusMQ, inputMQ, buffer));
ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::START));
ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::PROCESSING));
@@ -692,7 +699,7 @@
std::vector<float> buffer;
EXPECT_NO_FATAL_FAILURE(EffectHelper::allocateInputData(common, inputMQ, buffer));
- EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(inputMQ, buffer));
+ EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(statusMQ, inputMQ, buffer));
EXPECT_NO_FATAL_FAILURE(EffectHelper::readFromFmq(statusMQ, 0, outputMQ, 0, buffer));
ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::START));
@@ -701,7 +708,7 @@
EXPECT_NO_FATAL_FAILURE(
EffectHelper::readFromFmq(statusMQ, 1, outputMQ, buffer.size(), buffer));
- EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(inputMQ, buffer));
+ EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(statusMQ, inputMQ, buffer));
EXPECT_NO_FATAL_FAILURE(
EffectHelper::readFromFmq(statusMQ, 1, outputMQ, buffer.size(), buffer));
@@ -733,13 +740,13 @@
ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::PROCESSING));
std::vector<float> buffer;
EXPECT_NO_FATAL_FAILURE(EffectHelper::allocateInputData(common, inputMQ, buffer));
- EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(inputMQ, buffer));
+ EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(statusMQ, inputMQ, buffer));
EXPECT_NO_FATAL_FAILURE(
EffectHelper::readFromFmq(statusMQ, 1, outputMQ, buffer.size(), buffer));
ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::STOP));
ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::IDLE));
- EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(inputMQ, buffer));
+ EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(statusMQ, inputMQ, buffer));
EXPECT_NO_FATAL_FAILURE(EffectHelper::readFromFmq(statusMQ, 0, outputMQ, 0, buffer));
ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::START));
@@ -774,7 +781,7 @@
std::vector<float> buffer;
EXPECT_NO_FATAL_FAILURE(EffectHelper::allocateInputData(common, inputMQ, buffer));
- EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(inputMQ, buffer));
+ EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(statusMQ, inputMQ, buffer));
EXPECT_NO_FATAL_FAILURE(EffectHelper::readFromFmq(statusMQ, 0, outputMQ, 0, buffer));
ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
@@ -809,7 +816,7 @@
std::vector<float> buffer1, buffer2;
EXPECT_NO_FATAL_FAILURE(EffectHelper::allocateInputData(common1, inputMQ1, buffer1));
- EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(inputMQ1, buffer1));
+ EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(statusMQ1, inputMQ1, buffer1));
EXPECT_NO_FATAL_FAILURE(
EffectHelper::readFromFmq(statusMQ1, 1, outputMQ1, buffer1.size(), buffer1));
@@ -820,7 +827,7 @@
auto outputMQ2 = std::make_unique<EffectHelper::DataMQ>(ret2.outputDataMQ);
ASSERT_TRUE(outputMQ2->isValid());
EXPECT_NO_FATAL_FAILURE(EffectHelper::allocateInputData(common2, inputMQ2, buffer2));
- EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(inputMQ2, buffer2));
+ EXPECT_NO_FATAL_FAILURE(EffectHelper::writeToFmq(statusMQ2, inputMQ2, buffer2));
EXPECT_NO_FATAL_FAILURE(
EffectHelper::readFromFmq(statusMQ2, 1, outputMQ2, buffer2.size(), buffer2));
diff --git a/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp b/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp
index 824bd9f..9cfdc50 100644
--- a/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp
@@ -27,9 +27,9 @@
using aidl::android::hardware::audio::effect::BassBoost;
using aidl::android::hardware::audio::effect::Capability;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidBassBoost;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
-using aidl::android::hardware::audio::effect::kBassBoostTypeUUID;
using aidl::android::hardware::audio::effect::Parameter;
using aidl::android::hardware::audio::effect::Range;
@@ -138,7 +138,7 @@
BassBoostTest, BassBoostParamTest,
::testing::Combine(
testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kBassBoostTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidBassBoost())),
testing::ValuesIn(EffectHelper::getTestValueSet<BassBoost, int, Range::bassBoost,
BassBoost::strengthPm>(
kDescPair, EffectHelper::expandTestValueBasic<int>))),
diff --git a/audio/aidl/vts/VtsHalDownmixTargetTest.cpp b/audio/aidl/vts/VtsHalDownmixTargetTest.cpp
index bd3b76b..5aeebde 100644
--- a/audio/aidl/vts/VtsHalDownmixTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalDownmixTargetTest.cpp
@@ -24,10 +24,9 @@
using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::Downmix;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidDownmix;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
-using aidl::android::hardware::audio::effect::kDownmixTypeUUID;
-using aidl::android::hardware::audio::effect::kEffectNullUuid;
using aidl::android::hardware::audio::effect::Parameter;
/**
@@ -122,7 +121,7 @@
INSTANTIATE_TEST_SUITE_P(
DownmixTest, DownmixParamTest,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kDownmixTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidDownmix())),
testing::ValuesIn(kTypeValues)),
[](const testing::TestParamInfo<DownmixParamTest::ParamType>& info) {
auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
diff --git a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
index 0b05b17..033e3b5 100644
--- a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
+++ b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
@@ -25,14 +25,16 @@
#include <Utils.h>
#include "EffectHelper.h"
+#include "EffectRangeSpecific.h"
using namespace android;
+using namespace aidl::android::hardware::audio::effect::DynamicsProcessingRanges;
using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::DynamicsProcessing;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidDynamicsProcessing;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
-using aidl::android::hardware::audio::effect::kDynamicsProcessingTypeUUID;
using aidl::android::hardware::audio::effect::Parameter;
/**
@@ -95,6 +97,19 @@
template <typename T>
bool isAidlVectorEqual(const std::vector<T>& source, const std::vector<T>& target);
+ template <typename T>
+ bool isChannelConfigValid(const std::vector<T>& cfgs) {
+ auto& channelCount = mChannelCount;
+ return std::all_of(cfgs.cbegin(), cfgs.cend(), [channelCount](const T& cfg) {
+ return (cfg.channel >= 0 && cfg.channel < channelCount);
+ });
+ }
+
+ template <typename T>
+ bool isBandConfigValid(const std::vector<T>& cfgs, int bandCount);
+
+ bool isParamValid(const DynamicsProcessing::Tag& tag, const DynamicsProcessing& dp);
+
// get set params and validate
void SetAndGetDynamicsProcessingParameters();
@@ -133,9 +148,11 @@
static const std::set<DynamicsProcessing::StageEnablement> kStageEnablementTestSet;
static const std::set<std::vector<DynamicsProcessing::InputGain>> kInputGainTestSet;
+ protected:
+ int mChannelCount;
+
private:
int32_t mChannelLayout;
- int mChannelCount;
std::vector<std::pair<DynamicsProcessing::Tag, DynamicsProcessing>> mTags;
void CleanUp() {
mTags.clear();
@@ -152,6 +169,8 @@
{.inUse = true, .bandCount = DynamicsProcessingTestHelper::kBandCount},
{.inUse = true, .bandCount = 0},
{.inUse = true, .bandCount = -1},
+ {.inUse = false, .bandCount = 0},
+ {.inUse = false, .bandCount = -1},
{.inUse = false, .bandCount = DynamicsProcessingTestHelper::kBandCount}};
// test value set for DynamicsProcessing::ChannelConfig
@@ -161,9 +180,7 @@
{.channel = 0, .enable = true},
{.channel = 1, .enable = false},
{.channel = 2, .enable = true}},
-
{{.channel = -1, .enable = false}, {.channel = 2, .enable = true}},
-
{{.channel = 0, .enable = true}, {.channel = 1, .enable = true}}};
// test value set for DynamicsProcessing::InputGain
@@ -172,10 +189,65 @@
{{.channel = 0, .gainDb = 10.f},
{.channel = 1, .gainDb = 0.f},
{.channel = 2, .gainDb = -10.f}},
-
{{.channel = -1, .gainDb = -10.f}, {.channel = -2, .gainDb = 10.f}},
+ {{.channel = -1, .gainDb = 10.f}, {.channel = 0, .gainDb = -10.f}},
+ {{.channel = 0, .gainDb = 10.f}, {.channel = 1, .gainDb = -10.f}}};
- {{.channel = -1, .gainDb = 10.f}, {.channel = 0, .gainDb = -10.f}}};
+template <typename T>
+bool DynamicsProcessingTestHelper::isBandConfigValid(const std::vector<T>& cfgs, int bandCount) {
+ std::vector<float> freqs(cfgs.size(), -1);
+ for (auto cfg : cfgs) {
+ if (cfg.channel < 0 || cfg.channel >= mChannelCount) return false;
+ if (cfg.band < 0 || cfg.band >= bandCount) return false;
+ freqs[cfg.band] = cfg.cutoffFrequencyHz;
+ }
+ if (std::count(freqs.begin(), freqs.end(), -1)) return false;
+ return std::is_sorted(freqs.begin(), freqs.end());
+}
+
+bool DynamicsProcessingTestHelper::isParamValid(const DynamicsProcessing::Tag& tag,
+ const DynamicsProcessing& dp) {
+ switch (tag) {
+ case DynamicsProcessing::preEq: {
+ if (!mEngineConfigApplied.preEqStage.inUse) return false;
+ return isChannelConfigValid(dp.get<DynamicsProcessing::preEq>());
+ }
+ case DynamicsProcessing::postEq: {
+ if (!mEngineConfigApplied.postEqStage.inUse) return false;
+ return isChannelConfigValid(dp.get<DynamicsProcessing::postEq>());
+ }
+ case DynamicsProcessing::mbc: {
+ if (!mEngineConfigApplied.mbcStage.inUse) return false;
+ return isChannelConfigValid(dp.get<DynamicsProcessing::mbc>());
+ }
+ case DynamicsProcessing::preEqBand: {
+ if (!mEngineConfigApplied.preEqStage.inUse) return false;
+ return isBandConfigValid(dp.get<DynamicsProcessing::preEqBand>(),
+ mEngineConfigApplied.preEqStage.bandCount);
+ }
+ case DynamicsProcessing::postEqBand: {
+ if (!mEngineConfigApplied.postEqStage.inUse) return false;
+ return isBandConfigValid(dp.get<DynamicsProcessing::postEqBand>(),
+ mEngineConfigApplied.postEqStage.bandCount);
+ }
+ case DynamicsProcessing::mbcBand: {
+ if (!mEngineConfigApplied.mbcStage.inUse) return false;
+ return isBandConfigValid(dp.get<DynamicsProcessing::mbcBand>(),
+ mEngineConfigApplied.mbcStage.bandCount);
+ }
+ case DynamicsProcessing::limiter: {
+ if (!mEngineConfigApplied.limiterInUse) return false;
+ return isChannelConfigValid(dp.get<DynamicsProcessing::limiter>());
+ }
+ case DynamicsProcessing::inputGain: {
+ return isChannelConfigValid(dp.get<DynamicsProcessing::inputGain>());
+ }
+ default: {
+ return true;
+ }
+ }
+ return true;
+}
bool DynamicsProcessingTestHelper::isParamEqual(const DynamicsProcessing::Tag& tag,
const DynamicsProcessing& dpRef,
@@ -270,8 +342,8 @@
// validate parameter
Descriptor desc;
ASSERT_STATUS(EX_NONE, mEffect->getDescriptor(&desc));
- const bool valid =
- isParameterValid<DynamicsProcessing, Range::dynamicsProcessing>(dp, desc);
+ bool valid = isParamInRange(dp, desc.capability.range.get<Range::dynamicsProcessing>());
+ if (valid) valid = isParamValid(tag, dp);
const binder_exception_t expected = valid ? EX_NONE : EX_ILLEGAL_ARGUMENT;
// set parameter
@@ -428,11 +500,12 @@
DynamicsProcessingTest, DynamicsProcessingTestEngineArchitecture,
::testing::Combine(
testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kDynamicsProcessingTypeUUID)),
- testing::Values(DynamicsProcessing::ResolutionPreference::FAVOR_TIME_RESOLUTION,
- DynamicsProcessing::ResolutionPreference::
- FAVOR_FREQUENCY_RESOLUTION), // variant
- testing::Values(-10.f, 0.f, 10.f), // processing duration
+ IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
+ testing::Values(
+ DynamicsProcessing::ResolutionPreference::FAVOR_TIME_RESOLUTION,
+ DynamicsProcessing::ResolutionPreference::FAVOR_FREQUENCY_RESOLUTION,
+ static_cast<DynamicsProcessing::ResolutionPreference>(-1)), // variant
+ testing::Values(-10.f, 0.f, 10.f), // processing duration
testing::ValuesIn(
DynamicsProcessingTestHelper::kStageEnablementTestSet), // preEQ/postEQ/mbc
testing::Bool()), // limiter enable
@@ -480,7 +553,7 @@
INSTANTIATE_TEST_SUITE_P(
DynamicsProcessingTest, DynamicsProcessingTestInputGain,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kDynamicsProcessingTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
testing::ValuesIn(DynamicsProcessingTestInputGain::kInputGainTestSet)),
[](const auto& info) {
auto descriptor = std::get<INPUT_GAIN_INSTANCE_NAME>(info.param).second;
@@ -515,12 +588,12 @@
LIMITER_MAX_NUM,
};
using LimiterConfigTestAdditional = std::array<float, LIMITER_MAX_NUM>;
-// attachTime, releaseTime, ratio, thresh, postGain
+// attackTime, releaseTime, ratio, thresh, postGain
static constexpr std::array<LimiterConfigTestAdditional, 4> kLimiterConfigTestAdditionalParam = {
{{-1, -60, -2.5, -2, -3.14},
{-1, 60, -2.5, 2, -3.14},
{1, -60, 2.5, -2, 3.14},
- {1, 60, 2.5, 2, 3.14}}};
+ {1, 60, 2.5, -2, 3.14}}};
using LimiterConfigTestParams =
std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t, bool, int32_t, bool,
@@ -567,7 +640,7 @@
INSTANTIATE_TEST_SUITE_P(
DynamicsProcessingTest, DynamicsProcessingTestLimiterConfig,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kDynamicsProcessingTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
testing::Values(-1, 0, 1, 2), // channel count
testing::Bool(), // enable
testing::Values(3), // link group
@@ -642,7 +715,7 @@
DynamicsProcessingTest, DynamicsProcessingTestChannelConfig,
::testing::Combine(
testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kDynamicsProcessingTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
testing::ValuesIn(
DynamicsProcessingTestHelper::kChannelConfigTestSet), // channel config
testing::Bool()), // Engine inUse
@@ -669,15 +742,13 @@
enum EqBandConfigTestParamName {
EQ_BAND_INSTANCE_NAME,
EQ_BAND_CHANNEL,
- EQ_BAND_CHANNEL_ENABLE,
EQ_BAND_ENABLE,
EQ_BAND_CUT_OFF_FREQ,
EQ_BAND_GAIN,
EQ_BAND_STAGE_IN_USE
};
using EqBandConfigTestParams = std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t,
- std::vector<DynamicsProcessing::ChannelConfig>, bool,
- std::vector<std::pair<int, float>>, float, bool>;
+ bool, std::vector<std::pair<int, float>>, float, bool>;
void fillEqBandConfig(std::vector<DynamicsProcessing::EqBandConfig>& cfgs,
const EqBandConfigTestParams& params) {
@@ -698,8 +769,7 @@
public:
DynamicsProcessingTestEqBandConfig()
: DynamicsProcessingTestHelper(std::get<EQ_BAND_INSTANCE_NAME>(GetParam())),
- mStageInUse(std::get<EQ_BAND_STAGE_IN_USE>(GetParam())),
- mChannelConfig(std::get<EQ_BAND_CHANNEL_ENABLE>(GetParam())) {
+ mStageInUse(std::get<EQ_BAND_STAGE_IN_USE>(GetParam())) {
fillEqBandConfig(mCfgs, GetParam());
}
@@ -709,14 +779,18 @@
std::vector<DynamicsProcessing::EqBandConfig> mCfgs;
const bool mStageInUse;
- const std::vector<DynamicsProcessing::ChannelConfig> mChannelConfig;
};
TEST_P(DynamicsProcessingTestEqBandConfig, SetAndGetPreEqBandConfig) {
mEngineConfigPreset.preEqStage.inUse = mStageInUse;
mEngineConfigPreset.preEqStage.bandCount = mCfgs.size();
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
- EXPECT_NO_FATAL_FAILURE(addPreEqChannelConfig(mChannelConfig));
+ std::vector<DynamicsProcessing::ChannelConfig> cfgs(mChannelCount);
+ for (int i = 0; i < mChannelCount; i++) {
+ cfgs[i].channel = i;
+ cfgs[i].enable = true;
+ }
+ EXPECT_NO_FATAL_FAILURE(addPreEqChannelConfig(cfgs));
EXPECT_NO_FATAL_FAILURE(addPreEqBandConfigs(mCfgs));
SetAndGetDynamicsProcessingParameters();
}
@@ -725,7 +799,12 @@
mEngineConfigPreset.postEqStage.inUse = mStageInUse;
mEngineConfigPreset.postEqStage.bandCount = mCfgs.size();
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
- EXPECT_NO_FATAL_FAILURE(addPostEqChannelConfig(mChannelConfig));
+ std::vector<DynamicsProcessing::ChannelConfig> cfgs(mChannelCount);
+ for (int i = 0; i < mChannelCount; i++) {
+ cfgs[i].channel = i;
+ cfgs[i].enable = true;
+ }
+ EXPECT_NO_FATAL_FAILURE(addPostEqChannelConfig(cfgs));
EXPECT_NO_FATAL_FAILURE(addPostEqBandConfigs(mCfgs));
SetAndGetDynamicsProcessingParameters();
}
@@ -776,28 +855,23 @@
INSTANTIATE_TEST_SUITE_P(
DynamicsProcessingTest, DynamicsProcessingTestEqBandConfig,
- ::testing::Combine(
- testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kDynamicsProcessingTypeUUID)),
- testing::Values(-1, 0, 10), // channel ID
- testing::ValuesIn(
- DynamicsProcessingTestHelper::kChannelConfigTestSet), // channel enable
- testing::Bool(), // band enable
- testing::ValuesIn(kBands), // cut off frequencies
- testing::Values(-3.14f, 3.14f), // gain
- testing::Bool()), // stage in use
+ ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
+ testing::Values(-1, 0, 10), // channel ID
+ testing::Bool(), // band enable
+ testing::ValuesIn(kBands), // cut off frequencies
+ testing::Values(-3.14f, 3.14f), // gain
+ testing::Values(true)), // stage in use
[](const auto& info) {
auto descriptor = std::get<EQ_BAND_INSTANCE_NAME>(info.param).second;
std::vector<DynamicsProcessing::EqBandConfig> cfgs;
fillEqBandConfig(cfgs, info.param);
- std::string enable =
- ::android::internal::ToString(std::get<EQ_BAND_CHANNEL_ENABLE>(info.param));
std::string bands = ::android::internal::ToString(cfgs);
std::string stageInUse = std::to_string(std::get<EQ_BAND_STAGE_IN_USE>(info.param));
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_" + enable + "_bands_" +
- bands + "_stageInUse_" + stageInUse;
+ descriptor.common.id.uuid.toString() + "_bands_" + bands +
+ "_stageInUse_" + stageInUse;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -811,7 +885,6 @@
enum MbcBandConfigParamName {
MBC_BAND_INSTANCE_NAME,
MBC_BAND_CHANNEL,
- MBC_BAND_CHANNEL_CONFIG,
MBC_BAND_ENABLE,
MBC_BAND_CUTOFF_FREQ,
MBC_BAND_STAGE_IN_USE,
@@ -831,16 +904,15 @@
};
using TestParamsMbcBandConfigAdditional = std::array<float, MBC_ADD_MAX_NUM>;
-// attachTime, releaseTime, ratio, thresh, kneeWidth, noise, expander, preGain, postGain
+// attackTime, releaseTime, ratio, thresh, kneeWidth, noise, expander, preGain, postGain
static constexpr std::array<TestParamsMbcBandConfigAdditional, 4> kMbcBandConfigAdditionalParam = {
{{-3, -10, -2, -2, -5, -90, -2.5, -2, -2},
{0, 0, 0, 0, 0, 0, 0, 0, 0},
{-3, 10, -2, 2, -5, 90, -2.5, 2, -2},
- {3, 10, 2, 2, 5, 90, 2.5, 2, 2}}};
+ {3, 10, 2, -2, -5, 90, 2.5, 2, 2}}};
using TestParamsMbcBandConfig =
- std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t,
- std::vector<DynamicsProcessing::ChannelConfig>, bool,
+ std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int32_t, bool,
std::vector<std::pair<int, float>>, bool, TestParamsMbcBandConfigAdditional>;
void fillMbcBandConfig(std::vector<DynamicsProcessing::MbcBandConfig>& cfgs,
@@ -873,8 +945,7 @@
public:
DynamicsProcessingTestMbcBandConfig()
: DynamicsProcessingTestHelper(std::get<MBC_BAND_INSTANCE_NAME>(GetParam())),
- mStageInUse(std::get<MBC_BAND_STAGE_IN_USE>(GetParam())),
- mChannelConfig(std::get<MBC_BAND_CHANNEL_CONFIG>(GetParam())) {
+ mStageInUse(std::get<MBC_BAND_STAGE_IN_USE>(GetParam())) {
fillMbcBandConfig(mCfgs, GetParam());
}
@@ -884,42 +955,41 @@
std::vector<DynamicsProcessing::MbcBandConfig> mCfgs;
const bool mStageInUse;
- const std::vector<DynamicsProcessing::ChannelConfig> mChannelConfig;
};
TEST_P(DynamicsProcessingTestMbcBandConfig, SetAndGetMbcBandConfig) {
mEngineConfigPreset.mbcStage.inUse = mStageInUse;
mEngineConfigPreset.mbcStage.bandCount = mCfgs.size();
EXPECT_NO_FATAL_FAILURE(addEngineConfig(mEngineConfigPreset));
- EXPECT_NO_FATAL_FAILURE(addMbcChannelConfig(mChannelConfig));
+ std::vector<DynamicsProcessing::ChannelConfig> cfgs(mChannelCount);
+ for (int i = 0; i < mChannelCount; i++) {
+ cfgs[i].channel = i;
+ cfgs[i].enable = true;
+ }
+ EXPECT_NO_FATAL_FAILURE(addMbcChannelConfig(cfgs));
EXPECT_NO_FATAL_FAILURE(addMbcBandConfigs(mCfgs));
SetAndGetDynamicsProcessingParameters();
}
INSTANTIATE_TEST_SUITE_P(
DynamicsProcessingTest, DynamicsProcessingTestMbcBandConfig,
- ::testing::Combine(
- testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kDynamicsProcessingTypeUUID)),
- testing::Values(-1, 0, 10), // channel count
- testing::ValuesIn(
- DynamicsProcessingTestHelper::kChannelConfigTestSet), // channel config
- testing::Bool(), // enable
- testing::ValuesIn(kBands), // cut off frequencies
- testing::Bool(), // stage in use
- testing::ValuesIn(kMbcBandConfigAdditionalParam)), // Additional
+ ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, getEffectTypeUuidDynamicsProcessing())),
+ testing::Values(-1, 0, 10), // channel count
+ testing::Bool(), // enable
+ testing::ValuesIn(kBands), // cut off frequencies
+ testing::Bool(), // stage in use
+ testing::ValuesIn(kMbcBandConfigAdditionalParam)), // Additional
[](const auto& info) {
auto descriptor = std::get<MBC_BAND_INSTANCE_NAME>(info.param).second;
std::vector<DynamicsProcessing::MbcBandConfig> cfgs;
fillMbcBandConfig(cfgs, info.param);
- std::string enable =
- ::android::internal::ToString(std::get<MBC_BAND_CHANNEL_CONFIG>(info.param));
std::string mbcBands = ::android::internal::ToString(cfgs);
std::string stageInUse = std::to_string(std::get<MBC_BAND_STAGE_IN_USE>(info.param));
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_enable_" + enable +
- "_bands_" + mbcBands + "_stageInUse_" + stageInUse;
+ descriptor.common.id.uuid.toString() + "_bands_" + mbcBands +
+ "_stageInUse_" + stageInUse;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
diff --git a/audio/aidl/vts/VtsHalEnvironmentalReverbTargetTest.cpp b/audio/aidl/vts/VtsHalEnvironmentalReverbTargetTest.cpp
index a2deb7c..05c2c5b 100644
--- a/audio/aidl/vts/VtsHalEnvironmentalReverbTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalEnvironmentalReverbTargetTest.cpp
@@ -24,9 +24,9 @@
using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::EnvironmentalReverb;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidEnvReverb;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
-using aidl::android::hardware::audio::effect::kEnvReverbTypeUUID;
using aidl::android::hardware::audio::effect::Parameter;
/**
@@ -200,7 +200,7 @@
EnvironmentalReverbTest, EnvironmentalReverbRoomLevelTest,
::testing::Combine(
testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kEnvReverbTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidEnvReverb())),
testing::ValuesIn(EffectHelper::getTestValueSet<EnvironmentalReverb, int,
Range::environmentalReverb,
EnvironmentalReverb::roomLevelMb>(
@@ -239,13 +239,12 @@
INSTANTIATE_TEST_SUITE_P(
EnvironmentalReverbTest, EnvironmentalReverbRoomHfLevelTest,
- ::testing::Combine(
- testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor,
- kEnvReverbTypeUUID)),
- testing::ValuesIn(EffectHelper::getTestValueSet<EnvironmentalReverb, int,
- Range::environmentalReverb,
- EnvironmentalReverb::roomHfLevelMb>(
- kDescPair, EffectHelper::expandTestValueBasic<int>))),
+ ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, getEffectTypeUuidEnvReverb())),
+ testing::ValuesIn(EffectHelper::getTestValueSet<
+ EnvironmentalReverb, int, Range::environmentalReverb,
+ EnvironmentalReverb::roomHfLevelMb>(
+ kDescPair, EffectHelper::expandTestValueBasic<int>))),
[](const testing::TestParamInfo<EnvironmentalReverbRoomHfLevelTest::ParamType>& info) {
auto descriptor = std::get<0>(info.param).second;
std::string roomHfLevel = std::to_string(std::get<1>(info.param));
@@ -280,13 +279,12 @@
INSTANTIATE_TEST_SUITE_P(
EnvironmentalReverbTest, EnvironmentalReverbDecayTimeTest,
- ::testing::Combine(
- testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor,
- kEnvReverbTypeUUID)),
- testing::ValuesIn(EffectHelper::getTestValueSet<EnvironmentalReverb, int,
- Range::environmentalReverb,
- EnvironmentalReverb::decayTimeMs>(
- kDescPair, EffectHelper::expandTestValueBasic<int>))),
+ ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, getEffectTypeUuidEnvReverb())),
+ testing::ValuesIn(EffectHelper::getTestValueSet<
+ EnvironmentalReverb, int, Range::environmentalReverb,
+ EnvironmentalReverb::decayTimeMs>(
+ kDescPair, EffectHelper::expandTestValueBasic<int>))),
[](const testing::TestParamInfo<EnvironmentalReverbDecayTimeTest::ParamType>& info) {
auto descriptor = std::get<0>(info.param).second;
std::string decayTime = std::to_string(std::get<1>(info.param));
@@ -322,7 +320,7 @@
INSTANTIATE_TEST_SUITE_P(
EnvironmentalReverbTest, EnvironmentalReverbDecayHfRatioTest,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kEnvReverbTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidEnvReverb())),
testing::ValuesIn(EffectHelper::getTestValueSet<
EnvironmentalReverb, int, Range::environmentalReverb,
EnvironmentalReverb::decayHfRatioPm>(
@@ -362,13 +360,12 @@
INSTANTIATE_TEST_SUITE_P(
EnvironmentalReverbTest, EnvironmentalReverbLevelTest,
- ::testing::Combine(
- testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor,
- kEnvReverbTypeUUID)),
- testing::ValuesIn(EffectHelper::getTestValueSet<EnvironmentalReverb, int,
- Range::environmentalReverb,
- EnvironmentalReverb::levelMb>(
- kDescPair, EffectHelper::expandTestValueBasic<int>))),
+ ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, getEffectTypeUuidEnvReverb())),
+ testing::ValuesIn(EffectHelper::getTestValueSet<
+ EnvironmentalReverb, int, Range::environmentalReverb,
+ EnvironmentalReverb::levelMb>(
+ kDescPair, EffectHelper::expandTestValueBasic<int>))),
[](const testing::TestParamInfo<EnvironmentalReverbDecayHfRatioTest::ParamType>& info) {
auto descriptor = std::get<0>(info.param).second;
std::string level = std::to_string(std::get<1>(info.param));
@@ -403,13 +400,12 @@
INSTANTIATE_TEST_SUITE_P(
EnvironmentalReverbTest, EnvironmentalReverbDelayTest,
- ::testing::Combine(
- testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor,
- kEnvReverbTypeUUID)),
- testing::ValuesIn(EffectHelper::getTestValueSet<EnvironmentalReverb, int,
- Range::environmentalReverb,
- EnvironmentalReverb::delayMs>(
- kDescPair, EffectHelper::expandTestValueBasic<int>))),
+ ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, getEffectTypeUuidEnvReverb())),
+ testing::ValuesIn(EffectHelper::getTestValueSet<
+ EnvironmentalReverb, int, Range::environmentalReverb,
+ EnvironmentalReverb::delayMs>(
+ kDescPair, EffectHelper::expandTestValueBasic<int>))),
[](const testing::TestParamInfo<EnvironmentalReverbDelayTest::ParamType>& info) {
auto descriptor = std::get<0>(info.param).second;
std::string delay = std::to_string(std::get<1>(info.param));
@@ -444,13 +440,12 @@
INSTANTIATE_TEST_SUITE_P(
EnvironmentalReverbTest, EnvironmentalReverbDiffusionTest,
- ::testing::Combine(
- testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor,
- kEnvReverbTypeUUID)),
- testing::ValuesIn(EffectHelper::getTestValueSet<EnvironmentalReverb, int,
- Range::environmentalReverb,
- EnvironmentalReverb::diffusionPm>(
- kDescPair, EffectHelper::expandTestValueBasic<int>))),
+ ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, getEffectTypeUuidEnvReverb())),
+ testing::ValuesIn(EffectHelper::getTestValueSet<
+ EnvironmentalReverb, int, Range::environmentalReverb,
+ EnvironmentalReverb::diffusionPm>(
+ kDescPair, EffectHelper::expandTestValueBasic<int>))),
[](const testing::TestParamInfo<EnvironmentalReverbDiffusionTest::ParamType>& info) {
auto descriptor = std::get<0>(info.param).second;
std::string diffusion = std::to_string(std::get<1>(info.param));
@@ -485,13 +480,12 @@
INSTANTIATE_TEST_SUITE_P(
EnvironmentalReverbTest, EnvironmentalReverbDensityTest,
- ::testing::Combine(
- testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(IFactory::descriptor,
- kEnvReverbTypeUUID)),
- testing::ValuesIn(EffectHelper::getTestValueSet<EnvironmentalReverb, int,
- Range::environmentalReverb,
- EnvironmentalReverb::densityPm>(
- kDescPair, EffectHelper::expandTestValueBasic<int>))),
+ ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, getEffectTypeUuidEnvReverb())),
+ testing::ValuesIn(EffectHelper::getTestValueSet<
+ EnvironmentalReverb, int, Range::environmentalReverb,
+ EnvironmentalReverb::densityPm>(
+ kDescPair, EffectHelper::expandTestValueBasic<int>))),
[](const testing::TestParamInfo<EnvironmentalReverbDensityTest::ParamType>& info) {
auto descriptor = std::get<0>(info.param).second;
std::string density = std::to_string(std::get<1>(info.param));
@@ -527,7 +521,7 @@
INSTANTIATE_TEST_SUITE_P(
EnvironmentalReverbTest, EnvironmentalReverbBypassTest,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kEnvReverbTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidEnvReverb())),
testing::Bool()),
[](const testing::TestParamInfo<EnvironmentalReverbBypassTest::ParamType>& info) {
auto descriptor = std::get<0>(info.param).second;
diff --git a/audio/aidl/vts/VtsHalEqualizerTargetTest.cpp b/audio/aidl/vts/VtsHalEqualizerTargetTest.cpp
index 9beb0a7..716a2c6 100644
--- a/audio/aidl/vts/VtsHalEqualizerTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalEqualizerTargetTest.cpp
@@ -37,15 +37,14 @@
#include "AudioHalBinderServiceUtil.h"
#include "EffectHelper.h"
#include "TestUtils.h"
-#include "effect-impl/EffectUUID.h"
using namespace android;
using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::Equalizer;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidEqualizer;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
-using aidl::android::hardware::audio::effect::kEqualizerTypeUUID;
using aidl::android::hardware::audio::effect::Parameter;
/**
@@ -195,7 +194,7 @@
EqualizerTest, EqualizerTest,
::testing::Combine(
testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kEqualizerTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidEqualizer())),
testing::ValuesIn(EffectHelper::getTestValueSet<Equalizer, int, Range::equalizer,
Equalizer::preset>(
kDescPair, EffectHelper::expandTestValueBasic<int>)),
diff --git a/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp b/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp
index 32ebc4f..7c79d1b 100644
--- a/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp
@@ -28,10 +28,10 @@
using namespace android;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidHapticGenerator;
using aidl::android::hardware::audio::effect::HapticGenerator;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
-using aidl::android::hardware::audio::effect::kHapticGeneratorTypeUUID;
using aidl::android::hardware::audio::effect::Parameter;
/**
@@ -179,7 +179,7 @@
INSTANTIATE_TEST_SUITE_P(
HapticGeneratorValidTest, HapticGeneratorParamTest,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kHapticGeneratorTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidHapticGenerator())),
testing::ValuesIn(kHapticScaleIdValues),
testing::ValuesIn(kVibratorScaleValues),
testing::ValuesIn(kResonantFrequencyValues),
@@ -209,7 +209,7 @@
INSTANTIATE_TEST_SUITE_P(
HapticGeneratorInvalidTest, HapticGeneratorParamTest,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kHapticGeneratorTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidHapticGenerator())),
testing::Values(MIN_ID - 1),
testing::Values(HapticGenerator::VibratorScale::NONE),
testing::Values(MIN_FLOAT), testing::Values(MIN_FLOAT),
@@ -419,7 +419,7 @@
INSTANTIATE_TEST_SUITE_P(
HapticGeneratorScalesTest, HapticGeneratorScalesTest,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kHapticGeneratorTypeUUID))),
+ IFactory::descriptor, getEffectTypeUuidHapticGenerator()))),
[](const testing::TestParamInfo<HapticGeneratorScalesTest::ParamType>& info) {
auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
diff --git a/audio/aidl/vts/VtsHalLoudnessEnhancerTargetTest.cpp b/audio/aidl/vts/VtsHalLoudnessEnhancerTargetTest.cpp
index 5faf7f4..96b048e 100644
--- a/audio/aidl/vts/VtsHalLoudnessEnhancerTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalLoudnessEnhancerTargetTest.cpp
@@ -25,9 +25,9 @@
using namespace android;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidLoudnessEnhancer;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
-using aidl::android::hardware::audio::effect::kLoudnessEnhancerTypeUUID;
using aidl::android::hardware::audio::effect::LoudnessEnhancer;
using aidl::android::hardware::audio::effect::Parameter;
@@ -126,7 +126,7 @@
INSTANTIATE_TEST_SUITE_P(
LoudnessEnhancerTest, LoudnessEnhancerParamTest,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kLoudnessEnhancerTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidLoudnessEnhancer())),
testing::ValuesIn(kGainMbValues)),
[](const testing::TestParamInfo<LoudnessEnhancerParamTest::ParamType>& info) {
auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
diff --git a/audio/aidl/vts/VtsHalNSTargetTest.cpp b/audio/aidl/vts/VtsHalNSTargetTest.cpp
index 4fcda6b..5525c80 100644
--- a/audio/aidl/vts/VtsHalNSTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalNSTargetTest.cpp
@@ -27,9 +27,9 @@
using namespace android;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidNoiseSuppression;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
-using aidl::android::hardware::audio::effect::kNoiseSuppressionTypeUUID;
using aidl::android::hardware::audio::effect::NoiseSuppression;
using aidl::android::hardware::audio::effect::Parameter;
@@ -146,7 +146,7 @@
INSTANTIATE_TEST_SUITE_P(
NSParamTest, NSParamTest,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kNoiseSuppressionTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidNoiseSuppression())),
testing::ValuesIn(NSParamTest::getLevelValues()),
testing::ValuesIn(NSParamTest::getTypeValues())),
[](const testing::TestParamInfo<NSParamTest::ParamType>& info) {
diff --git a/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp b/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp
index 7bce9c3..8fb4ebf 100644
--- a/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp
@@ -24,10 +24,9 @@
using namespace android;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidPresetReverb;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
-using aidl::android::hardware::audio::effect::kEffectNullUuid;
-using aidl::android::hardware::audio::effect::kPresetReverbTypeUUID;
using aidl::android::hardware::audio::effect::Parameter;
using aidl::android::hardware::audio::effect::PresetReverb;
@@ -132,7 +131,7 @@
INSTANTIATE_TEST_SUITE_P(
PresetReverbTest, PresetReverbParamTest,
::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kPresetReverbTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidPresetReverb())),
testing::ValuesIn(kPresetsValues)),
[](const testing::TestParamInfo<PresetReverbParamTest::ParamType>& info) {
auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
diff --git a/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp b/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp
index 84b980f..6b1da63 100644
--- a/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp
@@ -23,9 +23,9 @@
using namespace android;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidVirtualizer;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
-using aidl::android::hardware::audio::effect::kVirtualizerTypeUUID;
using aidl::android::hardware::audio::effect::Parameter;
using aidl::android::hardware::audio::effect::Virtualizer;
@@ -134,7 +134,7 @@
VirtualizerTest, VirtualizerParamTest,
::testing::Combine(
testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kVirtualizerTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidVirtualizer())),
testing::ValuesIn(EffectHelper::getTestValueSet<
Virtualizer, int, Range::virtualizer, Virtualizer::strengthPm>(
kDescPair, EffectHelper::expandTestValueBasic<int>))),
diff --git a/audio/aidl/vts/VtsHalVisualizerTargetTest.cpp b/audio/aidl/vts/VtsHalVisualizerTargetTest.cpp
index e273824..f41ba30 100644
--- a/audio/aidl/vts/VtsHalVisualizerTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalVisualizerTargetTest.cpp
@@ -26,9 +26,9 @@
using namespace android;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidVisualizer;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
-using aidl::android::hardware::audio::effect::kVisualizerTypeUUID;
using aidl::android::hardware::audio::effect::Parameter;
using aidl::android::hardware::audio::effect::Visualizer;
@@ -177,7 +177,7 @@
VisualizerParamTest, VisualizerParamTest,
::testing::Combine(
testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kVisualizerTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidVisualizer())),
testing::ValuesIn(EffectHelper::getTestValueSet<Visualizer, int, Range::visualizer,
Visualizer::captureSamples>(
kDescPair, EffectHelper::expandTestValueBasic<int>)),
diff --git a/audio/aidl/vts/VtsHalVolumeTargetTest.cpp b/audio/aidl/vts/VtsHalVolumeTargetTest.cpp
index fbd10a8..90b7f37 100644
--- a/audio/aidl/vts/VtsHalVolumeTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalVolumeTargetTest.cpp
@@ -23,9 +23,9 @@
using namespace android;
using aidl::android::hardware::audio::effect::Descriptor;
+using aidl::android::hardware::audio::effect::getEffectTypeUuidVolume;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
-using aidl::android::hardware::audio::effect::kVolumeTypeUUID;
using aidl::android::hardware::audio::effect::Parameter;
using aidl::android::hardware::audio::effect::Volume;
@@ -140,7 +140,7 @@
VolumeTest, VolumeParamTest,
::testing::Combine(
testing::ValuesIn(kDescPair = EffectFactoryHelper::getAllEffectDescriptors(
- IFactory::descriptor, kVolumeTypeUUID)),
+ IFactory::descriptor, getEffectTypeUuidVolume())),
testing::ValuesIn(
EffectHelper::getTestValueSet<Volume, int, Range::volume, Volume::levelDb>(
kDescPair, EffectHelper::expandTestValueBasic<int>)),
diff --git a/audio/core/all-versions/vts/functional/6.0/Generators.cpp b/audio/core/all-versions/vts/functional/6.0/Generators.cpp
index dafd326..705932d 100644
--- a/audio/core/all-versions/vts/functional/6.0/Generators.cpp
+++ b/audio/core/all-versions/vts/functional/6.0/Generators.cpp
@@ -16,6 +16,8 @@
#include <android-base/macros.h>
+#include <IOProfile.h>
+
#include "6.0/Generators.h"
#include "ConfigHelper.h"
#include "PolicyConfig.h"
diff --git a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h
index 478482d..fabe2d2 100644
--- a/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h
+++ b/audio/core/all-versions/vts/functional/AudioPrimaryHidlHalTest.h
@@ -195,7 +195,7 @@
// Cached policy config after parsing for faster test startup
const PolicyConfig& getCachedPolicyConfig() {
static std::unique_ptr<PolicyConfig> policyConfig = [] {
- auto config = std::make_unique<PolicyConfig>(kConfigFileName);
+ auto config = std::make_unique<PolicyConfig>("", kConfigFileName);
return config;
}();
return *policyConfig;
diff --git a/audio/core/all-versions/vts/functional/PolicyConfig.h b/audio/core/all-versions/vts/functional/PolicyConfig.h
index 171d03f..b08e808 100644
--- a/audio/core/all-versions/vts/functional/PolicyConfig.h
+++ b/audio/core/all-versions/vts/functional/PolicyConfig.h
@@ -19,9 +19,9 @@
#include <set>
#include <string>
+#include <AudioPolicyConfig.h>
#include <DeviceDescriptor.h>
#include <HwModule.h>
-#include <Serializer.h>
#include <gtest/gtest.h>
#include <system/audio_config.h>
@@ -30,47 +30,35 @@
using ::android::sp;
using ::android::status_t;
-struct PolicyConfigData {
- android::HwModuleCollection hwModules;
- android::DeviceVector availableOutputDevices;
- android::DeviceVector availableInputDevices;
- sp<android::DeviceDescriptor> defaultOutputDevice;
-};
-
-class PolicyConfig : private PolicyConfigData, public android::AudioPolicyConfig {
+class PolicyConfig {
public:
- explicit PolicyConfig(const std::string& configFileName)
- : android::AudioPolicyConfig(hwModules, availableOutputDevices, availableInputDevices,
- defaultOutputDevice),
- mConfigFileName{configFileName} {
- for (const auto& location : android::audio_get_configuration_paths()) {
- std::string path = location + '/' + mConfigFileName;
- if (access(path.c_str(), F_OK) == 0) {
- mFilePath = path;
- break;
- }
- }
- init();
- }
PolicyConfig(const std::string& configPath, const std::string& configFileName)
- : android::AudioPolicyConfig(hwModules, availableOutputDevices, availableInputDevices,
- defaultOutputDevice),
- mConfigFileName{configFileName},
- mFilePath{configPath + "/" + mConfigFileName} {
- init();
+ : mInitialFilePath(configPath.empty() ? configFileName
+ : configPath + "/" + configFileName) {
+ auto result = android::AudioPolicyConfig::loadFromCustomXmlConfigForVtsTests(
+ configPath, configFileName);
+ if (result.ok()) {
+ mStatus = ::android::OK;
+ mConfig = result.value();
+ init();
+ } else {
+ mStatus = result.error();
+ }
}
status_t getStatus() const { return mStatus; }
std::string getError() const {
- if (mFilePath.empty()) {
- return std::string{"Could not find "} + mConfigFileName +
+ if (mConfig == nullptr) {
+ return std::string{"Could not find "} + mInitialFilePath +
" file in: " + testing::PrintToString(android::audio_get_configuration_paths());
} else {
- return "Invalid config file: " + mFilePath;
+ return "Invalid config file: " + mConfig->getSource();
}
}
- const std::string& getFilePath() const { return mFilePath; }
+ const std::string& getFilePath() const {
+ return mConfig != nullptr ? mConfig->getSource() : mInitialFilePath;
+ }
sp<const android::HwModule> getModuleFromName(const std::string& name) const {
- return getHwModules().getModuleFromName(name.c_str());
+ return mConfig->getHwModules().getModuleFromName(name.c_str());
}
sp<const android::HwModule> getPrimaryModule() const { return mPrimaryModule; }
const std::set<std::string>& getModulesWithDevicesNames() const {
@@ -86,6 +74,8 @@
return findAttachedDevice(getAttachedDevices(moduleName),
getSourceDevicesForMixPort(moduleName, mixPortName));
}
+ const android::DeviceVector& getInputDevices() const { return mConfig->getInputDevices(); }
+ const android::DeviceVector& getOutputDevices() const { return mConfig->getOutputDevices(); }
bool haveInputProfilesInModule(const std::string& name) const {
auto module = getModuleFromName(name);
return module && !module->getInputProfiles().empty();
@@ -93,29 +83,24 @@
private:
void init() {
- mStatus = android::deserializeAudioPolicyFileForVts(mFilePath.c_str(), this);
- if (mStatus == android::OK) {
- mPrimaryModule = getModuleFromName(DeviceManager::kPrimaryDevice);
- // Available devices are not 'attached' to modules at this moment.
- // Need to go over available devices and find their module.
- for (const auto& device : availableOutputDevices) {
- for (const auto& module : hwModules) {
- if (module->getDeclaredDevices().indexOf(device) >= 0) {
- mModulesWithDevicesNames.insert(module->getName());
- mAttachedDevicesPerModule[module->getName()].push_back(
- device->getTagName());
- break;
- }
+ mPrimaryModule = getModuleFromName(DeviceManager::kPrimaryDevice);
+ // Available devices are not 'attached' to modules at this moment.
+ // Need to go over available devices and find their module.
+ for (const auto& device : mConfig->getOutputDevices()) {
+ for (const auto& module : mConfig->getHwModules()) {
+ if (module->getDeclaredDevices().indexOf(device) >= 0) {
+ mModulesWithDevicesNames.insert(module->getName());
+ mAttachedDevicesPerModule[module->getName()].push_back(device->getTagName());
+ break;
}
}
- for (const auto& device : availableInputDevices) {
- for (const auto& module : hwModules) {
- if (module->getDeclaredDevices().indexOf(device) >= 0) {
- mModulesWithDevicesNames.insert(module->getName());
- mAttachedDevicesPerModule[module->getName()].push_back(
- device->getTagName());
- break;
- }
+ }
+ for (const auto& device : mConfig->getInputDevices()) {
+ for (const auto& module : mConfig->getHwModules()) {
+ if (module->getDeclaredDevices().indexOf(device) >= 0) {
+ mModulesWithDevicesNames.insert(module->getName());
+ mAttachedDevicesPerModule[module->getName()].push_back(device->getTagName());
+ break;
}
}
}
@@ -166,10 +151,10 @@
return result;
}
- const std::string mConfigFileName;
+ const std::string mInitialFilePath;
status_t mStatus = android::NO_INIT;
- std::string mFilePath;
- sp<const android::HwModule> mPrimaryModule = nullptr;
+ sp<android::AudioPolicyConfig> mConfig;
+ sp<const android::HwModule> mPrimaryModule;
std::set<std::string> mModulesWithDevicesNames;
std::map<std::string, std::vector<std::string>> mAttachedDevicesPerModule;
};
diff --git a/automotive/audiocontrol/1.0/default/test/fuzzer/Android.bp b/automotive/audiocontrol/1.0/default/test/fuzzer/Android.bp
index 78f5b52..4308d52 100644
--- a/automotive/audiocontrol/1.0/default/test/fuzzer/Android.bp
+++ b/automotive/audiocontrol/1.0/default/test/fuzzer/Android.bp
@@ -48,5 +48,13 @@
"android-media-fuzzing-reports@google.com",
],
componentid: 533764,
+ hotlists: [
+ "4593311",
+ ],
+ description: "The fuzzer targets the APIs of android.hardware.automotive.audiocontrol@1.0-service binary",
+ vector: "local_privileges_required",
+ service_privilege: "privileged",
+ users: "multi_user",
+ fuzzed_code_usage: "shipped",
},
}
diff --git a/automotive/can/1.0/default/tests/fuzzer/Android.bp b/automotive/can/1.0/default/tests/fuzzer/Android.bp
index 52b43b0..de0b96f 100644
--- a/automotive/can/1.0/default/tests/fuzzer/Android.bp
+++ b/automotive/can/1.0/default/tests/fuzzer/Android.bp
@@ -50,5 +50,13 @@
"android-media-fuzzing-reports@google.com",
],
componentid: 533764,
+ hotlists: [
+ "4593311",
+ ],
+ description: "The fuzzer targets the APIs of android.hardware.automotive.can@1.0-service",
+ vector: "local_no_privileges_required",
+ service_privilege: "privileged",
+ users: "multi_user",
+ fuzzed_code_usage: "shipped",
},
}
diff --git a/automotive/can/1.0/tools/configurator/canhalconfigurator.rc b/automotive/can/1.0/tools/configurator/canhalconfigurator.rc
index ff0efd7..8ae7cb2 100644
--- a/automotive/can/1.0/tools/configurator/canhalconfigurator.rc
+++ b/automotive/can/1.0/tools/configurator/canhalconfigurator.rc
@@ -1,3 +1,4 @@
service canhalconfigurator /system_ext/bin/canhalconfigurator
class core
+ user root
oneshot
diff --git a/automotive/occupant_awareness/aidl/default/Android.bp b/automotive/occupant_awareness/aidl/default/Android.bp
index 66af9de..1ae8689 100644
--- a/automotive/occupant_awareness/aidl/default/Android.bp
+++ b/automotive/occupant_awareness/aidl/default/Android.bp
@@ -26,6 +26,7 @@
cc_binary {
name: "android.hardware.automotive.occupant_awareness@1.0-service",
init_rc: ["android.hardware.automotive.occupant_awareness@1.0-service.rc"],
+ vintf_fragments: ["android.hardware.automotive.occupant_awareness-service.xml"],
relative_install_path: "hw",
vendor: true,
srcs: [
diff --git a/automotive/occupant_awareness/aidl/default/android.hardware.automotive.occupant_awareness-service.xml b/automotive/occupant_awareness/aidl/default/android.hardware.automotive.occupant_awareness-service.xml
new file mode 100644
index 0000000..b4f8fa5
--- /dev/null
+++ b/automotive/occupant_awareness/aidl/default/android.hardware.automotive.occupant_awareness-service.xml
@@ -0,0 +1,7 @@
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.automotive.occupant_awareness</name>
+ <version>1</version>
+ <fqname>IOccupantAwareness/default</fqname>
+ </hal>
+</manifest>
diff --git a/automotive/sv/1.0/default/tests/fuzzer/Android.bp b/automotive/sv/1.0/default/tests/fuzzer/Android.bp
index 394c532..696bfad 100644
--- a/automotive/sv/1.0/default/tests/fuzzer/Android.bp
+++ b/automotive/sv/1.0/default/tests/fuzzer/Android.bp
@@ -47,5 +47,13 @@
"android-media-fuzzing-reports@google.com",
],
componentid: 533764,
+ hotlists: [
+ "4593311",
+ ],
+ description: "The fuzzer targets the APIs of android.hardware.automotive.sv@1.0-service",
+ vector: "local_no_privileges_required",
+ service_privilege: "privileged",
+ users: "multi_user",
+ fuzzed_code_usage: "shipped",
},
}
diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp
index 33e211c..586a98e 100644
--- a/automotive/vehicle/2.0/default/Android.bp
+++ b/automotive/vehicle/2.0/default/Android.bp
@@ -292,5 +292,13 @@
"android-media-fuzzing-reports@google.com",
],
componentid: 533764,
+ hotlists: [
+ "4593311",
+ ],
+ description: "The fuzzer targets the APIs of android.hardware.automotive.vehicle@2.0-manager-lib",
+ vector: "local_no_privileges_required",
+ service_privilege: "privileged",
+ users: "multi_user",
+ fuzzed_code_usage: "shipped",
},
}
diff --git a/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json b/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
new file mode 100644
index 0000000..e312a3a
--- /dev/null
+++ b/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
@@ -0,0 +1,3460 @@
+[
+ {
+ "name": "VehicleApPowerStateReqIndex",
+ "values": [
+ {
+ "name": "STATE",
+ "value": 0
+ },
+ {
+ "name": "ADDITIONAL",
+ "value": 1
+ }
+ ]
+ },
+ {
+ "name": "EvChargeState",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "CHARGING",
+ "value": 1
+ },
+ {
+ "name": "FULLY_CHARGED",
+ "value": 2
+ },
+ {
+ "name": "NOT_CHARGING",
+ "value": 3
+ },
+ {
+ "name": "ERROR",
+ "value": 4
+ }
+ ]
+ },
+ {
+ "name": "TrailerState",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "NOT_PRESENT",
+ "value": 1
+ },
+ {
+ "name": "PRESENT",
+ "value": 2
+ },
+ {
+ "name": "ERROR",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "ProcessTerminationReason",
+ "values": [
+ {
+ "name": "NOT_RESPONDING",
+ "value": 1
+ },
+ {
+ "name": "IO_OVERUSE",
+ "value": 2
+ },
+ {
+ "name": "MEMORY_OVERUSE",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "VehicleApPowerStateConfigFlag",
+ "values": [
+ {
+ "name": "ENABLE_DEEP_SLEEP_FLAG",
+ "value": 1
+ },
+ {
+ "name": "CONFIG_SUPPORT_TIMER_POWER_ON_FLAG",
+ "value": 2
+ },
+ {
+ "name": "ENABLE_HIBERNATION_FLAG",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "Obd2FuelType",
+ "values": [
+ {
+ "name": "NOT_AVAILABLE",
+ "value": 0
+ },
+ {
+ "name": "GASOLINE",
+ "value": 1
+ },
+ {
+ "name": "METHANOL",
+ "value": 2
+ },
+ {
+ "name": "ETHANOL",
+ "value": 3
+ },
+ {
+ "name": "DIESEL",
+ "value": 4
+ },
+ {
+ "name": "LPG",
+ "value": 5
+ },
+ {
+ "name": "CNG",
+ "value": 6
+ },
+ {
+ "name": "PROPANE",
+ "value": 7
+ },
+ {
+ "name": "ELECTRIC",
+ "value": 8
+ },
+ {
+ "name": "BIFUEL_RUNNING_GASOLINE",
+ "value": 9
+ },
+ {
+ "name": "BIFUEL_RUNNING_METHANOL",
+ "value": 10
+ },
+ {
+ "name": "BIFUEL_RUNNING_ETHANOL",
+ "value": 11
+ },
+ {
+ "name": "BIFUEL_RUNNING_LPG",
+ "value": 12
+ },
+ {
+ "name": "BIFUEL_RUNNING_CNG",
+ "value": 13
+ },
+ {
+ "name": "BIFUEL_RUNNING_PROPANE",
+ "value": 14
+ },
+ {
+ "name": "BIFUEL_RUNNING_ELECTRIC",
+ "value": 15
+ },
+ {
+ "name": "BIFUEL_RUNNING_ELECTRIC_AND_COMBUSTION",
+ "value": 16
+ },
+ {
+ "name": "HYBRID_GASOLINE",
+ "value": 17
+ },
+ {
+ "name": "HYBRID_ETHANOL",
+ "value": 18
+ },
+ {
+ "name": "HYBRID_DIESEL",
+ "value": 19
+ },
+ {
+ "name": "HYBRID_ELECTRIC",
+ "value": 20
+ },
+ {
+ "name": "HYBRID_RUNNING_ELECTRIC_AND_COMBUSTION",
+ "value": 21
+ },
+ {
+ "name": "HYBRID_REGENERATIVE",
+ "value": 22
+ },
+ {
+ "name": "BIFUEL_RUNNING_DIESEL",
+ "value": 23
+ }
+ ]
+ },
+ {
+ "name": "VmsSubscriptionsStateIntegerValuesIndex",
+ "values": [
+ {
+ "name": "MESSAGE_TYPE",
+ "value": 0
+ },
+ {
+ "name": "SEQUENCE_NUMBER",
+ "value": 1
+ },
+ {
+ "name": "NUMBER_OF_LAYERS",
+ "value": 2
+ },
+ {
+ "name": "NUMBER_OF_ASSOCIATED_LAYERS",
+ "value": 3
+ },
+ {
+ "name": "SUBSCRIPTIONS_START",
+ "value": 4
+ }
+ ]
+ },
+ {
+ "name": "VehicleArea",
+ "values": [
+ {
+ "name": "GLOBAL",
+ "value": 16777216
+ },
+ {
+ "name": "WINDOW",
+ "value": 50331648
+ },
+ {
+ "name": "MIRROR",
+ "value": 67108864
+ },
+ {
+ "name": "SEAT",
+ "value": 83886080
+ },
+ {
+ "name": "DOOR",
+ "value": 100663296
+ },
+ {
+ "name": "WHEEL",
+ "value": 117440512
+ },
+ {
+ "name": "MASK",
+ "value": 251658240
+ }
+ ]
+ },
+ {
+ "name": "VehicleAreaWindow",
+ "values": [
+ {
+ "name": "FRONT_WINDSHIELD",
+ "value": 1
+ },
+ {
+ "name": "REAR_WINDSHIELD",
+ "value": 2
+ },
+ {
+ "name": "ROW_1_LEFT",
+ "value": 16
+ },
+ {
+ "name": "ROW_1_RIGHT",
+ "value": 64
+ },
+ {
+ "name": "ROW_2_LEFT",
+ "value": 256
+ },
+ {
+ "name": "ROW_2_RIGHT",
+ "value": 1024
+ },
+ {
+ "name": "ROW_3_LEFT",
+ "value": 4096
+ },
+ {
+ "name": "ROW_3_RIGHT",
+ "value": 16384
+ },
+ {
+ "name": "ROOF_TOP_1",
+ "value": 65536
+ },
+ {
+ "name": "ROOF_TOP_2",
+ "value": 131072
+ }
+ ]
+ },
+ {
+ "name": "ElectronicTollCollectionCardStatus",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "ELECTRONIC_TOLL_COLLECTION_CARD_VALID",
+ "value": 1
+ },
+ {
+ "name": "ELECTRONIC_TOLL_COLLECTION_CARD_INVALID",
+ "value": 2
+ },
+ {
+ "name": "ELECTRONIC_TOLL_COLLECTION_CARD_NOT_INSERTED",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "VehiclePropertyType",
+ "values": [
+ {
+ "name": "STRING",
+ "value": 1048576
+ },
+ {
+ "name": "BOOLEAN",
+ "value": 2097152
+ },
+ {
+ "name": "INT32",
+ "value": 4194304
+ },
+ {
+ "name": "INT32_VEC",
+ "value": 4259840
+ },
+ {
+ "name": "INT64",
+ "value": 5242880
+ },
+ {
+ "name": "INT64_VEC",
+ "value": 5308416
+ },
+ {
+ "name": "FLOAT",
+ "value": 6291456
+ },
+ {
+ "name": "FLOAT_VEC",
+ "value": 6356992
+ },
+ {
+ "name": "BYTES",
+ "value": 7340032
+ },
+ {
+ "name": "MIXED",
+ "value": 14680064
+ },
+ {
+ "name": "MASK",
+ "value": 16711680
+ }
+ ]
+ },
+ {
+ "name": "StatusCode",
+ "values": [
+ {
+ "name": "OK",
+ "value": 0
+ },
+ {
+ "name": "TRY_AGAIN",
+ "value": 1
+ },
+ {
+ "name": "INVALID_ARG",
+ "value": 2
+ },
+ {
+ "name": "NOT_AVAILABLE",
+ "value": 3
+ },
+ {
+ "name": "ACCESS_DENIED",
+ "value": 4
+ },
+ {
+ "name": "INTERNAL_ERROR",
+ "value": 5
+ }
+ ]
+ },
+ {
+ "name": "CreateUserStatus",
+ "values": [
+ {
+ "name": "SUCCESS",
+ "value": 1
+ },
+ {
+ "name": "FAILURE",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "ElectronicTollCollectionCardType",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "JP_ELECTRONIC_TOLL_COLLECTION_CARD",
+ "value": 1
+ },
+ {
+ "name": "JP_ELECTRONIC_TOLL_COLLECTION_CARD_V2",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "VehicleAreaMirror",
+ "values": [
+ {
+ "name": "DRIVER_LEFT",
+ "value": 1
+ },
+ {
+ "name": "DRIVER_RIGHT",
+ "value": 2
+ },
+ {
+ "name": "DRIVER_CENTER",
+ "value": 4
+ }
+ ]
+ },
+ {
+ "name": "InitialUserInfoResponseAction",
+ "values": [
+ {
+ "name": "DEFAULT",
+ "value": 0
+ },
+ {
+ "name": "SWITCH",
+ "value": 1
+ },
+ {
+ "name": "CREATE",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "VehicleHvacFanDirection",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "FACE",
+ "value": 1
+ },
+ {
+ "name": "FLOOR",
+ "value": 2
+ },
+ {
+ "name": "FACE_AND_FLOOR",
+ "value": 3
+ },
+ {
+ "name": "DEFROST",
+ "value": 4
+ },
+ {
+ "name": "DEFROST_AND_FLOOR",
+ "value": 6
+ }
+ ]
+ },
+ {
+ "name": "Obd2SecondaryAirStatus",
+ "values": [
+ {
+ "name": "UPSTREAM",
+ "value": 1
+ },
+ {
+ "name": "DOWNSTREAM_OF_CATALYCIC_CONVERTER",
+ "value": 2
+ },
+ {
+ "name": "FROM_OUTSIDE_OR_OFF",
+ "value": 4
+ },
+ {
+ "name": "PUMP_ON_FOR_DIAGNOSTICS",
+ "value": 8
+ }
+ ]
+ },
+ {
+ "name": "VmsStartSessionMessageIntegerValuesIndex",
+ "values": [
+ {
+ "name": "MESSAGE_TYPE",
+ "value": 0
+ },
+ {
+ "name": "SERVICE_ID",
+ "value": 1
+ },
+ {
+ "name": "CLIENT_ID",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "VehicleOilLevel",
+ "values": [
+ {
+ "name": "CRITICALLY_LOW",
+ "value": 0
+ },
+ {
+ "name": "LOW",
+ "value": 1
+ },
+ {
+ "name": "NORMAL",
+ "value": 2
+ },
+ {
+ "name": "HIGH",
+ "value": 3
+ },
+ {
+ "name": "ERROR",
+ "value": 4
+ }
+ ]
+ },
+ {
+ "name": "VehicleUnit",
+ "values": [
+ {
+ "name": "SHOULD_NOT_USE",
+ "value": 0
+ },
+ {
+ "name": "METER_PER_SEC",
+ "value": 1
+ },
+ {
+ "name": "RPM",
+ "value": 2
+ },
+ {
+ "name": "HERTZ",
+ "value": 3
+ },
+ {
+ "name": "PERCENTILE",
+ "value": 16
+ },
+ {
+ "name": "MILLIMETER",
+ "value": 32
+ },
+ {
+ "name": "METER",
+ "value": 33
+ },
+ {
+ "name": "KILOMETER",
+ "value": 35
+ },
+ {
+ "name": "MILE",
+ "value": 36
+ },
+ {
+ "name": "CELSIUS",
+ "value": 48
+ },
+ {
+ "name": "FAHRENHEIT",
+ "value": 49
+ },
+ {
+ "name": "KELVIN",
+ "value": 50
+ },
+ {
+ "name": "MILLILITER",
+ "value": 64
+ },
+ {
+ "name": "LITER",
+ "value": 65
+ },
+ {
+ "name": "GALLON",
+ "value": 66
+ },
+ {
+ "name": "US_GALLON",
+ "value": 66
+ },
+ {
+ "name": "IMPERIAL_GALLON",
+ "value": 67
+ },
+ {
+ "name": "NANO_SECS",
+ "value": 80
+ },
+ {
+ "name": "SECS",
+ "value": 83
+ },
+ {
+ "name": "YEAR",
+ "value": 89
+ },
+ {
+ "name": "WATT_HOUR",
+ "value": 96
+ },
+ {
+ "name": "MILLIAMPERE",
+ "value": 97
+ },
+ {
+ "name": "MILLIVOLT",
+ "value": 98
+ },
+ {
+ "name": "MILLIWATTS",
+ "value": 99
+ },
+ {
+ "name": "AMPERE_HOURS",
+ "value": 100
+ },
+ {
+ "name": "KILOWATT_HOUR",
+ "value": 101
+ },
+ {
+ "name": "AMPERE",
+ "value": 102
+ },
+ {
+ "name": "KILOPASCAL",
+ "value": 112
+ },
+ {
+ "name": "PSI",
+ "value": 113
+ },
+ {
+ "name": "BAR",
+ "value": 114
+ },
+ {
+ "name": "DEGREES",
+ "value": 128
+ },
+ {
+ "name": "MILES_PER_HOUR",
+ "value": 144
+ },
+ {
+ "name": "KILOMETERS_PER_HOUR",
+ "value": 145
+ }
+ ]
+ },
+ {
+ "name": "VehicleAreaWheel",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "LEFT_FRONT",
+ "value": 1
+ },
+ {
+ "name": "RIGHT_FRONT",
+ "value": 2
+ },
+ {
+ "name": "LEFT_REAR",
+ "value": 4
+ },
+ {
+ "name": "RIGHT_REAR",
+ "value": 8
+ }
+ ]
+ },
+ {
+ "name": "EvsServiceState",
+ "values": [
+ {
+ "name": "OFF",
+ "value": 0
+ },
+ {
+ "name": "ON",
+ "value": 1
+ }
+ ]
+ },
+ {
+ "name": "EvsServiceRequestIndex",
+ "values": [
+ {
+ "name": "TYPE",
+ "value": 0
+ },
+ {
+ "name": "STATE",
+ "value": 1
+ }
+ ]
+ },
+ {
+ "name": "VehicleSeatOccupancyState",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "VACANT",
+ "value": 1
+ },
+ {
+ "name": "OCCUPIED",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "VehicleProperty",
+ "values": [
+ {
+ "name": "Undefined property.",
+ "value": 0
+ },
+ {
+ "name": "VIN of vehicle",
+ "value": 286261504,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Manufacturer of vehicle",
+ "value": 286261505,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Model of vehicle",
+ "value": 286261506,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Model year of vehicle.",
+ "value": 289407235,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:YEAR"
+ },
+ {
+ "name": "Fuel capacity of the vehicle in milliliters",
+ "value": 291504388,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:MILLILITER"
+ },
+ {
+ "name": "List of fuels the vehicle may use",
+ "value": 289472773,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "FuelType"
+ },
+ {
+ "name": "INFO_EV_BATTERY_CAPACITY",
+ "value": 291504390,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:WH"
+ },
+ {
+ "name": "List of connectors this EV may use",
+ "value": 289472775,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "data_enum": "EvConnectorType",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Fuel door location",
+ "value": 289407240,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "data_enum": "PortLocationType",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "EV port location",
+ "value": 289407241,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "PortLocationType"
+ },
+ {
+ "name": "INFO_DRIVER_SEAT",
+ "value": 356516106,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "data_enum": "VehicleAreaSeat",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Exterior dimensions of vehicle.",
+ "value": 289472779,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:MILLIMETER"
+ },
+ {
+ "name": "Multiple EV port locations",
+ "value": 289472780,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "PortLocationType"
+ },
+ {
+ "name": "Current odometer value of the vehicle",
+ "value": 291504644,
+ "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:KILOMETER"
+ },
+ {
+ "name": "Speed of the vehicle",
+ "value": 291504647,
+ "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:METER_PER_SEC"
+ },
+ {
+ "name": "Speed of the vehicle for displays",
+ "value": 291504648,
+ "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:METER_PER_SEC"
+ },
+ {
+ "name": "Front bicycle model steering angle for vehicle",
+ "value": 291504649,
+ "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:DEGREES"
+ },
+ {
+ "name": "Rear bicycle model steering angle for vehicle",
+ "value": 291504656,
+ "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:DEGREES"
+ },
+ {
+ "name": "Temperature of engine coolant",
+ "value": 291504897,
+ "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:CELSIUS"
+ },
+ {
+ "name": "Engine oil level",
+ "value": 289407747,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "VehicleOilLevel"
+ },
+ {
+ "name": "Temperature of engine oil",
+ "value": 291504900,
+ "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:CELSIUS"
+ },
+ {
+ "name": "Engine rpm",
+ "value": 291504901,
+ "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:RPM"
+ },
+ {
+ "name": "Reports wheel ticks",
+ "value": 290521862,
+ "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "FUEL_LEVEL",
+ "value": 291504903,
+ "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:MILLILITER"
+ },
+ {
+ "name": "Fuel door open",
+ "value": 287310600,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "EV_BATTERY_LEVEL",
+ "value": 291504905,
+ "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:WH"
+ },
+ {
+ "name": "EV charge port open",
+ "value": 287310602,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "EV charge port connected",
+ "value": 287310603,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "EV instantaneous charge rate in milliwatts",
+ "value": 291504908,
+ "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:MW"
+ },
+ {
+ "name": "Range remaining",
+ "value": 291504904,
+ "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "unit": "VehicleUnit:METER"
+ },
+ {
+ "name": "Tire pressure",
+ "value": 392168201,
+ "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:KILOPASCAL"
+ },
+ {
+ "name": "Critically low tire pressure",
+ "value": 392168202,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:KILOPASCAL"
+ },
+ {
+ "name": "Currently selected gear",
+ "value": 289408000,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "VehicleGear"
+ },
+ {
+ "name": "CURRENT_GEAR",
+ "value": 289408001,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "VehicleGear"
+ },
+ {
+ "name": "Parking brake state.",
+ "value": 287310850,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "PARKING_BRAKE_AUTO_APPLY",
+ "value": 287310851,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Warning for fuel low level.",
+ "value": 287310853,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Night mode",
+ "value": 287310855,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "State of the vehicles turn signals",
+ "value": 289408008,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "VehicleTurnSignal"
+ },
+ {
+ "name": "Represents ignition state",
+ "value": 289408009,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "VehicleIgnitionState"
+ },
+ {
+ "name": "ABS is active",
+ "value": 287310858,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Traction Control is active",
+ "value": 287310859,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "HVAC_FAN_SPEED",
+ "value": 356517120
+ },
+ {
+ "name": "Fan direction setting",
+ "value": 356517121,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "data_enum": "VehicleHvacFanDirection"
+ },
+ {
+ "name": "HVAC current temperature.",
+ "value": 358614274,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:CELSIUS"
+ },
+ {
+ "name": "HVAC_TEMPERATURE_SET",
+ "value": 358614275,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "unit": "VehicleUnit:CELSIUS"
+ },
+ {
+ "name": "HVAC_DEFROSTER",
+ "value": 320865540,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "HVAC_AC_ON",
+ "value": 354419973,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "config_flags": "Supported"
+ },
+ {
+ "name": "HVAC_MAX_AC_ON",
+ "value": 354419974,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "HVAC_MAX_DEFROST_ON",
+ "value": 354419975,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "HVAC_RECIRC_ON",
+ "value": 354419976,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Enable temperature coupling between areas.",
+ "value": 354419977,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "HVAC_AUTO_ON",
+ "value": 354419978,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "HVAC_SEAT_TEMPERATURE",
+ "value": 356517131,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Side Mirror Heat",
+ "value": 339739916,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "HVAC_STEERING_WHEEL_HEAT",
+ "value": 289408269,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Temperature units for display",
+ "value": 289408270,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "data_enum": "VehicleUnit"
+ },
+ {
+ "name": "Actual fan speed",
+ "value": 356517135,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "HVAC_POWER_ON",
+ "value": 354419984,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Fan Positions Available",
+ "value": 356582673,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "VehicleHvacFanDirection"
+ },
+ {
+ "name": "HVAC_AUTO_RECIRC_ON",
+ "value": 354419986,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Seat ventilation",
+ "value": 356517139,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "HVAC_ELECTRIC_DEFROSTER_ON",
+ "value": 320865556,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Suggested values for setting HVAC temperature.",
+ "value": 291570965,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Distance units for display",
+ "value": 289408512,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "data_enum": "VehicleUnit"
+ },
+ {
+ "name": "Fuel volume units for display",
+ "value": 289408513,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "data_enum": "VehicleUnit"
+ },
+ {
+ "name": "Tire pressure units for display",
+ "value": 289408514,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "data_enum": "VehicleUnit"
+ },
+ {
+ "name": "EV battery units for display",
+ "value": 289408515,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "data_enum": "VehicleUnit"
+ },
+ {
+ "name": "Fuel consumption units for display",
+ "value": 287311364,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Speed units for display",
+ "value": 289408517,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "ANDROID_EPOCH_TIME",
+ "value": 290457094,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:WRITE_ONLY",
+ "unit": "VehicleUnit:MILLI_SECS"
+ },
+ {
+ "name": "External encryption binding seed.",
+ "value": 292554247,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Outside temperature",
+ "value": 291505923,
+ "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:CELSIUS"
+ },
+ {
+ "name": "Property to control power state of application processor",
+ "value": 289475072,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Property to report power state of application processor",
+ "value": 289475073,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "AP_POWER_BOOTUP_REASON",
+ "value": 289409538,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "DISPLAY_BRIGHTNESS",
+ "value": 289409539,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "HW_KEY_INPUT",
+ "value": 289475088,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "config_flags": ""
+ },
+ {
+ "name": "HW_ROTARY_INPUT",
+ "value": 289475104,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "data_enum": "RotaryInputType",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Defines a custom OEM partner input event.",
+ "value": 289475120,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "data_enum": "CustomInputType",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "DOOR_POS",
+ "value": 373295872,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Door move",
+ "value": 373295873,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Door lock",
+ "value": 371198722,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Mirror Z Position",
+ "value": 339741504,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Mirror Z Move",
+ "value": 339741505,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Mirror Y Position",
+ "value": 339741506,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Mirror Y Move",
+ "value": 339741507,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Mirror Lock",
+ "value": 287312708,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Mirror Fold",
+ "value": 287312709,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Seat memory select",
+ "value": 356518784,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:WRITE"
+ },
+ {
+ "name": "Seat memory set",
+ "value": 356518785,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:WRITE"
+ },
+ {
+ "name": "Seatbelt buckled",
+ "value": 354421634,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Seatbelt height position",
+ "value": 356518787,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Seatbelt height move",
+ "value": 356518788,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "SEAT_FORE_AFT_POS",
+ "value": 356518789,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "SEAT_FORE_AFT_MOVE",
+ "value": 356518790,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Seat backrest angle 1 position",
+ "value": 356518791,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Seat backrest angle 1 move",
+ "value": 356518792,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Seat backrest angle 2 position",
+ "value": 356518793,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Seat backrest angle 2 move",
+ "value": 356518794,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Seat height position",
+ "value": 356518795,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Seat height move",
+ "value": 356518796,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Seat depth position",
+ "value": 356518797,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Seat depth move",
+ "value": 356518798,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Seat tilt position",
+ "value": 356518799,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Seat tilt move",
+ "value": 356518800,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "SEAT_LUMBAR_FORE_AFT_POS",
+ "value": 356518801,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "SEAT_LUMBAR_FORE_AFT_MOVE",
+ "value": 356518802,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Lumbar side support position",
+ "value": 356518803,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Lumbar side support move",
+ "value": 356518804,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Headrest height position",
+ "value": 289409941,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Headrest height move",
+ "value": 356518806,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Headrest angle position",
+ "value": 356518807,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Headrest angle move",
+ "value": 356518808,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "SEAT_HEADREST_FORE_AFT_POS",
+ "value": 356518809,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "SEAT_HEADREST_FORE_AFT_MOVE",
+ "value": 356518810,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Seat Occupancy",
+ "value": 356518832,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "VehicleSeatOccupancyState"
+ },
+ {
+ "name": "Window Position",
+ "value": 322964416,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Window Move",
+ "value": 322964417,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Window Lock",
+ "value": 320867268,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "VEHICLE_MAP_SERVICE",
+ "value": 299895808,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "OBD2 Live Sensor Data",
+ "value": 299896064,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "OBD2 Freeze Frame Sensor Data",
+ "value": 299896065,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "OBD2 Freeze Frame Information",
+ "value": 299896066,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "OBD2 Freeze Frame Clear",
+ "value": 299896067,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:WRITE"
+ },
+ {
+ "name": "Headlights State",
+ "value": 289410560,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "High beam lights state",
+ "value": 289410561,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "Fog light state",
+ "value": 289410562,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "Hazard light status",
+ "value": 289410563,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "Headlight switch",
+ "value": 289410576,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "High beam light switch",
+ "value": 289410577,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "Fog light switch",
+ "value": 289410578,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "Hazard light switch",
+ "value": 289410579,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "Cabin lights",
+ "value": 289410817,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "Cabin lights switch",
+ "value": 289410818,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "Reading lights",
+ "value": 356519683,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "Reading lights switch",
+ "value": 356519684,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "Support customize permissions for vendor properties",
+ "value": 287313669,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Allow disabling optional featurs from vhal.",
+ "value": 286265094,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Defines the initial Android user to be used during initialization.",
+ "value": 299896583,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Defines a request to switch the foreground Android user.",
+ "value": 299896584,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Called by the Android System after an Android user was created.",
+ "value": 299896585,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Called by the Android System after an Android user was removed.",
+ "value": 299896586,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:WRITE"
+ },
+ {
+ "name": "USER_IDENTIFICATION_ASSOCIATION",
+ "value": 299896587,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "EVS_SERVICE_REQUEST",
+ "value": 289476368,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Defines a request to apply power policy.",
+ "value": 286265121,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "POWER_POLICY_GROUP_REQ",
+ "value": 286265122,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Notifies the current power policy to VHAL layer.",
+ "value": 286265123,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "WATCHDOG_ALIVE",
+ "value": 290459441,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:WRITE"
+ },
+ {
+ "name": "Defines a process terminated by car watchdog and the reason of termination.",
+ "value": 299896626,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:WRITE"
+ },
+ {
+ "name": "Defines an event that VHAL signals to car watchdog as a heartbeat.",
+ "value": 290459443,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Starts the ClusterUI in cluster display.",
+ "value": 289410868,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Changes the state of the cluster display.",
+ "value": 289476405,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ"
+ },
+ {
+ "name": "Reports the current display state and ClusterUI state.",
+ "value": 299896630,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:WRITE"
+ },
+ {
+ "name": "Requests to change the cluster display state to show some ClusterUI.",
+ "value": 289410871,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:WRITE"
+ },
+ {
+ "name": "Informs the current navigation state.",
+ "value": 292556600,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:WRITE"
+ },
+ {
+ "name": "Electronic Toll Collection card type.",
+ "value": 289410873,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "ElectronicTollCollectionCardType"
+ },
+ {
+ "name": "Electronic Toll Collection card status.",
+ "value": 289410874,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "ElectronicTollCollectionCardStatus"
+ },
+ {
+ "name": "Front fog lights state",
+ "value": 289410875,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "Front fog lights switch",
+ "value": 289410876,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "Rear fog lights state",
+ "value": 289410877,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "Rear fog lights switch",
+ "value": 289410878,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "Indicates the maximum current draw threshold for charging set by the user",
+ "value": 291508031,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE",
+ "unit": "VehicleUnit:AMPERE"
+ },
+ {
+ "name": "Indicates the maximum charge percent threshold set by the user",
+ "value": 291508032,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Charging state of the car",
+ "value": 289410881,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "EvChargeState"
+ },
+ {
+ "name": "Start or stop charging the EV battery",
+ "value": 287313730,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ_WRITE"
+ },
+ {
+ "name": "Estimated charge time remaining in seconds",
+ "value": 289410883,
+ "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:SECS"
+ },
+ {
+ "name": "EV_REGENERATIVE_BRAKING_STATE",
+ "value": 289410884,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "EvRegenerativeBrakingState"
+ },
+ {
+ "name": "Indicates if there is a trailer present or not.",
+ "value": 289410885,
+ "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
+ "access": "VehiclePropertyAccess:READ",
+ "data_enum": "TrailerState"
+ },
+ {
+ "name": "VEHICLE_CURB_WEIGHT",
+ "value": 289410886,
+ "change_mode": "VehiclePropertyChangeMode:STATIC",
+ "access": "VehiclePropertyAccess:READ",
+ "unit": "VehicleUnit:KILOGRAM"
+ }
+ ]
+ },
+ {
+ "name": "EvsServiceType",
+ "values": [
+ {
+ "name": "REARVIEW",
+ "value": 0
+ },
+ {
+ "name": "SURROUNDVIEW",
+ "value": 1
+ }
+ ]
+ },
+ {
+ "name": "VehiclePropertyChangeMode",
+ "values": [
+ {
+ "name": "STATIC",
+ "value": 0
+ },
+ {
+ "name": "ON_CHANGE",
+ "value": 1
+ },
+ {
+ "name": "CONTINUOUS",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "Obd2CompressionIgnitionMonitors",
+ "values": []
+ },
+ {
+ "name": "VehicleLightState",
+ "values": [
+ {
+ "name": "OFF",
+ "value": 0
+ },
+ {
+ "name": "ON",
+ "value": 1
+ },
+ {
+ "name": "DAYTIME_RUNNING",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "SwitchUserMessageType",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "LEGACY_ANDROID_SWITCH",
+ "value": 1
+ },
+ {
+ "name": "ANDROID_SWITCH",
+ "value": 2
+ },
+ {
+ "name": "VEHICLE_RESPONSE",
+ "value": 3
+ },
+ {
+ "name": "VEHICLE_REQUEST",
+ "value": 4
+ },
+ {
+ "name": "ANDROID_POST_SWITCH",
+ "value": 5
+ }
+ ]
+ },
+ {
+ "name": "PortLocationType",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "FRONT_LEFT",
+ "value": 1
+ },
+ {
+ "name": "FRONT_RIGHT",
+ "value": 2
+ },
+ {
+ "name": "REAR_RIGHT",
+ "value": 3
+ },
+ {
+ "name": "REAR_LEFT",
+ "value": 4
+ },
+ {
+ "name": "FRONT",
+ "value": 5
+ },
+ {
+ "name": "REAR",
+ "value": 6
+ }
+ ]
+ },
+ {
+ "name": "VehiclePropertyStatus",
+ "values": [
+ {
+ "name": "AVAILABLE",
+ "value": 0
+ },
+ {
+ "name": "UNAVAILABLE",
+ "value": 1
+ },
+ {
+ "name": "ERROR",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "VehicleDisplay",
+ "values": [
+ {
+ "name": "MAIN",
+ "value": 0
+ },
+ {
+ "name": "INSTRUMENT_CLUSTER",
+ "value": 1
+ }
+ ]
+ },
+ {
+ "name": "SwitchUserStatus",
+ "values": [
+ {
+ "name": "SUCCESS",
+ "value": 1
+ },
+ {
+ "name": "FAILURE",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "InitialUserInfoRequestType",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "FIRST_BOOT",
+ "value": 1
+ },
+ {
+ "name": "FIRST_BOOT_AFTER_OTA",
+ "value": 2
+ },
+ {
+ "name": "COLD_BOOT",
+ "value": 3
+ },
+ {
+ "name": "RESUME",
+ "value": 4
+ }
+ ]
+ },
+ {
+ "name": "UserIdentificationAssociationSetValue",
+ "values": [
+ {
+ "name": "INVALID",
+ "value": 0
+ },
+ {
+ "name": "ASSOCIATE_CURRENT_USER",
+ "value": 1
+ },
+ {
+ "name": "DISASSOCIATE_CURRENT_USER",
+ "value": 2
+ },
+ {
+ "name": "DISASSOCIATE_ALL_USERS",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "VehicleAreaDoor",
+ "values": [
+ {
+ "name": "ROW_1_LEFT",
+ "value": 1
+ },
+ {
+ "name": "ROW_1_RIGHT",
+ "value": 4
+ },
+ {
+ "name": "ROW_2_LEFT",
+ "value": 16
+ },
+ {
+ "name": "ROW_2_RIGHT",
+ "value": 64
+ },
+ {
+ "name": "ROW_3_LEFT",
+ "value": 256
+ },
+ {
+ "name": "ROW_3_RIGHT",
+ "value": 1024
+ },
+ {
+ "name": "HOOD",
+ "value": 268435456
+ },
+ {
+ "name": "REAR",
+ "value": 536870912
+ }
+ ]
+ },
+ {
+ "name": "VehicleLightSwitch",
+ "values": [
+ {
+ "name": "OFF",
+ "value": 0
+ },
+ {
+ "name": "ON",
+ "value": 1
+ },
+ {
+ "name": "DAYTIME_RUNNING",
+ "value": 2
+ },
+ {
+ "name": "AUTOMATIC",
+ "value": 256
+ }
+ ]
+ },
+ {
+ "name": "VehicleGear",
+ "values": [
+ {
+ "name": "GEAR_UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "GEAR_NEUTRAL",
+ "value": 1
+ },
+ {
+ "name": "GEAR_REVERSE",
+ "value": 2
+ },
+ {
+ "name": "GEAR_PARK",
+ "value": 4
+ },
+ {
+ "name": "GEAR_DRIVE",
+ "value": 8
+ },
+ {
+ "name": "GEAR_1",
+ "value": 16
+ },
+ {
+ "name": "GEAR_2",
+ "value": 32
+ },
+ {
+ "name": "GEAR_3",
+ "value": 64
+ },
+ {
+ "name": "GEAR_4",
+ "value": 128
+ },
+ {
+ "name": "GEAR_5",
+ "value": 256
+ },
+ {
+ "name": "GEAR_6",
+ "value": 512
+ },
+ {
+ "name": "GEAR_7",
+ "value": 1024
+ },
+ {
+ "name": "GEAR_8",
+ "value": 2048
+ },
+ {
+ "name": "GEAR_9",
+ "value": 4096
+ }
+ ]
+ },
+ {
+ "name": "Obd2IgnitionMonitorKind",
+ "values": [
+ {
+ "name": "SPARK",
+ "value": 0
+ },
+ {
+ "name": "COMPRESSION",
+ "value": 1
+ }
+ ]
+ },
+ {
+ "name": "CustomInputType",
+ "values": [
+ {
+ "name": "CUSTOM_EVENT_F1",
+ "value": 1001
+ },
+ {
+ "name": "CUSTOM_EVENT_F2",
+ "value": 1002
+ },
+ {
+ "name": "CUSTOM_EVENT_F3",
+ "value": 1003
+ },
+ {
+ "name": "CUSTOM_EVENT_F4",
+ "value": 1004
+ },
+ {
+ "name": "CUSTOM_EVENT_F5",
+ "value": 1005
+ },
+ {
+ "name": "CUSTOM_EVENT_F6",
+ "value": 1006
+ },
+ {
+ "name": "CUSTOM_EVENT_F7",
+ "value": 1007
+ },
+ {
+ "name": "CUSTOM_EVENT_F8",
+ "value": 1008
+ },
+ {
+ "name": "CUSTOM_EVENT_F9",
+ "value": 1009
+ },
+ {
+ "name": "CUSTOM_EVENT_F10",
+ "value": 1010
+ }
+ ]
+ },
+ {
+ "name": "VehicleApPowerStateReport",
+ "values": [
+ {
+ "name": "WAIT_FOR_VHAL",
+ "value": 1
+ },
+ {
+ "name": "DEEP_SLEEP_ENTRY",
+ "value": 2
+ },
+ {
+ "name": "DEEP_SLEEP_EXIT",
+ "value": 3
+ },
+ {
+ "name": "SHUTDOWN_POSTPONE",
+ "value": 4
+ },
+ {
+ "name": "SHUTDOWN_START",
+ "value": 5
+ },
+ {
+ "name": "ON",
+ "value": 6
+ },
+ {
+ "name": "SHUTDOWN_PREPARE",
+ "value": 7
+ },
+ {
+ "name": "SHUTDOWN_CANCELLED",
+ "value": 8
+ },
+ {
+ "name": "HIBERNATION_ENTRY",
+ "value": 9
+ },
+ {
+ "name": "HIBERNATION_EXIT",
+ "value": 10
+ }
+ ]
+ },
+ {
+ "name": "VmsMessageWithLayerIntegerValuesIndex",
+ "values": [
+ {
+ "name": "MESSAGE_TYPE",
+ "value": 0
+ },
+ {
+ "name": "LAYER_TYPE",
+ "value": 1
+ },
+ {
+ "name": "LAYER_SUBTYPE",
+ "value": 2
+ },
+ {
+ "name": "LAYER_VERSION",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "EvRegenerativeBrakingState",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "DISABLED",
+ "value": 1
+ },
+ {
+ "name": "PARTIALLY_ENABLED",
+ "value": 2
+ },
+ {
+ "name": "FULLY_ENABLED",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "VehiclePropertyGroup",
+ "values": [
+ {
+ "name": "SYSTEM",
+ "value": 268435456
+ },
+ {
+ "name": "VENDOR",
+ "value": 536870912
+ },
+ {
+ "name": "MASK",
+ "value": 4026531840
+ }
+ ]
+ },
+ {
+ "name": "VehicleIgnitionState",
+ "values": [
+ {
+ "name": "UNDEFINED",
+ "value": 0
+ },
+ {
+ "name": "LOCK",
+ "value": 1
+ },
+ {
+ "name": "OFF",
+ "value": 2
+ },
+ {
+ "name": "ACC",
+ "value": 3
+ },
+ {
+ "name": "ON",
+ "value": 4
+ },
+ {
+ "name": "START",
+ "value": 5
+ }
+ ]
+ },
+ {
+ "name": "VehicleHwKeyInputAction",
+ "values": [
+ {
+ "name": "ACTION_DOWN",
+ "value": 0
+ },
+ {
+ "name": "ACTION_UP",
+ "value": 1
+ }
+ ]
+ },
+ {
+ "name": "DiagnosticIntegerSensorIndex",
+ "values": [
+ {
+ "name": "FUEL_SYSTEM_STATUS",
+ "value": 0
+ },
+ {
+ "name": "MALFUNCTION_INDICATOR_LIGHT_ON",
+ "value": 1
+ },
+ {
+ "name": "IGNITION_MONITORS_SUPPORTED",
+ "value": 2
+ },
+ {
+ "name": "IGNITION_SPECIFIC_MONITORS",
+ "value": 3
+ },
+ {
+ "name": "INTAKE_AIR_TEMPERATURE",
+ "value": 4
+ },
+ {
+ "name": "COMMANDED_SECONDARY_AIR_STATUS",
+ "value": 5
+ },
+ {
+ "name": "NUM_OXYGEN_SENSORS_PRESENT",
+ "value": 6
+ },
+ {
+ "name": "RUNTIME_SINCE_ENGINE_START",
+ "value": 7
+ },
+ {
+ "name": "DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON",
+ "value": 8
+ },
+ {
+ "name": "WARMUPS_SINCE_CODES_CLEARED",
+ "value": 9
+ },
+ {
+ "name": "DISTANCE_TRAVELED_SINCE_CODES_CLEARED",
+ "value": 10
+ },
+ {
+ "name": "ABSOLUTE_BAROMETRIC_PRESSURE",
+ "value": 11
+ },
+ {
+ "name": "CONTROL_MODULE_VOLTAGE",
+ "value": 12
+ },
+ {
+ "name": "AMBIENT_AIR_TEMPERATURE",
+ "value": 13
+ },
+ {
+ "name": "TIME_WITH_MALFUNCTION_LIGHT_ON",
+ "value": 14
+ },
+ {
+ "name": "TIME_SINCE_TROUBLE_CODES_CLEARED",
+ "value": 15
+ },
+ {
+ "name": "MAX_FUEL_AIR_EQUIVALENCE_RATIO",
+ "value": 16
+ },
+ {
+ "name": "MAX_OXYGEN_SENSOR_VOLTAGE",
+ "value": 17
+ },
+ {
+ "name": "MAX_OXYGEN_SENSOR_CURRENT",
+ "value": 18
+ },
+ {
+ "name": "MAX_INTAKE_MANIFOLD_ABSOLUTE_PRESSURE",
+ "value": 19
+ },
+ {
+ "name": "MAX_AIR_FLOW_RATE_FROM_MASS_AIR_FLOW_SENSOR",
+ "value": 20
+ },
+ {
+ "name": "FUEL_TYPE",
+ "value": 21
+ },
+ {
+ "name": "FUEL_RAIL_ABSOLUTE_PRESSURE",
+ "value": 22
+ },
+ {
+ "name": "ENGINE_OIL_TEMPERATURE",
+ "value": 23
+ },
+ {
+ "name": "DRIVER_DEMAND_PERCENT_TORQUE",
+ "value": 24
+ },
+ {
+ "name": "ENGINE_ACTUAL_PERCENT_TORQUE",
+ "value": 25
+ },
+ {
+ "name": "ENGINE_REFERENCE_PERCENT_TORQUE",
+ "value": 26
+ },
+ {
+ "name": "ENGINE_PERCENT_TORQUE_DATA_IDLE",
+ "value": 27
+ },
+ {
+ "name": "ENGINE_PERCENT_TORQUE_DATA_POINT1",
+ "value": 28
+ },
+ {
+ "name": "ENGINE_PERCENT_TORQUE_DATA_POINT2",
+ "value": 29
+ },
+ {
+ "name": "ENGINE_PERCENT_TORQUE_DATA_POINT3",
+ "value": 30
+ },
+ {
+ "name": "ENGINE_PERCENT_TORQUE_DATA_POINT4",
+ "value": 31
+ }
+ ]
+ },
+ {
+ "name": "UserIdentificationAssociationValue",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 1
+ },
+ {
+ "name": "ASSOCIATED_CURRENT_USER",
+ "value": 2
+ },
+ {
+ "name": "ASSOCIATED_ANOTHER_USER",
+ "value": 3
+ },
+ {
+ "name": "NOT_ASSOCIATED_ANY_USER",
+ "value": 4
+ }
+ ]
+ },
+ {
+ "name": "VmsBaseMessageIntegerValuesIndex",
+ "values": [
+ {
+ "name": "MESSAGE_TYPE",
+ "value": 0
+ }
+ ]
+ },
+ {
+ "name": "DiagnosticFloatSensorIndex",
+ "values": [
+ {
+ "name": "CALCULATED_ENGINE_LOAD",
+ "value": 0
+ },
+ {
+ "name": "ENGINE_COOLANT_TEMPERATURE",
+ "value": 1
+ },
+ {
+ "name": "SHORT_TERM_FUEL_TRIM_BANK1",
+ "value": 2
+ },
+ {
+ "name": "LONG_TERM_FUEL_TRIM_BANK1",
+ "value": 3
+ },
+ {
+ "name": "SHORT_TERM_FUEL_TRIM_BANK2",
+ "value": 4
+ },
+ {
+ "name": "LONG_TERM_FUEL_TRIM_BANK2",
+ "value": 5
+ },
+ {
+ "name": "FUEL_PRESSURE",
+ "value": 6
+ },
+ {
+ "name": "INTAKE_MANIFOLD_ABSOLUTE_PRESSURE",
+ "value": 7
+ },
+ {
+ "name": "ENGINE_RPM",
+ "value": 8
+ },
+ {
+ "name": "VEHICLE_SPEED",
+ "value": 9
+ },
+ {
+ "name": "TIMING_ADVANCE",
+ "value": 10
+ },
+ {
+ "name": "MAF_AIR_FLOW_RATE",
+ "value": 11
+ },
+ {
+ "name": "THROTTLE_POSITION",
+ "value": 12
+ },
+ {
+ "name": "OXYGEN_SENSOR1_VOLTAGE",
+ "value": 13
+ },
+ {
+ "name": "OXYGEN_SENSOR1_SHORT_TERM_FUEL_TRIM",
+ "value": 14
+ },
+ {
+ "name": "OXYGEN_SENSOR1_FUEL_AIR_EQUIVALENCE_RATIO",
+ "value": 15
+ },
+ {
+ "name": "OXYGEN_SENSOR2_VOLTAGE",
+ "value": 16
+ },
+ {
+ "name": "OXYGEN_SENSOR2_SHORT_TERM_FUEL_TRIM",
+ "value": 17
+ },
+ {
+ "name": "OXYGEN_SENSOR2_FUEL_AIR_EQUIVALENCE_RATIO",
+ "value": 18
+ },
+ {
+ "name": "OXYGEN_SENSOR3_VOLTAGE",
+ "value": 19
+ },
+ {
+ "name": "OXYGEN_SENSOR3_SHORT_TERM_FUEL_TRIM",
+ "value": 20
+ },
+ {
+ "name": "OXYGEN_SENSOR3_FUEL_AIR_EQUIVALENCE_RATIO",
+ "value": 21
+ },
+ {
+ "name": "OXYGEN_SENSOR4_VOLTAGE",
+ "value": 22
+ },
+ {
+ "name": "OXYGEN_SENSOR4_SHORT_TERM_FUEL_TRIM",
+ "value": 23
+ },
+ {
+ "name": "OXYGEN_SENSOR4_FUEL_AIR_EQUIVALENCE_RATIO",
+ "value": 24
+ },
+ {
+ "name": "OXYGEN_SENSOR5_VOLTAGE",
+ "value": 25
+ },
+ {
+ "name": "OXYGEN_SENSOR5_SHORT_TERM_FUEL_TRIM",
+ "value": 26
+ },
+ {
+ "name": "OXYGEN_SENSOR5_FUEL_AIR_EQUIVALENCE_RATIO",
+ "value": 27
+ },
+ {
+ "name": "OXYGEN_SENSOR6_VOLTAGE",
+ "value": 28
+ },
+ {
+ "name": "OXYGEN_SENSOR6_SHORT_TERM_FUEL_TRIM",
+ "value": 29
+ },
+ {
+ "name": "OXYGEN_SENSOR6_FUEL_AIR_EQUIVALENCE_RATIO",
+ "value": 30
+ },
+ {
+ "name": "OXYGEN_SENSOR7_VOLTAGE",
+ "value": 31
+ },
+ {
+ "name": "OXYGEN_SENSOR7_SHORT_TERM_FUEL_TRIM",
+ "value": 32
+ },
+ {
+ "name": "OXYGEN_SENSOR7_FUEL_AIR_EQUIVALENCE_RATIO",
+ "value": 33
+ },
+ {
+ "name": "OXYGEN_SENSOR8_VOLTAGE",
+ "value": 34
+ },
+ {
+ "name": "OXYGEN_SENSOR8_SHORT_TERM_FUEL_TRIM",
+ "value": 35
+ },
+ {
+ "name": "OXYGEN_SENSOR8_FUEL_AIR_EQUIVALENCE_RATIO",
+ "value": 36
+ },
+ {
+ "name": "FUEL_RAIL_PRESSURE",
+ "value": 37
+ },
+ {
+ "name": "FUEL_RAIL_GAUGE_PRESSURE",
+ "value": 38
+ },
+ {
+ "name": "COMMANDED_EXHAUST_GAS_RECIRCULATION",
+ "value": 39
+ },
+ {
+ "name": "EXHAUST_GAS_RECIRCULATION_ERROR",
+ "value": 40
+ },
+ {
+ "name": "COMMANDED_EVAPORATIVE_PURGE",
+ "value": 41
+ },
+ {
+ "name": "FUEL_TANK_LEVEL_INPUT",
+ "value": 42
+ },
+ {
+ "name": "EVAPORATION_SYSTEM_VAPOR_PRESSURE",
+ "value": 43
+ },
+ {
+ "name": "CATALYST_TEMPERATURE_BANK1_SENSOR1",
+ "value": 44
+ },
+ {
+ "name": "CATALYST_TEMPERATURE_BANK2_SENSOR1",
+ "value": 45
+ },
+ {
+ "name": "CATALYST_TEMPERATURE_BANK1_SENSOR2",
+ "value": 46
+ },
+ {
+ "name": "CATALYST_TEMPERATURE_BANK2_SENSOR2",
+ "value": 47
+ },
+ {
+ "name": "ABSOLUTE_LOAD_VALUE",
+ "value": 48
+ },
+ {
+ "name": "FUEL_AIR_COMMANDED_EQUIVALENCE_RATIO",
+ "value": 49
+ },
+ {
+ "name": "RELATIVE_THROTTLE_POSITION",
+ "value": 50
+ },
+ {
+ "name": "ABSOLUTE_THROTTLE_POSITION_B",
+ "value": 51
+ },
+ {
+ "name": "ABSOLUTE_THROTTLE_POSITION_C",
+ "value": 52
+ },
+ {
+ "name": "ACCELERATOR_PEDAL_POSITION_D",
+ "value": 53
+ },
+ {
+ "name": "ACCELERATOR_PEDAL_POSITION_E",
+ "value": 54
+ },
+ {
+ "name": "ACCELERATOR_PEDAL_POSITION_F",
+ "value": 55
+ },
+ {
+ "name": "COMMANDED_THROTTLE_ACTUATOR",
+ "value": 56
+ },
+ {
+ "name": "ETHANOL_FUEL_PERCENTAGE",
+ "value": 57
+ },
+ {
+ "name": "ABSOLUTE_EVAPORATION_SYSTEM_VAPOR_PRESSURE",
+ "value": 58
+ },
+ {
+ "name": "SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1",
+ "value": 59
+ },
+ {
+ "name": "SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2",
+ "value": 60
+ },
+ {
+ "name": "SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3",
+ "value": 61
+ },
+ {
+ "name": "SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4",
+ "value": 62
+ },
+ {
+ "name": "LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1",
+ "value": 63
+ },
+ {
+ "name": "LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2",
+ "value": 64
+ },
+ {
+ "name": "LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3",
+ "value": 65
+ },
+ {
+ "name": "LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4",
+ "value": 66
+ },
+ {
+ "name": "RELATIVE_ACCELERATOR_PEDAL_POSITION",
+ "value": 67
+ },
+ {
+ "name": "HYBRID_BATTERY_PACK_REMAINING_LIFE",
+ "value": 68
+ },
+ {
+ "name": "FUEL_INJECTION_TIMING",
+ "value": 69
+ },
+ {
+ "name": "ENGINE_FUEL_RATE",
+ "value": 70
+ }
+ ]
+ },
+ {
+ "name": "VmsMessageWithLayerAndPublisherIdIntegerValuesIndex",
+ "values": [
+ {
+ "name": "MESSAGE_TYPE",
+ "value": 0
+ },
+ {
+ "name": "LAYER_TYPE",
+ "value": 1
+ },
+ {
+ "name": "LAYER_SUBTYPE",
+ "value": 2
+ },
+ {
+ "name": "LAYER_VERSION",
+ "value": 3
+ },
+ {
+ "name": "PUBLISHER_ID",
+ "value": 4
+ }
+ ]
+ },
+ {
+ "name": "FuelType",
+ "values": [
+ {
+ "name": "FUEL_TYPE_UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "FUEL_TYPE_UNLEADED",
+ "value": 1
+ },
+ {
+ "name": "FUEL_TYPE_LEADED",
+ "value": 2
+ },
+ {
+ "name": "FUEL_TYPE_DIESEL_1",
+ "value": 3
+ },
+ {
+ "name": "FUEL_TYPE_DIESEL_2",
+ "value": 4
+ },
+ {
+ "name": "FUEL_TYPE_BIODIESEL",
+ "value": 5
+ },
+ {
+ "name": "FUEL_TYPE_E85",
+ "value": 6
+ },
+ {
+ "name": "FUEL_TYPE_LPG",
+ "value": 7
+ },
+ {
+ "name": "FUEL_TYPE_CNG",
+ "value": 8
+ },
+ {
+ "name": "FUEL_TYPE_LNG",
+ "value": 9
+ },
+ {
+ "name": "FUEL_TYPE_ELECTRIC",
+ "value": 10
+ },
+ {
+ "name": "FUEL_TYPE_HYDROGEN",
+ "value": 11
+ },
+ {
+ "name": "FUEL_TYPE_OTHER",
+ "value": 12
+ }
+ ]
+ },
+ {
+ "name": "VehicleApPowerStateReq",
+ "values": [
+ {
+ "name": "ON",
+ "value": 0
+ },
+ {
+ "name": "SHUTDOWN_PREPARE",
+ "value": 1
+ },
+ {
+ "name": "CANCEL_SHUTDOWN",
+ "value": 2
+ },
+ {
+ "name": "FINISHED",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "VmsMessageType",
+ "values": [
+ {
+ "name": "SUBSCRIBE",
+ "value": 1
+ },
+ {
+ "name": "SUBSCRIBE_TO_PUBLISHER",
+ "value": 2
+ },
+ {
+ "name": "UNSUBSCRIBE",
+ "value": 3
+ },
+ {
+ "name": "UNSUBSCRIBE_TO_PUBLISHER",
+ "value": 4
+ },
+ {
+ "name": "OFFERING",
+ "value": 5
+ },
+ {
+ "name": "AVAILABILITY_REQUEST",
+ "value": 6
+ },
+ {
+ "name": "SUBSCRIPTIONS_REQUEST",
+ "value": 7
+ },
+ {
+ "name": "AVAILABILITY_RESPONSE",
+ "value": 8
+ },
+ {
+ "name": "AVAILABILITY_CHANGE",
+ "value": 9
+ },
+ {
+ "name": "SUBSCRIPTIONS_RESPONSE",
+ "value": 10
+ },
+ {
+ "name": "SUBSCRIPTIONS_CHANGE",
+ "value": 11
+ },
+ {
+ "name": "DATA",
+ "value": 12
+ },
+ {
+ "name": "PUBLISHER_ID_REQUEST",
+ "value": 13
+ },
+ {
+ "name": "PUBLISHER_ID_RESPONSE",
+ "value": 14
+ },
+ {
+ "name": "PUBLISHER_INFORMATION_REQUEST",
+ "value": 15
+ },
+ {
+ "name": "PUBLISHER_INFORMATION_RESPONSE",
+ "value": 16
+ },
+ {
+ "name": "START_SESSION",
+ "value": 17
+ }
+ ]
+ },
+ {
+ "name": "Obd2CommonIgnitionMonitors",
+ "values": []
+ },
+ {
+ "name": "UserIdentificationAssociationType",
+ "values": [
+ {
+ "name": "INVALID",
+ "value": 0
+ },
+ {
+ "name": "KEY_FOB",
+ "value": 1
+ },
+ {
+ "name": "CUSTOM_1",
+ "value": 101
+ },
+ {
+ "name": "CUSTOM_2",
+ "value": 102
+ },
+ {
+ "name": "CUSTOM_3",
+ "value": 103
+ },
+ {
+ "name": "CUSTOM_4",
+ "value": 104
+ }
+ ]
+ },
+ {
+ "name": "EvConnectorType",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "IEC_TYPE_1_AC",
+ "value": 1
+ },
+ {
+ "name": "IEC_TYPE_2_AC",
+ "value": 2
+ },
+ {
+ "name": "IEC_TYPE_3_AC",
+ "value": 3
+ },
+ {
+ "name": "IEC_TYPE_4_DC",
+ "value": 4
+ },
+ {
+ "name": "IEC_TYPE_1_CCS_DC",
+ "value": 5
+ },
+ {
+ "name": "IEC_TYPE_2_CCS_DC",
+ "value": 6
+ },
+ {
+ "name": "TESLA_ROADSTER",
+ "value": 7
+ },
+ {
+ "name": "TESLA_HPWC",
+ "value": 8
+ },
+ {
+ "name": "TESLA_SUPERCHARGER",
+ "value": 9
+ },
+ {
+ "name": "GBT_AC",
+ "value": 10
+ },
+ {
+ "name": "GBT_DC",
+ "value": 11
+ },
+ {
+ "name": "OTHER",
+ "value": 101
+ }
+ ]
+ },
+ {
+ "name": "VehicleApPowerStateShutdownParam",
+ "values": [
+ {
+ "name": "SHUTDOWN_IMMEDIATELY",
+ "value": 1
+ },
+ {
+ "name": "CAN_SLEEP",
+ "value": 2
+ },
+ {
+ "name": "SHUTDOWN_ONLY",
+ "value": 3
+ },
+ {
+ "name": "SLEEP_IMMEDIATELY",
+ "value": 4
+ },
+ {
+ "name": "HIBERNATE_IMMEDIATELY",
+ "value": 5
+ },
+ {
+ "name": "CAN_HIBERNATE",
+ "value": 6
+ }
+ ]
+ },
+ {
+ "name": "VmsOfferingMessageIntegerValuesIndex",
+ "values": [
+ {
+ "name": "MESSAGE_TYPE",
+ "value": 0
+ },
+ {
+ "name": "PUBLISHER_ID",
+ "value": 1
+ },
+ {
+ "name": "NUMBER_OF_OFFERS",
+ "value": 2
+ },
+ {
+ "name": "OFFERING_START",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "VehicleAreaSeat",
+ "values": [
+ {
+ "name": "ROW_1_LEFT",
+ "value": 1
+ },
+ {
+ "name": "ROW_1_CENTER",
+ "value": 2
+ },
+ {
+ "name": "ROW_1_RIGHT",
+ "value": 4
+ },
+ {
+ "name": "ROW_2_LEFT",
+ "value": 16
+ },
+ {
+ "name": "ROW_2_CENTER",
+ "value": 32
+ },
+ {
+ "name": "ROW_2_RIGHT",
+ "value": 64
+ },
+ {
+ "name": "ROW_3_LEFT",
+ "value": 256
+ },
+ {
+ "name": "ROW_3_CENTER",
+ "value": 512
+ },
+ {
+ "name": "ROW_3_RIGHT",
+ "value": 1024
+ }
+ ]
+ },
+ {
+ "name": "VehicleVendorPermission",
+ "values": [
+ {
+ "name": "PERMISSION_DEFAULT",
+ "value": 0
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_WINDOW",
+ "value": 1
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_WINDOW",
+ "value": 2
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_DOOR",
+ "value": 3
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_DOOR",
+ "value": 4
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_SEAT",
+ "value": 5
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_SEAT",
+ "value": 6
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_MIRROR",
+ "value": 7
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_MIRROR",
+ "value": 8
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_INFO",
+ "value": 9
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_INFO",
+ "value": 10
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_ENGINE",
+ "value": 11
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_ENGINE",
+ "value": 12
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_HVAC",
+ "value": 13
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_HVAC",
+ "value": 14
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_LIGHT",
+ "value": 15
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_LIGHT",
+ "value": 16
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_1",
+ "value": 65536
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_1",
+ "value": 69632
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_2",
+ "value": 131072
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_2",
+ "value": 135168
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_3",
+ "value": 196608
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_3",
+ "value": 200704
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_4",
+ "value": 262144
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_4",
+ "value": 266240
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_5",
+ "value": 327680
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_5",
+ "value": 331776
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_6",
+ "value": 393216
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_6",
+ "value": 397312
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_7",
+ "value": 458752
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_7",
+ "value": 462848
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_8",
+ "value": 524288
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_8",
+ "value": 528384
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_9",
+ "value": 589824
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_9",
+ "value": 593920
+ },
+ {
+ "name": "PERMISSION_SET_VENDOR_CATEGORY_10",
+ "value": 655360
+ },
+ {
+ "name": "PERMISSION_GET_VENDOR_CATEGORY_10",
+ "value": 659456
+ },
+ {
+ "name": "PERMISSION_NOT_ACCESSIBLE",
+ "value": 4026531840
+ }
+ ]
+ },
+ {
+ "name": "VehiclePropertyAccess",
+ "values": [
+ {
+ "name": "NONE",
+ "value": 0
+ },
+ {
+ "name": "READ",
+ "value": 1
+ },
+ {
+ "name": "WRITE",
+ "value": 2
+ },
+ {
+ "name": "READ_WRITE",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "VmsAvailabilityStateIntegerValuesIndex",
+ "values": [
+ {
+ "name": "MESSAGE_TYPE",
+ "value": 0
+ },
+ {
+ "name": "SEQUENCE_NUMBER",
+ "value": 1
+ },
+ {
+ "name": "NUMBER_OF_ASSOCIATED_LAYERS",
+ "value": 2
+ },
+ {
+ "name": "LAYERS_START",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "Obd2SparkIgnitionMonitors",
+ "values": []
+ },
+ {
+ "name": "VehicleTurnSignal",
+ "values": [
+ {
+ "name": "NONE",
+ "value": 0
+ },
+ {
+ "name": "RIGHT",
+ "value": 1
+ },
+ {
+ "name": "LEFT",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "VmsPublisherInformationIntegerValuesIndex",
+ "values": [
+ {
+ "name": "MESSAGE_TYPE",
+ "value": 0
+ },
+ {
+ "name": "PUBLISHER_ID",
+ "value": 1
+ }
+ ]
+ },
+ {
+ "name": "RotaryInputType",
+ "values": [
+ {
+ "name": "ROTARY_INPUT_TYPE_SYSTEM_NAVIGATION",
+ "value": 0
+ },
+ {
+ "name": "ROTARY_INPUT_TYPE_AUDIO_VOLUME",
+ "value": 1
+ }
+ ]
+ },
+ {
+ "name": "Obd2FuelSystemStatus",
+ "values": [
+ {
+ "name": "OPEN_INSUFFICIENT_ENGINE_TEMPERATURE",
+ "value": 1
+ },
+ {
+ "name": "CLOSED_LOOP",
+ "value": 2
+ },
+ {
+ "name": "OPEN_ENGINE_LOAD_OR_DECELERATION",
+ "value": 4
+ },
+ {
+ "name": "OPEN_SYSTEM_FAILURE",
+ "value": 8
+ },
+ {
+ "name": "CLOSED_LOOP_BUT_FEEDBACK_FAULT",
+ "value": 16
+ }
+ ]
+ }
+]
\ No newline at end of file
diff --git a/automotive/vehicle/aidl/emu_metadata/generate_emulator_metadata.py b/automotive/vehicle/aidl/emu_metadata/generate_emulator_metadata.py
new file mode 100755
index 0000000..b2eb172
--- /dev/null
+++ b/automotive/vehicle/aidl/emu_metadata/generate_emulator_metadata.py
@@ -0,0 +1,97 @@
+#!/usr/bin/python3
+
+#
+# Script for generation of VHAL properties metadata .json from AIDL interface
+#
+# This metadata is used to display human property names, names of enum
+# data types for their values, change and access modes and other information,
+# available from AIDL block comments, but not at runtime.
+#
+# Usage example:
+# ./emu_metadata/generate_emulator_metadata.py android/hardware/automotive/vehicle $OUT/android.hardware.automotive.vehicle-types-meta.json
+# (Note, that the resulting file has to match a '*types-meta.json' pattern to be parsed by the emulator).
+#
+
+import json
+import os
+import re
+import sys
+
+from pathlib import Path
+
+RE_ENUM = re.compile(r"\s*enum\s+(\w*) {\n(.*)}", re.MULTILINE | re.DOTALL)
+RE_COMMENT = re.compile(r"(?:(?:\/\*\*)((?:.|\n)*?)(?:\*\/))?(?:\n|^)\s*(\w*)(?:\s+=\s*)?((?:[a-zA-Z0-9]|\s|\+|)*),", re.DOTALL)
+RE_BLOCK_COMMENT_TITLE = re.compile("^(?:\s|\*)*((?:\w|\s|\.)*)\n(?:\s|\*)*(?:\n|$)")
+RE_BLOCK_COMMENT_ANNOTATION = re.compile("^(?:\s|\*)*@(\w*)\s+((?:\w|:)*)", re.MULTILINE)
+RE_HEX_NUMBER = re.compile("([0-9A-Fa-fxX]+)")
+
+
+class JEnum:
+ def __init__(self, name):
+ self.name = name
+ self.values = []
+
+
+class Converter:
+ # Only addition is supported for now, but that covers all existing properties except
+ # OBD diagnostics, which use bitwise shifts
+ def calculateValue(self, expression, default_value):
+ numbers = RE_HEX_NUMBER.findall(expression)
+ if len(numbers) == 0:
+ return default_value
+ result = 0
+ base = 10
+ if numbers[0].lower().startswith("0x"):
+ base = 16
+ for number in numbers:
+ result += int(number, base)
+ return result
+
+ def parseBlockComment(self, value, blockComment):
+ titles = RE_BLOCK_COMMENT_TITLE.findall(blockComment)
+ for title in titles:
+ value['name'] = title
+ break
+ annots_res = RE_BLOCK_COMMENT_ANNOTATION.findall(blockComment)
+ for annot in annots_res:
+ value[annot[0]] = annot[1]
+
+ def parseEnumContents(self, enum: JEnum, enumValue):
+ matches = RE_COMMENT.findall(enumValue)
+ defaultValue = 0
+ for match in matches:
+ value = dict()
+ value['name'] = match[1]
+ value['value'] = self.calculateValue(match[2], defaultValue)
+ defaultValue = value['value'] + 1
+ if enum.name == "VehicleProperty":
+ block_comment = match[0]
+ self.parseBlockComment(value, block_comment)
+ enum.values.append(value)
+
+ def convert(self, input):
+ text = Path(input).read_text()
+ matches = RE_ENUM.findall(text)
+ jenums = []
+ for match in matches:
+ enum = JEnum(match[0])
+ self.parseEnumContents(enum, match[1])
+ jenums.append(enum)
+ return jenums
+
+def main():
+ if (len(sys.argv) != 3):
+ print("Usage: ", sys.argv[0], " INPUT_PATH OUTPUT")
+ sys.exit(1)
+ aidl_path = sys.argv[1]
+ out_path = sys.argv[2]
+ result = []
+ for file in os.listdir(aidl_path):
+ result.extend(Converter().convert(os.path.join(aidl_path, file)))
+ json_result = json.dumps(result, default=vars, indent=2)
+ with open(out_path, 'w') as f:
+ f.write(json_result)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/biometrics/OWNERS b/biometrics/OWNERS
new file mode 100644
index 0000000..58998c1
--- /dev/null
+++ b/biometrics/OWNERS
@@ -0,0 +1,8 @@
+ilyamaty@google.com
+jeffpu@google.com
+jbolinger@google.com
+joshmccloskey@google.com
+diyab@google.com
+austindelgado@google.com
+spdonghao@google.com
+wenhuiy@google.com
diff --git a/bluetooth/1.0/default/test/fuzzer/Android.bp b/bluetooth/1.0/default/test/fuzzer/Android.bp
index 691136f..de2b46d 100644
--- a/bluetooth/1.0/default/test/fuzzer/Android.bp
+++ b/bluetooth/1.0/default/test/fuzzer/Android.bp
@@ -60,5 +60,13 @@
"android-media-fuzzing-reports@google.com",
],
componentid: 533764,
+ hotlists: [
+ "4593311",
+ ],
+ description: "The fuzzer targets the APIs of android.hardware.bluetooth@1.0-impl library",
+ vector: "local_no_privileges_required",
+ service_privilege: "privileged",
+ users: "multi_user",
+ fuzzed_code_usage: "shipped",
},
}
diff --git a/bluetooth/aidl/TEST_MAPPING b/bluetooth/aidl/TEST_MAPPING
index 342a1e4..18958d2 100644
--- a/bluetooth/aidl/TEST_MAPPING
+++ b/bluetooth/aidl/TEST_MAPPING
@@ -3,5 +3,10 @@
{
"name" : "VtsHalBluetoothTargetTest"
}
+ ],
+ "hwasan-presubmit" : [
+ {
+ "name" : "VtsHalBluetoothTargetTest"
+ }
]
}
diff --git a/bluetooth/aidl/default/BluetoothHci.cpp b/bluetooth/aidl/default/BluetoothHci.cpp
index d4e4b34..18a371d 100644
--- a/bluetooth/aidl/default/BluetoothHci.cpp
+++ b/bluetooth/aidl/default/BluetoothHci.cpp
@@ -117,11 +117,9 @@
strerror(errno));
return fd;
}
- if (int ret = SetTerminalRaw(mFd) < 0) {
- ALOGE("Could not make %s a raw terminal %d(%s)", mDevPath.c_str(), ret,
+ if (int ret = SetTerminalRaw(fd) < 0) {
+ ALOGI("Could not make %s a raw terminal %d(%s)", mDevPath.c_str(), ret,
strerror(errno));
- ::close(fd);
- return -1;
}
return fd;
}
@@ -176,7 +174,10 @@
mFdWatcher.WatchFdForNonBlockingReads(mFd,
[this](int) { mH4->OnDataReady(); });
- send(PacketType::COMMAND, reset);
+ ndk::ScopedAStatus result = send(PacketType::COMMAND, reset);
+ if (!result.isOk()) {
+ ALOGE("Error sending reset command");
+ }
auto status = resetFuture.wait_for(std::chrono::seconds(1));
mFdWatcher.StopWatchingFileDescriptors();
if (status == std::future_status::ready) {
@@ -303,30 +304,35 @@
ndk::ScopedAStatus BluetoothHci::sendHciCommand(
const std::vector<uint8_t>& packet) {
- send(PacketType::COMMAND, packet);
- return ndk::ScopedAStatus::ok();
+ return send(PacketType::COMMAND, packet);
}
ndk::ScopedAStatus BluetoothHci::sendAclData(
const std::vector<uint8_t>& packet) {
- send(PacketType::ACL_DATA, packet);
- return ndk::ScopedAStatus::ok();
+ return send(PacketType::ACL_DATA, packet);
}
ndk::ScopedAStatus BluetoothHci::sendScoData(
const std::vector<uint8_t>& packet) {
- send(PacketType::SCO_DATA, packet);
- return ndk::ScopedAStatus::ok();
+ return send(PacketType::SCO_DATA, packet);
}
ndk::ScopedAStatus BluetoothHci::sendIsoData(
const std::vector<uint8_t>& packet) {
- send(PacketType::ISO_DATA, packet);
- return ndk::ScopedAStatus::ok();
+ return send(PacketType::ISO_DATA, packet);
}
-void BluetoothHci::send(PacketType type, const std::vector<uint8_t>& v) {
+ndk::ScopedAStatus BluetoothHci::send(PacketType type,
+ const std::vector<uint8_t>& v) {
+ if (mH4 == nullptr) {
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+ }
+ if (v.empty()) {
+ ALOGE("Packet is empty, no data was found to be sent");
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ }
mH4->Send(type, v);
+ return ndk::ScopedAStatus::ok();
}
} // namespace aidl::android::hardware::bluetooth::impl
diff --git a/bluetooth/aidl/default/BluetoothHci.h b/bluetooth/aidl/default/BluetoothHci.h
index 85aafc8..477cc5c 100644
--- a/bluetooth/aidl/default/BluetoothHci.h
+++ b/bluetooth/aidl/default/BluetoothHci.h
@@ -66,8 +66,9 @@
::android::hardware::bluetooth::async::AsyncFdWatcher mFdWatcher;
int getFdFromDevPath();
- void send(::android::hardware::bluetooth::hci::PacketType type,
- const std::vector<uint8_t>& packet);
+ [[nodiscard]] ndk::ScopedAStatus send(
+ ::android::hardware::bluetooth::hci::PacketType type,
+ const std::vector<uint8_t>& packet);
std::unique_ptr<NetBluetoothMgmt> management_{};
// Send a reset command and discard all packets until a reset is received.
diff --git a/bluetooth/aidl/default/service.cpp b/bluetooth/aidl/default/service.cpp
index 9af2a08..ef4b884 100644
--- a/bluetooth/aidl/default/service.cpp
+++ b/bluetooth/aidl/default/service.cpp
@@ -30,7 +30,7 @@
int main(int /* argc */, char** /* argv */) {
ALOGI("Bluetooth HAL starting");
- if (!ABinderProcess_setThreadPoolMaxThreadCount(1)) {
+ if (!ABinderProcess_setThreadPoolMaxThreadCount(0)) {
ALOGI("failed to set thread pool max thread count");
return 1;
}
diff --git a/bluetooth/aidl/vts/Android.bp b/bluetooth/aidl/vts/Android.bp
index 414f707..5fc0b2e 100644
--- a/bluetooth/aidl/vts/Android.bp
+++ b/bluetooth/aidl/vts/Android.bp
@@ -13,7 +13,17 @@
"VtsHalTargetTestDefaults",
"use_libaidlvintf_gtest_helper_static",
],
- srcs: ["VtsHalBluetoothTargetTest.cpp"],
+ srcs: [
+ "VtsHalBluetoothTargetTest.cpp",
+ ":BluetoothPacketSources",
+ ":BluetoothHciPacketSources",
+ ],
+ generated_headers: [
+ "BluetoothGeneratedPackets_h",
+ ],
+ include_dirs: [
+ "packages/modules/Bluetooth/system/gd",
+ ],
shared_libs: [
"libbase",
"libbinder_ndk",
@@ -45,4 +55,8 @@
tidy_flags: [
"--header-filter=^.*tools\\/rootcanal\\/(model|include|net|desktop)\\/(.(?!\\.pb\\.h))*$",
],
+ tidy_disabled_srcs: [
+ ":BluetoothPacketSources",
+ ":BluetoothHciPacketSources",
+ ],
}
diff --git a/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp b/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp
index 3704c3d..529e092 100644
--- a/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp
+++ b/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp
@@ -24,27 +24,50 @@
#include <android/binder_manager.h>
#include <android/binder_process.h>
#include <binder/IServiceManager.h>
-#include <binder/ProcessState.h>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <future>
-#include <mutex>
#include <queue>
#include <thread>
+#include <utility>
#include <vector>
+// TODO: Remove custom logging defines from PDL packets.
+#undef LOG_INFO
+#undef LOG_DEBUG
+#undef LOG_TAG
+#define LOG_TAG "VtsHalBluetooth"
+#include "hci/hci_packets.h"
+#include "packet/raw_builder.h"
+
using aidl::android::hardware::bluetooth::IBluetoothHci;
using aidl::android::hardware::bluetooth::IBluetoothHciCallbacks;
using aidl::android::hardware::bluetooth::Status;
using ndk::ScopedAStatus;
using ndk::SpAIBinder;
-// Bluetooth Core Specification 3.0 + HS
-static constexpr uint8_t kHciMinimumHciVersion = 5;
-// Bluetooth Core Specification 3.0 + HS
-static constexpr uint8_t kHciMinimumLmpVersion = 5;
+using ::bluetooth::hci::CommandBuilder;
+using ::bluetooth::hci::CommandCompleteView;
+using ::bluetooth::hci::CommandView;
+using ::bluetooth::hci::ErrorCode;
+using ::bluetooth::hci::EventView;
+using ::bluetooth::hci::LeReadLocalSupportedFeaturesBuilder;
+using ::bluetooth::hci::LeReadLocalSupportedFeaturesCompleteView;
+using ::bluetooth::hci::LeReadNumberOfSupportedAdvertisingSetsBuilder;
+using ::bluetooth::hci::LeReadNumberOfSupportedAdvertisingSetsCompleteView;
+using ::bluetooth::hci::LeReadResolvingListSizeBuilder;
+using ::bluetooth::hci::LeReadResolvingListSizeCompleteView;
+using ::bluetooth::hci::LLFeaturesBits;
+using ::bluetooth::hci::OpCode;
+using ::bluetooth::hci::OpCodeText;
+using ::bluetooth::hci::PacketView;
+using ::bluetooth::hci::ReadLocalVersionInformationBuilder;
+using ::bluetooth::hci::ReadLocalVersionInformationCompleteView;
+
+static constexpr uint8_t kMinLeAdvSetForBt5 = 16;
+static constexpr uint8_t kMinLeResolvingListForBt5 = 8;
static constexpr size_t kNumHciCommandsBandwidth = 100;
static constexpr size_t kNumScoPacketsBandwidth = 100;
@@ -55,65 +78,14 @@
static constexpr std::chrono::milliseconds kWaitForAclDataTimeout(1000);
static constexpr std::chrono::milliseconds kInterfaceCloseDelayMs(200);
-static constexpr uint8_t kCommandHciShouldBeUnknown[] = {
- 0xff, 0x3B, 0x08, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
-static constexpr uint8_t kCommandHciReadLocalVersionInformation[] = {0x01, 0x10,
- 0x00};
-static constexpr uint8_t kCommandHciReadBufferSize[] = {0x05, 0x10, 0x00};
-static constexpr uint8_t kCommandHciWriteLoopbackModeLocal[] = {0x02, 0x18,
- 0x01, 0x01};
-static constexpr uint8_t kCommandHciReset[] = {0x03, 0x0c, 0x00};
-static constexpr uint8_t kCommandHciSynchronousFlowControlEnable[] = {
- 0x2f, 0x0c, 0x01, 0x01};
-static constexpr uint8_t kCommandHciWriteLocalName[] = {0x13, 0x0c, 0xf8};
-static constexpr uint8_t kHciStatusSuccess = 0x00;
-static constexpr uint8_t kHciStatusUnknownHciCommand = 0x01;
-
-static constexpr uint8_t kEventConnectionComplete = 0x03;
-static constexpr uint8_t kEventCommandComplete = 0x0e;
-static constexpr uint8_t kEventCommandStatus = 0x0f;
-static constexpr uint8_t kEventNumberOfCompletedPackets = 0x13;
-static constexpr uint8_t kEventLoopbackCommand = 0x19;
-
-static constexpr size_t kEventCodeByte = 0;
-static constexpr size_t kEventLengthByte = 1;
-static constexpr size_t kEventFirstPayloadByte = 2;
-static constexpr size_t kEventCommandStatusStatusByte = 2;
-static constexpr size_t kEventCommandStatusOpcodeLsByte = 4; // Bytes 4 and 5
-static constexpr size_t kEventCommandCompleteOpcodeLsByte = 3; // Bytes 3 and 4
-static constexpr size_t kEventCommandCompleteStatusByte = 5;
-static constexpr size_t kEventCommandCompleteFirstParamByte = 6;
-static constexpr size_t kEventLocalHciVersionByte =
- kEventCommandCompleteFirstParamByte;
-static constexpr size_t kEventLocalLmpVersionByte =
- kEventLocalHciVersionByte + 3;
-
-static constexpr size_t kEventConnectionCompleteParamLength = 11;
-static constexpr size_t kEventConnectionCompleteType = 11;
-static constexpr size_t kEventConnectionCompleteTypeSco = 0;
-static constexpr size_t kEventConnectionCompleteTypeAcl = 1;
-static constexpr size_t kEventConnectionCompleteHandleLsByte = 3;
-
-static constexpr size_t kEventNumberOfCompletedPacketsNumHandles = 2;
-
-static constexpr size_t kAclBroadcastFlagOffset = 6;
-static constexpr uint8_t kAclBroadcastFlagPointToPoint = 0x0;
-static constexpr uint8_t kAclBroadcastPointToPoint =
- (kAclBroadcastFlagPointToPoint << kAclBroadcastFlagOffset);
-
-static constexpr uint8_t kAclPacketBoundaryFlagOffset = 4;
-static constexpr uint8_t kAclPacketBoundaryFlagFirstAutoFlushable = 0x2;
-static constexpr uint8_t kAclPacketBoundaryFirstAutoFlushable =
- kAclPacketBoundaryFlagFirstAutoFlushable << kAclPacketBoundaryFlagOffset;
-
// To discard Qualcomm ACL debugging
static constexpr uint16_t kAclHandleQcaDebugMessage = 0xedc;
class ThroughputLogger {
public:
- ThroughputLogger(std::string task)
+ explicit ThroughputLogger(std::string task)
: total_bytes_(0),
- task_(task),
+ task_(std::move(task)),
start_time_(std::chrono::steady_clock::now()) {}
~ThroughputLogger() {
@@ -142,7 +114,7 @@
// The main test class for Bluetooth HAL.
class BluetoothAidlTest : public ::testing::TestWithParam<std::string> {
public:
- virtual void SetUp() override {
+ void SetUp() override {
// currently test passthrough mode only
hci = IBluetoothHci::fromBinder(
SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
@@ -158,7 +130,7 @@
ASSERT_NE(bluetooth_hci_death_recipient, nullptr);
ASSERT_EQ(STATUS_OK,
AIBinder_linkToDeath(hci->asBinder().get(),
- bluetooth_hci_death_recipient, 0));
+ bluetooth_hci_death_recipient, nullptr));
hci_cb = ndk::SharedRefBase::make<BluetoothHciCallbacks>(*this);
ASSERT_NE(hci_cb, nullptr);
@@ -179,7 +151,7 @@
ASSERT_TRUE(future.get());
}
- virtual void TearDown() override {
+ void TearDown() override {
ALOGI("TearDown");
// Should not be checked in production code
ASSERT_TRUE(hci->close().isOk());
@@ -205,8 +177,14 @@
void handle_no_ops();
void discard_qca_debugging();
void wait_for_event(bool timeout_is_error);
- void wait_for_command_complete_event(std::vector<uint8_t> cmd);
+ void wait_for_command_complete_event(OpCode opCode,
+ std::vector<uint8_t>& complete_event);
+ // Wait until a command complete is received.
+ // Command complete will be consumed after this method
+ void wait_and_validate_command_complete_event(OpCode opCode);
int wait_for_completed_packets_event(uint16_t handle);
+ void send_and_wait_for_cmd_complete(std::unique_ptr<CommandBuilder> cmd,
+ std::vector<uint8_t>& cmd_complete);
// A simple test implementation of BluetoothHciCallbacks.
class BluetoothHciCallbacks
@@ -214,36 +192,41 @@
BluetoothAidlTest& parent_;
public:
- BluetoothHciCallbacks(BluetoothAidlTest& parent) : parent_(parent){};
+ explicit BluetoothHciCallbacks(BluetoothAidlTest& parent)
+ : parent_(parent){};
- virtual ~BluetoothHciCallbacks() = default;
+ ~BluetoothHciCallbacks() override = default;
- ndk::ScopedAStatus initializationComplete(Status status) {
+ ndk::ScopedAStatus initializationComplete(Status status) override {
parent_.initialized_promise.set_value(status == Status::SUCCESS);
ALOGV("%s (status = %d)", __func__, static_cast<int>(status));
return ScopedAStatus::ok();
};
- ndk::ScopedAStatus hciEventReceived(const std::vector<uint8_t>& event) {
+ ndk::ScopedAStatus hciEventReceived(
+ const std::vector<uint8_t>& event) override {
parent_.event_cb_count++;
parent_.event_queue.push(event);
- ALOGV("Event received (length = %d)", static_cast<int>(event.size()));
+ ALOGI("Event received (length = %d)", static_cast<int>(event.size()));
return ScopedAStatus::ok();
};
- ndk::ScopedAStatus aclDataReceived(const std::vector<uint8_t>& data) {
+ ndk::ScopedAStatus aclDataReceived(
+ const std::vector<uint8_t>& data) override {
parent_.acl_cb_count++;
parent_.acl_queue.push(data);
return ScopedAStatus::ok();
};
- ndk::ScopedAStatus scoDataReceived(const std::vector<uint8_t>& data) {
+ ndk::ScopedAStatus scoDataReceived(
+ const std::vector<uint8_t>& data) override {
parent_.sco_cb_count++;
parent_.sco_queue.push(data);
return ScopedAStatus::ok();
};
- ndk::ScopedAStatus isoDataReceived(const std::vector<uint8_t>& data) {
+ ndk::ScopedAStatus isoDataReceived(
+ const std::vector<uint8_t>& data) override {
parent_.iso_cb_count++;
parent_.iso_queue.push(data);
return ScopedAStatus::ok();
@@ -253,7 +236,8 @@
template <class T>
class WaitQueue {
public:
- WaitQueue(){};
+ WaitQueue() = default;
+ ;
virtual ~WaitQueue() = default;
@@ -283,6 +267,14 @@
return true;
};
+ void pop() {
+ std::lock_guard<std::mutex> lock(m_);
+ if (q_.empty()) {
+ return;
+ }
+ q_.pop();
+ };
+
bool front(T& v) {
std::lock_guard<std::mutex> lock(m_);
if (q_.empty()) {
@@ -329,22 +321,22 @@
std::shared_ptr<IBluetoothHci> hci;
std::shared_ptr<BluetoothHciCallbacks> hci_cb;
- AIBinder_DeathRecipient* bluetooth_hci_death_recipient;
+ AIBinder_DeathRecipient* bluetooth_hci_death_recipient{};
WaitQueue<std::vector<uint8_t>> event_queue;
WaitQueue<std::vector<uint8_t>> acl_queue;
WaitQueue<std::vector<uint8_t>> sco_queue;
WaitQueue<std::vector<uint8_t>> iso_queue;
std::promise<bool> initialized_promise;
- int event_cb_count;
- int sco_cb_count;
- int acl_cb_count;
- int iso_cb_count;
+ int event_cb_count{};
+ int sco_cb_count{};
+ int acl_cb_count{};
+ int iso_cb_count{};
- int max_acl_data_packet_length;
- int max_sco_data_packet_length;
- int max_acl_data_packets;
- int max_sco_data_packets;
+ int max_acl_data_packet_length{};
+ int max_sco_data_packet_length{};
+ int max_acl_data_packets{};
+ int max_sco_data_packets{};
std::vector<uint16_t> sco_connection_handles;
std::vector<uint16_t> acl_connection_handles;
@@ -355,17 +347,20 @@
while (!event_queue.empty()) {
std::vector<uint8_t> event;
event_queue.front(event);
- ASSERT_GE(event.size(),
- static_cast<size_t>(kEventCommandCompleteStatusByte));
- bool event_is_no_op =
- (event[kEventCodeByte] == kEventCommandComplete) &&
- (event[kEventCommandCompleteOpcodeLsByte] == 0x00) &&
- (event[kEventCommandCompleteOpcodeLsByte + 1] == 0x00);
- event_is_no_op |= (event[kEventCodeByte] == kEventCommandStatus) &&
- (event[kEventCommandStatusOpcodeLsByte] == 0x00) &&
- (event[kEventCommandStatusOpcodeLsByte + 1] == 0x00);
- if (event_is_no_op) {
- event_queue.pop(event);
+ auto complete_view = ::bluetooth::hci::CommandCompleteView::Create(
+ ::bluetooth::hci::EventView::Create(::bluetooth::hci::PacketView<true>(
+ std::make_shared<std::vector<uint8_t>>(event))));
+ auto status_view = ::bluetooth::hci::CommandCompleteView::Create(
+ ::bluetooth::hci::EventView::Create(::bluetooth::hci::PacketView<true>(
+ std::make_shared<std::vector<uint8_t>>(event))));
+ bool is_complete_no_op =
+ complete_view.IsValid() &&
+ complete_view.GetCommandOpCode() == ::bluetooth::hci::OpCode::NONE;
+ bool is_status_no_op =
+ status_view.IsValid() &&
+ status_view.GetCommandOpCode() == ::bluetooth::hci::OpCode::NONE;
+ if (is_complete_no_op || is_status_no_op) {
+ event_queue.pop();
} else {
break;
}
@@ -377,12 +372,12 @@
while (!acl_queue.empty()) {
std::vector<uint8_t> acl_packet;
acl_queue.front(acl_packet);
- uint16_t connection_handle = acl_packet[1] & 0xF;
- connection_handle <<= 8;
- connection_handle |= acl_packet[0];
- bool packet_is_no_op = connection_handle == kAclHandleQcaDebugMessage;
- if (packet_is_no_op) {
- acl_queue.pop(acl_packet);
+ auto acl_view =
+ ::bluetooth::hci::AclView::Create(::bluetooth::hci::PacketView<true>(
+ std::make_shared<std::vector<uint8_t>>(acl_packet)));
+ EXPECT_TRUE(acl_view.IsValid());
+ if (acl_view.GetHandle() == kAclHandleQcaDebugMessage) {
+ acl_queue.pop();
} else {
break;
}
@@ -407,48 +402,49 @@
}
}
-// Wait until a command complete is received.
void BluetoothAidlTest::wait_for_command_complete_event(
- std::vector<uint8_t> cmd) {
+ OpCode opCode, std::vector<uint8_t>& complete_event) {
ASSERT_NO_FATAL_FAILURE(wait_for_event());
- std::vector<uint8_t> event;
ASSERT_FALSE(event_queue.empty());
- ASSERT_TRUE(event_queue.pop(event));
+ ASSERT_TRUE(event_queue.pop(complete_event));
+ auto complete_view = ::bluetooth::hci::CommandCompleteView::Create(
+ ::bluetooth::hci::EventView::Create(::bluetooth::hci::PacketView<true>(
+ std::make_shared<std::vector<uint8_t>>(complete_event))));
+ ASSERT_TRUE(complete_view.IsValid());
+ ASSERT_EQ(complete_view.GetCommandOpCode(), opCode);
+ ASSERT_EQ(complete_view.GetPayload()[0],
+ static_cast<uint8_t>(::bluetooth::hci::ErrorCode::SUCCESS));
+}
- ASSERT_GT(event.size(), static_cast<size_t>(kEventCommandCompleteStatusByte));
- ASSERT_EQ(kEventCommandComplete, event[kEventCodeByte]);
- ASSERT_EQ(cmd[0], event[kEventCommandCompleteOpcodeLsByte]);
- ASSERT_EQ(cmd[1], event[kEventCommandCompleteOpcodeLsByte + 1]);
- ASSERT_EQ(kHciStatusSuccess, event[kEventCommandCompleteStatusByte]);
+void BluetoothAidlTest::wait_and_validate_command_complete_event(
+ ::bluetooth::hci::OpCode opCode) {
+ std::vector<uint8_t> complete_event;
+ ASSERT_NO_FATAL_FAILURE(
+ wait_for_command_complete_event(opCode, complete_event));
}
// Send the command to read the controller's buffer sizes.
void BluetoothAidlTest::setBufferSizes() {
- std::vector<uint8_t> cmd{
- kCommandHciReadBufferSize,
- kCommandHciReadBufferSize + sizeof(kCommandHciReadBufferSize)};
+ std::vector<uint8_t> cmd;
+ ::bluetooth::packet::BitInserter bi{cmd};
+ ::bluetooth::hci::ReadBufferSizeBuilder::Create()->Serialize(bi);
hci->sendHciCommand(cmd);
ASSERT_NO_FATAL_FAILURE(wait_for_event());
- if (event_queue.empty()) {
- return;
- }
std::vector<uint8_t> event;
ASSERT_TRUE(event_queue.pop(event));
+ auto complete_view = ::bluetooth::hci::ReadBufferSizeCompleteView::Create(
+ ::bluetooth::hci::CommandCompleteView::Create(
+ ::bluetooth::hci::EventView::Create(
+ ::bluetooth::hci::PacketView<true>(
+ std::make_shared<std::vector<uint8_t>>(event)))));
- ASSERT_EQ(kEventCommandComplete, event[kEventCodeByte]);
- ASSERT_EQ(cmd[0], event[kEventCommandCompleteOpcodeLsByte]);
- ASSERT_EQ(cmd[1], event[kEventCommandCompleteOpcodeLsByte + 1]);
- ASSERT_EQ(kHciStatusSuccess, event[kEventCommandCompleteStatusByte]);
-
- max_acl_data_packet_length =
- event[kEventCommandCompleteStatusByte + 1] +
- (event[kEventCommandCompleteStatusByte + 2] << 8);
- max_sco_data_packet_length = event[kEventCommandCompleteStatusByte + 3];
- max_acl_data_packets = event[kEventCommandCompleteStatusByte + 4] +
- (event[kEventCommandCompleteStatusByte + 5] << 8);
- max_sco_data_packets = event[kEventCommandCompleteStatusByte + 6] +
- (event[kEventCommandCompleteStatusByte + 7] << 8);
+ ASSERT_TRUE(complete_view.IsValid());
+ ASSERT_EQ(complete_view.GetStatus(), ::bluetooth::hci::ErrorCode::SUCCESS);
+ max_acl_data_packet_length = complete_view.GetAclDataPacketLength();
+ max_sco_data_packet_length = complete_view.GetSynchronousDataPacketLength();
+ max_acl_data_packets = complete_view.GetTotalNumAclDataPackets();
+ max_sco_data_packets = complete_view.GetTotalNumSynchronousDataPackets();
ALOGD("%s: ACL max %d num %d SCO max %d num %d", __func__,
static_cast<int>(max_acl_data_packet_length),
@@ -459,39 +455,39 @@
// Enable flow control packets for SCO
void BluetoothAidlTest::setSynchronousFlowControlEnable() {
- std::vector<uint8_t> cmd{kCommandHciSynchronousFlowControlEnable,
- kCommandHciSynchronousFlowControlEnable +
- sizeof(kCommandHciSynchronousFlowControlEnable)};
+ std::vector<uint8_t> cmd;
+ ::bluetooth::packet::BitInserter bi{cmd};
+ ::bluetooth::hci::WriteSynchronousFlowControlEnableBuilder::Create(
+ ::bluetooth::hci::Enable::ENABLED)
+ ->Serialize(bi);
hci->sendHciCommand(cmd);
- wait_for_command_complete_event(cmd);
+ wait_and_validate_command_complete_event(
+ ::bluetooth::hci::OpCode::WRITE_SYNCHRONOUS_FLOW_CONTROL_ENABLE);
}
// Send an HCI command (in Loopback mode) and check the response.
void BluetoothAidlTest::sendAndCheckHci(int num_packets) {
- ThroughputLogger logger = {__func__};
- int command_size = 0;
+ ThroughputLogger logger{__func__};
+ size_t command_size = 0;
+ char new_name[] = "John Jacob Jingleheimer Schmidt ___________________";
+ size_t new_name_length = strlen(new_name);
for (int n = 0; n < num_packets; n++) {
- // Send an HCI packet
- std::vector<uint8_t> write_name{
- kCommandHciWriteLocalName,
- kCommandHciWriteLocalName + sizeof(kCommandHciWriteLocalName)};
- // With a name
- char new_name[] = "John Jacob Jingleheimer Schmidt ___________________0";
- size_t new_name_length = strlen(new_name);
+ // The name to set is new_name
+ std::array<uint8_t, 248> name_array{};
for (size_t i = 0; i < new_name_length; i++) {
- write_name.push_back(static_cast<uint8_t>(new_name[i]));
+ name_array[i] = new_name[i];
}
// And the packet number
- size_t i = new_name_length - 1;
- for (int digits = n; digits > 0; digits = digits / 10, i--) {
- write_name[i] = static_cast<uint8_t>('0' + digits % 10);
+ char number[11] = "0000000000";
+ snprintf(number, sizeof(number), "%010d", static_cast<int>(n));
+ for (size_t i = new_name_length; i < new_name_length + sizeof(number) - 1;
+ i++) {
+ name_array[new_name_length + i] = number[i];
}
- // And padding
- for (size_t i = 0; i < 248 - new_name_length; i++) {
- write_name.push_back(static_cast<uint8_t>(0));
- }
-
+ std::vector<uint8_t> write_name;
+ ::bluetooth::packet::BitInserter bi{write_name};
+ ::bluetooth::hci::WriteLocalNameBuilder::Create(name_array)->Serialize(bi);
hci->sendHciCommand(write_name);
// Check the loopback of the HCI packet
@@ -499,28 +495,17 @@
std::vector<uint8_t> event;
ASSERT_TRUE(event_queue.pop(event));
-
- size_t compare_length = (write_name.size() > static_cast<size_t>(0xff)
- ? static_cast<size_t>(0xff)
- : write_name.size());
- ASSERT_GT(event.size(), compare_length + kEventFirstPayloadByte - 1);
-
- ASSERT_EQ(kEventLoopbackCommand, event[kEventCodeByte]);
- ASSERT_EQ(compare_length, event[kEventLengthByte]);
-
- // Don't compare past the end of the event.
- if (compare_length + kEventFirstPayloadByte > event.size()) {
- compare_length = event.size() - kEventFirstPayloadByte;
- ALOGE("Only comparing %d bytes", static_cast<int>(compare_length));
- }
+ auto event_view = ::bluetooth::hci::LoopbackCommandView::Create(
+ ::bluetooth::hci::EventView::Create(::bluetooth::hci::PacketView<true>(
+ std::make_shared<std::vector<uint8_t>>(event))));
+ ASSERT_TRUE(event_view.IsValid());
+ std::vector<uint8_t> looped_back_command{event_view.GetPayload().begin(),
+ event_view.GetPayload().end()};
+ ASSERT_EQ(looped_back_command, write_name);
if (n == num_packets - 1) {
command_size = write_name.size();
}
-
- for (size_t i = 0; i < compare_length; i++) {
- ASSERT_EQ(write_name[i], event[kEventFirstPayloadByte + i]);
- }
}
logger.setTotalBytes(command_size * num_packets * 2);
}
@@ -528,16 +513,18 @@
// Send a SCO data packet (in Loopback mode) and check the response.
void BluetoothAidlTest::sendAndCheckSco(int num_packets, size_t size,
uint16_t handle) {
- ThroughputLogger logger = {__func__};
+ ThroughputLogger logger{__func__};
for (int n = 0; n < num_packets; n++) {
// Send a SCO packet
std::vector<uint8_t> sco_packet;
- sco_packet.push_back(static_cast<uint8_t>(handle & 0xff));
- sco_packet.push_back(static_cast<uint8_t>((handle & 0x0f00) >> 8));
- sco_packet.push_back(static_cast<uint8_t>(size & 0xff));
+ std::vector<uint8_t> payload;
for (size_t i = 0; i < size; i++) {
- sco_packet.push_back(static_cast<uint8_t>(i + n));
+ payload.push_back(static_cast<uint8_t>(i + n));
}
+ ::bluetooth::packet::BitInserter bi{sco_packet};
+ ::bluetooth::hci::ScoBuilder::Create(
+ handle, ::bluetooth::hci::PacketStatusFlag::CORRECTLY_RECEIVED, payload)
+ ->Serialize(bi);
hci->sendScoData(sco_packet);
// Check the loopback of the SCO packet
@@ -545,21 +532,7 @@
ASSERT_TRUE(
sco_queue.tryPopWithTimeout(sco_loopback, kWaitForScoDataTimeout));
- ASSERT_EQ(sco_packet.size(), sco_loopback.size());
- size_t successful_bytes = 0;
-
- for (size_t i = 0; i < sco_packet.size(); i++) {
- if (sco_packet[i] == sco_loopback[i]) {
- successful_bytes = i;
- } else {
- ALOGE("Miscompare at %d (expected %x, got %x)", static_cast<int>(i),
- sco_packet[i], sco_loopback[i]);
- ALOGE("At %d (expected %x, got %x)", static_cast<int>(i + 1),
- sco_packet[i + 1], sco_loopback[i + 1]);
- break;
- }
- }
- ASSERT_EQ(sco_packet.size(), successful_bytes + 1);
+ ASSERT_EQ(sco_packet, sco_loopback);
}
logger.setTotalBytes(num_packets * size * 2);
}
@@ -567,19 +540,20 @@
// Send an ACL data packet (in Loopback mode) and check the response.
void BluetoothAidlTest::sendAndCheckAcl(int num_packets, size_t size,
uint16_t handle) {
- ThroughputLogger logger = {__func__};
+ ThroughputLogger logger{__func__};
for (int n = 0; n < num_packets; n++) {
- // Send an ACL packet
- std::vector<uint8_t> acl_packet;
- acl_packet.push_back(static_cast<uint8_t>(handle & 0xff));
- acl_packet.push_back(static_cast<uint8_t>((handle & 0x0f00) >> 8) |
- kAclBroadcastPointToPoint |
- kAclPacketBoundaryFirstAutoFlushable);
- acl_packet.push_back(static_cast<uint8_t>(size & 0xff));
- acl_packet.push_back(static_cast<uint8_t>((size & 0xff00) >> 8));
+ // Send an ACL packet with counting data
+ auto payload = std::make_unique<::bluetooth::packet::RawBuilder>();
for (size_t i = 0; i < size; i++) {
- acl_packet.push_back(static_cast<uint8_t>(i + n));
+ payload->AddOctets1(static_cast<uint8_t>(i + n));
}
+ std::vector<uint8_t> acl_packet;
+ ::bluetooth::packet::BitInserter bi{acl_packet};
+ ::bluetooth::hci::AclBuilder::Create(
+ handle,
+ ::bluetooth::hci::PacketBoundaryFlag::FIRST_AUTOMATICALLY_FLUSHABLE,
+ ::bluetooth::hci::BroadcastFlag::POINT_TO_POINT, std::move(payload))
+ ->Serialize(bi);
hci->sendAclData(acl_packet);
std::vector<uint8_t> acl_loopback;
@@ -587,21 +561,7 @@
ASSERT_TRUE(
acl_queue.tryPopWithTimeout(acl_loopback, kWaitForAclDataTimeout));
- ASSERT_EQ(acl_packet.size(), acl_loopback.size());
- size_t successful_bytes = 0;
-
- for (size_t i = 0; i < acl_packet.size(); i++) {
- if (acl_packet[i] == acl_loopback[i]) {
- successful_bytes = i;
- } else {
- ALOGE("Miscompare at %d (expected %x, got %x)", static_cast<int>(i),
- acl_packet[i], acl_loopback[i]);
- ALOGE("At %d (expected %x, got %x)", static_cast<int>(i + 1),
- acl_packet[i + 1], acl_loopback[i + 1]);
- break;
- }
- }
- ASSERT_EQ(acl_packet.size(), successful_bytes + 1);
+ ASSERT_EQ(acl_packet, acl_loopback);
}
logger.setTotalBytes(num_packets * size * 2);
}
@@ -620,23 +580,29 @@
}
std::vector<uint8_t> event;
EXPECT_TRUE(event_queue.pop(event));
-
- EXPECT_EQ(kEventNumberOfCompletedPackets, event[kEventCodeByte]);
- EXPECT_EQ(1, event[kEventNumberOfCompletedPacketsNumHandles]);
-
- uint16_t event_handle = event[3] + (event[4] << 8);
- EXPECT_EQ(handle, event_handle);
-
- packets_processed += event[5] + (event[6] << 8);
+ auto event_view = ::bluetooth::hci::NumberOfCompletedPacketsView::Create(
+ ::bluetooth::hci::EventView::Create(::bluetooth::hci::PacketView<true>(
+ std::make_shared<std::vector<uint8_t>>(event))));
+ if (!event_view.IsValid()) {
+ ADD_FAILURE();
+ return packets_processed;
+ }
+ auto completed_packets = event_view.GetCompletedPackets();
+ for (const auto& entry : completed_packets) {
+ EXPECT_EQ(handle, entry.connection_handle_);
+ packets_processed += entry.host_num_of_completed_packets_;
+ }
}
return packets_processed;
}
// Send local loopback command and initialize SCO and ACL handles.
void BluetoothAidlTest::enterLoopbackMode() {
- std::vector<uint8_t> cmd{kCommandHciWriteLoopbackModeLocal,
- kCommandHciWriteLoopbackModeLocal +
- sizeof(kCommandHciWriteLoopbackModeLocal)};
+ std::vector<uint8_t> cmd;
+ ::bluetooth::packet::BitInserter bi{cmd};
+ ::bluetooth::hci::WriteLoopbackModeBuilder::Create(
+ bluetooth::hci::LoopbackMode::ENABLE_LOCAL)
+ ->Serialize(bi);
hci->sendHciCommand(cmd);
// Receive connection complete events with data channels
@@ -652,97 +618,128 @@
}
std::vector<uint8_t> event;
ASSERT_TRUE(event_queue.pop(event));
- ASSERT_GT(event.size(),
- static_cast<size_t>(kEventCommandCompleteStatusByte));
- if (event[kEventCodeByte] == kEventConnectionComplete) {
- ASSERT_GT(event.size(),
- static_cast<size_t>(kEventConnectionCompleteType));
- ASSERT_EQ(event[kEventLengthByte], kEventConnectionCompleteParamLength);
- uint8_t connection_type = event[kEventConnectionCompleteType];
+ auto event_view =
+ ::bluetooth::hci::EventView::Create(::bluetooth::hci::PacketView<true>(
+ std::make_shared<std::vector<uint8_t>>(event)));
+ ASSERT_TRUE(event_view.IsValid());
- ASSERT_TRUE(connection_type == kEventConnectionCompleteTypeSco ||
- connection_type == kEventConnectionCompleteTypeAcl);
-
- // Save handles
- uint16_t handle = event[kEventConnectionCompleteHandleLsByte] |
- event[kEventConnectionCompleteHandleLsByte + 1] << 8;
- if (connection_type == kEventConnectionCompleteTypeSco) {
- sco_connection_handles.push_back(handle);
- } else {
- acl_connection_handles.push_back(handle);
+ if (event_view.GetEventCode() ==
+ ::bluetooth::hci::EventCode::CONNECTION_COMPLETE) {
+ auto complete_view =
+ ::bluetooth::hci::ConnectionCompleteView::Create(event_view);
+ ASSERT_TRUE(complete_view.IsValid());
+ switch (complete_view.GetLinkType()) {
+ case ::bluetooth::hci::LinkType::ACL:
+ acl_connection_handles.push_back(complete_view.GetConnectionHandle());
+ break;
+ case ::bluetooth::hci::LinkType::SCO:
+ sco_connection_handles.push_back(complete_view.GetConnectionHandle());
+ break;
+ default:
+ ASSERT_EQ(complete_view.GetLinkType(),
+ ::bluetooth::hci::LinkType::ACL);
}
-
- ALOGD("Connect complete type = %d handle = %d",
- event[kEventConnectionCompleteType], handle);
connection_event_count++;
} else {
- ASSERT_EQ(kEventCommandComplete, event[kEventCodeByte]);
- ASSERT_EQ(cmd[0], event[kEventCommandCompleteOpcodeLsByte]);
- ASSERT_EQ(cmd[1], event[kEventCommandCompleteOpcodeLsByte + 1]);
- ASSERT_EQ(kHciStatusSuccess, event[kEventCommandCompleteStatusByte]);
+ auto command_complete_view =
+ ::bluetooth::hci::WriteLoopbackModeCompleteView::Create(
+ ::bluetooth::hci::CommandCompleteView::Create(event_view));
+ ASSERT_TRUE(command_complete_view.IsValid());
+ ASSERT_EQ(::bluetooth::hci::ErrorCode::SUCCESS,
+ command_complete_view.GetStatus());
command_complete_received = true;
}
}
}
+void BluetoothAidlTest::send_and_wait_for_cmd_complete(
+ std::unique_ptr<CommandBuilder> cmd, std::vector<uint8_t>& cmd_complete) {
+ std::vector<uint8_t> cmd_bytes = cmd->SerializeToBytes();
+ hci->sendHciCommand(cmd_bytes);
+
+ auto view = CommandView::Create(
+ PacketView<true>(std::make_shared<std::vector<uint8_t>>(cmd_bytes)));
+ ASSERT_TRUE(view.IsValid());
+ ALOGI("Waiting for %s[0x%x]", OpCodeText(view.GetOpCode()).c_str(),
+ static_cast<int>(view.GetOpCode()));
+ ASSERT_NO_FATAL_FAILURE(
+ wait_for_command_complete_event(view.GetOpCode(), cmd_complete));
+}
+
// Empty test: Initialize()/Close() are called in SetUp()/TearDown().
TEST_P(BluetoothAidlTest, InitializeAndClose) {}
// Send an HCI Reset with sendHciCommand and wait for a command complete event.
TEST_P(BluetoothAidlTest, HciReset) {
- std::vector<uint8_t> reset{kCommandHciReset,
- kCommandHciReset + sizeof(kCommandHciReset)};
+ std::vector<uint8_t> reset;
+ ::bluetooth::packet::BitInserter bi{reset};
+ ::bluetooth::hci::ResetBuilder::Create()->Serialize(bi);
hci->sendHciCommand(reset);
- wait_for_command_complete_event(reset);
+ wait_and_validate_command_complete_event(::bluetooth::hci::OpCode::RESET);
}
// Read and check the HCI version of the controller.
TEST_P(BluetoothAidlTest, HciVersionTest) {
- std::vector<uint8_t> cmd{kCommandHciReadLocalVersionInformation,
- kCommandHciReadLocalVersionInformation +
- sizeof(kCommandHciReadLocalVersionInformation)};
+ std::vector<uint8_t> cmd;
+ ::bluetooth::packet::BitInserter bi{cmd};
+ ::bluetooth::hci::ReadLocalVersionInformationBuilder::Create()->Serialize(bi);
hci->sendHciCommand(cmd);
ASSERT_NO_FATAL_FAILURE(wait_for_event());
std::vector<uint8_t> event;
ASSERT_TRUE(event_queue.pop(event));
- ASSERT_GT(event.size(), static_cast<size_t>(kEventLocalLmpVersionByte));
-
- ASSERT_EQ(kEventCommandComplete, event[kEventCodeByte]);
- ASSERT_EQ(cmd[0], event[kEventCommandCompleteOpcodeLsByte]);
- ASSERT_EQ(cmd[1], event[kEventCommandCompleteOpcodeLsByte + 1]);
- ASSERT_EQ(kHciStatusSuccess, event[kEventCommandCompleteStatusByte]);
-
- ASSERT_LE(kHciMinimumHciVersion, event[kEventLocalHciVersionByte]);
- ASSERT_LE(kHciMinimumLmpVersion, event[kEventLocalLmpVersionByte]);
+ auto complete_view =
+ ::bluetooth::hci::ReadLocalVersionInformationCompleteView::Create(
+ ::bluetooth::hci::CommandCompleteView::Create(
+ ::bluetooth::hci::EventView::Create(
+ ::bluetooth::hci::PacketView<true>(
+ std::make_shared<std::vector<uint8_t>>(event)))));
+ ASSERT_TRUE(complete_view.IsValid());
+ ASSERT_EQ(::bluetooth::hci::ErrorCode::SUCCESS, complete_view.GetStatus());
+ auto version = complete_view.GetLocalVersionInformation();
+ ASSERT_LE(::bluetooth::hci::HciVersion::V_3_0, version.hci_version_);
+ ASSERT_LE(::bluetooth::hci::LmpVersion::V_3_0, version.lmp_version_);
}
// Send an unknown HCI command and wait for the error message.
TEST_P(BluetoothAidlTest, HciUnknownCommand) {
- std::vector<uint8_t> cmd{
- kCommandHciShouldBeUnknown,
- kCommandHciShouldBeUnknown + sizeof(kCommandHciShouldBeUnknown)};
+ std::vector<uint8_t> cmd;
+ ::bluetooth::packet::BitInserter bi{cmd};
+ ::bluetooth::hci::CommandBuilder::Create(
+ static_cast<::bluetooth::hci::OpCode>(0x3cff),
+ std::make_unique<::bluetooth::packet::RawBuilder>())
+ ->Serialize(bi);
hci->sendHciCommand(cmd);
ASSERT_NO_FATAL_FAILURE(wait_for_event());
std::vector<uint8_t> event;
ASSERT_TRUE(event_queue.pop(event));
+ auto event_view =
+ ::bluetooth::hci::EventView::Create(::bluetooth::hci::PacketView<true>(
+ std::make_shared<std::vector<uint8_t>>(event)));
+ ASSERT_TRUE(event_view.IsValid());
- ASSERT_GT(event.size(), static_cast<size_t>(kEventCommandCompleteStatusByte));
- if (event[kEventCodeByte] == kEventCommandComplete) {
- ASSERT_EQ(cmd[0], event[kEventCommandCompleteOpcodeLsByte]);
- ASSERT_EQ(cmd[1], event[kEventCommandCompleteOpcodeLsByte + 1]);
- ASSERT_EQ(kHciStatusUnknownHciCommand,
- event[kEventCommandCompleteStatusByte]);
- } else {
- ASSERT_EQ(kEventCommandStatus, event[kEventCodeByte]);
- ASSERT_EQ(cmd[0], event[kEventCommandStatusOpcodeLsByte]);
- ASSERT_EQ(cmd[1], event[kEventCommandStatusOpcodeLsByte + 1]);
- ASSERT_EQ(kHciStatusUnknownHciCommand,
- event[kEventCommandStatusStatusByte]);
+ switch (event_view.GetEventCode()) {
+ case ::bluetooth::hci::EventCode::COMMAND_COMPLETE: {
+ auto command_complete =
+ ::bluetooth::hci::CommandCompleteView::Create(event_view);
+ ASSERT_TRUE(command_complete.IsValid());
+ ASSERT_EQ(command_complete.GetPayload()[0],
+ static_cast<uint8_t>(
+ ::bluetooth::hci::ErrorCode::UNKNOWN_HCI_COMMAND));
+ } break;
+ case ::bluetooth::hci::EventCode::COMMAND_STATUS: {
+ auto command_status =
+ ::bluetooth::hci::CommandStatusView::Create(event_view);
+ ASSERT_TRUE(command_status.IsValid());
+ ASSERT_EQ(command_status.GetStatus(),
+ ::bluetooth::hci::ErrorCode::UNKNOWN_HCI_COMMAND);
+ } break;
+ default:
+ ADD_FAILURE();
}
}
@@ -851,20 +848,24 @@
// Set all bits in the event mask
TEST_P(BluetoothAidlTest, SetEventMask) {
- std::vector<uint8_t> set_event_mask{
- 0x01, 0x0c, 0x08 /*parameter bytes*/, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff};
- hci->sendHciCommand({set_event_mask});
- wait_for_command_complete_event(set_event_mask);
+ std::vector<uint8_t> cmd;
+ ::bluetooth::packet::BitInserter bi{cmd};
+ uint64_t full_mask = UINT64_MAX;
+ ::bluetooth::hci::SetEventMaskBuilder::Create(full_mask)->Serialize(bi);
+ hci->sendHciCommand(cmd);
+ wait_and_validate_command_complete_event(
+ ::bluetooth::hci::OpCode::SET_EVENT_MASK);
}
// Set all bits in the LE event mask
TEST_P(BluetoothAidlTest, SetLeEventMask) {
- std::vector<uint8_t> set_event_mask{
- 0x20, 0x0c, 0x08 /*parameter bytes*/, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
- 0xff, 0xff};
- hci->sendHciCommand({set_event_mask});
- wait_for_command_complete_event(set_event_mask);
+ std::vector<uint8_t> cmd;
+ ::bluetooth::packet::BitInserter bi{cmd};
+ uint64_t full_mask = UINT64_MAX;
+ ::bluetooth::hci::LeSetEventMaskBuilder::Create(full_mask)->Serialize(bi);
+ hci->sendHciCommand(cmd);
+ wait_and_validate_command_complete_event(
+ ::bluetooth::hci::OpCode::LE_SET_EVENT_MASK);
}
// Call initialize twice, second one should fail.
@@ -872,28 +873,32 @@
class SecondCb
: public aidl::android::hardware::bluetooth::BnBluetoothHciCallbacks {
public:
- ndk::ScopedAStatus initializationComplete(Status status) {
+ ndk::ScopedAStatus initializationComplete(Status status) override {
EXPECT_EQ(status, Status::ALREADY_INITIALIZED);
init_promise.set_value();
return ScopedAStatus::ok();
};
- ndk::ScopedAStatus hciEventReceived(const std::vector<uint8_t>& /*event*/) {
+ ndk::ScopedAStatus hciEventReceived(
+ const std::vector<uint8_t>& /*event*/) override {
ADD_FAILURE();
return ScopedAStatus::ok();
};
- ndk::ScopedAStatus aclDataReceived(const std::vector<uint8_t>& /*data*/) {
+ ndk::ScopedAStatus aclDataReceived(
+ const std::vector<uint8_t>& /*data*/) override {
ADD_FAILURE();
return ScopedAStatus::ok();
};
- ndk::ScopedAStatus scoDataReceived(const std::vector<uint8_t>& /*data*/) {
+ ndk::ScopedAStatus scoDataReceived(
+ const std::vector<uint8_t>& /*data*/) override {
ADD_FAILURE();
return ScopedAStatus::ok();
};
- ndk::ScopedAStatus isoDataReceived(const std::vector<uint8_t>& /*data*/) {
+ ndk::ScopedAStatus isoDataReceived(
+ const std::vector<uint8_t>& /*data*/) override {
ADD_FAILURE();
return ScopedAStatus::ok();
};
@@ -909,6 +914,66 @@
ASSERT_EQ(status, std::future_status::ready);
}
+TEST_P(BluetoothAidlTest, Cdd_C_12_1_Bluetooth5Requirements) {
+ std::vector<uint8_t> version_event;
+ send_and_wait_for_cmd_complete(ReadLocalVersionInformationBuilder::Create(),
+ version_event);
+ auto version_view = ReadLocalVersionInformationCompleteView::Create(
+ CommandCompleteView::Create(EventView::Create(PacketView<true>(
+ std::make_shared<std::vector<uint8_t>>(version_event)))));
+ ASSERT_TRUE(version_view.IsValid());
+ ASSERT_EQ(::bluetooth::hci::ErrorCode::SUCCESS, version_view.GetStatus());
+ auto version = version_view.GetLocalVersionInformation();
+ if (version.hci_version_ < ::bluetooth::hci::HciVersion::V_5_0) {
+ // This test does not apply to controllers below 5.0
+ return;
+ };
+ // When HCI version is 5.0, LMP version must also be at least 5.0
+ ASSERT_GE(static_cast<int>(version.lmp_version_),
+ static_cast<int>(version.hci_version_));
+
+ std::vector<uint8_t> le_features_event;
+ send_and_wait_for_cmd_complete(LeReadLocalSupportedFeaturesBuilder::Create(),
+ le_features_event);
+ auto le_features_view = LeReadLocalSupportedFeaturesCompleteView::Create(
+ CommandCompleteView::Create(EventView::Create(PacketView<true>(
+ std::make_shared<std::vector<uint8_t>>(le_features_event)))));
+ ASSERT_TRUE(le_features_view.IsValid());
+ ASSERT_EQ(::bluetooth::hci::ErrorCode::SUCCESS, le_features_view.GetStatus());
+ auto le_features = le_features_view.GetLeFeatures();
+ ASSERT_TRUE(le_features & static_cast<uint64_t>(LLFeaturesBits::LL_PRIVACY));
+ ASSERT_TRUE(le_features & static_cast<uint64_t>(LLFeaturesBits::LE_2M_PHY));
+ ASSERT_TRUE(le_features &
+ static_cast<uint64_t>(LLFeaturesBits::LE_CODED_PHY));
+ ASSERT_TRUE(le_features &
+ static_cast<uint64_t>(LLFeaturesBits::LE_EXTENDED_ADVERTISING));
+
+ std::vector<uint8_t> num_adv_set_event;
+ send_and_wait_for_cmd_complete(
+ LeReadNumberOfSupportedAdvertisingSetsBuilder::Create(),
+ num_adv_set_event);
+ auto num_adv_set_view =
+ LeReadNumberOfSupportedAdvertisingSetsCompleteView::Create(
+ CommandCompleteView::Create(EventView::Create(PacketView<true>(
+ std::make_shared<std::vector<uint8_t>>(num_adv_set_event)))));
+ ASSERT_TRUE(num_adv_set_view.IsValid());
+ ASSERT_EQ(::bluetooth::hci::ErrorCode::SUCCESS, num_adv_set_view.GetStatus());
+ auto num_adv_set = num_adv_set_view.GetNumberSupportedAdvertisingSets();
+ ASSERT_GE(num_adv_set, kMinLeAdvSetForBt5);
+
+ std::vector<uint8_t> num_resolving_list_event;
+ send_and_wait_for_cmd_complete(LeReadResolvingListSizeBuilder::Create(),
+ num_resolving_list_event);
+ auto num_resolving_list_view = LeReadResolvingListSizeCompleteView::Create(
+ CommandCompleteView::Create(EventView::Create(PacketView<true>(
+ std::make_shared<std::vector<uint8_t>>(num_resolving_list_event)))));
+ ASSERT_TRUE(num_resolving_list_view.IsValid());
+ ASSERT_EQ(::bluetooth::hci::ErrorCode::SUCCESS,
+ num_resolving_list_view.GetStatus());
+ auto num_resolving_list = num_resolving_list_view.GetResolvingListSize();
+ ASSERT_GE(num_resolving_list, kMinLeResolvingListForBt5);
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(BluetoothAidlTest);
INSTANTIATE_TEST_SUITE_P(PerInstance, BluetoothAidlTest,
testing::ValuesIn(android::getAidlHalInstanceNames(
diff --git a/bluetooth/hci/h4_protocol.cc b/bluetooth/hci/h4_protocol.cc
index 51a624f..5f6d86e 100644
--- a/bluetooth/hci/h4_protocol.cc
+++ b/bluetooth/hci/h4_protocol.cc
@@ -105,15 +105,12 @@
buffer_offset += 1;
} else {
bool packet_ready = hci_packetizer_.OnDataReady(
- hci_packet_type_, input_buffer, buffer_offset);
+ hci_packet_type_, input_buffer, &buffer_offset);
if (packet_ready) {
- // Call packet callback and move offset.
- buffer_offset += OnPacketReady(hci_packetizer_.GetPacket());
+ // Call packet callback.
+ OnPacketReady(hci_packetizer_.GetPacket());
// Get ready for the next type byte.
hci_packet_type_ = PacketType::UNKNOWN;
- } else {
- // The data was consumed, but there wasn't a packet.
- buffer_offset = input_buffer.size();
}
}
}
diff --git a/bluetooth/hci/hci_packetizer.cc b/bluetooth/hci/hci_packetizer.cc
index 5b6c443..4135920 100644
--- a/bluetooth/hci/hci_packetizer.cc
+++ b/bluetooth/hci/hci_packetizer.cc
@@ -51,9 +51,10 @@
bool HciPacketizer::OnDataReady(PacketType packet_type,
const std::vector<uint8_t>& buffer,
- size_t offset) {
+ size_t* offset) {
bool packet_completed = false;
- size_t bytes_available = buffer.size() - offset;
+ size_t bytes_available = buffer.size() - *offset;
+
switch (state_) {
case HCI_HEADER: {
size_t header_size =
@@ -62,18 +63,20 @@
bytes_remaining_ = header_size;
packet_.clear();
}
+
size_t bytes_to_copy = std::min(bytes_remaining_, bytes_available);
- packet_.insert(packet_.end(), buffer.begin() + offset,
- buffer.begin() + offset + bytes_to_copy);
+ packet_.insert(packet_.end(), buffer.begin() + *offset,
+ buffer.begin() + *offset + bytes_to_copy);
bytes_remaining_ -= bytes_to_copy;
bytes_available -= bytes_to_copy;
+ *offset += bytes_to_copy;
+
if (bytes_remaining_ == 0) {
bytes_remaining_ = HciGetPacketLengthForType(packet_type, packet_);
if (bytes_remaining_ > 0) {
state_ = HCI_PAYLOAD;
if (bytes_available > 0) {
- packet_completed =
- OnDataReady(packet_type, buffer, offset + bytes_to_copy);
+ packet_completed = OnDataReady(packet_type, buffer, offset);
}
} else {
packet_completed = true;
@@ -84,9 +87,10 @@
case HCI_PAYLOAD: {
size_t bytes_to_copy = std::min(bytes_remaining_, bytes_available);
- packet_.insert(packet_.end(), buffer.begin() + offset,
- buffer.begin() + offset + bytes_to_copy);
+ packet_.insert(packet_.end(), buffer.begin() + *offset,
+ buffer.begin() + *offset + bytes_to_copy);
bytes_remaining_ -= bytes_to_copy;
+ *offset += bytes_to_copy;
if (bytes_remaining_ == 0) {
state_ = HCI_HEADER;
packet_completed = true;
@@ -94,6 +98,7 @@
break;
}
}
+
return packet_completed;
}
diff --git a/bluetooth/hci/hci_packetizer.h b/bluetooth/hci/hci_packetizer.h
index ba3e841..0d9319f 100644
--- a/bluetooth/hci/hci_packetizer.h
+++ b/bluetooth/hci/hci_packetizer.h
@@ -28,7 +28,7 @@
public:
HciPacketizer() = default;
bool OnDataReady(PacketType packet_type, const std::vector<uint8_t>& data,
- size_t offset);
+ size_t* offset);
const std::vector<uint8_t>& GetPacket() const;
protected:
diff --git a/bluetooth/hci/test/h4_protocol_unittest.cc b/bluetooth/hci/test/h4_protocol_unittest.cc
index d3fab61..f0c49b5 100644
--- a/bluetooth/hci/test/h4_protocol_unittest.cc
+++ b/bluetooth/hci/test/h4_protocol_unittest.cc
@@ -31,7 +31,6 @@
#include <vector>
#include "async_fd_watcher.h"
-#include "log/log.h"
using android::hardware::bluetooth::async::AsyncFdWatcher;
using namespace android::hardware::bluetooth::hci;
@@ -49,6 +48,7 @@
static char event_data[100] = "The edges of a surface are lines.";
static char iso_data[100] =
"A plane angle is the inclination to one another of two lines in a ...";
+static char short_payload[10] = "12345";
// 5 seconds. Just don't hang.
static constexpr size_t kTimeoutMs = 5000;
@@ -225,6 +225,49 @@
CallDataReady();
}
+ void WriteAndExpectManyAclDataPacketsDifferentOffsetsShort() {
+ std::promise<void> last_packet_promise;
+ size_t kNumPackets = 30;
+ // h4 type[1] + handle[2] + size[2]
+ char preamble[5] = {static_cast<uint8_t>(PacketType::ACL_DATA), 19, 92, 0,
+ 0};
+ int length = strlen(short_payload);
+ preamble[3] = length & 0xFF;
+ preamble[4] = 0;
+
+ EXPECT_CALL(acl_cb_, Call(PacketMatches(preamble + 1, kAclHeaderSize,
+ short_payload)))
+ .Times(kNumPackets);
+ ExpectInboundEvent(event_data, &last_packet_promise);
+
+ char all_packets[kNumPackets * 10];
+ size_t total_bytes = 0;
+
+ for (size_t packet = 0; packet < kNumPackets; packet++) {
+ for (size_t i = 0; i < sizeof(preamble); i++) {
+ all_packets[total_bytes++] = preamble[i];
+ }
+ for (size_t i = 0; i < length; i++) {
+ all_packets[total_bytes++] = short_payload[i];
+ }
+ }
+
+ size_t written_bytes = 0;
+ size_t partial_size = 1;
+ while (written_bytes < total_bytes) {
+ size_t to_write = std::min(partial_size, total_bytes - written_bytes);
+ TEMP_FAILURE_RETRY(
+ write(chip_uart_fd_, all_packets + written_bytes, to_write));
+ written_bytes += to_write;
+ CallDataReady();
+ partial_size++;
+ partial_size = partial_size % 5 + 1;
+ }
+ WriteInboundEvent(event_data);
+ CallDataReady();
+ WaitForTimeout(&last_packet_promise);
+ }
+
testing::MockFunction<void(const std::vector<uint8_t>&)> cmd_cb_;
testing::MockFunction<void(const std::vector<uint8_t>&)> event_cb_;
testing::MockFunction<void(const std::vector<uint8_t>&)> acl_cb_;
@@ -276,6 +319,10 @@
WriteAndExpectManyInboundAclDataPackets(sco_data);
}
+TEST_F(H4ProtocolTest, TestMultipleWritesPacketsShortWrites) {
+ WriteAndExpectManyAclDataPacketsDifferentOffsetsShort();
+}
+
TEST_F(H4ProtocolTest, TestDisconnect) {
EXPECT_CALL(disconnect_cb_, Call());
close(chip_uart_fd_);
@@ -332,10 +379,8 @@
void TearDown() override { fd_watcher_.StopWatchingFileDescriptors(); }
- void CallDataReady() override {
- // The Async test can't call data ready.
- FAIL();
- }
+ // Calling CallDataReady() has no effect in the AsyncTest
+ void CallDataReady() override {}
void SendAndReadUartOutbound(PacketType type, char* data) {
ALOGD("%s sending", __func__);
@@ -434,6 +479,10 @@
WriteAndExpectManyInboundAclDataPackets(sco_data);
}
+TEST_F(H4ProtocolAsyncTest, TestMultipleWritesPacketsShortWrites) {
+ WriteAndExpectManyAclDataPacketsDifferentOffsetsShort();
+}
+
TEST_F(H4ProtocolAsyncTest, TestDisconnect) {
std::promise<void> promise;
EXPECT_CALL(disconnect_cb_, Call()).WillOnce(Notify(&promise));
diff --git a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
index 5ea6ae2..339a142 100644
--- a/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
+++ b/camera/provider/2.4/vts/functional/VtsHalCameraProviderV2_4TargetTest.cpp
@@ -929,7 +929,7 @@
static Status getMandatoryConcurrentStreams(const camera_metadata_t* staticMeta,
std::vector<AvailableStream>* outputStreams);
- static bool supportsPreviewStabilization(const std::string& name, sp<ICameraProvider> provider);
+
static Status getJpegBufferSize(camera_metadata_t *staticMeta,
uint32_t* outBufSize);
static Status isConstrainedModeAvailable(camera_metadata_t *staticMeta);
@@ -976,9 +976,6 @@
void processCaptureRequestInternal(uint64_t bufferusage, RequestTemplate reqTemplate,
bool useSecureOnlyCameras);
- void processPreviewStabilizationCaptureRequestInternal(
- bool previewStabilizationOn,
- /*inout*/ std::unordered_map<std::string, nsecs_t>& cameraDeviceToTimeLag);
// Used by switchToOffline where a new result queue is created for offline reqs
void updateInflightResultQueue(std::shared_ptr<ResultMetadataQueue> resultQueue);
@@ -1032,11 +1029,7 @@
// Buffers are added by process_capture_result when output buffers
// return from HAL but framework.
- struct StreamBufferAndTimestamp {
- StreamBuffer buffer;
- nsecs_t timeStamp;
- };
- ::android::Vector<StreamBufferAndTimestamp> resultOutputBuffers;
+ ::android::Vector<StreamBuffer> resultOutputBuffers;
std::unordered_set<std::string> expectedPhysicalResults;
@@ -1453,25 +1446,8 @@
return notify;
}
- for (const auto& buffer : results.outputBuffers) {
- // wait for the fence timestamp and store it along with the buffer
- // TODO: Check if we really need the dup here
- sp<android::Fence> releaseFence = nullptr;
- if (buffer.releaseFence && (buffer.releaseFence->numFds == 1) &&
- buffer.releaseFence->data[0] >= 0) {
- releaseFence = new android::Fence(dup(buffer.releaseFence->data[0]));
- }
- InFlightRequest::StreamBufferAndTimestamp streamBufferAndTimestamp;
- streamBufferAndTimestamp.buffer = buffer;
- streamBufferAndTimestamp.timeStamp = systemTime();
- if (releaseFence && releaseFence->isValid()) {
- releaseFence->wait(/*ms*/ 300);
- nsecs_t releaseTime = releaseFence->getSignalTime();
- if (streamBufferAndTimestamp.timeStamp < releaseTime)
- streamBufferAndTimestamp.timeStamp = releaseTime;
- }
- request->resultOutputBuffers.push_back(streamBufferAndTimestamp);
- }
+ request->resultOutputBuffers.appendArray(results.outputBuffers.data(),
+ results.outputBuffers.size());
// If shutter event is received notify the pending threads.
if (request->shutterTimestamp != 0) {
notify = true;
@@ -4841,7 +4817,7 @@
ASSERT_FALSE(inflightReq.errorCodeValid);
ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u);
- ASSERT_EQ(testStream.id, inflightReq.resultOutputBuffers[0].buffer.streamId);
+ ASSERT_EQ(testStream.id, inflightReq.resultOutputBuffers[0].streamId);
request.frameNumber++;
// Empty settings should be supported after the first call
@@ -4879,7 +4855,7 @@
ASSERT_FALSE(inflightReq.errorCodeValid);
ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u);
- ASSERT_EQ(testStream.id, inflightReq.resultOutputBuffers[0].buffer.streamId);
+ ASSERT_EQ(testStream.id, inflightReq.resultOutputBuffers[0].streamId);
}
if (useHalBufManager) {
@@ -5460,7 +5436,7 @@
ASSERT_FALSE(inflightReqs[i].errorCodeValid);
ASSERT_NE(inflightReqs[i].resultOutputBuffers.size(), 0u);
- ASSERT_EQ(previewStream.id, inflightReqs[i].resultOutputBuffers[0].buffer.streamId);
+ ASSERT_EQ(previewStream.id, inflightReqs[i].resultOutputBuffers[0].streamId);
ASSERT_FALSE(inflightReqs[i].collectedResult.isEmpty());
ASSERT_TRUE(inflightReqs[i].collectedResult.exists(ANDROID_SENSOR_SENSITIVITY));
camera_metadata_entry_t isoResult = inflightReqs[i].collectedResult.find(
@@ -5744,7 +5720,7 @@
ASSERT_FALSE(inflightReqs[i].errorCodeValid);
ASSERT_NE(inflightReqs[i].resultOutputBuffers.size(), 0u);
- ASSERT_EQ(stream.id, inflightReqs[i].resultOutputBuffers[0].buffer.streamId);
+ ASSERT_EQ(stream.id, inflightReqs[i].resultOutputBuffers[0].streamId);
ASSERT_FALSE(inflightReqs[i].collectedResult.isEmpty());
}
@@ -5940,7 +5916,7 @@
if (!inflightReq.errorCodeValid) {
ASSERT_NE(inflightReq.resultOutputBuffers.size(), 0u);
- ASSERT_EQ(previewStream.id, inflightReq.resultOutputBuffers[0].buffer.streamId);
+ ASSERT_EQ(previewStream.id, inflightReq.resultOutputBuffers[0].streamId);
} else {
switch (inflightReq.errorCode) {
case ErrorCode::ERROR_REQUEST:
@@ -6346,7 +6322,7 @@
AvailableStream depthPreviewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
static_cast<int32_t>(PixelFormat::Y16)};
const AvailableStream* depthThreshold =
- (threshold != nullptr) ? threshold : &depthPreviewThreshold;
+ isDepthOnly(staticMeta) ? &depthPreviewThreshold : threshold;
fillOutputStreams(&depthEntry, outputStreams, depthThreshold,
ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_OUTPUT);
}
@@ -7427,47 +7403,6 @@
previewStream, halStreamConfig, supportsPartialResults,
partialResultCount, useHalBufManager, outCb, streamConfigCounter);
}
-
-bool CameraHidlTest::supportsPreviewStabilization(const std::string& name,
- sp<ICameraProvider> provider) {
- Return<void> ret;
- sp<ICameraDevice> device3_x = nullptr;
- ret = provider->getCameraDeviceInterface_V3_x(name, [&](auto status, const auto& device) {
- ALOGI("getCameraDeviceInterface_V3_x returns status:%d", (int)status);
- ASSERT_EQ(Status::OK, status);
- ASSERT_NE(device, nullptr);
- device3_x = device;
- });
- if (!(ret.isOk())) {
- ADD_FAILURE() << "Failed to get camera device interface for " << name;
- }
-
- camera_metadata_t* staticMeta = nullptr;
- ret = device3_x->getCameraCharacteristics([&](Status s, CameraMetadata metadata) {
- ASSERT_EQ(Status::OK, s);
- staticMeta =
- clone_camera_metadata(reinterpret_cast<const camera_metadata_t*>(metadata.data()));
- });
- if (!(ret.isOk())) {
- ADD_FAILURE() << "Failed to get camera characteristics for " << name;
- }
- // Go through the characteristics and see if video stabilization modes have
- // preview stabilization
- camera_metadata_ro_entry entry;
-
- int retcode = find_camera_metadata_ro_entry(
- staticMeta, ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES, &entry);
- if ((0 == retcode) && (entry.count > 0)) {
- for (auto i = 0; i < entry.count; i++) {
- if (entry.data.u8[i] ==
- ANDROID_CONTROL_VIDEO_STABILIZATION_MODE_PREVIEW_STABILIZATION) {
- return true;
- }
- }
- }
- return false;
-}
-
// Open a device session and configure a preview stream.
void CameraHidlTest::configureSingleStream(
const std::string& name, int32_t deviceVersion, sp<ICameraProvider> provider,
diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
index 2c98db8..b764ad6 100644
--- a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
+++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
@@ -2002,6 +2002,8 @@
ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout));
}
+ waitForReleaseFence(inflightReq->resultOutputBuffers);
+
ASSERT_FALSE(inflightReq->errorCodeValid);
ASSERT_NE(inflightReq->resultOutputBuffers.size(), 0u);
verify10BitMetadata(mHandleImporter, *inflightReq, profile);
diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp
index 573b8f1..ef3ce4f 100644
--- a/camera/provider/aidl/vts/camera_aidl_test.cpp
+++ b/camera/provider/aidl/vts/camera_aidl_test.cpp
@@ -34,6 +34,7 @@
#include <grallocusage/GrallocUsageConversion.h>
#include <hardware/gralloc1.h>
#include <simple_device_cb.h>
+#include <ui/Fence.h>
#include <ui/GraphicBufferAllocator.h>
#include <regex>
#include <typeinfo>
@@ -139,6 +140,25 @@
}
}
+void CameraAidlTest::waitForReleaseFence(
+ std::vector<InFlightRequest::StreamBufferAndTimestamp>& resultOutputBuffers) {
+ for (auto& bufferAndTimestamp : resultOutputBuffers) {
+ // wait for the fence timestamp and store it along with the buffer
+ android::sp<android::Fence> releaseFence = nullptr;
+ const native_handle_t* releaseFenceHandle = bufferAndTimestamp.buffer.releaseFence;
+ if (releaseFenceHandle != nullptr && releaseFenceHandle->numFds == 1 &&
+ releaseFenceHandle->data[0] >= 0) {
+ releaseFence = new android::Fence(dup(releaseFenceHandle->data[0]));
+ }
+ if (releaseFence && releaseFence->isValid()) {
+ releaseFence->wait(/*ms*/ 300);
+ nsecs_t releaseTime = releaseFence->getSignalTime();
+ if (bufferAndTimestamp.timeStamp < releaseTime)
+ bufferAndTimestamp.timeStamp = releaseTime;
+ }
+ }
+}
+
std::vector<std::string> CameraAidlTest::getCameraDeviceNames(
std::shared_ptr<ICameraProvider>& provider, bool addSecureOnly) {
std::vector<std::string> cameraDeviceNames;
@@ -779,7 +799,7 @@
AvailableStream depthPreviewThreshold = {kMaxPreviewWidth, kMaxPreviewHeight,
static_cast<int32_t>(PixelFormat::Y16)};
const AvailableStream* depthThreshold =
- (threshold != nullptr) ? threshold : &depthPreviewThreshold;
+ isDepthOnly(staticMeta) ? &depthPreviewThreshold : threshold;
fillOutputStreams(&depthEntry, outputStreams, depthThreshold,
ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_OUTPUT);
}
@@ -2376,6 +2396,7 @@
std::chrono::seconds(kStreamBufferTimeoutSec);
ASSERT_NE(std::cv_status::timeout, mResultCondition.wait_until(l, timeout));
}
+ waitForReleaseFence(inflightReq->resultOutputBuffers);
ASSERT_FALSE(inflightReq->errorCodeValid);
ASSERT_NE(inflightReq->resultOutputBuffers.size(), 0u);
diff --git a/camera/provider/aidl/vts/camera_aidl_test.h b/camera/provider/aidl/vts/camera_aidl_test.h
index 3741a64..fdf312e 100644
--- a/camera/provider/aidl/vts/camera_aidl_test.h
+++ b/camera/provider/aidl/vts/camera_aidl_test.h
@@ -481,6 +481,20 @@
hasInputBuffer(hasInput),
collectedResult(1, 10),
expectedPhysicalResults(extraPhysicalResult) {}
+
+ ~InFlightRequest() {
+ for (auto& buffer : resultOutputBuffers) {
+ native_handle_t* acquireFenceHandle = const_cast<native_handle_t*>(
+ buffer.buffer.acquireFence);
+ native_handle_close(acquireFenceHandle);
+ native_handle_delete(acquireFenceHandle);
+
+ native_handle_t* releaseFenceHandle = const_cast<native_handle_t*>(
+ buffer.buffer.releaseFence);
+ native_handle_close(releaseFenceHandle);
+ native_handle_delete(releaseFenceHandle);
+ }
+ }
};
static bool matchDeviceName(const std::string& deviceName, const std::string& providerType,
@@ -491,6 +505,9 @@
aidl::android::hardware::camera::metadata::RequestAvailableDynamicRangeProfilesMap
profile);
+ static void waitForReleaseFence(
+ std::vector<InFlightRequest::StreamBufferAndTimestamp>& resultOutputBuffers);
+
// Map from frame number to the in-flight request state
typedef std::unordered_map<uint32_t, std::shared_ptr<InFlightRequest>> InFlightMap;
diff --git a/camera/provider/aidl/vts/device_cb.cpp b/camera/provider/aidl/vts/device_cb.cpp
index 3ec96a1..7e0969a 100644
--- a/camera/provider/aidl/vts/device_cb.cpp
+++ b/camera/provider/aidl/vts/device_cb.cpp
@@ -19,7 +19,6 @@
#include <aidl/android/hardware/graphics/common/PixelFormat.h>
#include <aidlcommonsupport/NativeHandle.h>
#include <grallocusage/GrallocUsageConversion.h>
-#include <ui/Fence.h>
#include <cinttypes>
using ::aidl::android::hardware::camera::device::BufferStatus;
@@ -419,13 +418,6 @@
}
for (const auto& buffer : results.outputBuffers) {
- // wait for the fence timestamp and store it along with the buffer
- // TODO: Check if we really need the dup here
- android::sp<android::Fence> releaseFence = nullptr;
- if (buffer.releaseFence.fds.size() == 1 && buffer.releaseFence.fds[0].get() >= 0) {
- releaseFence = new android::Fence(dup(buffer.releaseFence.fds[0].get()));
- }
-
CameraAidlTest::InFlightRequest::StreamBufferAndTimestamp streamBufferAndTimestamp;
auto outstandingBuffers = mUseHalBufManager ? mOutstandingBufferIds :
request->mOutstandingBufferIds;
@@ -436,15 +428,9 @@
bufferId,
outputBuffer,
buffer.status,
- ::android::makeFromAidl(buffer.acquireFence),
- ::android::makeFromAidl(buffer.releaseFence)};
+ ::android::dupFromAidl(buffer.acquireFence),
+ ::android::dupFromAidl(buffer.releaseFence)};
streamBufferAndTimestamp.timeStamp = systemTime();
- if (releaseFence && releaseFence->isValid()) {
- releaseFence->wait(/*ms*/ 300);
- nsecs_t releaseTime = releaseFence->getSignalTime();
- if (streamBufferAndTimestamp.timeStamp < releaseTime)
- streamBufferAndTimestamp.timeStamp = releaseTime;
- }
request->resultOutputBuffers.push_back(streamBufferAndTimestamp);
}
// If shutter event is received notify the pending threads.
diff --git a/common/fmq/aidl/Android.bp b/common/fmq/aidl/Android.bp
index 95fcc41..40ceb32 100644
--- a/common/fmq/aidl/Android.bp
+++ b/common/fmq/aidl/Android.bp
@@ -38,5 +38,10 @@
},
},
frozen: true,
- versions: ["1"],
+ versions_with_info: [
+ {
+ version: "1",
+ imports: ["android.hardware.common-V2"],
+ },
+ ],
}
diff --git a/compatibility_matrices/Android.bp b/compatibility_matrices/Android.bp
index 622835e..b3ca293 100644
--- a/compatibility_matrices/Android.bp
+++ b/compatibility_matrices/Android.bp
@@ -78,7 +78,19 @@
"compatibility_matrix.8.xml",
],
kernel_configs: [
- "kernel_config_current_5.15",
- "kernel_config_current_6.1",
+ "kernel_config_u_5.15",
+ "kernel_config_u_6.1",
+ ],
+}
+
+vintf_compatibility_matrix {
+ name: "framework_compatibility_matrix.9.xml",
+ stem: "compatibility_matrix.9.xml",
+ srcs: [
+ "compatibility_matrix.9.xml",
+ ],
+ kernel_configs: [
+ "kernel_config_v_5.15",
+ "kernel_config_v_6.1",
],
}
diff --git a/compatibility_matrices/Android.mk b/compatibility_matrices/Android.mk
index 6e4c419..a82a421 100644
--- a/compatibility_matrices/Android.mk
+++ b/compatibility_matrices/Android.mk
@@ -103,6 +103,7 @@
framework_compatibility_matrix.6.xml \
framework_compatibility_matrix.7.xml \
framework_compatibility_matrix.8.xml \
+ framework_compatibility_matrix.9.xml \
framework_compatibility_matrix.device.xml \
my_framework_matrix_deps += \
diff --git a/compatibility_matrices/compatibility_matrix.4.xml b/compatibility_matrices/compatibility_matrix.4.xml
index c898aab..b9fb3f4 100644
--- a/compatibility_matrices/compatibility_matrix.4.xml
+++ b/compatibility_matrices/compatibility_matrix.4.xml
@@ -7,7 +7,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <hal format="hidl" optional="true">
<name>android.hardware.audio</name>
<version>5.0</version>
<interface>
@@ -15,7 +15,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <hal format="hidl" optional="true">
<name>android.hardware.audio.effect</name>
<version>5.0</version>
<interface>
@@ -199,7 +199,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <hal format="hidl" optional="true">
<name>android.hardware.graphics.composer</name>
<version>2.1-3</version>
<interface>
@@ -207,7 +207,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <hal format="hidl" optional="true">
<name>android.hardware.graphics.mapper</name>
<version>2.1</version>
<version>3.0</version>
diff --git a/compatibility_matrices/compatibility_matrix.5.xml b/compatibility_matrices/compatibility_matrix.5.xml
index c5a1dc2..b374c8c 100644
--- a/compatibility_matrices/compatibility_matrix.5.xml
+++ b/compatibility_matrices/compatibility_matrix.5.xml
@@ -7,7 +7,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <hal format="hidl" optional="true">
<name>android.hardware.audio</name>
<version>6.0</version>
<interface>
@@ -15,7 +15,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <hal format="hidl" optional="true">
<name>android.hardware.audio.effect</name>
<version>6.0</version>
<interface>
@@ -222,7 +222,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <hal format="hidl" optional="true">
<name>android.hardware.graphics.composer</name>
<version>2.1-4</version>
<interface>
@@ -230,7 +230,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <hal format="hidl" optional="true">
<name>android.hardware.graphics.mapper</name>
<!-- New, non-Go devices should use 4.0, tested in vts_treble_vintf_vendor_test -->
<version>2.1</version>
@@ -367,7 +367,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="aidl" optional="false">
+ <hal format="aidl" optional="true">
<name>android.hardware.power</name>
<interface>
<name>IPower</name>
diff --git a/compatibility_matrices/compatibility_matrix.6.xml b/compatibility_matrices/compatibility_matrix.6.xml
index 1c76ee6..40ae655 100644
--- a/compatibility_matrices/compatibility_matrix.6.xml
+++ b/compatibility_matrices/compatibility_matrix.6.xml
@@ -7,7 +7,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <hal format="hidl" optional="true">
<name>android.hardware.audio</name>
<version>6.0</version>
<version>7.0</version>
@@ -16,7 +16,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <hal format="hidl" optional="true">
<name>android.hardware.audio.effect</name>
<version>6.0</version>
<version>7.0</version>
@@ -252,7 +252,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <hal format="hidl" optional="true">
<name>android.hardware.graphics.composer</name>
<version>2.1-4</version>
<interface>
@@ -260,7 +260,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <hal format="hidl" optional="true">
<name>android.hardware.graphics.mapper</name>
<!-- New, non-Go devices should use 4.0, tested in vts_treble_vintf_vendor_test -->
<version>2.1</version>
@@ -423,7 +423,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="aidl" optional="false">
+ <hal format="aidl" optional="true">
<name>android.hardware.power</name>
<version>1-2</version>
<interface>
diff --git a/compatibility_matrices/compatibility_matrix.7.xml b/compatibility_matrices/compatibility_matrix.7.xml
index 67dd717..e5ef954 100644
--- a/compatibility_matrices/compatibility_matrix.7.xml
+++ b/compatibility_matrices/compatibility_matrix.7.xml
@@ -327,7 +327,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="aidl" optional="false">
+ <hal format="aidl" optional="true">
<name>android.hardware.health</name>
<version>1</version>
<interface>
@@ -493,7 +493,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="aidl" optional="false">
+ <hal format="aidl" optional="true">
<name>android.hardware.power</name>
<version>2-3</version>
<interface>
diff --git a/compatibility_matrices/compatibility_matrix.8.xml b/compatibility_matrices/compatibility_matrix.8.xml
index f5a1b20..93beb92 100644
--- a/compatibility_matrices/compatibility_matrix.8.xml
+++ b/compatibility_matrices/compatibility_matrix.8.xml
@@ -1,5 +1,5 @@
<compatibility-matrix version="1.0" type="framework" level="8">
- <hal format="hidl" optional="false">
+ <hal format="hidl" optional="true">
<name>android.hardware.audio</name>
<version>6.0</version>
<version>7.0-1</version>
@@ -347,7 +347,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="aidl" optional="false">
+ <hal format="aidl" optional="true">
<name>android.hardware.health</name>
<version>1-2</version>
<interface>
@@ -485,7 +485,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="aidl" optional="false">
+ <hal format="aidl" optional="true">
<name>android.hardware.power</name>
<version>2-3</version>
<interface>
diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml
new file mode 100644
index 0000000..9b9506d
--- /dev/null
+++ b/compatibility_matrices/compatibility_matrix.9.xml
@@ -0,0 +1,829 @@
+<compatibility-matrix version="1.0" type="framework" level="9">
+ <hal format="hidl" optional="true">
+ <name>android.hardware.audio</name>
+ <version>6.0</version>
+ <version>7.0-1</version>
+ <interface>
+ <name>IDevicesFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.audio.effect</name>
+ <version>6.0</version>
+ <version>7.0</version>
+ <interface>
+ <name>IEffectsFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.audio.core</name>
+ <version>1</version>
+ <interface>
+ <name>IModule</name>
+ <instance>default</instance>
+ <instance>a2dp</instance>
+ <instance>bluetooth</instance>
+ <instance>hearing_aid</instance>
+ <instance>msd</instance>
+ <instance>r_submix</instance>
+ <instance>stub</instance>
+ <instance>usb</instance>
+ </interface>
+ <interface>
+ <name>IConfig</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.audio.effect</name>
+ <version>1</version>
+ <interface>
+ <name>IFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.audio.sounddose</name>
+ <version>1</version>
+ <interface>
+ <name>ISoundDoseFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.authsecret</name>
+ <version>1</version>
+ <interface>
+ <name>IAuthSecret</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.authsecret</name>
+ <version>1.0</version>
+ <interface>
+ <name>IAuthSecret</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.automotive.audiocontrol</name>
+ <interface>
+ <name>IAudioControl</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.automotive.can</name>
+ <version>1.0</version>
+ <interface>
+ <name>ICanBus</name>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ <interface>
+ <name>ICanController</name>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.automotive.evs</name>
+ <interface>
+ <name>IEvsEnumerator</name>
+ <instance>default</instance>
+ <regex-instance>[a-z]+/[0-9]+</regex-instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.automotive.evs</name>
+ <version>1.0-1</version>
+ <interface>
+ <name>IEvsEnumerator</name>
+ <instance>default</instance>
+ <regex-instance>[a-z]+/[0-9]+</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.automotive.occupant_awareness</name>
+ <version>1</version>
+ <interface>
+ <name>IOccupantAwareness</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.automotive.vehicle</name>
+ <interface>
+ <name>IVehicle</name>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.automotive.remoteaccess</name>
+ <interface>
+ <name>IRemoteAccess</name>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.automotive.vehicle</name>
+ <version>2.0</version>
+ <interface>
+ <name>IVehicle</name>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.biometrics.face</name>
+ <version>2</version>
+ <interface>
+ <name>IFace</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.biometrics.fingerprint</name>
+ <version>2</version>
+ <interface>
+ <name>IFingerprint</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.bluetooth</name>
+ <version>1.0-1</version>
+ <interface>
+ <name>IBluetoothHci</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.bluetooth</name>
+ <interface>
+ <name>IBluetoothHci</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.bluetooth.audio</name>
+ <version>3</version>
+ <interface>
+ <name>IBluetoothAudioProviderFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.boot</name>
+ <interface>
+ <name>IBootControl</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.broadcastradio</name>
+ <version>1.0-1</version>
+ <interface>
+ <name>IBroadcastRadioFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.broadcastradio</name>
+ <version>2.0</version>
+ <interface>
+ <name>IBroadcastRadio</name>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.camera.provider</name>
+ <version>2.4-7</version>
+ <interface>
+ <name>ICameraProvider</name>
+ <regex-instance>[^/]+/[0-9]+</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true" updatable-via-apex="true">
+ <name>android.hardware.camera.provider</name>
+ <version>1</version>
+ <interface>
+ <name>ICameraProvider</name>
+ <regex-instance>[^/]+/[0-9]+</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.cas</name>
+ <interface>
+ <name>IMediaCasService</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.confirmationui</name>
+ <version>1</version>
+ <interface>
+ <name>IConfirmationUI</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.contexthub</name>
+ <interface>
+ <name>IContextHub</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true" updatable-via-apex="true">
+ <name>android.hardware.drm</name>
+ <version>1</version>
+ <interface>
+ <name>IDrmFactory</name>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.drm</name>
+ <version>1.3-4</version>
+ <interface>
+ <name>ICryptoFactory</name>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ <interface>
+ <name>IDrmFactory</name>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.dumpstate</name>
+ <interface>
+ <name>IDumpstateDevice</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.gatekeeper</name>
+ <version>1</version>
+ <interface>
+ <name>IGatekeeper</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.gnss</name>
+ <version>2</version>
+ <interface>
+ <name>IGnss</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.gnss.visibility_control</name>
+ <version>1</version>
+ <interface>
+ <name>IGnssVisibilityControl</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.gnss.measurement_corrections</name>
+ <version>1</version>
+ <interface>
+ <name>IMeasurementCorrectionsInterface</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <!-- Either the AIDL or the HIDL allocator HAL must exist on the device.
+ If the HIDL composer HAL exists, it must be at least version 2.0.
+ See DeviceManifestTest.GrallocHal -->
+ <hal format="hidl" optional="true">
+ <name>android.hardware.graphics.allocator</name>
+ <!-- New, non-Go devices should use 4.0 or the AIDL hal.
+ See DeviceManifestTest.GrallocVersionCompatibility. -->
+ <version>2.0</version>
+ <version>3.0</version>
+ <version>4.0</version>
+ <interface>
+ <name>IAllocator</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.graphics.allocator</name>
+ <version>1-2</version>
+ <interface>
+ <name>IAllocator</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <!-- Either the AIDL or the HIDL composer HAL must exist on the device.
+ If the HIDL composer HAL exists, it must be at least version 2.1.
+ See DeviceManifestTest.ComposerHal -->
+ <hal format="hidl" optional="true">
+ <name>android.hardware.graphics.composer</name>
+ <version>2.1-4</version>
+ <interface>
+ <name>IComposer</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.graphics.composer3</name>
+ <version>1</version>
+ <interface>
+ <name>IComposer</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <!-- Either the native or the HIDL mapper HAL must exist on the device -->
+ <hal format="hidl" optional="true">
+ <name>android.hardware.graphics.mapper</name>
+ <!-- New, non-Go devices should use 4.0, tested in vts_treble_vintf_vendor_test -->
+ <version>2.1</version>
+ <version>3.0</version>
+ <version>4.0</version>
+ <interface>
+ <name>IMapper</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.health</name>
+ <version>1-2</version>
+ <interface>
+ <name>IHealth</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.health.storage</name>
+ <version>1</version>
+ <interface>
+ <name>IStorage</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.identity</name>
+ <version>1-5</version>
+ <interface>
+ <name>IIdentityCredentialStore</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.net.nlinterceptor</name>
+ <interface>
+ <name>IInterceptor</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.oemlock</name>
+ <version>1</version>
+ <interface>
+ <name>IOemLock</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.ir</name>
+ <version>1</version>
+ <interface>
+ <name>IConsumerIr</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.input.processor</name>
+ <version>1</version>
+ <interface>
+ <name>IInputProcessor</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.security.keymint</name>
+ <version>1-3</version>
+ <interface>
+ <name>IKeyMintDevice</name>
+ <instance>default</instance>
+ <instance>strongbox</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.security.keymint</name>
+ <version>1-3</version>
+ <interface>
+ <name>IRemotelyProvisionedComponent</name>
+ <instance>default</instance>
+ <instance>strongbox</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.light</name>
+ <version>2</version>
+ <interface>
+ <name>ILights</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.media.c2</name>
+ <version>1.0-2</version>
+ <interface>
+ <name>IComponentStore</name>
+ <regex-instance>default[0-9]*</regex-instance>
+ <regex-instance>vendor[0-9]*_software</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.media.c2</name>
+ <version>1</version>
+ <interface>
+ <name>IComponentStore</name>
+ <regex-instance>default[0-9]*</regex-instance>
+ <regex-instance>vendor[0-9]*_software</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.memtrack</name>
+ <version>1</version>
+ <interface>
+ <name>IMemtrack</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.neuralnetworks</name>
+ <version>1.0-3</version>
+ <interface>
+ <name>IDevice</name>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.neuralnetworks</name>
+ <version>1-4</version>
+ <interface>
+ <name>IDevice</name>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.nfc</name>
+ <interface>
+ <name>INfc</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.oemlock</name>
+ <version>1.0</version>
+ <interface>
+ <name>IOemLock</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.power</name>
+ <version>2-3</version>
+ <interface>
+ <name>IPower</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.power.stats</name>
+ <version>2</version>
+ <interface>
+ <name>IPowerStats</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.radio.config</name>
+ <version>1</version>
+ <interface>
+ <name>IRadioConfig</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.radio.data</name>
+ <version>1</version>
+ <interface>
+ <name>IRadioData</name>
+ <instance>slot1</instance>
+ <instance>slot2</instance>
+ <instance>slot3</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.radio.messaging</name>
+ <version>1</version>
+ <interface>
+ <name>IRadioMessaging</name>
+ <instance>slot1</instance>
+ <instance>slot2</instance>
+ <instance>slot3</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.radio.modem</name>
+ <version>1</version>
+ <interface>
+ <name>IRadioModem</name>
+ <instance>slot1</instance>
+ <instance>slot2</instance>
+ <instance>slot3</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.radio.network</name>
+ <version>1</version>
+ <interface>
+ <name>IRadioNetwork</name>
+ <instance>slot1</instance>
+ <instance>slot2</instance>
+ <instance>slot3</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.radio.sim</name>
+ <version>1</version>
+ <interface>
+ <name>IRadioSim</name>
+ <instance>slot1</instance>
+ <instance>slot2</instance>
+ <instance>slot3</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.radio.sap</name>
+ <version>1</version>
+ <interface>
+ <name>ISap</name>
+ <instance>slot1</instance>
+ <instance>slot2</instance>
+ <instance>slot3</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.radio.voice</name>
+ <version>1</version>
+ <interface>
+ <name>IRadioVoice</name>
+ <instance>slot1</instance>
+ <instance>slot2</instance>
+ <instance>slot3</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.radio</name>
+ <version>1.2</version>
+ <interface>
+ <name>ISap</name>
+ <instance>slot1</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.rebootescrow</name>
+ <version>1</version>
+ <interface>
+ <name>IRebootEscrow</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.secure_element</name>
+ <version>1</version>
+ <interface>
+ <name>ISecureElement</name>
+ <regex-instance>eSE[1-9][0-9]*</regex-instance>
+ <regex-instance>SIM[1-9][0-9]*</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.security.secureclock</name>
+ <version>1</version>
+ <interface>
+ <name>ISecureClock</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.security.sharedsecret</name>
+ <version>1</version>
+ <interface>
+ <name>ISharedSecret</name>
+ <instance>default</instance>
+ <instance>strongbox</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.sensors</name>
+ <interface>
+ <name>ISensors</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.sensors</name>
+ <version>1.0</version>
+ <version>2.0-1</version>
+ <interface>
+ <name>ISensors</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.soundtrigger</name>
+ <version>2.3</version>
+ <interface>
+ <name>ISoundTriggerHw</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.soundtrigger3</name>
+ <version>1</version>
+ <interface>
+ <name>ISoundTriggerHw</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.tetheroffload.config</name>
+ <version>1.0</version>
+ <interface>
+ <name>IOffloadConfig</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.tetheroffload.control</name>
+ <version>1.1</version>
+ <interface>
+ <name>IOffloadControl</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.tetheroffload</name>
+ <version>1</version>
+ <interface>
+ <name>IOffload</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.thermal</name>
+ <version>1</version>
+ <interface>
+ <name>IThermal</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.tv.hdmi.cec</name>
+ <version>1</version>
+ <interface>
+ <name>IHdmiCec</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.tv.hdmi.earc</name>
+ <version>1</version>
+ <interface>
+ <name>IEArc</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.tv.hdmi.connection</name>
+ <version>1</version>
+ <interface>
+ <name>IHdmiConnection</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.tv.input</name>
+ <version>1.0</version>
+ <interface>
+ <name>ITvInput</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.tv.tuner</name>
+ <version>1.0-1</version>
+ <interface>
+ <name>ITuner</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.tv.tuner</name>
+ <version>1</version>
+ <interface>
+ <name>ITuner</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.usb</name>
+ <interface>
+ <name>IUsb</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.usb.gadget</name>
+ <interface>
+ <name>IUsbGadget</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.vibrator</name>
+ <version>1-2</version>
+ <interface>
+ <name>IVibrator</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.vibrator</name>
+ <version>1-2</version>
+ <interface>
+ <name>IVibratorManager</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true">
+ <name>android.hardware.weaver</name>
+ <version>1.0</version>
+ <interface>
+ <name>IWeaver</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.weaver</name>
+ <version>1</version>
+ <interface>
+ <name>IWeaver</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true" updatable-via-apex="true">
+ <name>android.hardware.wifi</name>
+ <version>1</version>
+ <interface>
+ <name>IWifi</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="hidl" optional="true" updatable-via-apex="true">
+ <name>android.hardware.wifi</name>
+ <version>1.3-6</version>
+ <interface>
+ <name>IWifi</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.uwb</name>
+ <version>1</version>
+ <interface>
+ <name>IUwb</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.wifi.hostapd</name>
+ <version>1</version>
+ <interface>
+ <name>IHostapd</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.wifi.supplicant</name>
+ <interface>
+ <name>ISupplicant</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <!-- Either the native or the HIDL mapper HAL must exist on the device -->
+ <hal format="native" optional="true">
+ <name>mapper</name>
+ <version>5.0</version>
+ <interface>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ </hal>
+</compatibility-matrix>
diff --git a/drm/1.3/vts/OWNERS b/drm/1.3/vts/OWNERS
index 3a0672e..744827c 100644
--- a/drm/1.3/vts/OWNERS
+++ b/drm/1.3/vts/OWNERS
@@ -1,9 +1,11 @@
+# Bug component: 49079
conglin@google.com
-edwinwong@google.com
fredgc@google.com
-jtinker@google.com
juce@google.com
+kelzhan@google.com
kylealexander@google.com
+mattfedd@google.com
rfrias@google.com
robertshih@google.com
sigquit@google.com
+vickymin@google.com
\ No newline at end of file
diff --git a/gnss/aidl/OWNERS b/gnss/aidl/OWNERS
index b7b4a2e..e5b585e 100644
--- a/gnss/aidl/OWNERS
+++ b/gnss/aidl/OWNERS
@@ -1,3 +1,5 @@
+# Bug component: 393449
+
gomo@google.com
smalkos@google.com
wyattriley@google.com
diff --git a/gnss/aidl/vts/gnss_hal_test.cpp b/gnss/aidl/vts/gnss_hal_test.cpp
index 3907f57..64e51c7 100644
--- a/gnss/aidl/vts/gnss_hal_test.cpp
+++ b/gnss/aidl/vts/gnss_hal_test.cpp
@@ -447,6 +447,7 @@
const int numMeasurementEvents,
const int timeoutSeconds,
std::vector<int>& deltasMs) {
+ callback->gnss_data_cbq_.reset(); // throw away the initial measurements if any
int64_t lastElapsedRealtimeMillis = 0;
for (int i = 0; i < numMeasurementEvents; i++) {
GnssData lastGnssData;
diff --git a/graphics/mapper/2.0/default/passthrough.cpp b/graphics/mapper/2.0/default/passthrough.cpp
index 93d6d99..e18b88f 100644
--- a/graphics/mapper/2.0/default/passthrough.cpp
+++ b/graphics/mapper/2.0/default/passthrough.cpp
@@ -19,14 +19,6 @@
using android::hardware::graphics::mapper::V2_0::IMapper;
using android::hardware::graphics::mapper::V2_0::passthrough::GrallocLoader;
-// Preload the gralloc module such that GraphicBufferMapper::preloadHal is
-// meaningful
-class GrallocPreloader {
-public:
- GrallocPreloader() { GrallocLoader::loadModule(); }
-};
-static GrallocPreloader sGrallocPreloader;
-
extern "C" IMapper* HIDL_FETCH_IMapper(const char* /*name*/) {
return GrallocLoader::load();
}
diff --git a/graphics/mapper/2.1/default/passthrough.cpp b/graphics/mapper/2.1/default/passthrough.cpp
index c99c984..c7f0cf5 100644
--- a/graphics/mapper/2.1/default/passthrough.cpp
+++ b/graphics/mapper/2.1/default/passthrough.cpp
@@ -19,14 +19,6 @@
using android::hardware::graphics::mapper::V2_1::IMapper;
using android::hardware::graphics::mapper::V2_1::passthrough::GrallocLoader;
-// Preload the gralloc module such that GraphicBufferMapper::preloadHal is
-// meaningful
-class GrallocPreloader {
-public:
- GrallocPreloader() { GrallocLoader::loadModule(); }
-};
-static GrallocPreloader sGrallocPreloader;
-
extern "C" IMapper* HIDL_FETCH_IMapper(const char* /*name*/) {
return GrallocLoader::load();
}
diff --git a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
index 69d4789..783ce11 100644
--- a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
+++ b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
@@ -257,7 +257,7 @@
BatteryChargingPolicy value;
/* set ChargingPolicy*/
- status = health->setChargingPolicy(static_cast<BatteryChargingPolicy>(2)); // LONG_LIFE
+ status = health->setChargingPolicy(BatteryChargingPolicy::LONG_LIFE);
ASSERT_THAT(status, AnyOf(IsOk(), ExceptionIs(EX_UNSUPPORTED_OPERATION)));
if (!status.isOk()) return;
@@ -265,7 +265,9 @@
status = health->getChargingPolicy(&value);
ASSERT_THAT(status, AnyOf(IsOk(), ExceptionIs(EX_UNSUPPORTED_OPERATION)));
if (!status.isOk()) return;
- ASSERT_THAT(static_cast<int>(value), Eq(2));
+ // the result of getChargingPolicy will be one of default(1), ADAPTIVE_AON(2)
+ // ADAPTIVE_AC(3) or LONG_LIFE(4). default(1) means NOT_SUPPORT
+ ASSERT_THAT(static_cast<int>(value), AnyOf(Eq(1), Eq(4)));
}
MATCHER(IsValidHealthData, "") {
diff --git a/health/storage/aidl/vts/functional/OWNERS b/health/storage/aidl/vts/functional/OWNERS
new file mode 100644
index 0000000..a15ed7c
--- /dev/null
+++ b/health/storage/aidl/vts/functional/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 30545
+file:platform/hardware/interfaces:/health/aidl/OWNERS
\ No newline at end of file
diff --git a/identity/OWNERS b/identity/OWNERS
index 6969910..9353bbc 100644
--- a/identity/OWNERS
+++ b/identity/OWNERS
@@ -1,2 +1,4 @@
+# Bug component: 1084909
+
swillden@google.com
zeuthen@google.com
diff --git a/identity/aidl/vts/Android.bp b/identity/aidl/vts/Android.bp
index 5e303bb..6f7ab54 100644
--- a/identity/aidl/vts/Android.bp
+++ b/identity/aidl/vts/Android.bp
@@ -61,16 +61,3 @@
],
require_root: true,
}
-
-java_test_host {
- name: "IdentityCredentialImplementedTest",
- libs: [
- "tradefed",
- "vts-core-tradefed-harness",
- ],
- srcs: ["src/**/*.java"],
- test_suites: [
- "vts",
- ],
- test_config: "IdentityCredentialImplementedTest.xml",
-}
diff --git a/identity/aidl/vts/IdentityCredentialImplementedTest.xml b/identity/aidl/vts/IdentityCredentialImplementedTest.xml
deleted file mode 100644
index 4276ae6..0000000
--- a/identity/aidl/vts/IdentityCredentialImplementedTest.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Copyright (C) 2022 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.
--->
-<configuration description="Runs IdentityCredentialImplementedTest">
- <target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
-
- <test class="com.android.tradefed.testtype.HostTest" >
- <option name="jar" value="IdentityCredentialImplementedTest.jar" />
- </test>
-</configuration>
diff --git a/identity/aidl/vts/src/com/android/tests/security/identity/IdentityCredentialImplementedTest.java b/identity/aidl/vts/src/com/android/tests/security/identity/IdentityCredentialImplementedTest.java
deleted file mode 100644
index 4936f8c..0000000
--- a/identity/aidl/vts/src/com/android/tests/security/identity/IdentityCredentialImplementedTest.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (C) 2022 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.
- */
-
-package com.android.tests.security.identity;
-
-import static org.junit.Assert.fail;
-import static org.junit.Assume.assumeTrue;
-
-import android.platform.test.annotations.RequiresDevice;
-import com.android.tradefed.device.DeviceNotAvailableException;
-import com.android.tradefed.testtype.DeviceJUnit4ClassRunner;
-import com.android.tradefed.testtype.junit4.BaseHostJUnit4Test;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-// This is a host-test which executes shell commands on the device. It would be
-// nicer to have this be a Device test (like CTS) but this is currently not
-// possible, see https://source.android.com/docs/core/tests/vts
-
-@RunWith(DeviceJUnit4ClassRunner.class)
-public class IdentityCredentialImplementedTest extends BaseHostJUnit4Test {
- // Returns the ro.vendor.api_level or 0 if not set.
- //
- // Throws NumberFormatException if ill-formatted.
- //
- // Throws DeviceNotAvailableException if device is not available.
- //
- private int getVendorApiLevel() throws NumberFormatException, DeviceNotAvailableException {
- String vendorApiLevelString =
- getDevice().executeShellCommand("getprop ro.vendor.api_level").trim();
- if (vendorApiLevelString.isEmpty()) {
- return 0;
- }
- return Integer.parseInt(vendorApiLevelString);
- }
-
- // As of Android 14 VSR (vendor API level 34), Identity Credential is required at feature
- // version 202301 or later.
- @RequiresDevice
- @Test
- public void testIdentityCredentialIsImplemented() throws Exception {
- int vendorApiLevel = getVendorApiLevel();
- assumeTrue(vendorApiLevel >= 34);
-
- final String minimumFeatureVersionNeeded = "202301";
-
- String result = getDevice().executeShellCommand(
- "pm has-feature android.hardware.identity_credential "
- + minimumFeatureVersionNeeded);
- if (!result.trim().equals("true")) {
- fail("Identity Credential feature version " + minimumFeatureVersionNeeded
- + " required but not found");
- }
- }
-}
diff --git a/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp
index dcf8451..e344458 100644
--- a/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp
+++ b/neuralnetworks/aidl/vts/functional/GeneratedTestHarness.cpp
@@ -736,8 +736,8 @@
// If a sync fence is returned, try start another run waiting for the sync
// fence.
if (testConfig.reusable) {
- ret = execution->executeFenced(waitFor, kNoDeadline, kNoDuration,
- &executionResult);
+ // Nothing to do because at most one execution may occur on a reusable
+ // execution object at any given time.
} else if (testConfig.useConfig) {
ret = preparedModel->executeFencedWithConfig(
request, waitFor,
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
index 655b869..38cb33b 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
@@ -87,12 +87,19 @@
cellIdentities.cellIdentityTdscdma.size());
if (checkMccMnc) {
- // 32 bit system gets result: "\xff\xff\xff..." from RIL, which is not testable. Only
- // test for 64 bit here. TODO: remove this limit after b/113181277 being fixed.
- if (hidl_mcc.size() < 4 && hidl_mnc.size() < 4) {
+ // 32 bit system gets result: "\xff\xff\xff..." from RIL, which is not testable.
+ // Only test for 64 bit here. TODO: remove this limit after b/113181277 being fixed.
+ int mccSize = hidl_mcc.size();
+ EXPECT_TRUE(mccSize == 0 || mccSize == 3);
+ if (mccSize > 0) {
int mcc = stoi(hidl_mcc);
- int mnc = stoi(hidl_mnc);
EXPECT_TRUE(mcc >= 0 && mcc <= 999);
+ }
+
+ int mncSize = hidl_mnc.size();
+ EXPECT_TRUE(mncSize == 0 || mncSize == 2 || mncSize == 3);
+ if (mncSize > 0) {
+ int mnc = stoi(hidl_mnc);
EXPECT_TRUE(mnc >= 0 && mnc <= 999);
}
}
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
index 624d003..ee8b4dc 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_misc.cpp
@@ -654,6 +654,8 @@
ASSERT_TRUE(CheckAnyOfErrors(radioRsp->rspInfo.error,
{RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
}
+ // wait until modem reset finishes
+ sleep(10);
LOG(DEBUG) << "nvResetConfig finished";
}
diff --git a/radio/1.0/vts/functional/vts_hal_radio_target_test.xml b/radio/1.0/vts/functional/vts_hal_radio_target_test.xml
index 82af2ee..7aaadff 100644
--- a/radio/1.0/vts/functional/vts_hal_radio_target_test.xml
+++ b/radio/1.0/vts/functional/vts_hal_radio_target_test.xml
@@ -16,6 +16,7 @@
<configuration description="Runs VtsHalRadioV1_0TargetTest.">
<option name="test-suite-tag" value="apct" />
<option name="test-suite-tag" value="apct-native" />
+ <option name="config-descriptor:metadata" key="token" value="SIM_CARD" />
<!-- TODO: b/154638140, b/152655658: bad interactions -->
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
diff --git a/radio/1.1/vts/functional/AndroidTest.xml b/radio/1.1/vts/functional/AndroidTest.xml
index f1bc7a8..90428f4 100644
--- a/radio/1.1/vts/functional/AndroidTest.xml
+++ b/radio/1.1/vts/functional/AndroidTest.xml
@@ -16,6 +16,7 @@
<configuration description="Runs VtsHalRadioV1_1TargetTest.">
<option name="test-suite-tag" value="apct" />
<option name="test-suite-tag" value="apct-native" />
+ <option name="config-descriptor:metadata" key="token" value="SIM_CARD" />
<!-- TODO: b/154638140, b/152655658: bad interactions -->
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
diff --git a/radio/1.2/vts/functional/AndroidTest.xml b/radio/1.2/vts/functional/AndroidTest.xml
index 9904760..e25249b 100644
--- a/radio/1.2/vts/functional/AndroidTest.xml
+++ b/radio/1.2/vts/functional/AndroidTest.xml
@@ -16,6 +16,7 @@
<configuration description="Runs VtsHalRadioV1_2TargetTest.">
<option name="test-suite-tag" value="apct" />
<option name="test-suite-tag" value="apct-native" />
+ <option name="config-descriptor:metadata" key="token" value="SIM_CARD" />
<!-- TODO: b/154638140, b/152655658: bad interactions -->
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
diff --git a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp
index 2400bde..2bce2f9 100644
--- a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp
@@ -120,7 +120,7 @@
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_2::NetworkScanRequest request = {
- .type = ScanType::ONE_SHOT,
+ .type = ScanType::PERIODIC,
.interval = 4,
.specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850},
.maxSearchTime = 60,
@@ -155,7 +155,7 @@
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_2::NetworkScanRequest request = {
- .type = ScanType::ONE_SHOT,
+ .type = ScanType::PERIODIC,
.interval = 301,
.specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850},
.maxSearchTime = 60,
@@ -821,11 +821,20 @@
cellIdentities.cellIdentityTdscdma.size());
// 32 bit system might return invalid mcc and mnc hidl string "\xff\xff..."
- if (checkMccMnc && hidl_mcc.size() < 4 && hidl_mnc.size() < 4) {
- int mcc = stoi(hidl_mcc);
- int mnc = stoi(hidl_mnc);
- EXPECT_TRUE(mcc >= 0 && mcc <= 999);
- EXPECT_TRUE(mnc >= 0 && mnc <= 999);
+ if (checkMccMnc) {
+ int mccSize = hidl_mcc.size();
+ EXPECT_TRUE(mccSize == 0 || mccSize == 3);
+ if (mccSize > 0) {
+ int mcc = stoi(hidl_mcc);
+ EXPECT_TRUE(mcc >= 0 && mcc <= 999);
+ }
+
+ int mncSize = hidl_mnc.size();
+ EXPECT_TRUE(mncSize == 0 || mncSize == 2 || mncSize == 3);
+ if (mncSize > 0) {
+ int mnc = stoi(hidl_mnc);
+ EXPECT_TRUE(mnc >= 0 && mnc <= 999);
+ }
}
}
diff --git a/radio/1.3/vts/functional/AndroidTest.xml b/radio/1.3/vts/functional/AndroidTest.xml
index 9df8f9c..44b7419 100644
--- a/radio/1.3/vts/functional/AndroidTest.xml
+++ b/radio/1.3/vts/functional/AndroidTest.xml
@@ -16,6 +16,7 @@
<configuration description="Runs VtsHalRadioV1_3TargetTest.">
<option name="test-suite-tag" value="apct" />
<option name="test-suite-tag" value="apct-native" />
+ <option name="config-descriptor:metadata" key="token" value="SIM_CARD" />
<!-- TODO: b/154638140, b/152655658: bad interactions -->
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
diff --git a/radio/1.4/vts/functional/AndroidTest.xml b/radio/1.4/vts/functional/AndroidTest.xml
index 469e103..d0843e6 100644
--- a/radio/1.4/vts/functional/AndroidTest.xml
+++ b/radio/1.4/vts/functional/AndroidTest.xml
@@ -16,6 +16,7 @@
<configuration description="Runs VtsHalRadioV1_4TargetTest.">
<option name="test-suite-tag" value="apct" />
<option name="test-suite-tag" value="apct-native" />
+ <option name="config-descriptor:metadata" key="token" value="SIM_CARD" />
<!-- TODO: b/154638140, b/152655658: bad interactions -->
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer" />
diff --git a/radio/1.4/vts/functional/radio_hidl_hal_api.cpp b/radio/1.4/vts/functional/radio_hidl_hal_api.cpp
index 8f357a0..744af75 100644
--- a/radio/1.4/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.4/vts/functional/radio_hidl_hal_api.cpp
@@ -335,7 +335,7 @@
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_2::NetworkScanRequest request = {
- .type = ScanType::ONE_SHOT,
+ .type = ScanType::PERIODIC,
.interval = 4,
.specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850},
.maxSearchTime = 60,
@@ -368,7 +368,7 @@
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_2::NetworkScanRequest request = {
- .type = ScanType::ONE_SHOT,
+ .type = ScanType::PERIODIC,
.interval = 301,
.specifiers = {::GERAN_SPECIFIER_P900, ::GERAN_SPECIFIER_850},
.maxSearchTime = 60,
diff --git a/radio/1.5/vts/functional/radio_hidl_hal_api.cpp b/radio/1.5/vts/functional/radio_hidl_hal_api.cpp
index 5994d88..fd44e93 100644
--- a/radio/1.5/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.5/vts/functional/radio_hidl_hal_api.cpp
@@ -564,23 +564,23 @@
TEST_P(RadioHidlTest_v1_5, startNetworkScan) {
serial = GetRandomSerialNumber();
- ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands bandP900;
- bandP900.geranBands() = {GeranBands::BAND_P900};
- ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band850;
- band850.geranBands() = {GeranBands::BAND_850};
- ::android::hardware::radio::V1_5::RadioAccessSpecifier specifierP900 = {
- .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN,
- .bands = bandP900,
+ ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band17;
+ band17.eutranBands({::android::hardware::radio::V1_5::EutranBands::BAND_17});
+ ::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band20;
+ band20.eutranBands({::android::hardware::radio::V1_5::EutranBands::BAND_20});
+ ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier17 = {
+ .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::EUTRAN,
+ .bands = band17,
.channels = {1, 2}};
- ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier850 = {
- .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::GERAN,
- .bands = band850,
+ ::android::hardware::radio::V1_5::RadioAccessSpecifier specifier20 = {
+ .radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::EUTRAN,
+ .bands = band20,
.channels = {128, 129}};
::android::hardware::radio::V1_5::NetworkScanRequest request = {
.type = ScanType::ONE_SHOT,
.interval = 60,
- .specifiers = {specifierP900, specifier850},
+ .specifiers = {specifier17, specifier20},
.maxSearchTime = 60,
.incrementalResults = false,
.incrementalResultsPeriodicity = 1};
@@ -595,7 +595,7 @@
if (cardStatus.base.base.base.cardState == CardState::ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error, {RadioError::SIM_ABSENT}));
} else if (cardStatus.base.base.base.cardState == CardState::PRESENT) {
- // Modems have "GSM" rat scan need to
+ // Modems support 3GPP RAT family need to
// support scanning requests combined with some parameters.
if (deviceSupportsFeature(FEATURE_TELEPHONY_GSM)) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_v1_5->rspInfo.error,
@@ -661,7 +661,7 @@
.channels = {128, 129}};
::android::hardware::radio::V1_5::NetworkScanRequest request = {
- .type = ScanType::ONE_SHOT,
+ .type = ScanType::PERIODIC,
.interval = 4,
.specifiers = {specifierP900, specifier850},
.maxSearchTime = 60,
@@ -705,7 +705,7 @@
.channels = {128, 129}};
::android::hardware::radio::V1_5::NetworkScanRequest request = {
- .type = ScanType::ONE_SHOT,
+ .type = ScanType::PERIODIC,
.interval = 301,
.specifiers = {specifierP900, specifier850},
.maxSearchTime = 60,
diff --git a/radio/aidl/vts/AndroidTest.xml b/radio/aidl/vts/AndroidTest.xml
index 36381d1..7edc072 100644
--- a/radio/aidl/vts/AndroidTest.xml
+++ b/radio/aidl/vts/AndroidTest.xml
@@ -16,6 +16,7 @@
<configuration description="Runs VtsHalRadioTargetTest.">
<option name="test-suite-tag" value="apct" />
<option name="test-suite-tag" value="apct-native" />
+ <option name="config-descriptor:metadata" key="token" value="SIM_CARD" />
<target_preparer class="com.android.tradefed.targetprep.MultiSimPreparer" />
<target_preparer class="com.android.tradefed.targetprep.RootTargetPreparer">
@@ -31,4 +32,4 @@
<option name="native-test-timeout" value="300000" /> <!-- 5 min -->
<option name="module-name" value="VtsHalRadioTargetTest" />
</test>
-</configuration>
\ No newline at end of file
+</configuration>
diff --git a/radio/aidl/vts/radio_aidl_hal_utils.cpp b/radio/aidl/vts/radio_aidl_hal_utils.cpp
index 6ed8e7d..f18da55 100644
--- a/radio/aidl/vts/radio_aidl_hal_utils.cpp
+++ b/radio/aidl/vts/radio_aidl_hal_utils.cpp
@@ -85,7 +85,7 @@
// Do not use checkSubstringInCommandOutput("getprop persist.radio.multisim.config", "")
// until b/148904287 is fixed. We need exact matching instead of partial matching. (i.e.
// by definition the empty string "" is a substring of any string).
- return !isDsDsEnabled() && !isTsTsEnabled();
+ return !isDsDsEnabled() && !isTsTsEnabled() && !isDsDaEnabled();
}
bool isDsDsEnabled() {
@@ -125,8 +125,8 @@
ALOGI("%s instance is not valid for SSSS device.", serviceName.c_str());
return false;
}
- } else if (isDsDsEnabled()) {
- // Device is configured as DSDS.
+ } else if (isDsDsEnabled() || isDsDaEnabled()) {
+ // Device is configured as DSDS or DSDA.
if (!stringEndsWith(serviceName, RADIO_SERVICE_SLOT1_NAME) &&
!stringEndsWith(serviceName, RADIO_SERVICE_SLOT2_NAME)) {
ALOGI("%s instance is not valid for DSDS device.", serviceName.c_str());
diff --git a/radio/aidl/vts/radio_data_test.cpp b/radio/aidl/vts/radio_data_test.cpp
index 1cc6a36..3eedc14 100644
--- a/radio/aidl/vts/radio_data_test.cpp
+++ b/radio/aidl/vts/radio_data_test.cpp
@@ -233,14 +233,10 @@
EXPECT_EQ(std::cv_status::no_timeout, wait());
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_data->rspInfo.type);
EXPECT_EQ(serial, radioRsp_data->rspInfo.serial);
- if (getRadioHalCapabilities()) {
- ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
- {RadioError::REQUEST_NOT_SUPPORTED}));
- } else {
- ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
- {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
- RadioError::INTERNAL_ERR, RadioError::MODEM_ERR}));
- }
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_data->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::INTERNAL_ERR, RadioError::MODEM_ERR,
+ RadioError::REQUEST_NOT_SUPPORTED}));
}
/*
@@ -535,8 +531,7 @@
ASSERT_TRUE(CheckAnyOfErrors(
radioRsp_data->rspInfo.error,
- {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_ARGUMENTS,
- RadioError::REQUEST_NOT_SUPPORTED}));
+ {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
}
@@ -553,8 +548,7 @@
ASSERT_TRUE(
CheckAnyOfErrors(radioRsp_data->rspInfo.error,
- {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
- RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
+ {RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED}));
}
/*
diff --git a/radio/aidl/vts/radio_modem_test.cpp b/radio/aidl/vts/radio_modem_test.cpp
index f88da13..e867378 100644
--- a/radio/aidl/vts/radio_modem_test.cpp
+++ b/radio/aidl/vts/radio_modem_test.cpp
@@ -264,6 +264,8 @@
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_modem->rspInfo.error,
{RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED}));
}
+ // wait until modem reset finishes
+ sleep(10);
LOG(DEBUG) << "nvResetConfig finished";
}
diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp
index 679d6c7..95ab2b1 100644
--- a/radio/aidl/vts/radio_network_test.cpp
+++ b/radio/aidl/vts/radio_network_test.cpp
@@ -66,12 +66,20 @@
}
/*
- * Test IRadioNetwork.setAllowedNetworkTypesBitmap for the response returned.
+ * Test IRadioNetwork.setAllowedNetworkTypesBitmap and IRadioNetwork.getAllowedNetworkTypesBitmap
+ * for the response returned.
*/
-TEST_P(RadioNetworkTest, setAllowedNetworkTypesBitmap) {
+TEST_P(RadioNetworkTest, setGetAllowedNetworkTypesBitmap) {
serial = GetRandomSerialNumber();
- int32_t allowedNetworkTypesBitmap = static_cast<int32_t>(RadioAccessFamily::LTE);
+ // save current value
+ radio_network->getAllowedNetworkTypesBitmap(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ int32_t currentAllowedNetworkTypesBitmap = radioRsp_network->networkTypeBitmapResponse;
+
+ // set new value
+ int32_t allowedNetworkTypesBitmap = static_cast<int32_t>(RadioAccessFamily::LTE);
+ serial = GetRandomSerialNumber();
radio_network->setAllowedNetworkTypesBitmap(serial, allowedNetworkTypesBitmap);
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -83,20 +91,6 @@
RadioError::MODE_NOT_SUPPORTED, RadioError::INTERNAL_ERR, RadioError::MODEM_ERR,
RadioError::INVALID_ARGUMENTS, RadioError::REQUEST_NOT_SUPPORTED,
RadioError::NO_RESOURCES}));
-}
-
-/*
- * Test IRadioNetwork.getAllowedNetworkTypesBitmap for the response returned.
- */
-TEST_P(RadioNetworkTest, getAllowedNetworkTypesBitmap) {
- serial = GetRandomSerialNumber();
- int32_t allowedNetworkTypesBitmap = static_cast<int32_t>(RadioAccessFamily::LTE);
-
- radio_network->setAllowedNetworkTypesBitmap(serial, allowedNetworkTypesBitmap);
-
- EXPECT_EQ(std::cv_status::no_timeout, wait());
- EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
- EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
if (radioRsp_network->rspInfo.error == RadioError::NONE) {
sleep(3); // wait for modem
@@ -112,7 +106,16 @@
RadioError::OPERATION_NOT_ALLOWED, RadioError::MODE_NOT_SUPPORTED,
RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR,
RadioError::REQUEST_NOT_SUPPORTED, RadioError::NO_RESOURCES}));
+ if (radioRsp_network->rspInfo.error == RadioError::NONE) {
+ // verify we get the value we set
+ ASSERT_EQ(radioRsp_network->networkTypeBitmapResponse, allowedNetworkTypesBitmap);
+ }
}
+
+ // reset value to previous
+ serial = GetRandomSerialNumber();
+ radio_network->setAllowedNetworkTypesBitmap(serial, currentAllowedNetworkTypesBitmap);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
}
/*
@@ -829,20 +832,20 @@
TEST_P(RadioNetworkTest, startNetworkScan) {
serial = GetRandomSerialNumber();
- RadioAccessSpecifierBands bandP900 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_P900});
- RadioAccessSpecifierBands band850 =
- RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::geranBands>(
- {GeranBands::BAND_850});
- RadioAccessSpecifier specifierP900 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = bandP900, .channels = {1, 2}};
- RadioAccessSpecifier specifier850 = {
- .accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
+ RadioAccessSpecifierBands band17 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::eutranBands>(
+ {EutranBands::BAND_17});
+ RadioAccessSpecifierBands band20 =
+ RadioAccessSpecifierBands::make<RadioAccessSpecifierBands::eutranBands>(
+ {EutranBands::BAND_20});
+ RadioAccessSpecifier specifier17 = {
+ .accessNetwork = AccessNetwork::EUTRAN, .bands = band17, .channels = {1, 2}};
+ RadioAccessSpecifier specifier20 = {
+ .accessNetwork = AccessNetwork::EUTRAN, .bands = band20, .channels = {128, 129}};
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
.interval = 60,
- .specifiers = {specifierP900, specifier850},
+ .specifiers = {specifier17, specifier20},
.maxSearchTime = 60,
.incrementalResults = false,
.incrementalResultsPeriodicity = 1};
@@ -858,11 +861,9 @@
if (cardStatus.cardState == CardStatus::STATE_ABSENT) {
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, {RadioError::SIM_ABSENT}));
} else if (cardStatus.cardState == CardStatus::STATE_PRESENT) {
- // OPERATION_NOT_ALLOWED should not be allowed; however, some vendors do
- // not support the required manual GSM search functionality. This is
- // tracked in b/112206766. Modems have "GSM" rat scan need to
- // support scanning requests combined with some parameters.
if (deviceSupportsFeature(FEATURE_TELEPHONY_GSM)) {
+ // Modems support 3GPP RAT family need to
+ // support scanning requests combined with some parameters.
ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
{RadioError::NONE, RadioError::OPERATION_NOT_ALLOWED}));
} else {
@@ -922,7 +923,7 @@
RadioAccessSpecifier specifier850 = {
.accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
- NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
+ NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_PERIODIC,
.interval = 4,
.specifiers = {specifierP900, specifier850},
.maxSearchTime = 60,
@@ -963,7 +964,7 @@
RadioAccessSpecifier specifier850 = {
.accessNetwork = AccessNetwork::GERAN, .bands = band850, .channels = {128, 129}};
- NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
+ NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_PERIODIC,
.interval = 301,
.specifiers = {specifierP900, specifier850},
.maxSearchTime = 60,
@@ -1496,11 +1497,20 @@
}
// 32 bit system might return invalid mcc and mnc string "\xff\xff..."
- if (checkMccMnc && mcc.size() < 4 && mnc.size() < 4) {
- int mcc_int = stoi(mcc);
- int mnc_int = stoi(mnc);
- EXPECT_TRUE(mcc_int >= 0 && mcc_int <= 999);
- EXPECT_TRUE(mnc_int >= 0 && mnc_int <= 999);
+ if (checkMccMnc) {
+ int mccSize = mcc.size();
+ EXPECT_TRUE(mccSize == 0 || mccSize == 3);
+ if (mccSize > 0) {
+ int mcc_int = stoi(mcc);
+ EXPECT_TRUE(mcc_int >= 0 && mcc_int <= 999);
+ }
+
+ int mncSize = mnc.size();
+ EXPECT_TRUE(mncSize == 0 || mncSize == 2 || mncSize == 3);
+ if (mncSize > 0) {
+ int mnc_int = stoi(mnc);
+ EXPECT_TRUE(mnc_int >= 0 && mnc_int <= 999);
+ }
}
// Check for access technology specific info
diff --git a/secure_element/aidl/android/hardware/secure_element/ISecureElement.aidl b/secure_element/aidl/android/hardware/secure_element/ISecureElement.aidl
index 8c0dd6d..800494a 100644
--- a/secure_element/aidl/android/hardware/secure_element/ISecureElement.aidl
+++ b/secure_element/aidl/android/hardware/secure_element/ISecureElement.aidl
@@ -117,6 +117,9 @@
* closed by this operation.
* HAL service must send onStateChange() with connected equal to true
* after resetting and all the re-initialization has been successfully completed.
+ *
+ * @throws ServiceSpecificException on error with the following code:
+ * - FAILED if the service was unable to reset the secure element.
*/
void reset();
diff --git a/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp b/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp
index 0925a21..97b4e27 100644
--- a/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp
+++ b/secure_element/aidl/vts/VtsHalSecureElementTargetTest.cpp
@@ -83,10 +83,15 @@
void expectCallbackHistory(std::vector<bool>&& want) {
std::unique_lock<std::mutex> l(m);
- cv.wait_for(l, 2s, [&]() { return history.size() >= want.size(); });
+ cv.wait_for(l, 5s, [&]() { return history.size() >= want.size(); });
EXPECT_THAT(history, ElementsAreArray(want));
}
+ void resetCallbackHistory() {
+ std::unique_lock<std::mutex> l(m);
+ history.clear();
+ }
+
private:
std::mutex m; // guards history
std::condition_variable cv;
@@ -118,7 +123,9 @@
}
void TearDown() override {
+ secure_element_callback_->resetCallbackHistory();
EXPECT_OK(secure_element_->reset());
+ secure_element_callback_->expectCallbackHistory({false, true});
secure_element_ = nullptr;
secure_element_callback_ = nullptr;
}
@@ -284,14 +291,21 @@
TEST_P(SecureElementAidl, transmit) {
std::vector<uint8_t> response;
+ LogicalChannelResponse logical_channel_response;
- // transmit called after init shall succeed.
- // Note: no channel is opened for this test and the transmit
- // response will have the status SW_LOGICAL_CHANNEL_NOT_SUPPORTED.
- // The transmit response shall be larger than 2 bytes as it includes the
- // status code.
- EXPECT_OK(secure_element_->transmit(kDataApdu, &response));
- EXPECT_GE(response.size(), 2u);
+ // Note: no channel is opened for this test
+ // transmit() will return an empty response with the error
+ // code CHANNEL_NOT_AVAILABLE when the SE cannot be
+ // communicated with.
+ EXPECT_ERR(secure_element_->transmit(kDataApdu, &response));
+
+ EXPECT_OK(secure_element_->openLogicalChannel(kSelectableAid, 0x00, &logical_channel_response));
+ EXPECT_GE(logical_channel_response.selectResponse.size(), 2u);
+ EXPECT_GE(logical_channel_response.channelNumber, 1u);
+ EXPECT_LE(logical_channel_response.channelNumber, 19u);
+
+ // transmit called on the logical channel should succeed.
+ EXPECT_EQ(transmit(logical_channel_response.channelNumber), 0x9000);
}
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SecureElementAidl);
diff --git a/security/keymint/aidl/vts/functional/Android.bp b/security/keymint/aidl/vts/functional/Android.bp
index ed3ca74..7a4359d 100644
--- a/security/keymint/aidl/vts/functional/Android.bp
+++ b/security/keymint/aidl/vts/functional/Android.bp
@@ -63,6 +63,7 @@
srcs: [
"AttestKeyTest.cpp",
"AuthTest.cpp",
+ "BootloaderStateTest.cpp",
"DeviceUniqueAttestationTest.cpp",
"KeyBlobUpgradeTest.cpp",
"KeyMintTest.cpp",
diff --git a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
index 8ffc179..c035f19 100644
--- a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
+++ b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
@@ -88,96 +88,9 @@
class AttestKeyTest : public KeyMintAidlTestBase {
public:
void SetUp() override {
- check_skip_test();
+ skipAttestKeyTest();
KeyMintAidlTestBase::SetUp();
}
-
- protected:
- const string FEATURE_KEYSTORE_APP_ATTEST_KEY = "android.hardware.keystore.app_attest_key";
-
- const string FEATURE_STRONGBOX_KEYSTORE = "android.hardware.strongbox_keystore";
-
- ErrorCode GenerateAttestKey(const AuthorizationSet& key_desc,
- const optional<AttestationKey>& attest_key,
- vector<uint8_t>* key_blob,
- vector<KeyCharacteristics>* key_characteristics,
- vector<Certificate>* cert_chain) {
- // The original specification for KeyMint v1 required ATTEST_KEY not be combined
- // with any other key purpose, but the original VTS tests incorrectly did exactly that.
- // This means that a device that launched prior to Android T (API level 33) may
- // accept or even require KeyPurpose::SIGN too.
- if (property_get_int32("ro.board.first_api_level", 0) < __ANDROID_API_T__) {
- AuthorizationSet key_desc_plus_sign = key_desc;
- key_desc_plus_sign.push_back(TAG_PURPOSE, KeyPurpose::SIGN);
-
- auto result = GenerateKey(key_desc_plus_sign, attest_key, key_blob, key_characteristics,
- cert_chain);
- if (result == ErrorCode::OK) {
- return result;
- }
- // If the key generation failed, it may be because the device is (correctly)
- // rejecting the combination of ATTEST_KEY+SIGN. Fall through to try again with
- // just ATTEST_KEY.
- }
- return GenerateKey(key_desc, attest_key, key_blob, key_characteristics, cert_chain);
- }
-
- // Check if ATTEST_KEY feature is disabled
- bool is_attest_key_feature_disabled(void) const {
- if (!check_feature(FEATURE_KEYSTORE_APP_ATTEST_KEY)) {
- GTEST_LOG_(INFO) << "Feature " + FEATURE_KEYSTORE_APP_ATTEST_KEY + " is disabled";
- return true;
- }
-
- return false;
- }
-
- // Check if StrongBox KeyStore is enabled
- bool is_strongbox_enabled(void) const {
- if (check_feature(FEATURE_STRONGBOX_KEYSTORE)) {
- GTEST_LOG_(INFO) << "Feature " + FEATURE_STRONGBOX_KEYSTORE + " is enabled";
- return true;
- }
-
- return false;
- }
-
- // Check if chipset has received a waiver allowing it to be launched with Android S or T with
- // Keymaster 4.0 in StrongBox.
- bool is_chipset_allowed_km4_strongbox(void) const {
- std::array<char, PROPERTY_VALUE_MAX> buffer;
-
- const int32_t first_api_level = property_get_int32("ro.board.first_api_level", 0);
- if (first_api_level <= 0 || first_api_level > __ANDROID_API_T__) return false;
-
- auto res = property_get("ro.vendor.qti.soc_model", buffer.data(), nullptr);
- if (res <= 0) return false;
-
- const string allowed_soc_models[] = {"SM8450", "SM8475", "SM8550", "SXR2230P"};
-
- for (const string model : allowed_soc_models) {
- if (model.compare(buffer.data()) == 0) {
- GTEST_LOG_(INFO) << "QTI SOC Model " + model + " is allowed SB KM 4.0";
- return true;
- }
- }
-
- return false;
- }
-
- // Skip the test if all the following conditions hold:
- // 1. ATTEST_KEY feature is disabled
- // 2. STRONGBOX is enabled
- // 3. The device is running one of the chipsets that have received a waiver
- // allowing it to be launched with Android S (or later) with Keymaster 4.0
- // in StrongBox
- void check_skip_test(void) const {
- // Check the chipset first as that doesn't require a round-trip to Package Manager.
- if (is_chipset_allowed_km4_strongbox() && is_strongbox_enabled() &&
- is_attest_key_feature_disabled()) {
- GTEST_SKIP() << "Test is not applicable";
- }
- }
};
/*
@@ -1019,12 +932,8 @@
.Authorization(TAG_ATTESTATION_ID_MANUFACTURER, "malformed-manufacturer")
.Authorization(TAG_ATTESTATION_ID_MODEL, "malicious-model");
- // TODO(b/262255219): Remove this condition when StrongBox supports 2nd IMEI attestation.
- if (SecLevel() != SecurityLevel::STRONGBOX) {
- if (isSecondImeiIdAttestationRequired()) {
- attestation_id_tags.Authorization(TAG_ATTESTATION_ID_SECOND_IMEI,
- "invalid-second-imei");
- }
+ if (isSecondImeiIdAttestationRequired()) {
+ attestation_id_tags.Authorization(TAG_ATTESTATION_ID_SECOND_IMEI, "invalid-second-imei");
}
vector<uint8_t> key_blob;
vector<KeyCharacteristics> key_characteristics;
@@ -1061,11 +970,6 @@
GTEST_SKIP() << "Test not applicable under GSI";
}
- // TODO(b/262255219): Remove this condition when StrongBox supports 2nd IMEI attestation.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- GTEST_SKIP() << "Test not applicable for SecurityLevel::STRONGBOX";
- }
-
// Skip the test if there is no second IMEI exists.
string second_imei = get_imei(1);
if (second_imei.empty() || second_imei.compare("null") == 0) {
@@ -1144,11 +1048,6 @@
GTEST_SKIP() << "Test not applicable under GSI";
}
- // TODO(b/262255219): Remove this condition when StrongBox supports 2nd IMEI attestation.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- GTEST_SKIP() << "Test not applicable for SecurityLevel::STRONGBOX";
- }
-
// Skip the test if there is no first IMEI exists.
string imei = get_imei(0);
if (imei.empty() || imei.compare("null") == 0) {
diff --git a/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp b/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp
new file mode 100644
index 0000000..dff0498
--- /dev/null
+++ b/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+#define LOG_TAG "keymint_1_bootloader_test"
+
+#include <memory>
+#include <optional>
+#include <string>
+#include <vector>
+
+#include <android/binder_manager.h>
+#include <remote_prov/remote_prov_utils.h>
+
+#include "KeyMintAidlTestBase.h"
+
+namespace aidl::android::hardware::security::keymint::test {
+
+using ::android::getAidlHalInstanceNames;
+using ::std::string;
+using ::std::vector;
+
+// Since this test needs to talk to KeyMint HAL, it can only run as root. Thus,
+// bootloader can not be locked.
+class BootloaderStateTest : public KeyMintAidlTestBase {};
+
+// Check that attested bootloader state is set to unlocked.
+TEST_P(BootloaderStateTest, IsUnlocked) {
+ // Generate a key with attestation.
+ vector<uint8_t> key_blob;
+ vector<KeyCharacteristics> key_characteristics;
+ AuthorizationSet keyDesc = AuthorizationSetBuilder()
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .EcdsaSigningKey(EcCurve::P_256)
+ .AttestationChallenge("foo")
+ .AttestationApplicationId("bar")
+ .Digest(Digest::NONE)
+ .SetDefaultValidity();
+ auto result = GenerateKey(keyDesc, &key_blob, &key_characteristics);
+ // If factory provisioned attestation key is not supported by Strongbox,
+ // then create a key with self-signed attestation and use it as the
+ // attestation key instead.
+ if (SecLevel() == SecurityLevel::STRONGBOX &&
+ result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
+ result = GenerateKeyWithSelfSignedAttestKey(
+ AuthorizationSetBuilder()
+ .EcdsaKey(EcCurve::P_256)
+ .AttestKey()
+ .SetDefaultValidity(), /* attest key params */
+ keyDesc, &key_blob, &key_characteristics);
+ }
+ ASSERT_EQ(ErrorCode::OK, result);
+
+ // Parse attested AVB values.
+ X509_Ptr cert(parse_cert_blob(cert_chain_[0].encodedCertificate));
+ ASSERT_TRUE(cert.get());
+
+ ASN1_OCTET_STRING* attest_rec = get_attestation_record(cert.get());
+ ASSERT_TRUE(attest_rec);
+
+ vector<uint8_t> key;
+ VerifiedBoot attestedVbState;
+ bool attestedBootloaderState;
+ vector<uint8_t> attestedVbmetaDigest;
+ auto error = parse_root_of_trust(attest_rec->data, attest_rec->length, &key, &attestedVbState,
+ &attestedBootloaderState, &attestedVbmetaDigest);
+ ASSERT_EQ(error, ErrorCode::OK);
+ ASSERT_FALSE(attestedBootloaderState) << "This test runs as root. Bootloader must be unlocked.";
+}
+
+INSTANTIATE_KEYMINT_AIDL_TEST(BootloaderStateTest);
+
+} // namespace aidl::android::hardware::security::keymint::test
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
index 5e27bd0..a8ea407 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
@@ -322,12 +322,13 @@
const AuthorizationSet& attest_key_desc, const AuthorizationSet& key_desc,
vector<uint8_t>* key_blob, vector<KeyCharacteristics>* key_characteristics,
vector<Certificate>* cert_chain) {
+ skipAttestKeyTest();
AttestationKey attest_key;
vector<Certificate> attest_cert_chain;
vector<KeyCharacteristics> attest_key_characteristics;
// Generate a key with self signed attestation.
- auto error = GenerateKey(attest_key_desc, std::nullopt, &attest_key.keyBlob,
- &attest_key_characteristics, &attest_cert_chain);
+ auto error = GenerateAttestKey(attest_key_desc, std::nullopt, &attest_key.keyBlob,
+ &attest_key_characteristics, &attest_cert_chain);
if (error != ErrorCode::OK) {
return error;
}
@@ -1548,6 +1549,88 @@
return result;
}
+ErrorCode KeyMintAidlTestBase::GenerateAttestKey(const AuthorizationSet& key_desc,
+ const optional<AttestationKey>& attest_key,
+ vector<uint8_t>* key_blob,
+ vector<KeyCharacteristics>* key_characteristics,
+ vector<Certificate>* cert_chain) {
+ // The original specification for KeyMint v1 required ATTEST_KEY not be combined
+ // with any other key purpose, but the original VTS tests incorrectly did exactly that.
+ // This means that a device that launched prior to Android T (API level 33) may
+ // accept or even require KeyPurpose::SIGN too.
+ if (property_get_int32("ro.board.first_api_level", 0) < __ANDROID_API_T__) {
+ AuthorizationSet key_desc_plus_sign = key_desc;
+ key_desc_plus_sign.push_back(TAG_PURPOSE, KeyPurpose::SIGN);
+
+ auto result = GenerateKey(key_desc_plus_sign, attest_key, key_blob, key_characteristics,
+ cert_chain);
+ if (result == ErrorCode::OK) {
+ return result;
+ }
+ // If the key generation failed, it may be because the device is (correctly)
+ // rejecting the combination of ATTEST_KEY+SIGN. Fall through to try again with
+ // just ATTEST_KEY.
+ }
+ return GenerateKey(key_desc, attest_key, key_blob, key_characteristics, cert_chain);
+}
+
+// Check if ATTEST_KEY feature is disabled
+bool KeyMintAidlTestBase::is_attest_key_feature_disabled(void) const {
+ if (!check_feature(FEATURE_KEYSTORE_APP_ATTEST_KEY)) {
+ GTEST_LOG_(INFO) << "Feature " + FEATURE_KEYSTORE_APP_ATTEST_KEY + " is disabled";
+ return true;
+ }
+
+ return false;
+}
+
+// Check if StrongBox KeyStore is enabled
+bool KeyMintAidlTestBase::is_strongbox_enabled(void) const {
+ if (check_feature(FEATURE_STRONGBOX_KEYSTORE)) {
+ GTEST_LOG_(INFO) << "Feature " + FEATURE_STRONGBOX_KEYSTORE + " is enabled";
+ return true;
+ }
+
+ return false;
+}
+
+// Check if chipset has received a waiver allowing it to be launched with Android S or T with
+// Keymaster 4.0 in StrongBox.
+bool KeyMintAidlTestBase::is_chipset_allowed_km4_strongbox(void) const {
+ std::array<char, PROPERTY_VALUE_MAX> buffer;
+
+ const int32_t first_api_level = property_get_int32("ro.board.first_api_level", 0);
+ if (first_api_level <= 0 || first_api_level > __ANDROID_API_T__) return false;
+
+ auto res = property_get("ro.vendor.qti.soc_model", buffer.data(), nullptr);
+ if (res <= 0) return false;
+
+ const string allowed_soc_models[] = {"SM8450", "SM8475", "SM8550", "SXR2230P"};
+
+ for (const string model : allowed_soc_models) {
+ if (model.compare(buffer.data()) == 0) {
+ GTEST_LOG_(INFO) << "QTI SOC Model " + model + " is allowed SB KM 4.0";
+ return true;
+ }
+ }
+
+ return false;
+}
+
+// Skip the test if all the following conditions hold:
+// 1. ATTEST_KEY feature is disabled
+// 2. STRONGBOX is enabled
+// 3. The device is running one of the chipsets that have received a waiver
+// allowing it to be launched with Android S (or later) with Keymaster 4.0
+// in StrongBox
+void KeyMintAidlTestBase::skipAttestKeyTest(void) const {
+ // Check the chipset first as that doesn't require a round-trip to Package Manager.
+ if (is_chipset_allowed_km4_strongbox() && is_strongbox_enabled() &&
+ is_attest_key_feature_disabled()) {
+ GTEST_SKIP() << "Test is not applicable";
+ }
+}
+
void verify_serial(X509* cert, const uint64_t expected_serial) {
BIGNUM_Ptr ser(BN_new());
EXPECT_TRUE(ASN1_INTEGER_to_BN(X509_get_serialNumber(cert), ser.get()));
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
index 3245ca9..30ac452 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
@@ -54,6 +54,9 @@
constexpr uint64_t kOpHandleSentinel = 0xFFFFFFFFFFFFFFFF;
+const string FEATURE_KEYSTORE_APP_ATTEST_KEY = "android.hardware.keystore.app_attest_key";
+const string FEATURE_STRONGBOX_KEYSTORE = "android.hardware.strongbox_keystore";
+
class KeyMintAidlTestBase : public ::testing::TestWithParam<string> {
public:
struct KeyData {
@@ -347,6 +350,17 @@
ErrorCode UseRsaKey(const vector<uint8_t>& rsaKeyBlob);
ErrorCode UseEcdsaKey(const vector<uint8_t>& ecdsaKeyBlob);
+ ErrorCode GenerateAttestKey(const AuthorizationSet& key_desc,
+ const optional<AttestationKey>& attest_key,
+ vector<uint8_t>* key_blob,
+ vector<KeyCharacteristics>* key_characteristics,
+ vector<Certificate>* cert_chain);
+
+ bool is_attest_key_feature_disabled(void) const;
+ bool is_strongbox_enabled(void) const;
+ bool is_chipset_allowed_km4_strongbox(void) const;
+ void skipAttestKeyTest(void) const;
+
protected:
std::shared_ptr<IKeyMintDevice> keymint_;
uint32_t os_version_;
diff --git a/security/keymint/aidl/vts/functional/KeyMintTest.cpp b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
index c6b8906..bdec4d3 100644
--- a/security/keymint/aidl/vts/functional/KeyMintTest.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
@@ -26,6 +26,7 @@
#include <openssl/ec.h>
#include <openssl/evp.h>
#include <openssl/mem.h>
+#include <openssl/x509.h>
#include <openssl/x509v3.h>
#include <cutils/properties.h>
@@ -590,8 +591,7 @@
return name.substr(pos + 1);
}
-bool matching_rp_instance(const string& km_name,
- std::shared_ptr<IRemotelyProvisionedComponent>* rp) {
+std::shared_ptr<IRemotelyProvisionedComponent> matching_rp_instance(const std::string& km_name) {
string km_suffix = device_suffix(km_name);
vector<string> rp_names =
@@ -601,11 +601,10 @@
// KeyMint instance, assume they match.
if (device_suffix(rp_name) == km_suffix && AServiceManager_isDeclared(rp_name.c_str())) {
::ndk::SpAIBinder binder(AServiceManager_waitForService(rp_name.c_str()));
- *rp = IRemotelyProvisionedComponent::fromBinder(binder);
- return true;
+ return IRemotelyProvisionedComponent::fromBinder(binder);
}
}
- return false;
+ return nullptr;
}
} // namespace
@@ -1061,6 +1060,42 @@
}
/*
+ * NewKeyGenerationTest.RsaWithSpecifiedValidity
+ *
+ * Verifies that KeyMint respects specified NOT_BEFORE and NOT_AFTER certificate dates.
+ */
+TEST_P(NewKeyGenerationTest, RsaWithSpecifiedValidity) {
+ vector<uint8_t> key_blob;
+ vector<KeyCharacteristics> key_characteristics;
+ ASSERT_EQ(ErrorCode::OK,
+ GenerateKey(AuthorizationSetBuilder()
+ .RsaSigningKey(2048, 65537)
+ .Digest(Digest::NONE)
+ .Padding(PaddingMode::NONE)
+ .Authorization(TAG_CERTIFICATE_NOT_BEFORE,
+ 1183806000000 /* 2007-07-07T11:00:00Z */)
+ .Authorization(TAG_CERTIFICATE_NOT_AFTER,
+ 1916049600000 /* 2030-09-19T12:00:00Z */),
+ &key_blob, &key_characteristics));
+ ASSERT_GT(cert_chain_.size(), 0);
+
+ X509_Ptr cert(parse_cert_blob(cert_chain_[0].encodedCertificate));
+ ASSERT_TRUE(!!cert.get());
+
+ const ASN1_TIME* not_before = X509_get0_notBefore(cert.get());
+ ASSERT_NE(not_before, nullptr);
+ time_t not_before_time;
+ ASSERT_EQ(ASN1_TIME_to_time_t(not_before, ¬_before_time), 1);
+ EXPECT_EQ(not_before_time, 1183806000);
+
+ const ASN1_TIME* not_after = X509_get0_notAfter(cert.get());
+ ASSERT_NE(not_after, nullptr);
+ time_t not_after_time;
+ ASSERT_EQ(ASN1_TIME_to_time_t(not_after, ¬_after_time), 1);
+ EXPECT_EQ(not_after_time, 1916049600);
+}
+
+/*
* NewKeyGenerationTest.RsaWithAttestation
*
* Verifies that keymint can generate all required RSA key sizes with attestation, and that the
@@ -1140,11 +1175,14 @@
GTEST_SKIP() << "RKP support is not required on this platform";
}
- // There should be an IRemotelyProvisionedComponent instance associated with the KeyMint
- // instance.
- std::shared_ptr<IRemotelyProvisionedComponent> rp;
- ASSERT_TRUE(matching_rp_instance(GetParam(), &rp))
- << "No IRemotelyProvisionedComponent found that matches KeyMint device " << GetParam();
+ // Check for an IRemotelyProvisionedComponent instance associated with the
+ // KeyMint instance.
+ std::shared_ptr<IRemotelyProvisionedComponent> rp = matching_rp_instance(GetParam());
+ if (rp == nullptr && SecLevel() == SecurityLevel::STRONGBOX) {
+ GTEST_SKIP() << "Encountered StrongBox implementation that does not support RKP";
+ }
+ ASSERT_NE(rp, nullptr) << "No IRemotelyProvisionedComponent found that matches KeyMint device "
+ << GetParam();
// Generate a P-256 keypair to use as an attestation key.
MacedPublicKey macedPubKey;
@@ -1218,11 +1256,14 @@
GTEST_SKIP() << "RKP support is not required on this platform";
}
- // There should be an IRemotelyProvisionedComponent instance associated with the KeyMint
- // instance.
- std::shared_ptr<IRemotelyProvisionedComponent> rp;
- ASSERT_TRUE(matching_rp_instance(GetParam(), &rp))
- << "No IRemotelyProvisionedComponent found that matches KeyMint device " << GetParam();
+ // Check for an IRemotelyProvisionedComponent instance associated with the
+ // KeyMint instance.
+ std::shared_ptr<IRemotelyProvisionedComponent> rp = matching_rp_instance(GetParam());
+ if (rp == nullptr && SecLevel() == SecurityLevel::STRONGBOX) {
+ GTEST_SKIP() << "Encountered StrongBox implementation that does not support RKP";
+ }
+ ASSERT_NE(rp, nullptr) << "No IRemotelyProvisionedComponent found that matches KeyMint device "
+ << GetParam();
// Generate a P-256 keypair to use as an attestation key.
MacedPublicKey macedPubKey;
@@ -3077,11 +3118,8 @@
* presented.
*/
TEST_P(SigningOperationsTest, NoUserConfirmation) {
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- GTEST_SKIP() << "Test not applicable to StrongBox device";
- }
ASSERT_EQ(ErrorCode::OK, GenerateKey(AuthorizationSetBuilder()
- .RsaSigningKey(1024, 65537)
+ .RsaSigningKey(2048, 65537)
.Digest(Digest::NONE)
.Padding(PaddingMode::NONE)
.Authorization(TAG_NO_AUTH_REQUIRED)
@@ -7784,10 +7822,6 @@
* in hardware.
*/
TEST_P(UsageCountLimitTest, TestSingleUseKeyAndRollbackResistance) {
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- GTEST_SKIP() << "Test not applicable to StrongBox device";
- }
-
auto error = GenerateKey(AuthorizationSetBuilder()
.RsaSigningKey(2048, 65537)
.Digest(Digest::NONE)
diff --git a/security/keymint/support/remote_prov_utils.cpp b/security/keymint/support/remote_prov_utils.cpp
index 086ee79..3cb783c 100644
--- a/security/keymint/support/remote_prov_utils.cpp
+++ b/security/keymint/support/remote_prov_utils.cpp
@@ -22,6 +22,7 @@
#include "aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.h"
#include <aidl/android/hardware/security/keymint/RpcHardwareInfo.h>
+#include <android-base/macros.h>
#include <android-base/properties.h>
#include <cppbor.h>
#include <hwtrust/hwtrust.h>
@@ -43,6 +44,7 @@
constexpr int32_t kBccPayloadSubjPubKey = -4670552;
constexpr int32_t kBccPayloadKeyUsage = -4670553;
constexpr int kP256AffinePointSize = 32;
+constexpr uint32_t kNumTeeDeviceInfoEntries = 14;
using EC_KEY_Ptr = bssl::UniquePtr<EC_KEY>;
using EVP_PKEY_Ptr = bssl::UniquePtr<EVP_PKEY>;
@@ -388,6 +390,11 @@
return entryName + " has an invalid value.\n";
}
+bool isTeeDeviceInfo(const cppbor::Map& devInfo) {
+ return devInfo.get("security_level") && devInfo.get("security_level")->asTstr() &&
+ devInfo.get("security_level")->asTstr()->value() == "tee";
+}
+
ErrMsgOr<std::unique_ptr<cppbor::Map>> parseAndValidateDeviceInfo(
const std::vector<uint8_t>& deviceInfoBytes, IRemotelyProvisionedComponent* provisionable,
bool isFactory) {
@@ -396,6 +403,21 @@
const cppbor::Array kValidSecurityLevels = {"tee", "strongbox"};
const cppbor::Array kValidAttIdStates = {"locked", "open"};
const cppbor::Array kValidFused = {0, 1};
+ constexpr std::array<std::string_view, kNumTeeDeviceInfoEntries> kDeviceInfoKeys = {
+ "brand",
+ "manufacturer",
+ "product",
+ "model",
+ "device",
+ "vb_state",
+ "bootloader_state",
+ "vbmeta_digest",
+ "os_version",
+ "system_patch_level",
+ "boot_patch_level",
+ "vendor_patch_level",
+ "security_level",
+ "fused"};
struct AttestationIdEntry {
const char* id;
@@ -439,20 +461,48 @@
}
std::string error;
+ std::string tmp;
+ std::set<std::string_view> previousKeys;
switch (info.versionNumber) {
case 3:
+ if (isTeeDeviceInfo(*parsed) && parsed->size() != kNumTeeDeviceInfoEntries) {
+ error += fmt::format(
+ "Err: Incorrect number of device info entries. Expected {} but got "
+ "{}\n",
+ kNumTeeDeviceInfoEntries, parsed->size());
+ }
+ // TEE IRPC instances require all entries to be present in DeviceInfo. Non-TEE instances
+ // may omit `os_version`
+ if (!isTeeDeviceInfo(*parsed) && (parsed->size() != kNumTeeDeviceInfoEntries &&
+ parsed->size() != kNumTeeDeviceInfoEntries - 1)) {
+ error += fmt::format(
+ "Err: Incorrect number of device info entries. Expected {} or {} but got "
+ "{}\n",
+ kNumTeeDeviceInfoEntries - 1, kNumTeeDeviceInfoEntries, parsed->size());
+ }
+ for (auto& [key, _] : *parsed) {
+ const std::string& keyValue = key->asTstr()->value();
+ if (!previousKeys.insert(keyValue).second) {
+ error += "Err: Duplicate device info entry: <" + keyValue + ">,\n";
+ }
+ if (std::find(kDeviceInfoKeys.begin(), kDeviceInfoKeys.end(), keyValue) ==
+ kDeviceInfoKeys.end()) {
+ error += "Err: Unrecognized key entry: <" + key->asTstr()->value() + ">,\n";
+ }
+ }
+ FALLTHROUGH_INTENDED;
case 2:
for (const auto& entry : kAttestationIdEntrySet) {
- error += checkMapEntry(isFactory && !entry.alwaysValidate, *parsed, cppbor::TSTR,
- entry.id);
+ tmp = checkMapEntry(isFactory && !entry.alwaysValidate, *parsed, cppbor::TSTR,
+ entry.id);
}
- if (!error.empty()) {
- return error +
- "Attestation IDs are missing or malprovisioned. If this test is being\n"
- "run against an early proto or EVT build, this error is probably WAI\n"
- "and indicates that Device IDs were not provisioned in the factory. If\n"
- "this error is returned on a DVT or later build revision, then\n"
- "something is likely wrong with the factory provisioning process.";
+ if (!tmp.empty()) {
+ error += tmp +
+ "Attestation IDs are missing or malprovisioned. If this test is being\n"
+ "run against an early proto or EVT build, this error is probably WAI\n"
+ "and indicates that Device IDs were not provisioned in the factory. If\n"
+ "this error is returned on a DVT or later build revision, then\n"
+ "something is likely wrong with the factory provisioning process.";
}
// TODO: Refactor the KeyMint code that validates these fields and include it here.
error += checkMapEntry(isFactory, *parsed, cppbor::TSTR, "vb_state", kValidVbStates);
@@ -465,8 +515,7 @@
error += checkMapEntry(isFactory, *parsed, cppbor::UINT, "fused", kValidFused);
error += checkMapEntry(isFactory, *parsed, cppbor::TSTR, "security_level",
kValidSecurityLevels);
- if (parsed->get("security_level") && parsed->get("security_level")->asTstr() &&
- parsed->get("security_level")->asTstr()->value() == "tee") {
+ if (isTeeDeviceInfo(*parsed)) {
error += checkMapEntry(isFactory, *parsed, cppbor::TSTR, "os_version");
}
break;
@@ -570,7 +619,7 @@
}
// BCC is [ pubkey, + BccEntry]
- auto bccContents = validateBcc(bcc->asArray(), hwtrust::DiceChain::Kind::kProtectedData);
+ auto bccContents = validateBcc(bcc->asArray(), hwtrust::DiceChain::Kind::kVsr13);
if (!bccContents) {
return bccContents.message() + "\n" + prettyPrint(bcc.get());
}
@@ -806,8 +855,8 @@
return "Challenge must be a Bstr.";
}
- if (challenge.size() < 16 || challenge.size() > 64) {
- return "Challenge size must be between 16 and 64 bytes inclusive. "
+ if (challenge.size() > 64) {
+ return "Challenge size must be between 0 and 64 bytes inclusive. "
"However, challenge is " +
std::to_string(challenge.size()) + " bytes long.";
}
@@ -861,7 +910,7 @@
}
// DICE chain is [ pubkey, + DiceChainEntry ].
- auto diceContents = validateBcc(diceCertChain, hwtrust::DiceChain::Kind::kAuthenticatedMessage);
+ auto diceContents = validateBcc(diceCertChain, hwtrust::DiceChain::Kind::kVsr14);
if (!diceContents) {
return diceContents.message() + "\n" + prettyPrint(diceCertChain);
}
diff --git a/security/rkp/CHANGELOG.md b/security/rkp/CHANGELOG.md
index 9409a6d..6593ab2 100644
--- a/security/rkp/CHANGELOG.md
+++ b/security/rkp/CHANGELOG.md
@@ -31,7 +31,7 @@
* IRemotelyProvisionedComponent
* The need for an EEK has been removed. There is no longer an encrypted portion of the CSR.
* Keys for new CSR format must be generated with test mode set to false, effectively removing test
- mode in the new CSR flow. Old behavior is kept unchanged for backwards compatibility.
+ mode in the new CSR flow.
* The schema for the CSR itself has been significantly simplified, please see
IRemotelyProvisionedComponent.aidl for more details. Notably,
* the chain of signing, MACing, and encryption operations has been replaced with a single
@@ -42,6 +42,7 @@
`AuthenticatedRequest<T>` object representing the top level data required to authenticate
the data provided in the payload, `T`.
* The new CSR format supports P-384 signing keys and SHA-384 hashes in the DICE chain.
+ * The component version can now be either an int or a string.
* RpcHardwareInfo
* `supportedNumKeysInCsr` added to report the maximum number of keys supported in a CSR.
* `supportedEekCurve` is no longer used, due to the removal of the EEK from the scheme.
diff --git a/security/rkp/README.md b/security/rkp/README.md
index 9090ac5..01c90a8 100644
--- a/security/rkp/README.md
+++ b/security/rkp/README.md
@@ -302,7 +302,7 @@
| ----------------- | ------ | ---------- | ----------------------------------|
| Component name | -70002 | tstr | Name of firmware component / boot |
: : : : stage :
-| Component version | -70003 | int | Version of firmware component / |
+| Component version | -70003 | int / tstr | Version of firmware component / |
: : : : boot stage :
| Resettable | -70004 | null | If present, key changes on factory|
: : : : reset :
diff --git a/security/rkp/aidl/android/hardware/security/keymint/DeviceInfo.aidl b/security/rkp/aidl/android/hardware/security/keymint/DeviceInfo.aidl
index f0af619..8456148 100644
--- a/security/rkp/aidl/android/hardware/security/keymint/DeviceInfo.aidl
+++ b/security/rkp/aidl/android/hardware/security/keymint/DeviceInfo.aidl
@@ -17,11 +17,11 @@
package android.hardware.security.keymint;
/**
- * DeviceInfo contains information about the device that's fed in as AAD in the signature of the
- * device private key over the MAC key used for the bundle of public keys. These values are intended
- * to be checked by the server to verify that the certificate signing request crafted by
- * an IRemotelyProvisionedComponent HAL instance is coming from the expected device based
- * on values initially uploaded during device manufacture in the factory.
+ * DeviceInfo contains information about the device that's signed by the
+ * IRemotelyProvisionedComponent HAL. These values are intended to be checked by the server to
+ * verify that the certificate signing request crafted by an IRemotelyProvisionedComponent HAL
+ * instance is coming from the expected device based on values initially uploaded during device
+ * manufacture in the factory.
* @hide
*/
@VintfStability
@@ -31,6 +31,11 @@
* canonicalized according to the specification in RFC 7049. The ordering presented here is
* non-canonical to group similar entries semantically.
*
+ * The DeviceInfo has changed across versions 1, 2, and 3 of the HAL. All versions of the
+ * DeviceInfo CDDL are described as follows. Please refer to the CDDL structure version
+ * that corresponds to the HAL version you are working with:
+ *
+ * Version 3, introduced in Android 14:
* DeviceInfo = {
* "brand" : tstr,
* "manufacturer" : tstr,
@@ -43,13 +48,63 @@
* ? "os_version" : tstr, ; Same as
* ; android.os.Build.VERSION.release
* ; Not optional for TEE.
- * "system_patch_level" : uint, ; YYYYMMDD
- * "boot_patch_level" : uint, ; YYYYMMDD
- * "vendor_patch_level" : uint, ; YYYYMMDD
+ * "system_patch_level" : uint, ; YYYYMM, must match KeyMint OS_PATCHLEVEL
+ * "boot_patch_level" : uint, ; YYYYMMDD, must match KeyMint BOOT_PATCHLEVEL
+ * "vendor_patch_level" : uint, ; YYYYMMDD, must match KeyMint VENDOR_PATCHLEVEL
* "security_level" : "tee" / "strongbox",
* "fused": 1 / 0, ; 1 if secure boot is enforced for the processor that the IRPC
* ; implementation is contained in. 0 otherwise.
* }
+ *
+ * ---------------------------------------------------------------------------------------------
+ *
+ * Version 2, introduced in Android 13:
+ * DeviceInfo = {
+ * "brand" : tstr,
+ * "manufacturer" : tstr,
+ * "product" : tstr,
+ * "model" : tstr,
+ * "device" : tstr,
+ * "vb_state" : "green" / "yellow" / "orange", ; Taken from the AVB values
+ * "bootloader_state" : "locked" / "unlocked", ; Taken from the AVB values
+ * "vbmeta_digest": bstr, ; Taken from the AVB values
+ * ? "os_version" : tstr, ; Same as
+ * ; android.os.Build.VERSION.release
+ * ; Not optional for TEE.
+ * "system_patch_level" : uint, ; YYYYMM, must match KeyMint OS_PATCHLEVEL
+ * "boot_patch_level" : uint, ; YYYYMMDD, must match KeyMint BOOT_PATCHLEVEL
+ * "vendor_patch_level" : uint, ; YYYYMMDD, must match KeyMint VENDOR_PATCHLEVEL
+ * "version" : 2, ; The CDDL schema version.
+ * "security_level" : "tee" / "strongbox",
+ * "fused": 1 / 0, ; 1 if secure boot is enforced for the processor that the IRPC
+ * ; implementation is contained in. 0 otherwise.
+ *
+ * ---------------------------------------------------------------------------------------------
+ *
+ * Version 1, introduced in Android 12:
+ * DeviceInfo = {
+ * ? "brand" : tstr,
+ * ? "manufacturer" : tstr,
+ * ? "product" : tstr,
+ * ? "model" : tstr,
+ * ? "board" : tstr,
+ * ? "vb_state" : "green" / "yellow" / "orange", ; Taken from the AVB values
+ * ? "bootloader_state" : "locked" / "unlocked", ; Taken from the AVB values
+ * ? "vbmeta_digest": bstr, ; Taken from the AVB values
+ * ? "os_version" : tstr, ; Same as
+ * ; android.os.Build.VERSION.release
+ * ? "system_patch_level" : uint, ; YYYYMM, must match KeyMint OS_PATCHLEVEL
+ * ? "boot_patch_level" : uint, ; YYYYMMDD, must match KeyMint BOOT_PATCHLEVEL
+ * ? "vendor_patch_level" : uint, ; YYYYMMDD, must match KeyMint VENDOR_PATCHLEVEL
+ * "version" : 1, ; The CDDL schema version.
+ * "security_level" : "tee" / "strongbox"
+ * "att_id_state": "locked" / "open", ; Attestation IDs State. If "locked", this
+ * ; indicates a device's attestable IDs are
+ * ; factory-locked and immutable. If "open",
+ * ; this indicates the device is still in a
+ * ; provisionable state and the attestable IDs
+ * ; are not yet frozen.
+ * }
*/
byte[] deviceInfo;
}
diff --git a/security/rkp/aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl b/security/rkp/aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl
index 35b83dd..2a4cba1 100644
--- a/security/rkp/aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl
+++ b/security/rkp/aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.aidl
@@ -134,6 +134,10 @@
* are marked (see the definition of PublicKey in the MacedPublicKey structure) to
* prevent them from being confused with production keys.
*
+ * This parameter has been deprecated since version 3 of the HAL and will always be
+ * false. From v3, if this parameter is true, the method must raise a
+ * ServiceSpecificException with an error of code of STATUS_REMOVED.
+ *
* @param out MacedPublicKey macedPublicKey contains the public key of the generated key pair,
* MACed so that generateCertificateRequest can easily verify, without the
* privateKeyHandle, that the contained public key is for remote certification.
@@ -144,9 +148,9 @@
byte[] generateEcdsaP256KeyPair(in boolean testMode, out MacedPublicKey macedPublicKey);
/**
- * This method can be removed in version 3 of the HAL. The header is kept around for
- * backwards compatibility purposes. From v3, this method is allowed to raise a
- * ServiceSpecificException with an error code of STATUS_REMOVED.
+ * This method has been deprecated since version 3 of the HAL. The header is kept around for
+ * backwards compatibility purposes. From v3, this method must raise a ServiceSpecificException
+ * with an error code of STATUS_REMOVED.
*
* For v1 and v2 implementations:
* generateCertificateRequest creates a certificate request to be sent to the provisioning
@@ -315,7 +319,7 @@
*
* @param in challenge contains a byte string from the provisioning server which will be
* included in the signed data of the CSR structure. Different provisioned backends may
- * use different semantic data for this field, but the supported sizes must be between 16
+ * use different semantic data for this field, but the supported sizes must be between 0
* and 64 bytes, inclusive.
*
* @return the following CBOR Certificate Signing Request (Csr) serialized into a byte array:
@@ -344,7 +348,7 @@
* UdsCerts,
* DiceCertChain,
* SignedData<[
- * challenge: bstr .size (16..64), ; Provided by the method parameters
+ * challenge: bstr .size (0..64), ; Provided by the method parameters
* bstr .cbor T,
* ]>,
* ]
@@ -421,7 +425,7 @@
* ? -4670547 : bstr, ; Configuration Hash
* -4670548 : bstr .cbor { ; Configuration Descriptor
* ? -70002 : tstr, ; Component name
- * ? -70003 : int, ; Firmware version
+ * ? -70003 : int / tstr, ; Component version
* ? -70004 : null, ; Resettable
* },
* -4670549 : bstr, ; Authority Hash
diff --git a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
index bf40976..62463eb 100644
--- a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
+++ b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
@@ -47,7 +47,14 @@
namespace {
constexpr int32_t VERSION_WITH_UNIQUE_ID_SUPPORT = 2;
+
+constexpr int32_t VERSION_WITHOUT_EEK = 3;
constexpr int32_t VERSION_WITHOUT_TEST_MODE = 3;
+constexpr int32_t VERSION_WITH_CERTIFICATE_REQUEST_V2 = 3;
+constexpr int32_t VERSION_WITH_SUPPORTED_NUM_KEYS_IN_CSR = 3;
+
+constexpr uint8_t MIN_CHALLENGE_SIZE = 0;
+constexpr uint8_t MAX_CHALLENGE_SIZE = 64;
#define INSTANTIATE_REM_PROV_AIDL_TEST(name) \
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(name); \
@@ -223,21 +230,13 @@
RpcHardwareInfo hwInfo;
ASSERT_TRUE(provisionable_->getHardwareInfo(&hwInfo).isOk());
- const std::set<int> validCurves = {RpcHardwareInfo::CURVE_P256, RpcHardwareInfo::CURVE_25519};
- // First check for the implementations that supports only IRPC V3+.
- if (rpcHardwareInfo.versionNumber >= VERSION_WITHOUT_TEST_MODE) {
- bytevec keysToSignMac;
- DeviceInfo deviceInfo;
- ProtectedData protectedData;
- auto status = provisionable_->generateCertificateRequest(false, {}, {}, {}, &deviceInfo,
- &protectedData, &keysToSignMac);
- if (!status.isOk() &&
- (status.getServiceSpecificError() == BnRemotelyProvisionedComponent::STATUS_REMOVED)) {
- ASSERT_EQ(hwInfo.supportedEekCurve, RpcHardwareInfo::CURVE_NONE)
- << "Invalid curve: " << hwInfo.supportedEekCurve;
- return;
- }
+ if (rpcHardwareInfo.versionNumber >= VERSION_WITHOUT_EEK) {
+ ASSERT_EQ(hwInfo.supportedEekCurve, RpcHardwareInfo::CURVE_NONE)
+ << "Invalid curve: " << hwInfo.supportedEekCurve;
+ return;
}
+
+ const std::set<int> validCurves = {RpcHardwareInfo::CURVE_P256, RpcHardwareInfo::CURVE_25519};
ASSERT_EQ(validCurves.count(hwInfo.supportedEekCurve), 1)
<< "Invalid curve: " << hwInfo.supportedEekCurve;
}
@@ -261,7 +260,7 @@
* Verify implementation supports at least MIN_SUPPORTED_NUM_KEYS_IN_CSR keys in a CSR.
*/
TEST_P(GetHardwareInfoTests, supportedNumKeysInCsr) {
- if (rpcHardwareInfo.versionNumber < VERSION_WITHOUT_TEST_MODE) {
+ if (rpcHardwareInfo.versionNumber < VERSION_WITH_SUPPORTED_NUM_KEYS_IN_CSR) {
return;
}
@@ -362,6 +361,13 @@
bytevec privateKeyBlob;
bool testMode = true;
auto status = provisionable_->generateEcdsaP256KeyPair(testMode, &macedPubKey, &privateKeyBlob);
+
+ if (rpcHardwareInfo.versionNumber >= VERSION_WITHOUT_TEST_MODE) {
+ ASSERT_FALSE(status.isOk());
+ EXPECT_EQ(status.getServiceSpecificError(), BnRemotelyProvisionedComponent::STATUS_REMOVED);
+ return;
+ }
+
ASSERT_TRUE(status.isOk());
check_maced_pubkey(macedPubKey, testMode, nullptr);
}
@@ -407,17 +413,9 @@
CertificateRequestTestBase::SetUp();
ASSERT_FALSE(HasFatalFailure());
- if (rpcHardwareInfo.versionNumber >= VERSION_WITHOUT_TEST_MODE) {
- bytevec keysToSignMac;
- DeviceInfo deviceInfo;
- ProtectedData protectedData;
- auto status = provisionable_->generateCertificateRequest(
- false, {}, {}, {}, &deviceInfo, &protectedData, &keysToSignMac);
- if (!status.isOk() && (status.getServiceSpecificError() ==
- BnRemotelyProvisionedComponent::STATUS_REMOVED)) {
- GTEST_SKIP() << "This test case applies to RKP v3+ only if "
- << "generateCertificateRequest() is implemented.";
- }
+ if (rpcHardwareInfo.versionNumber >= VERSION_WITH_CERTIFICATE_REQUEST_V2) {
+ GTEST_SKIP() << "This test case only applies to RKP v1 and v2. "
+ << "RKP version discovered: " << rpcHardwareInfo.versionNumber;
}
}
};
@@ -693,7 +691,7 @@
CertificateRequestTestBase::SetUp();
ASSERT_FALSE(HasFatalFailure());
- if (rpcHardwareInfo.versionNumber < VERSION_WITHOUT_TEST_MODE) {
+ if (rpcHardwareInfo.versionNumber < VERSION_WITH_CERTIFICATE_REQUEST_V2) {
GTEST_SKIP() << "This test case only applies to RKP v3 and above. "
<< "RKP version discovered: " << rpcHardwareInfo.versionNumber;
}
@@ -701,38 +699,63 @@
};
/**
- * Generate an empty certificate request, and decrypt and verify the structure and content.
+ * Generate an empty certificate request with all possible length of challenge, and decrypt and
+ * verify the structure and content.
*/
+// @VsrTest = 3.10-015
TEST_P(CertificateRequestV2Test, EmptyRequest) {
bytevec csr;
- auto status =
- provisionable_->generateCertificateRequestV2({} /* keysToSign */, challenge_, &csr);
- ASSERT_TRUE(status.isOk()) << status.getMessage();
+ for (auto size = MIN_CHALLENGE_SIZE; size <= MAX_CHALLENGE_SIZE; size++) {
+ SCOPED_TRACE(testing::Message() << "challenge[" << size << "]");
+ auto challenge = randomBytes(size);
+ auto status =
+ provisionable_->generateCertificateRequestV2({} /* keysToSign */, challenge, &csr);
+ ASSERT_TRUE(status.isOk()) << status.getMessage();
- auto result = verifyProductionCsr(cppbor::Array(), csr, provisionable_.get(), challenge_);
- ASSERT_TRUE(result) << result.message();
+ auto result = verifyProductionCsr(cppbor::Array(), csr, provisionable_.get(), challenge);
+ ASSERT_TRUE(result) << result.message();
+ }
}
/**
- * Generate a non-empty certificate request. Decrypt, parse and validate the contents.
+ * Generate a non-empty certificate request with all possible length of challenge. Decrypt, parse
+ * and validate the contents.
*/
+// @VsrTest = 3.10-015
TEST_P(CertificateRequestV2Test, NonEmptyRequest) {
generateKeys(false /* testMode */, 1 /* numKeys */);
bytevec csr;
- auto status = provisionable_->generateCertificateRequestV2(keysToSign_, challenge_, &csr);
- ASSERT_TRUE(status.isOk()) << status.getMessage();
+ for (auto size = MIN_CHALLENGE_SIZE; size <= MAX_CHALLENGE_SIZE; size++) {
+ SCOPED_TRACE(testing::Message() << "challenge[" << size << "]");
+ auto challenge = randomBytes(size);
+ auto status = provisionable_->generateCertificateRequestV2(keysToSign_, challenge, &csr);
+ ASSERT_TRUE(status.isOk()) << status.getMessage();
- auto result = verifyProductionCsr(cborKeysToSign_, csr, provisionable_.get(), challenge_);
- ASSERT_TRUE(result) << result.message();
+ auto result = verifyProductionCsr(cborKeysToSign_, csr, provisionable_.get(), challenge);
+ ASSERT_TRUE(result) << result.message();
+ }
+}
+
+/**
+ * Generate an empty certificate request with invalid size of challenge
+ */
+TEST_P(CertificateRequestV2Test, EmptyRequestWithInvalidChallengeFail) {
+ bytevec csr;
+
+ auto status = provisionable_->generateCertificateRequestV2(
+ /* keysToSign */ {}, randomBytes(MAX_CHALLENGE_SIZE + 1), &csr);
+ EXPECT_FALSE(status.isOk()) << status.getMessage();
+ EXPECT_EQ(status.getServiceSpecificError(), BnRemotelyProvisionedComponent::STATUS_FAILED);
}
/**
* Generate a non-empty certificate request. Make sure contents are reproducible but allow for the
* signature to be different since algorithms including ECDSA P-256 can include a random value.
*/
+// @VsrTest = 3.10-015
TEST_P(CertificateRequestV2Test, NonEmptyRequestReproducible) {
generateKeys(false /* testMode */, 1 /* numKeys */);
@@ -756,6 +779,7 @@
/**
* Generate a non-empty certificate request with multiple keys.
*/
+// @VsrTest = 3.10-015
TEST_P(CertificateRequestV2Test, NonEmptyRequestMultipleKeys) {
generateKeys(false /* testMode */, rpcHardwareInfo.supportedNumKeysInCsr /* numKeys */);
@@ -785,17 +809,31 @@
}
/**
- * Generate a non-empty certificate request in prod mode, with test keys. Must fail with
- * STATUS_TEST_KEY_IN_PRODUCTION_REQUEST.
+ * Call generateCertificateRequest(). Make sure it's removed.
*/
-TEST_P(CertificateRequestV2Test, NonEmptyRequest_testKeyInProdCert) {
- generateKeys(true /* testMode */, 1 /* numKeys */);
-
- bytevec csr;
- auto status = provisionable_->generateCertificateRequestV2(keysToSign_, challenge_, &csr);
+TEST_P(CertificateRequestV2Test, CertificateRequestV1Removed_prodMode) {
+ bytevec keysToSignMac;
+ DeviceInfo deviceInfo;
+ ProtectedData protectedData;
+ auto status = provisionable_->generateCertificateRequest(
+ false /* testMode */, {} /* keysToSign */, {} /* EEK chain */, challenge_, &deviceInfo,
+ &protectedData, &keysToSignMac);
ASSERT_FALSE(status.isOk()) << status.getMessage();
- ASSERT_EQ(status.getServiceSpecificError(),
- BnRemotelyProvisionedComponent::STATUS_TEST_KEY_IN_PRODUCTION_REQUEST);
+ EXPECT_EQ(status.getServiceSpecificError(), BnRemotelyProvisionedComponent::STATUS_REMOVED);
+}
+
+/**
+ * Call generateCertificateRequest() in test mode. Make sure it's removed.
+ */
+TEST_P(CertificateRequestV2Test, CertificateRequestV1Removed_testMode) {
+ bytevec keysToSignMac;
+ DeviceInfo deviceInfo;
+ ProtectedData protectedData;
+ auto status = provisionable_->generateCertificateRequest(
+ true /* testMode */, {} /* keysToSign */, {} /* EEK chain */, challenge_, &deviceInfo,
+ &protectedData, &keysToSignMac);
+ ASSERT_FALSE(status.isOk()) << status.getMessage();
+ EXPECT_EQ(status.getServiceSpecificError(), BnRemotelyProvisionedComponent::STATUS_REMOVED);
}
void parse_root_of_trust(const vector<uint8_t>& attestation_cert,
@@ -815,6 +853,7 @@
/**
* Generate a CSR and verify DeviceInfo against IDs attested by KeyMint.
*/
+// @VsrTest = 3.10-015
TEST_P(CertificateRequestV2Test, DeviceInfo) {
// See if there is a matching IKeyMintDevice for this IRemotelyProvisionedComponent.
std::shared_ptr<IKeyMintDevice> keyMint;
diff --git a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp
index d536e29..35220a2 100644
--- a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp
+++ b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp
@@ -98,6 +98,7 @@
CHECK_TYPE_STRING_FOR_SENSOR_TYPE(TILT_DETECTOR);
CHECK_TYPE_STRING_FOR_SENSOR_TYPE(WAKE_GESTURE);
CHECK_TYPE_STRING_FOR_SENSOR_TYPE(WRIST_TILT_GESTURE);
+ CHECK_TYPE_STRING_FOR_SENSOR_TYPE(HINGE_ANGLE);
default:
FAIL() << "Type " << static_cast<int>(type)
<< " in android defined range is not checked, "
diff --git a/sensors/common/default/2.X/multihal/tests/fake_subhal/Sensor.cpp b/sensors/common/default/2.X/multihal/tests/fake_subhal/Sensor.cpp
index a0bb67a..d8e292a 100644
--- a/sensors/common/default/2.X/multihal/tests/fake_subhal/Sensor.cpp
+++ b/sensors/common/default/2.X/multihal/tests/fake_subhal/Sensor.cpp
@@ -76,6 +76,7 @@
static_cast<int64_t>(mSensorInfo.minDelay) * 1000,
static_cast<int64_t>(mSensorInfo.maxDelay) * 1000);
+ std::unique_lock<std::mutex> lock(mRunMutex);
if (mSamplingPeriodNs != samplingPeriodNs) {
mSamplingPeriodNs = samplingPeriodNs;
// Wake up the 'run' thread to check if a new event should be generated now
diff --git a/tests/extension/vibrator/aidl/Android.bp b/tests/extension/vibrator/aidl/Android.bp
index 20df5bb..0306dca 100644
--- a/tests/extension/vibrator/aidl/Android.bp
+++ b/tests/extension/vibrator/aidl/Android.bp
@@ -38,5 +38,11 @@
enabled: false,
},
},
- versions: ["1"],
+ frozen: true,
+ versions_with_info: [
+ {
+ version: "1",
+ imports: ["android.hardware.vibrator-V2"],
+ },
+ ],
}
diff --git a/tests/extension/vibrator/aidl/default/Android.bp b/tests/extension/vibrator/aidl/default/Android.bp
index 0f3895f..5e156af 100644
--- a/tests/extension/vibrator/aidl/default/Android.bp
+++ b/tests/extension/vibrator/aidl/default/Android.bp
@@ -29,6 +29,6 @@
"libbase",
"libbinder_ndk",
"android.hardware.vibrator-V2-ndk",
- "android.hardware.tests.extension.vibrator-V2-ndk",
+ "android.hardware.tests.extension.vibrator-V1-ndk",
],
}
diff --git a/tv/cec/1.0/vts/functional/VtsHalTvCecV1_0TargetTest.cpp b/tv/cec/1.0/vts/functional/VtsHalTvCecV1_0TargetTest.cpp
index 7b42689..75c44b7 100644
--- a/tv/cec/1.0/vts/functional/VtsHalTvCecV1_0TargetTest.cpp
+++ b/tv/cec/1.0/vts/functional/VtsHalTvCecV1_0TargetTest.cpp
@@ -127,7 +127,15 @@
TEST_P(HdmiCecTest, SendMessage) {
CecMessage message;
- message.initiator = CecLogicalAddress::PLAYBACK_1;
+ if (hasDeviceType(CecDeviceType::TV))
+ {
+ hdmiCec->clearLogicalAddress();
+ Return<Result> result = hdmiCec->addLogicalAddress(CecLogicalAddress::TV);
+ EXPECT_EQ(result, Result::SUCCESS);
+ message.initiator = CecLogicalAddress::TV;
+ }
+ else
+ message.initiator = CecLogicalAddress::PLAYBACK_1;
message.destination = CecLogicalAddress::BROADCAST;
message.body.resize(1);
message.body[0] = 131;
diff --git a/tv/cec/OWNERS b/tv/cec/OWNERS
new file mode 100644
index 0000000..71e74c0
--- /dev/null
+++ b/tv/cec/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 826094
+include platform/frameworks/base:/core/java/android/hardware/hdmi/OWNERS
diff --git a/tv/tuner/1.0/vts/OWNERS b/tv/tuner/1.0/vts/OWNERS
index 1b3d095..9bdafca 100644
--- a/tv/tuner/1.0/vts/OWNERS
+++ b/tv/tuner/1.0/vts/OWNERS
@@ -1,3 +1,4 @@
+# Bug component: 136752
nchalko@google.com
amyjojo@google.com
shubang@google.com
diff --git a/tv/tuner/1.1/vts/OWNERS b/tv/tuner/1.1/vts/OWNERS
index 1b3d095..9bdafca 100644
--- a/tv/tuner/1.1/vts/OWNERS
+++ b/tv/tuner/1.1/vts/OWNERS
@@ -1,3 +1,4 @@
+# Bug component: 136752
nchalko@google.com
amyjojo@google.com
shubang@google.com
diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
index 0cc01c5..25d704e 100644
--- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
+++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
@@ -44,6 +44,7 @@
CCC_SUPPORTED_PULSE_SHAPE_COMBOS = 166,
CCC_SUPPORTED_RAN_MULTIPLIER = 167,
CCC_SUPPORTED_MAX_RANGING_SESSION_NUMBER = 168,
+ CCC_SUPPORTED_MIN_UWB_INITIATION_TIME_MS = 169,
SUPPORTED_AOA_RESULT_REQ_ANTENNA_INTERLEAVING = 227,
SUPPORTED_MIN_RANGING_INTERVAL_MS = 228,
SUPPORTED_RANGE_DATA_NTF_CONFIG = 229,
diff --git a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl
index 8413f06..c3ac401 100644
--- a/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl
+++ b/uwb/aidl/aidl_api/android.hardware.uwb.fira_android/current/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl
@@ -40,6 +40,7 @@
CCC_UWB_CONFIG_ID = 164,
CCC_PULSESHAPE_COMBO = 165,
CCC_URSK_TTL = 166,
+ CCC_LAST_INDEX_USED = 168,
NB_OF_RANGE_MEASUREMENTS = 227,
NB_OF_AZIMUTH_MEASUREMENTS = 228,
NB_OF_ELEVATION_MEASUREMENTS = 229,
diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
index 891b6f0..22b7bfe 100644
--- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
+++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorCapabilityTlvTypes.aidl
@@ -144,6 +144,11 @@
*/
CCC_SUPPORTED_MAX_RANGING_SESSION_NUMBER = 0xA8,
+ /**
+ * Int value to indicate the smallest supported CCC uwb initiation time in ms
+ */
+ CCC_SUPPORTED_MIN_UWB_INITIATION_TIME_MS = 0xA9,
+
/*********************************************
* FIRA specific
********************************************/
diff --git a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl
index f303ed9..65bb1c9 100644
--- a/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl
+++ b/uwb/aidl/android/hardware/uwb/fira_android/UwbVendorSessionAppConfigTlvTypes.aidl
@@ -46,6 +46,8 @@
CCC_PULSESHAPE_COMBO = 0xA5,
/** 2 byte data */
CCC_URSK_TTL = 0xA6,
+ /** 4 byte data */
+ CCC_LAST_INDEX_USED = 0xA8,
/**
* Range 0xE3 - 0xFF is reserved for proprietary use in the FIRA spec.
diff --git a/uwb/aidl/default/Android.bp b/uwb/aidl/default/Android.bp
index 8c2b60e..9621f2c 100644
--- a/uwb/aidl/default/Android.bp
+++ b/uwb/aidl/default/Android.bp
@@ -7,29 +7,26 @@
default_applicable_licenses: ["hardware_interfaces_license"],
}
-cc_binary {
+rust_binary {
name: "android.hardware.uwb-service",
+ crate_name: "uwb_default_hal",
relative_install_path: "hw",
- init_rc: ["uwb-service.rc"],
vintf_fragments: ["uwb-service.xml"],
vendor: true,
- cflags: [
- "-Wall",
- "-Wextra",
- "-g",
+ rustlibs: [
+ "android.hardware.uwb-V1-rust",
+ "liblogger",
+ "liblog_rust",
+ "libbinder_rs",
+ "libbinder_tokio_rs",
+ "libtokio",
+ "libnix",
+ "libanyhow",
],
- shared_libs: [
- "liblog",
- "libbinder_ndk",
- ],
- static_libs: [
- "libbase",
- "libutils",
- "android.hardware.uwb-V1-ndk",
+ proc_macros: [
+ "libasync_trait",
],
srcs: [
- "service.cpp",
- "uwb.cpp",
- "uwb_chip.cpp",
+ "src/service.rs",
],
}
diff --git a/uwb/aidl/default/service.cpp b/uwb/aidl/default/service.cpp
deleted file mode 100644
index 007637f..0000000
--- a/uwb/aidl/default/service.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright 2021, 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.
- */
-
-#include <android-base/logging.h>
-#include <android/binder_manager.h>
-#include <android/binder_process.h>
-#include <utils/StrongPointer.h>
-
-#include "uwb.h"
-
-using ::aidl::android::hardware::uwb::IUwb;
-using ::android::sp;
-using ::android::base::InitLogging;
-using ::android::base::StderrLogger;
-using ::android::hardware::uwb::impl::Uwb;
-
-int main(int /*argc*/, char* argv[]) {
- InitLogging(argv, StderrLogger);
- LOG(INFO) << "UWB HAL starting up";
-
- ABinderProcess_setThreadPoolMaxThreadCount(0);
- std::shared_ptr<IUwb> uwb = ndk::SharedRefBase::make<Uwb>();
- const std::string instance = std::string() + IUwb::descriptor + "/default";
- binder_status_t status = AServiceManager_addService(uwb->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
-
- ABinderProcess_joinThreadPool();
- return EXIT_FAILURE; // should not reach
-}
diff --git a/uwb/aidl/default/src/service.rs b/uwb/aidl/default/src/service.rs
new file mode 100644
index 0000000..7d5c073
--- /dev/null
+++ b/uwb/aidl/default/src/service.rs
@@ -0,0 +1,47 @@
+use android_hardware_uwb::aidl::android::hardware::uwb::IUwb::{self, IUwb as _};
+use android_hardware_uwb::binder;
+
+use tokio::runtime::Runtime;
+
+use std::env;
+use std::panic;
+
+use log::Level;
+
+mod uwb;
+mod uwb_chip;
+
+fn main() -> anyhow::Result<()> {
+ logger::init(
+ logger::Config::default()
+ .with_min_level(Level::Debug)
+ .with_tag_on_device("android.hardware.uwb"),
+ );
+
+ // Redirect panic messages to logcat.
+ panic::set_hook(Box::new(|panic_info| {
+ log::error!("{}", panic_info);
+ }));
+
+ log::info!("UWB HAL starting up");
+
+ // Create the tokio runtime
+ let rt = Runtime::new()?;
+
+ let chips = env::args()
+ .skip(1) // Skip binary name
+ .enumerate()
+ .map(|(i, arg)| uwb_chip::UwbChip::new(i.to_string(), arg));
+
+ binder::add_service(
+ &format!("{}/default", IUwb::BpUwb::get_descriptor()),
+ IUwb::BnUwb::new_binder(
+ uwb::Uwb::from_chips(chips, rt.handle().clone()),
+ binder::BinderFeatures::default(),
+ )
+ .as_binder(),
+ )?;
+
+ binder::ProcessState::join_thread_pool();
+ Ok(())
+}
diff --git a/uwb/aidl/default/src/uwb.rs b/uwb/aidl/default/src/uwb.rs
new file mode 100644
index 0000000..428f08f
--- /dev/null
+++ b/uwb/aidl/default/src/uwb.rs
@@ -0,0 +1,53 @@
+use android_hardware_uwb::aidl::android::hardware::uwb::{IUwb, IUwbChip};
+use android_hardware_uwb::binder;
+use binder::{Result, Strong};
+use binder_tokio::TokioRuntime;
+use tokio::runtime::Handle as TokioHandle;
+
+use crate::uwb_chip;
+
+pub struct Uwb {
+ chips: Vec<Strong<dyn IUwbChip::IUwbChip>>,
+}
+
+impl Uwb {
+ pub fn from_chips(
+ chips: impl IntoIterator<Item = uwb_chip::UwbChip>,
+ handle: TokioHandle,
+ ) -> Self {
+ Self {
+ chips: chips
+ .into_iter()
+ .map(|chip| {
+ IUwbChip::BnUwbChip::new_async_binder(
+ chip,
+ TokioRuntime(handle.clone()),
+ binder::BinderFeatures::default(),
+ )
+ })
+ .collect(),
+ }
+ }
+}
+
+impl binder::Interface for Uwb {}
+
+impl IUwb::IUwb for Uwb {
+ fn getChips(&self) -> Result<Vec<String>> {
+ log::debug!("getChips");
+ self.chips.iter().map(|chip| chip.getName()).collect()
+ }
+
+ fn getChip(&self, name: &str) -> Result<Strong<dyn IUwbChip::IUwbChip>> {
+ log::debug!("getChip {}", name);
+ let chip = self
+ .chips
+ .iter()
+ .find(|chip| chip.getName().as_deref() == Ok(name));
+ if let Some(chip) = chip {
+ Ok(chip.clone())
+ } else {
+ Err(binder::ExceptionCode::ILLEGAL_ARGUMENT.into())
+ }
+ }
+}
diff --git a/uwb/aidl/default/src/uwb_chip.rs b/uwb/aidl/default/src/uwb_chip.rs
new file mode 100644
index 0000000..cf32694
--- /dev/null
+++ b/uwb/aidl/default/src/uwb_chip.rs
@@ -0,0 +1,161 @@
+use android_hardware_uwb::aidl::android::hardware::uwb::{
+ IUwbChip::IUwbChipAsyncServer, IUwbClientCallback::IUwbClientCallback, UwbEvent::UwbEvent,
+ UwbStatus::UwbStatus,
+};
+use android_hardware_uwb::binder;
+use async_trait::async_trait;
+use binder::{Result, Strong};
+
+use tokio::fs::{self, File};
+use tokio::io::AsyncReadExt;
+use tokio::sync::Mutex;
+
+use std::os::fd::AsRawFd;
+
+use std::io;
+
+use nix::sys::termios;
+
+enum State {
+ Closed,
+ Opened {
+ callbacks: Strong<dyn IUwbClientCallback>,
+ #[allow(dead_code)]
+ tasks: tokio::task::JoinSet<()>,
+ },
+}
+
+pub struct UwbChip {
+ name: String,
+ path: String,
+ state: Mutex<State>,
+}
+
+impl UwbChip {
+ pub fn new(name: String, path: String) -> Self {
+ Self {
+ name,
+ path,
+ state: Mutex::new(State::Closed),
+ }
+ }
+}
+
+pub fn makeraw(file: File) -> io::Result<File> {
+ let fd = file.as_raw_fd();
+
+ let mut attrs = termios::tcgetattr(fd)?;
+
+ termios::cfmakeraw(&mut attrs);
+
+ termios::tcsetattr(fd, termios::SetArg::TCSANOW, &attrs)?;
+
+ Ok(file)
+}
+
+impl binder::Interface for UwbChip {}
+
+#[async_trait]
+impl IUwbChipAsyncServer for UwbChip {
+ async fn getName(&self) -> Result<String> {
+ Ok(self.name.clone())
+ }
+
+ async fn open(&self, callbacks: &Strong<dyn IUwbClientCallback>) -> Result<()> {
+ log::debug!("open: {:?}", &self.path);
+
+ let mut serial = File::open(&self.path)
+ .await
+ .and_then(makeraw)
+ .map_err(|_| binder::StatusCode::UNKNOWN_ERROR)?;
+
+ let mut state = self.state.lock().await;
+
+ if let State::Closed = *state {
+ let client_callbacks = callbacks.clone();
+
+ let mut tasks = tokio::task::JoinSet::new();
+
+ tasks.spawn(async move {
+ loop {
+ const UWB_HEADER_SIZE: usize = 4;
+
+ let mut buffer = vec![0; UWB_HEADER_SIZE];
+ serial
+ .read_exact(&mut buffer[0..UWB_HEADER_SIZE])
+ .await
+ .unwrap();
+
+ let length = buffer[3] as usize + UWB_HEADER_SIZE;
+
+ buffer.resize(length, 0);
+ serial
+ .read_exact(&mut buffer[UWB_HEADER_SIZE..length])
+ .await
+ .unwrap();
+
+ client_callbacks.onUciMessage(&buffer[..]).unwrap();
+ }
+ });
+
+ callbacks.onHalEvent(UwbEvent::OPEN_CPLT, UwbStatus::OK)?;
+
+ *state = State::Opened {
+ callbacks: callbacks.clone(),
+ tasks,
+ };
+
+ Ok(())
+ } else {
+ Err(binder::ExceptionCode::ILLEGAL_STATE.into())
+ }
+ }
+
+ async fn close(&self) -> Result<()> {
+ log::debug!("close");
+
+ let mut state = self.state.lock().await;
+
+ if let State::Opened { ref callbacks, .. } = *state {
+ callbacks.onHalEvent(UwbEvent::CLOSE_CPLT, UwbStatus::OK)?;
+ *state = State::Closed;
+ Ok(())
+ } else {
+ Err(binder::ExceptionCode::ILLEGAL_STATE.into())
+ }
+ }
+
+ async fn coreInit(&self) -> Result<()> {
+ log::debug!("coreInit");
+
+ if let State::Opened { ref callbacks, .. } = *self.state.lock().await {
+ callbacks.onHalEvent(UwbEvent::POST_INIT_CPLT, UwbStatus::OK)?;
+ Ok(())
+ } else {
+ Err(binder::ExceptionCode::ILLEGAL_STATE.into())
+ }
+ }
+
+ async fn sessionInit(&self, _id: i32) -> Result<()> {
+ log::debug!("sessionInit");
+
+ Ok(())
+ }
+
+ async fn getSupportedAndroidUciVersion(&self) -> Result<i32> {
+ Ok(1)
+ }
+
+ async fn sendUciMessage(&self, data: &[u8]) -> Result<i32> {
+ log::debug!("sendUciMessage");
+
+ if let State::Opened { .. } = &mut *self.state.lock().await {
+ fs::write(&self.path, data)
+ .await
+ .map(|_| data.len() as i32)
+ .map_err(|_| binder::StatusCode::UNKNOWN_ERROR.into())
+ } else {
+ Err(binder::ExceptionCode::ILLEGAL_STATE.into())
+ }
+ }
+}
diff --git a/uwb/aidl/default/uwb-service.rc b/uwb/aidl/default/uwb-service.rc
deleted file mode 100644
index e2c3825..0000000
--- a/uwb/aidl/default/uwb-service.rc
+++ /dev/null
@@ -1,3 +0,0 @@
-service vendor.uwb_hal /vendor/bin/hw/android.hardware.uwb-service
- class hal
- user uwb
diff --git a/uwb/aidl/default/uwb.cpp b/uwb/aidl/default/uwb.cpp
deleted file mode 100644
index 1e2ef4e..0000000
--- a/uwb/aidl/default/uwb.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2021, 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.
- */
-#include <android-base/logging.h>
-
-#include "uwb.h"
-
-namespace {
-static constexpr char kDefaultChipName[] = "default";
-
-} // namespace
-
-namespace android {
-namespace hardware {
-namespace uwb {
-namespace impl {
-using namespace ::aidl::android::hardware::uwb;
-
-// The default implementation of the HAL assumes 1 chip on the device.
-Uwb::Uwb() : chips_({{kDefaultChipName, ndk::SharedRefBase::make<UwbChip>(kDefaultChipName)}}) {}
-
-Uwb::~Uwb() {}
-
-::ndk::ScopedAStatus Uwb::getChips(std::vector<std::string>* names) {
- for (const auto& chip : chips_) {
- names->push_back(chip.first);
- }
- return ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus Uwb::getChip(const std::string& name, std::shared_ptr<IUwbChip>* chip) {
- const auto chip_found = chips_.find(name);
- if (chip_found == chips_.end()) {
- LOG(ERROR) << "Unknown chip name" << name;
- return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
- }
- *chip = chip_found->second;
- return ndk::ScopedAStatus::ok();
-}
-} // namespace impl
-} // namespace uwb
-} // namespace hardware
-} // namespace android
diff --git a/uwb/aidl/default/uwb.h b/uwb/aidl/default/uwb.h
deleted file mode 100644
index ec51fd8..0000000
--- a/uwb/aidl/default/uwb.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2021, 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.
- */
-#ifndef ANDROID_HARDWARE_UWB_UWB
-#define ANDROID_HARDWARE_UWB_UWB
-
-#include <map>
-#include <vector>
-
-#include <aidl/android/hardware/uwb/BnUwb.h>
-#include <aidl/android/hardware/uwb/IUwbChip.h>
-
-#include "uwb_chip.h"
-
-namespace android {
-namespace hardware {
-namespace uwb {
-namespace impl {
-using namespace ::aidl::android::hardware::uwb;
-// Default implementation mean't to be used on simulator targets.
-class Uwb : public BnUwb {
- public:
- Uwb();
- virtual ~Uwb();
-
- ::ndk::ScopedAStatus getChips(std::vector<std::string>* names) override;
- ::ndk::ScopedAStatus getChip(const std::string& name, std::shared_ptr<IUwbChip>* chip) override;
-
- private:
- std::map<std::string, std::shared_ptr<UwbChip>> chips_;
-};
-} // namespace impl
-} // namespace uwb
-} // namespace hardware
-} // namespace android
-
-#endif // ANDROID_HARDWARE_UWB_UWB
\ No newline at end of file
diff --git a/uwb/aidl/default/uwb_chip.cpp b/uwb/aidl/default/uwb_chip.cpp
deleted file mode 100644
index 41f14fd..0000000
--- a/uwb/aidl/default/uwb_chip.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Copyright 2021, 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.
- */
-
-#include "uwb.h"
-
-namespace {
-constexpr static int32_t kAndroidUciVersion = 1;
-}
-
-namespace android {
-namespace hardware {
-namespace uwb {
-namespace impl {
-using namespace ::aidl::android::hardware::uwb;
-
-UwbChip::UwbChip(const std::string& name) : name_(name), mClientCallback(nullptr) {}
-UwbChip::~UwbChip() {}
-
-::ndk::ScopedAStatus UwbChip::getName(std::string* name) {
- *name = name_;
- return ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus UwbChip::open(const std::shared_ptr<IUwbClientCallback>& clientCallback) {
- mClientCallback = clientCallback;
- mClientCallback->onHalEvent(UwbEvent::OPEN_CPLT, UwbStatus::OK);
- return ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus UwbChip::close() {
- mClientCallback->onHalEvent(UwbEvent::CLOSE_CPLT, UwbStatus::OK);
- mClientCallback = nullptr;
- return ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus UwbChip::coreInit() {
- return ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus UwbChip::sessionInit(int /* sessionId */) {
- return ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus UwbChip::getSupportedAndroidUciVersion(int32_t* version) {
- *version = kAndroidUciVersion;
- return ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus UwbChip::sendUciMessage(const std::vector<uint8_t>& /* data */,
- int32_t* /* bytes_written */) {
- // TODO(b/195992658): Need emulator support for UCI stack.
- return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
-}
-} // namespace impl
-} // namespace uwb
-} // namespace hardware
-} // namespace android
diff --git a/uwb/aidl/default/uwb_chip.h b/uwb/aidl/default/uwb_chip.h
deleted file mode 100644
index e900cbe..0000000
--- a/uwb/aidl/default/uwb_chip.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright 2021, 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.
- */
-
-#ifndef ANDROID_HARDWARE_UWB_UWBCHIP
-#define ANDROID_HARDWARE_UWB_UWBCHIP
-
-#include <vector>
-
-#include <aidl/android/hardware/uwb/BnUwbChip.h>
-#include <aidl/android/hardware/uwb/IUwbClientCallback.h>
-
-namespace android {
-namespace hardware {
-namespace uwb {
-namespace impl {
-using namespace ::aidl::android::hardware::uwb;
-// Default implementation mean't to be used on simulator targets.
-class UwbChip : public BnUwbChip {
- public:
- UwbChip(const std::string& name);
- virtual ~UwbChip();
-
- ::ndk::ScopedAStatus getName(std::string* name) override;
- ::ndk::ScopedAStatus open(const std::shared_ptr<IUwbClientCallback>& clientCallback) override;
- ::ndk::ScopedAStatus close() override;
- ::ndk::ScopedAStatus coreInit() override;
- ::ndk::ScopedAStatus sessionInit(int sesionId) override;
- ::ndk::ScopedAStatus getSupportedAndroidUciVersion(int32_t* version) override;
- ::ndk::ScopedAStatus sendUciMessage(const std::vector<uint8_t>& data,
- int32_t* bytes_written) override;
-
- private:
- std::string name_;
- std::shared_ptr<IUwbClientCallback> mClientCallback;
-};
-} // namespace impl
-} // namespace uwb
-} // namespace hardware
-} // namespace android
-
-#endif // ANDROID_HARDWARE_UWB_UWBCHIP