Merge "Migrate Test Targets to New Android Ownership Model" into main
diff --git a/PREUPLOAD.cfg b/PREUPLOAD.cfg
index 2116e21..de7aa35 100644
--- a/PREUPLOAD.cfg
+++ b/PREUPLOAD.cfg
@@ -10,3 +10,4 @@
aosp_hook_confirmationui = ${REPO_ROOT}/frameworks/base/tools/aosp/aosp_sha.sh ${PREUPLOAD_COMMIT} confirmationui
aosp_hook_gatekeeper = ${REPO_ROOT}/frameworks/base/tools/aosp/aosp_sha.sh ${PREUPLOAD_COMMIT} gatekeeper
aosp_hook_keymaster = ${REPO_ROOT}/frameworks/base/tools/aosp/aosp_sha.sh ${PREUPLOAD_COMMIT} keymaster
+generate_vehicle_property_enums = ${REPO_ROOT}/hardware/interfaces/automotive/vehicle/tools/generate_annotation_enums.py --android_build_top ${REPO_ROOT} --preupload_files ${PREUPLOAD_FILES} --check_only
diff --git a/audio/6.0/config/api/current.txt b/audio/6.0/config/api/current.txt
index 01db90e..1814b59 100644
--- a/audio/6.0/config/api/current.txt
+++ b/audio/6.0/config/api/current.txt
@@ -116,6 +116,7 @@
enum_constant public static final audio.policy.configuration.V6_0.AudioFormat AUDIO_FORMAT_APTX_HD;
enum_constant public static final audio.policy.configuration.V6_0.AudioFormat AUDIO_FORMAT_APTX_TWSP;
enum_constant public static final audio.policy.configuration.V6_0.AudioFormat AUDIO_FORMAT_CELT;
+ enum_constant public static final audio.policy.configuration.V6_0.AudioFormat AUDIO_FORMAT_DEFAULT;
enum_constant public static final audio.policy.configuration.V6_0.AudioFormat AUDIO_FORMAT_DOLBY_TRUEHD;
enum_constant public static final audio.policy.configuration.V6_0.AudioFormat AUDIO_FORMAT_DSD;
enum_constant public static final audio.policy.configuration.V6_0.AudioFormat AUDIO_FORMAT_DTS;
diff --git a/audio/6.0/config/audio_policy_configuration.xsd b/audio/6.0/config/audio_policy_configuration.xsd
index c2b8c5d..177af16 100644
--- a/audio/6.0/config/audio_policy_configuration.xsd
+++ b/audio/6.0/config/audio_policy_configuration.xsd
@@ -302,6 +302,7 @@
TODO: generate from hidl to avoid manual sync. -->
<xs:simpleType name="audioFormat">
<xs:restriction base="xs:string">
+ <xs:enumeration value="AUDIO_FORMAT_DEFAULT" />
<xs:enumeration value="AUDIO_FORMAT_PCM_16_BIT" />
<xs:enumeration value="AUDIO_FORMAT_PCM_8_BIT"/>
<xs:enumeration value="AUDIO_FORMAT_PCM_32_BIT"/>
diff --git a/audio/aidl/Android.bp b/audio/aidl/Android.bp
index 3963ce3..8bb8cd5 100644
--- a/audio/aidl/Android.bp
+++ b/audio/aidl/Android.bp
@@ -44,7 +44,7 @@
"android/hardware/audio/common/SinkMetadata.aidl",
"android/hardware/audio/common/SourceMetadata.aidl",
],
- frozen: false,
+ frozen: true,
backend: {
cpp: {
enabled: true,
@@ -74,6 +74,10 @@
version: "2",
imports: ["android.media.audio.common.types-V2"],
},
+ {
+ version: "3",
+ imports: ["android.media.audio.common.types-V3"],
+ },
// IMPORTANT: Update latest_android_hardware_audio_common every time you
// add the latest frozen version to versions_with_info
@@ -169,11 +173,22 @@
"android.media.audio.common.types-V2",
],
},
+ {
+ version: "2",
+ imports: [
+ "android.media.audio.common.types-V3",
+ "android.hardware.audio.effect-V2",
+ "android.hardware.audio.core.sounddose-V2",
+ "android.hardware.audio.common-V3",
+ "android.hardware.common-V2",
+ "android.hardware.common.fmq-V1",
+ ],
+ },
// IMPORTANT: Update latest_android_hardware_audio_core every time you
// add the latest frozen version to versions_with_info
],
- frozen: false,
+ frozen: true,
}
// Note: This should always be one version ahead of the last frozen version
@@ -227,11 +242,15 @@
version: "1",
imports: ["android.media.audio.common.types-V2"],
},
+ {
+ version: "2",
+ imports: ["android.media.audio.common.types-V3"],
+ },
// IMPORTANT: Update latest_android_hardware_audio_core_sounddose every time you
// add the latest frozen version to versions_with_info
],
- frozen: false,
+ frozen: true,
}
// Note: This should always be one version ahead of the last frozen version
@@ -328,8 +347,18 @@
"android.media.audio.common.types-V2",
],
},
+ {
+ version: "2",
+ imports: [
+ "android.media.audio.common.types-V3",
+ "android.hardware.audio.common-V3",
+ "android.hardware.common-V2",
+ "android.hardware.common.fmq-V1",
+ ],
+ },
+
],
- frozen: false,
+ frozen: true,
}
diff --git a/audio/aidl/TEST_MAPPING b/audio/aidl/TEST_MAPPING
index b5fcd86..e325001 100644
--- a/audio/aidl/TEST_MAPPING
+++ b/audio/aidl/TEST_MAPPING
@@ -4,9 +4,15 @@
"name": "VtsHalAudioCoreTargetTest"
},
{
+ "name": "audioeffect_tests"
+ },
+ {
"name": "audio_policy_config_xml_converter_tests"
},
{
+ "name": "trackplayerbase_tests"
+ },
+ {
"name": "VtsHalAudioEffectFactoryTargetTest"
},
{
@@ -60,15 +66,9 @@
"name": "audiorecord_tests"
},
{
- "name": "audioeffect_tests"
- },
- {
"name": "audiorouting_tests"
},
{
- "name": "trackplayerbase_tests"
- },
- {
"name": "audiosystem_tests"
},
{
diff --git a/audio/aidl/aidl_api/android.hardware.audio.common/3/.hash b/audio/aidl/aidl_api/android.hardware.audio.common/3/.hash
new file mode 100644
index 0000000..6addcf5
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.common/3/.hash
@@ -0,0 +1 @@
+57ce9506b87e721f0d994b16d7cd16a494f699b9
diff --git a/audio/aidl/aidl_api/android.hardware.audio.common/3/android/hardware/audio/common/AudioOffloadMetadata.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/3/android/hardware/audio/common/AudioOffloadMetadata.aidl
new file mode 100644
index 0000000..000504b
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.common/3/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/3/android/hardware/audio/common/PlaybackTrackMetadata.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/3/android/hardware/audio/common/PlaybackTrackMetadata.aidl
new file mode 100644
index 0000000..be4941c
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.common/3/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/3/android/hardware/audio/common/RecordTrackMetadata.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/3/android/hardware/audio/common/RecordTrackMetadata.aidl
new file mode 100644
index 0000000..8f667d1
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.common/3/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/3/android/hardware/audio/common/SinkMetadata.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/3/android/hardware/audio/common/SinkMetadata.aidl
new file mode 100644
index 0000000..270147d
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.common/3/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/3/android/hardware/audio/common/SourceMetadata.aidl b/audio/aidl/aidl_api/android.hardware.audio.common/3/android/hardware/audio/common/SourceMetadata.aidl
new file mode 100644
index 0000000..2d4a982
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.common/3/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/2/.hash b/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/2/.hash
new file mode 100644
index 0000000..b49d59b
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/2/.hash
@@ -0,0 +1 @@
+daed2ce165b383deb25a388fb04396a6b53746f3
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/2/android/hardware/audio/core/sounddose/ISoundDose.aidl b/audio/aidl/aidl_api/android.hardware.audio.core.sounddose/2/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/2/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/2/.hash b/audio/aidl/aidl_api/android.hardware.audio.core/2/.hash
new file mode 100644
index 0000000..aaca981
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/.hash
@@ -0,0 +1 @@
+003735b3fd3c94c53b02a6eb5e099731f7062610
diff --git a/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/AudioPatch.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/AudioPatch.aidl
new file mode 100644
index 0000000..078b5ea
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/android/hardware/audio/core/AudioRoute.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/AudioRoute.aidl
new file mode 100644
index 0000000..deeef87
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/android/hardware/audio/core/IBluetooth.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/IBluetooth.aidl
new file mode 100644
index 0000000..9357a15
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/android/hardware/audio/core/IBluetoothA2dp.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/IBluetoothA2dp.aidl
new file mode 100644
index 0000000..0f4c46d
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/android/hardware/audio/core/IBluetoothLe.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/IBluetoothLe.aidl
new file mode 100644
index 0000000..2068daf
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/android/hardware/audio/core/IConfig.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/IConfig.aidl
new file mode 100644
index 0000000..9ce45bb
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/android/hardware/audio/core/IModule.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/IModule.aidl
new file mode 100644
index 0000000..07a85f8
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/IModule.aidl
@@ -0,0 +1,119 @@
+/*
+ * 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();
+ void prepareToDisconnectExternalDevice(int portId);
+ 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/2/android/hardware/audio/core/IStreamCallback.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/IStreamCallback.aidl
new file mode 100644
index 0000000..5a2ab78
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/android/hardware/audio/core/IStreamCommon.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/IStreamCommon.aidl
new file mode 100644
index 0000000..65a2ee4
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/android/hardware/audio/core/IStreamIn.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/IStreamIn.aidl
new file mode 100644
index 0000000..a01f877
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/android/hardware/audio/core/IStreamOut.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/IStreamOut.aidl
new file mode 100644
index 0000000..ec3078e
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/android/hardware/audio/core/IStreamOutEventCallback.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/IStreamOutEventCallback.aidl
new file mode 100644
index 0000000..31cf0b7
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/android/hardware/audio/core/ITelephony.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/ITelephony.aidl
new file mode 100644
index 0000000..84d7aa1
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/android/hardware/audio/core/MmapBufferDescriptor.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/MmapBufferDescriptor.aidl
new file mode 100644
index 0000000..6ea1c69
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/android/hardware/audio/core/ModuleDebug.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/ModuleDebug.aidl
new file mode 100644
index 0000000..467d37b
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/android/hardware/audio/core/StreamDescriptor.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/StreamDescriptor.aidl
new file mode 100644
index 0000000..3e3dc38
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/android/hardware/audio/core/SurroundSoundConfig.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/SurroundSoundConfig.aidl
new file mode 100644
index 0000000..08a1537
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/android/hardware/audio/core/VendorParameter.aidl b/audio/aidl/aidl_api/android.hardware.audio.core/2/android/hardware/audio/core/VendorParameter.aidl
new file mode 100644
index 0000000..bfe33ee
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.core/2/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/2/.hash b/audio/aidl/aidl_api/android.hardware.audio.effect/2/.hash
new file mode 100644
index 0000000..1c70e87
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/.hash
@@ -0,0 +1 @@
+54d5a2e1d59066b57e35eb7bcb5ebc72a1259c1c
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/AcousticEchoCanceler.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/AcousticEchoCanceler.aidl
new file mode 100644
index 0000000..16367c0
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/AutomaticGainControlV1.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/AutomaticGainControlV1.aidl
new file mode 100644
index 0000000..e69e2bd
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/AutomaticGainControlV2.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/AutomaticGainControlV2.aidl
new file mode 100644
index 0000000..46ffcaf
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/BassBoost.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/BassBoost.aidl
new file mode 100644
index 0000000..c248ce8
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/Capability.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/Capability.aidl
new file mode 100644
index 0000000..c9df073
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/CommandId.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/CommandId.aidl
new file mode 100644
index 0000000..86b69fa
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/DefaultExtension.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/DefaultExtension.aidl
new file mode 100644
index 0000000..f1cf389
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/Descriptor.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/Descriptor.aidl
new file mode 100644
index 0000000..115da1d
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/Downmix.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/Downmix.aidl
new file mode 100644
index 0000000..ce0a7df
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/DynamicsProcessing.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/DynamicsProcessing.aidl
new file mode 100644
index 0000000..04f627d
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/EnvironmentalReverb.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/EnvironmentalReverb.aidl
new file mode 100644
index 0000000..00b7d1a
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/Equalizer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/Equalizer.aidl
new file mode 100644
index 0000000..80f7c7e
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/Flags.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/Flags.aidl
new file mode 100644
index 0000000..046c220
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/Flags.aidl
@@ -0,0 +1,76 @@
+/*
+ * 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;
+ boolean sinkMetadataIndication;
+ boolean sourceMetadataIndication;
+ @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/2/android/hardware/audio/effect/HapticGenerator.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/HapticGenerator.aidl
new file mode 100644
index 0000000..8addab7
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/IEffect.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/IEffect.aidl
new file mode 100644
index 0000000..a1b00be
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/IEffect.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
+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);
+ android.hardware.audio.effect.IEffect.OpenEffectReturn reopen();
+ @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/2/android/hardware/audio/effect/IFactory.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/IFactory.aidl
new file mode 100644
index 0000000..a6c138c
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/LoudnessEnhancer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/LoudnessEnhancer.aidl
new file mode 100644
index 0000000..fc276d6
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/NoiseSuppression.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/NoiseSuppression.aidl
new file mode 100644
index 0000000..7f30fe2
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/Parameter.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/Parameter.aidl
new file mode 100644
index 0000000..ff33c42
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/Parameter.aidl
@@ -0,0 +1,99 @@
+/*
+ * 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;
+ android.hardware.audio.common.SinkMetadata sinkMetadata;
+ android.hardware.audio.common.SourceMetadata sourceMetadata;
+ @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;
+ android.hardware.audio.effect.Spatializer.Id spatializerTag;
+ }
+ @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;
+ android.hardware.audio.effect.Spatializer spatializer;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/PresetReverb.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/PresetReverb.aidl
new file mode 100644
index 0000000..26d96b5
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/Processing.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/Processing.aidl
new file mode 100644
index 0000000..f6d6ee2
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/Range.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/Range.aidl
new file mode 100644
index 0000000..40ee6b5
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/Range.aidl
@@ -0,0 +1,139 @@
+/*
+ * 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;
+ android.hardware.audio.effect.Range.SpatializerRange[] spatializer;
+ @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 SpatializerRange {
+ android.hardware.audio.effect.Spatializer min;
+ android.hardware.audio.effect.Spatializer 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/2/android/hardware/audio/effect/Spatializer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/Spatializer.aidl
new file mode 100644
index 0000000..98ecee0
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/Spatializer.aidl
@@ -0,0 +1,50 @@
+/*
+ * 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 Spatializer {
+ android.hardware.audio.effect.VendorExtension vendor;
+ android.media.audio.common.AudioChannelLayout[] supportedChannelLayout;
+ android.media.audio.common.Spatialization.Level spatializationLevel;
+ android.media.audio.common.Spatialization.Mode spatializationMode;
+ int headTrackingSensorId;
+ android.media.audio.common.HeadTracking.Mode headTrackingMode;
+ android.media.audio.common.HeadTracking.ConnectionMode headTrackingConnectionMode;
+ android.media.audio.common.HeadTracking.SensorData headTrackingSensorData;
+ @VintfStability
+ union Id {
+ android.hardware.audio.effect.VendorExtension vendorExtensionTag;
+ android.hardware.audio.effect.Spatializer.Tag commonTag;
+ }
+}
diff --git a/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/State.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/State.aidl
new file mode 100644
index 0000000..17f9814
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/VendorExtension.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/VendorExtension.aidl
new file mode 100644
index 0000000..b806334
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/Virtualizer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/Virtualizer.aidl
new file mode 100644
index 0000000..6092b14
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/Visualizer.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/Visualizer.aidl
new file mode 100644
index 0000000..7d319da
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/2/android/hardware/audio/effect/Volume.aidl b/audio/aidl/aidl_api/android.hardware.audio.effect/2/android/hardware/audio/effect/Volume.aidl
new file mode 100644
index 0000000..8227118
--- /dev/null
+++ b/audio/aidl/aidl_api/android.hardware.audio.effect/2/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/common/include/Utils.h b/audio/aidl/common/include/Utils.h
index ef312d5..a1008a4 100644
--- a/audio/aidl/common/include/Utils.h
+++ b/audio/aidl/common/include/Utils.h
@@ -174,6 +174,12 @@
return result;
}
+template <typename E, typename U = std::underlying_type_t<E>,
+ typename = std::enable_if_t<is_bit_position_enum<E>::value>>
+constexpr bool isAnyBitPositionFlagSet(U mask, std::initializer_list<E> flags) {
+ return (mask & makeBitPositionFlagMask<E>(flags)) != 0;
+}
+
constexpr int32_t frameCountFromDurationUs(long durationUs, int32_t sampleRateHz) {
return (static_cast<long long>(durationUs) * sampleRateHz) / 1000000LL;
}
diff --git a/audio/aidl/default/Android.bp b/audio/aidl/default/Android.bp
index 8c6c537..844f1e9 100644
--- a/audio/aidl/default/Android.bp
+++ b/audio/aidl/default/Android.bp
@@ -97,8 +97,11 @@
shared_libs: [
"android.hardware.bluetooth.audio-impl",
"libaudio_aidl_conversion_common_ndk",
+ "libaudioutils",
"libbluetooth_audio_session_aidl",
+ "liblog",
"libmedia_helper",
+ "libmediautils_vendor",
"libstagefright_foundation",
],
export_shared_lib_headers: [
@@ -130,6 +133,7 @@
"android.hardware.bluetooth.audio-impl",
"libaudio_aidl_conversion_common_ndk",
"libbluetooth_audio_session_aidl",
+ "liblog",
"libmedia_helper",
"libstagefright_foundation",
],
@@ -245,7 +249,7 @@
"EffectFactory.cpp",
"EffectMain.cpp",
],
- installable: false, //installed in apex com.android.hardware.audio.effect
+ installable: false, //installed in apex com.android.hardware.audio
}
cc_library_headers {
@@ -267,9 +271,3 @@
sub_dir: "vintf",
installable: false,
}
-
-prebuilt_etc {
- name: "audio_effects_config.xml",
- src: "audio_effects_config.xml",
- installable: false,
-}
diff --git a/audio/aidl/default/EffectConfig.cpp b/audio/aidl/default/EffectConfig.cpp
index a1fbefa..eb0c015 100644
--- a/audio/aidl/default/EffectConfig.cpp
+++ b/audio/aidl/default/EffectConfig.cpp
@@ -37,7 +37,6 @@
EffectConfig::EffectConfig(const std::string& file) {
tinyxml2::XMLDocument doc;
doc.LoadFile(file.c_str());
- LOG(DEBUG) << __func__ << " loading " << file;
// parse the xml file into maps
if (doc.Error()) {
LOG(ERROR) << __func__ << " tinyxml2 failed to load " << file
@@ -143,7 +142,7 @@
std::string name = xml.Attribute("name");
RETURN_VALUE_IF(name == "", false, "effectsNoName");
- LOG(DEBUG) << __func__ << dump(xml);
+ LOG(VERBOSE) << __func__ << dump(xml);
struct Library library;
if (std::strcmp(xml.Name(), "effectProxy") == 0) {
// proxy lib and uuid
@@ -187,11 +186,11 @@
}
RETURN_VALUE_IF((library.uuid == getEffectUuidZero()), false, "invalidUuidAttribute");
- LOG(DEBUG) << __func__ << (isProxy ? " proxy " : library.name) << " : uuid "
- << ::android::audio::utils::toString(library.uuid)
- << (library.type.has_value()
- ? ::android::audio::utils::toString(library.type.value())
- : "");
+ LOG(VERBOSE) << __func__ << (isProxy ? " proxy " : library.name) << " : uuid "
+ << ::android::audio::utils::toString(library.uuid)
+ << (library.type.has_value()
+ ? ::android::audio::utils::toString(library.type.value())
+ : "");
return true;
}
@@ -245,7 +244,7 @@
}
bool EffectConfig::parseProcessing(Processing::Type::Tag typeTag, const tinyxml2::XMLElement& xml) {
- LOG(DEBUG) << __func__ << dump(xml);
+ LOG(VERBOSE) << __func__ << dump(xml);
const char* typeStr = xml.Attribute("type");
auto aidlType = stringToProcessingType(typeTag, typeStr);
RETURN_VALUE_IF(!aidlType.has_value(), false, "illegalStreamType");
@@ -259,7 +258,6 @@
}
RETURN_VALUE_IF(!name, false, "noEffectAttribute");
mProcessingMap[aidlType.value()].emplace_back(mEffectsMap[name]);
- LOG(WARNING) << __func__ << " " << typeStr << " : " << name;
}
return true;
}
diff --git a/audio/aidl/default/EffectContext.cpp b/audio/aidl/default/EffectContext.cpp
index 4f226c4..7b8cfb1 100644
--- a/audio/aidl/default/EffectContext.cpp
+++ b/audio/aidl/default/EffectContext.cpp
@@ -22,6 +22,7 @@
using aidl::android::hardware::audio::common::getChannelCount;
using aidl::android::hardware::audio::common::getFrameSizeInBytes;
using aidl::android::hardware::audio::effect::IEffect;
+using aidl::android::hardware::audio::effect::kReopenSupportedVersion;
using aidl::android::media::audio::common::PcmType;
using ::android::hardware::EventFlag;
@@ -40,7 +41,8 @@
mOutputMQ = std::make_shared<DataMQ>(outBufferSizeInFloat);
if (!mStatusMQ->isValid() || !mInputMQ->isValid() || !mOutputMQ->isValid()) {
- LOG(ERROR) << __func__ << " created invalid FMQ";
+ LOG(ERROR) << __func__ << " created invalid FMQ, statusMQ: " << mStatusMQ->isValid()
+ << " inputMQ: " << mInputMQ->isValid() << " outputMQ: " << mOutputMQ->isValid();
}
::android::status_t status =
@@ -52,7 +54,9 @@
// reset buffer status by abandon input data in FMQ
void EffectContext::resetBuffer() {
auto buffer = static_cast<float*>(mWorkBuffer.data());
- std::vector<IEffect::Status> status(mStatusMQ->availableToRead());
+ if (mStatusMQ) {
+ std::vector<IEffect::Status> status(mStatusMQ->availableToRead());
+ }
if (mInputMQ) {
mInputMQ->read(buffer, mInputMQ->availableToRead());
}
@@ -71,7 +75,7 @@
}
void EffectContext::dupeFmq(IEffect::OpenEffectReturn* effectRet) {
- if (effectRet) {
+ if (effectRet && mStatusMQ && mInputMQ && mOutputMQ) {
effectRet->statusMQ = mStatusMQ->dupeDesc();
effectRet->inputDataMQ = mInputMQ->dupeDesc();
effectRet->outputDataMQ = mOutputMQ->dupeDesc();
@@ -153,7 +157,6 @@
}
RetCode EffectContext::setCommon(const Parameter::Common& common) {
- LOG(VERBOSE) << __func__ << common.toString();
auto& input = common.input;
auto& output = common.output;
@@ -182,7 +185,6 @@
}
Parameter::Common EffectContext::getCommon() {
- LOG(VERBOSE) << __func__ << mCommon.toString();
return mCommon;
}
@@ -191,24 +193,34 @@
}
RetCode EffectContext::updateIOFrameSize(const Parameter::Common& common) {
- const auto iFrameSize = ::aidl::android::hardware::audio::common::getFrameSizeInBytes(
+ const auto prevInputFrameSize = mInputFrameSize;
+ const auto prevOutputFrameSize = mOutputFrameSize;
+ mInputFrameSize = ::aidl::android::hardware::audio::common::getFrameSizeInBytes(
common.input.base.format, common.input.base.channelMask);
- const auto oFrameSize = ::aidl::android::hardware::audio::common::getFrameSizeInBytes(
+ mOutputFrameSize = ::aidl::android::hardware::audio::common::getFrameSizeInBytes(
common.output.base.format, common.output.base.channelMask);
+ // workBuffer and data MQ not allocated yet, no need to update
+ if (mWorkBuffer.size() == 0 || !mInputMQ || !mOutputMQ) {
+ return RetCode::SUCCESS;
+ }
+ // IEffect::reopen introduced in android.hardware.audio.effect-V2
+ if (mVersion < kReopenSupportedVersion) {
+ LOG(WARNING) << __func__ << " skipped for HAL version " << mVersion;
+ return RetCode::SUCCESS;
+ }
bool needUpdateMq = false;
- if (mInputMQ &&
- (mInputFrameSize != iFrameSize || mCommon.input.frameCount != common.input.frameCount)) {
+ if (mInputFrameSize != prevInputFrameSize ||
+ mCommon.input.frameCount != common.input.frameCount) {
mInputMQ.reset();
needUpdateMq = true;
}
- if (mOutputMQ &&
- (mOutputFrameSize != oFrameSize || mCommon.output.frameCount != common.output.frameCount)) {
+ if (mOutputFrameSize != prevOutputFrameSize ||
+ mCommon.output.frameCount != common.output.frameCount) {
mOutputMQ.reset();
needUpdateMq = true;
}
- mInputFrameSize = iFrameSize;
- mOutputFrameSize = oFrameSize;
+
if (needUpdateMq) {
mWorkBuffer.resize(std::max(common.input.frameCount * mInputFrameSize / sizeof(float),
common.output.frameCount * mOutputFrameSize / sizeof(float)));
@@ -227,7 +239,7 @@
LOG(ERROR) << __func__ << ": wake failure with ret " << ret;
return RetCode::ERROR_EVENT_FLAG_ERROR;
}
- LOG(DEBUG) << __func__ << " : signal client for reopen";
+ LOG(VERBOSE) << __func__ << " : signal client for reopen";
return RetCode::SUCCESS;
}
} // namespace aidl::android::hardware::audio::effect
diff --git a/audio/aidl/default/EffectFactory.cpp b/audio/aidl/default/EffectFactory.cpp
index 96f13ba..e3894f9 100644
--- a/audio/aidl/default/EffectFactory.cpp
+++ b/audio/aidl/default/EffectFactory.cpp
@@ -43,12 +43,12 @@
Factory::~Factory() {
if (auto count = mEffectMap.size()) {
- LOG(ERROR) << __func__ << " remaining " << count
- << " effect instances not destroyed indicating resource leak!";
+ LOG(WARNING) << __func__ << " remaining " << count
+ << " effect instances not destroyed indicating resource leak!";
for (const auto& it : mEffectMap) {
if (auto spEffect = it.first.lock()) {
- LOG(ERROR) << __func__ << " erase remaining instance UUID "
- << ::android::audio::utils::toString(it.second.first);
+ LOG(WARNING) << __func__ << " erase remaining instance UUID "
+ << ::android::audio::utils::toString(it.second.first);
destroyEffectImpl_l(spEffect);
}
}
@@ -139,15 +139,15 @@
std::shared_ptr<IEffect> effectSp;
RETURN_IF_BINDER_EXCEPTION(libInterface->createEffectFunc(&in_impl_uuid, &effectSp));
if (!effectSp) {
- LOG(ERROR) << __func__ << ": library created null instance without return error!";
+ LOG(WARNING) << __func__ << ": library created null instance without return error!";
return ndk::ScopedAStatus::fromExceptionCode(EX_TRANSACTION_FAILED);
}
*_aidl_return = effectSp;
ndk::SpAIBinder effectBinder = effectSp->asBinder();
AIBinder_setMinSchedulerPolicy(effectBinder.get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
+ AIBinder_setInheritRt(effectBinder.get(), true);
mEffectMap[std::weak_ptr<IEffect>(effectSp)] =
std::make_pair(in_impl_uuid, std::move(effectBinder));
- LOG(DEBUG) << __func__ << ": instance " << effectSp.get() << " created successfully";
return ndk::ScopedAStatus::ok();
} else {
LOG(ERROR) << __func__ << ": library doesn't exist";
@@ -192,7 +192,6 @@
}
ndk::ScopedAStatus Factory::destroyEffect(const std::shared_ptr<IEffect>& in_handle) {
- LOG(DEBUG) << __func__ << ": instance " << in_handle.get();
std::lock_guard lg(mMutex);
ndk::ScopedAStatus status = destroyEffectImpl_l(in_handle);
// always do the cleanup
@@ -215,8 +214,8 @@
return false;
}
- LOG(INFO) << __func__ << " dlopen lib:" << path
- << "\nimpl:" << ::android::audio::utils::toString(impl) << "\nhandle:" << libHandle;
+ LOG(DEBUG) << __func__ << " dlopen lib: " << path
+ << "\nimpl:" << ::android::audio::utils::toString(impl) << "\nhandle:" << libHandle;
auto interface = new effect_dl_interface_s{nullptr, nullptr, nullptr};
mEffectLibMap.insert(
{impl,
@@ -235,11 +234,12 @@
id.type = typeUuid;
id.uuid = configLib.uuid;
id.proxy = proxyUuid;
- LOG(DEBUG) << __func__ << " loading lib " << path->second << ": typeUuid "
- << ::android::audio::utils::toString(id.type) << "\nimplUuid "
- << ::android::audio::utils::toString(id.uuid) << " proxyUuid "
- << (proxyUuid.has_value() ? ::android::audio::utils::toString(proxyUuid.value())
- : "null");
+ LOG(WARNING) << __func__ << " loading lib " << path->second << ": typeUuid "
+ << ::android::audio::utils::toString(id.type) << "\nimplUuid "
+ << ::android::audio::utils::toString(id.uuid) << " proxyUuid "
+ << (proxyUuid.has_value()
+ ? ::android::audio::utils::toString(proxyUuid.value())
+ : "null");
if (openEffectLibrary(id.uuid, path->second)) {
mIdentitySet.insert(std::move(id));
}
@@ -263,8 +263,8 @@
createIdentityWithConfig(configLib, type, proxyUuid);
}
} else {
- LOG(ERROR) << __func__ << ": can not find type UUID for effect " << configEffects.first
- << " skipping!";
+ LOG(WARNING) << __func__ << ": can not find type UUID for effect "
+ << configEffects.first << " skipping!";
}
}
}
diff --git a/audio/aidl/default/EffectImpl.cpp b/audio/aidl/default/EffectImpl.cpp
index c97a03e..03de74f 100644
--- a/audio/aidl/default/EffectImpl.cpp
+++ b/audio/aidl/default/EffectImpl.cpp
@@ -35,7 +35,6 @@
<< " in state: " << toString(state) << ", status: " << status.getDescription();
return EX_ILLEGAL_STATE;
}
- LOG(DEBUG) << __func__ << " instance " << instanceSp.get() << " destroyed";
return EX_NONE;
}
@@ -49,10 +48,16 @@
RETURN_IF(common.input.base.format.pcm != common.output.base.format.pcm ||
common.input.base.format.pcm != PcmType::FLOAT_32_BIT,
EX_ILLEGAL_ARGUMENT, "dataMustBe32BitsFloat");
+
std::lock_guard lg(mImplMutex);
RETURN_OK_IF(mState != State::INIT);
mImplContext = createContext(common);
RETURN_IF(!mImplContext, EX_NULL_POINTER, "nullContext");
+
+ int version = 0;
+ RETURN_IF(!getInterfaceVersion(&version).isOk(), EX_UNSUPPORTED_OPERATION,
+ "FailedToGetInterfaceVersion");
+ mImplContext->setVersion(version);
mEventFlag = mImplContext->getStatusEventFlag();
if (specific.has_value()) {
@@ -85,7 +90,7 @@
}
RETURN_IF(notifyEventFlag(kEventFlagNotEmpty) != RetCode::SUCCESS, EX_ILLEGAL_STATE,
- "notifyEventFlagFailed");
+ "notifyEventFlagNotEmptyFailed");
// stop the worker thread, ignore the return code
RETURN_IF(destroyThread() != RetCode::SUCCESS, EX_UNSUPPORTED_OPERATION,
"FailedToDestroyWorker");
@@ -225,8 +230,6 @@
ndk::ScopedAStatus EffectImpl::command(CommandId command) {
std::lock_guard lg(mImplMutex);
RETURN_IF(mState == State::INIT, EX_ILLEGAL_STATE, "instanceNotOpen");
- LOG(DEBUG) << getEffectName() << __func__ << ": receive command: " << toString(command)
- << " at state " << toString(mState);
switch (command) {
case CommandId::START:
@@ -234,7 +237,7 @@
RETURN_IF_ASTATUS_NOT_OK(commandImpl(command), "commandImplFailed");
mState = State::PROCESSING;
RETURN_IF(notifyEventFlag(kEventFlagNotEmpty) != RetCode::SUCCESS, EX_ILLEGAL_STATE,
- "notifyEventFlagFailed");
+ "notifyEventFlagNotEmptyFailed");
startThread();
break;
case CommandId::STOP:
@@ -242,7 +245,7 @@
RETURN_OK_IF(mState == State::IDLE);
mState = State::IDLE;
RETURN_IF(notifyEventFlag(kEventFlagNotEmpty) != RetCode::SUCCESS, EX_ILLEGAL_STATE,
- "notifyEventFlagFailed");
+ "notifyEventFlagNotEmptyFailed");
stopThread();
RETURN_IF_ASTATUS_NOT_OK(commandImpl(command), "commandImplFailed");
break;
@@ -251,7 +254,7 @@
return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
"CommandIdNotSupported");
}
- LOG(DEBUG) << getEffectName() << __func__ << " transfer to state: " << toString(mState);
+ LOG(VERBOSE) << getEffectName() << __func__ << " transfer to state: " << toString(mState);
return ndk::ScopedAStatus::ok();
}
@@ -288,6 +291,7 @@
LOG(ERROR) << getEffectName() << __func__ << ": wake failure with ret " << ret;
return RetCode::ERROR_EVENT_FLAG_ERROR;
}
+ LOG(VERBOSE) << getEffectName() << __func__ << ": " << std::hex << mEventFlag;
return RetCode::SUCCESS;
}
@@ -300,7 +304,7 @@
}
void EffectImpl::process() {
- ATRACE_CALL();
+ ATRACE_NAME(getEffectName().c_str());
/**
* wait for the EventFlag without lock, it's ok because the mEfGroup pointer will not change
* in the life cycle of workerThread (threadLoop).
@@ -338,8 +342,6 @@
IEffect::Status status = effectProcessImpl(buffer, buffer, processSamples);
outputMQ->write(buffer, status.fmqProduced);
statusMQ->writeBlocking(&status, 1);
- LOG(VERBOSE) << getEffectName() << __func__ << ": done processing, effect consumed "
- << status.fmqConsumed << " produced " << status.fmqProduced;
}
}
}
@@ -349,7 +351,6 @@
for (int i = 0; i < samples; i++) {
*out++ = *in++;
}
- LOG(VERBOSE) << 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 fdd4803..b515385 100644
--- a/audio/aidl/default/EffectThread.cpp
+++ b/audio/aidl/default/EffectThread.cpp
@@ -27,13 +27,8 @@
namespace aidl::android::hardware::audio::effect {
-EffectThread::EffectThread() {
- LOG(DEBUG) << __func__;
-}
-
EffectThread::~EffectThread() {
destroyThread();
- LOG(DEBUG) << __func__ << " done";
}
RetCode EffectThread::createThread(const std::string& name, int priority) {
@@ -51,7 +46,7 @@
}
mThread = std::thread(&EffectThread::threadLoop, this);
- LOG(DEBUG) << mName << __func__ << " priority " << mPriority << " done";
+ LOG(VERBOSE) << mName << __func__ << " priority " << mPriority << " done";
return RetCode::SUCCESS;
}
@@ -66,7 +61,7 @@
mThread.join();
}
- LOG(DEBUG) << mName << __func__;
+ LOG(VERBOSE) << mName << __func__;
return RetCode::SUCCESS;
}
@@ -77,7 +72,7 @@
mCv.notify_one();
}
- LOG(DEBUG) << mName << __func__;
+ LOG(VERBOSE) << mName << __func__;
return RetCode::SUCCESS;
}
@@ -88,7 +83,7 @@
mCv.notify_one();
}
- LOG(DEBUG) << mName << __func__;
+ LOG(VERBOSE) << mName << __func__;
return RetCode::SUCCESS;
}
@@ -101,7 +96,7 @@
::android::base::ScopedLockAssertion lock_assertion(mThreadMutex);
mCv.wait(l, [&]() REQUIRES(mThreadMutex) { return mExit || !mStop; });
if (mExit) {
- LOG(INFO) << __func__ << " EXIT!";
+ LOG(VERBOSE) << mName << " threadLoop EXIT!";
return;
}
}
diff --git a/audio/aidl/default/Module.cpp b/audio/aidl/default/Module.cpp
index b8e1df8..0d6151e 100644
--- a/audio/aidl/default/Module.cpp
+++ b/audio/aidl/default/Module.cpp
@@ -173,7 +173,8 @@
std::shared_ptr<IStreamCallback> asyncCallback,
std::shared_ptr<IStreamOutEventCallback> outEventCallback, StreamContext* out_context) {
if (in_bufferSizeFrames <= 0) {
- LOG(ERROR) << __func__ << ": non-positive buffer size " << in_bufferSizeFrames;
+ LOG(ERROR) << __func__ << ": " << mType << ": non-positive buffer size "
+ << in_bufferSizeFrames;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
auto& configs = getConfig().portConfigs;
@@ -184,20 +185,21 @@
const int32_t minimumStreamBufferSizeFrames =
calculateBufferSizeFrames(nominalLatencyMs, portConfigIt->sampleRate.value().value);
if (in_bufferSizeFrames < minimumStreamBufferSizeFrames) {
- LOG(ERROR) << __func__ << ": insufficient buffer size " << in_bufferSizeFrames
- << ", must be at least " << minimumStreamBufferSizeFrames;
+ LOG(ERROR) << __func__ << ": " << mType << ": insufficient buffer size "
+ << in_bufferSizeFrames << ", must be at least " << minimumStreamBufferSizeFrames;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
const size_t frameSize =
getFrameSizeInBytes(portConfigIt->format.value(), portConfigIt->channelMask.value());
if (frameSize == 0) {
- LOG(ERROR) << __func__ << ": could not calculate frame size for port config "
+ LOG(ERROR) << __func__ << ": " << mType
+ << ": could not calculate frame size for port config "
<< portConfigIt->toString();
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
- LOG(DEBUG) << __func__ << ": frame size " << frameSize << " bytes";
+ LOG(DEBUG) << __func__ << ": " << mType << ": frame size " << frameSize << " bytes";
if (frameSize > static_cast<size_t>(kMaximumStreamBufferSizeBytes / in_bufferSizeFrames)) {
- LOG(ERROR) << __func__ << ": buffer size " << in_bufferSizeFrames
+ LOG(ERROR) << __func__ << ": " << mType << ": buffer size " << in_bufferSizeFrames
<< " frames is too large, maximum size is "
<< kMaximumStreamBufferSizeBytes / frameSize;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
@@ -212,6 +214,11 @@
StreamContext::DebugParameters params{mDebug.streamTransientStateDelayMs,
mVendorDebug.forceTransientBurst,
mVendorDebug.forceSynchronousDrain};
+ std::shared_ptr<ISoundDose> soundDose;
+ if (!getSoundDose(&soundDose).isOk()) {
+ LOG(ERROR) << __func__ << ": could not create sound dose instance";
+ return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+ }
StreamContext temp(
std::make_unique<StreamContext::CommandMQ>(1, true /*configureEventFlagWord*/),
std::make_unique<StreamContext::ReplyMQ>(1, true /*configureEventFlagWord*/),
@@ -219,8 +226,7 @@
portConfigIt->sampleRate.value().value, flags, nominalLatencyMs,
portConfigIt->ext.get<AudioPortExt::mix>().handle,
std::make_unique<StreamContext::DataMQ>(frameSize * in_bufferSizeFrames),
- asyncCallback, outEventCallback,
- std::weak_ptr<sounddose::StreamDataProcessorInterface>{}, params);
+ asyncCallback, outEventCallback, mSoundDose.getInstance(), params);
if (temp.isValid()) {
*out_context = std::move(temp);
} else {
@@ -252,7 +258,8 @@
for (auto it = patchIdsRange.first; it != patchIdsRange.second; ++it) {
auto patchIt = findById<AudioPatch>(patches, it->second);
if (patchIt == patches.end()) {
- LOG(FATAL) << __func__ << ": patch with id " << it->second << " taken from mPatches "
+ LOG(FATAL) << __func__ << ": " << mType << ": patch with id " << it->second
+ << " taken from mPatches "
<< "not found in the configuration";
}
if (std::find(patchIt->sourcePortConfigIds.begin(), patchIt->sourcePortConfigIds.end(),
@@ -269,7 +276,8 @@
auto& configs = getConfig().portConfigs;
auto portConfigIt = findById<AudioPortConfig>(configs, in_portConfigId);
if (portConfigIt == configs.end()) {
- LOG(ERROR) << __func__ << ": existing port config id " << in_portConfigId << " not found";
+ LOG(ERROR) << __func__ << ": " << mType << ": existing port config id " << in_portConfigId
+ << " not found";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
const int32_t portId = portConfigIt->portId;
@@ -278,23 +286,23 @@
auto& ports = getConfig().ports;
auto portIt = findById<AudioPort>(ports, portId);
if (portIt == ports.end()) {
- LOG(ERROR) << __func__ << ": port id " << portId << " used by port config id "
- << in_portConfigId << " not found";
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << portId
+ << " used by port config id " << in_portConfigId << " not found";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
if (mStreams.count(in_portConfigId) != 0) {
- LOG(ERROR) << __func__ << ": port config id " << in_portConfigId
+ LOG(ERROR) << __func__ << ": " << mType << ": port config id " << in_portConfigId
<< " already has a stream opened on it";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
if (portIt->ext.getTag() != AudioPortExt::Tag::mix) {
- LOG(ERROR) << __func__ << ": port config id " << in_portConfigId
+ LOG(ERROR) << __func__ << ": " << mType << ": port config id " << in_portConfigId
<< " does not correspond to a mix port";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
const size_t maxOpenStreamCount = portIt->ext.get<AudioPortExt::Tag::mix>().maxOpenStreamCount;
if (maxOpenStreamCount != 0 && mStreams.count(portId) >= maxOpenStreamCount) {
- LOG(ERROR) << __func__ << ": port id " << portId
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << portId
<< " has already reached maximum allowed opened stream count: "
<< maxOpenStreamCount;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
@@ -322,7 +330,7 @@
config->ext = port.ext;
return true;
}
- LOG(ERROR) << __func__ << ": port " << port.id << " only has dynamic profiles";
+ LOG(ERROR) << __func__ << ": " << mType << ": port " << port.id << " only has dynamic profiles";
return false;
}
@@ -489,7 +497,8 @@
}
});
if (!maybeFailure.isOk()) {
- LOG(WARNING) << __func__ << ": Due to a failure, disconnecting streams on port config ids "
+ LOG(WARNING) << __func__ << ": " << mType
+ << ": Due to a failure, disconnecting streams on port config ids "
<< ::android::internal::ToString(idsToDisconnectOnFailure);
std::for_each(idsToDisconnectOnFailure.begin(), idsToDisconnectOnFailure.end(),
[&](const auto& portConfigId) {
@@ -508,7 +517,8 @@
if (mDebug.simulateDeviceConnections != in_debug.simulateDeviceConnections &&
!mConnectedDevicePorts.empty()) {
LOG(ERROR) << __func__ << ": " << mType
- << ": attempting to change device connections simulation while having external "
+ << ": attempting to change device connections simulation while "
+ "having external "
<< "devices connected";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
@@ -523,25 +533,25 @@
ndk::ScopedAStatus Module::getTelephony(std::shared_ptr<ITelephony>* _aidl_return) {
*_aidl_return = nullptr;
- LOG(DEBUG) << __func__ << ": returning null";
+ LOG(DEBUG) << __func__ << ": " << mType << ": returning null";
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::getBluetooth(std::shared_ptr<IBluetooth>* _aidl_return) {
*_aidl_return = nullptr;
- LOG(DEBUG) << __func__ << ": returning null";
+ LOG(DEBUG) << __func__ << ": " << mType << ": returning null";
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::getBluetoothA2dp(std::shared_ptr<IBluetoothA2dp>* _aidl_return) {
*_aidl_return = nullptr;
- LOG(DEBUG) << __func__ << ": returning null";
+ LOG(DEBUG) << __func__ << ": " << mType << ": returning null";
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::getBluetoothLe(std::shared_ptr<IBluetoothLe>* _aidl_return) {
*_aidl_return = nullptr;
- LOG(DEBUG) << __func__ << ": returning null";
+ LOG(DEBUG) << __func__ << ": " << mType << ": returning null";
return ndk::ScopedAStatus::ok();
}
@@ -553,20 +563,23 @@
{ // Scope the template port so that we don't accidentally modify it.
auto templateIt = findById<AudioPort>(ports, templateId);
if (templateIt == ports.end()) {
- LOG(ERROR) << __func__ << ": port id " << templateId << " not found";
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << templateId << " not found";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
if (templateIt->ext.getTag() != AudioPortExt::Tag::device) {
- LOG(ERROR) << __func__ << ": port id " << templateId << " is not a device port";
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << templateId
+ << " is not a device port";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
auto& templateDevicePort = templateIt->ext.get<AudioPortExt::Tag::device>();
if (templateDevicePort.device.type.connection.empty()) {
- LOG(ERROR) << __func__ << ": port id " << templateId << " is permanently attached";
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << templateId
+ << " is permanently attached";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
if (mConnectedDevicePorts.find(templateId) != mConnectedDevicePorts.end()) {
- LOG(ERROR) << __func__ << ": port id " << templateId << " is a connected device port";
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << templateId
+ << " is a connected device port";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
// Postpone id allocation until we ensure that there are no client errors.
@@ -576,14 +589,16 @@
in_templateIdAndAdditionalData.ext.get<AudioPortExt::Tag::device>();
auto& connectedDevicePort = connectedPort.ext.get<AudioPortExt::Tag::device>();
connectedDevicePort.device.address = inputDevicePort.device.address;
- LOG(DEBUG) << __func__ << ": device port " << connectedPort.id << " device set to "
- << connectedDevicePort.device.toString();
+ LOG(DEBUG) << __func__ << ": " << mType << ": 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 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()
+ LOG(ERROR) << __func__ << ": " << mType << ": device "
+ << connectedDevicePort.device.toString()
<< " is already connected at the device port id "
<< connectedPortPair.first;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
@@ -635,7 +650,8 @@
hasDynamicProfilesOnly(p.profiles);
});
dynamicMixPortIt != ports.end()) {
- LOG(ERROR) << __func__ << ": connected port only has dynamic profiles after connecting "
+ LOG(ERROR) << __func__ << ": " << mType
+ << ": connected port only has dynamic profiles after connecting "
<< "external device " << connectedPort.toString() << ", and there exist "
<< "a routable mix port with dynamic profiles: "
<< dynamicMixPortIt->toString();
@@ -646,7 +662,8 @@
connectedPort.id = nextPortId;
auto [connectedPortsIt, _] =
mConnectedDevicePorts.insert(std::pair(connectedPort.id, std::set<int32_t>()));
- LOG(DEBUG) << __func__ << ": template port " << templateId << " external device connected, "
+ LOG(DEBUG) << __func__ << ": " << mType << ": template port " << templateId
+ << " external device connected, "
<< "connected port ID " << connectedPort.id;
ports.push_back(connectedPort);
onExternalDeviceConnectionChanged(connectedPort, true /*connected*/);
@@ -696,16 +713,18 @@
auto& ports = getConfig().ports;
auto portIt = findById<AudioPort>(ports, in_portId);
if (portIt == ports.end()) {
- LOG(ERROR) << __func__ << ": port id " << in_portId << " not found";
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << in_portId << " not found";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
if (portIt->ext.getTag() != AudioPortExt::Tag::device) {
- LOG(ERROR) << __func__ << ": port id " << in_portId << " is not a device port";
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << in_portId
+ << " is not a device port";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
auto connectedPortsIt = mConnectedDevicePorts.find(in_portId);
if (connectedPortsIt == mConnectedDevicePorts.end()) {
- LOG(ERROR) << __func__ << ": port id " << in_portId << " is not a connected device port";
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << in_portId
+ << " is not a connected device port";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
auto& configs = getConfig().portConfigs;
@@ -719,13 +738,14 @@
return false;
});
if (configIt != configs.end()) {
- LOG(ERROR) << __func__ << ": port id " << in_portId << " has a non-default config with id "
- << configIt->id;
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << in_portId
+ << " has a non-default config with id " << configIt->id;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
onExternalDeviceConnectionChanged(*portIt, false /*connected*/);
ports.erase(portIt);
- LOG(DEBUG) << __func__ << ": connected device port " << in_portId << " released";
+ LOG(DEBUG) << __func__ << ": " << mType << ": connected device port " << in_portId
+ << " released";
auto& routes = getConfig().routes;
for (auto routesIt = routes.begin(); routesIt != routes.end();) {
@@ -761,16 +781,18 @@
auto& ports = getConfig().ports;
auto portIt = findById<AudioPort>(ports, in_portId);
if (portIt == ports.end()) {
- LOG(ERROR) << __func__ << ": port id " << in_portId << " not found";
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << in_portId << " not found";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
if (portIt->ext.getTag() != AudioPortExt::Tag::device) {
- LOG(ERROR) << __func__ << ": port id " << in_portId << " is not a device port";
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << in_portId
+ << " is not a device port";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
auto connectedPortsIt = mConnectedDevicePorts.find(in_portId);
if (connectedPortsIt == mConnectedDevicePorts.end()) {
- LOG(ERROR) << __func__ << ": port id " << in_portId << " is not a connected device port";
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << in_portId
+ << " is not a connected device port";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
@@ -781,7 +803,7 @@
ndk::ScopedAStatus Module::getAudioPatches(std::vector<AudioPatch>* _aidl_return) {
*_aidl_return = getConfig().patches;
- LOG(DEBUG) << __func__ << ": returning " << _aidl_return->size() << " patches";
+ LOG(DEBUG) << __func__ << ": " << mType << ": returning " << _aidl_return->size() << " patches";
return ndk::ScopedAStatus::ok();
}
@@ -790,28 +812,29 @@
auto portIt = findById<AudioPort>(ports, in_portId);
if (portIt != ports.end()) {
*_aidl_return = *portIt;
- LOG(DEBUG) << __func__ << ": returning port by id " << in_portId;
+ LOG(DEBUG) << __func__ << ": " << mType << ": returning port by id " << in_portId;
return ndk::ScopedAStatus::ok();
}
- LOG(ERROR) << __func__ << ": port id " << in_portId << " not found";
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << in_portId << " not found";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
ndk::ScopedAStatus Module::getAudioPortConfigs(std::vector<AudioPortConfig>* _aidl_return) {
*_aidl_return = getConfig().portConfigs;
- LOG(DEBUG) << __func__ << ": returning " << _aidl_return->size() << " port configs";
+ LOG(DEBUG) << __func__ << ": " << mType << ": returning " << _aidl_return->size()
+ << " port configs";
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::getAudioPorts(std::vector<AudioPort>* _aidl_return) {
*_aidl_return = getConfig().ports;
- LOG(DEBUG) << __func__ << ": returning " << _aidl_return->size() << " ports";
+ LOG(DEBUG) << __func__ << ": " << mType << ": returning " << _aidl_return->size() << " ports";
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::getAudioRoutes(std::vector<AudioRoute>* _aidl_return) {
*_aidl_return = getConfig().routes;
- LOG(DEBUG) << __func__ << ": returning " << _aidl_return->size() << " routes";
+ LOG(DEBUG) << __func__ << ": " << mType << ": returning " << _aidl_return->size() << " routes";
return ndk::ScopedAStatus::ok();
}
@@ -819,7 +842,7 @@
std::vector<AudioRoute>* _aidl_return) {
auto& ports = getConfig().ports;
if (auto portIt = findById<AudioPort>(ports, in_portId); portIt == ports.end()) {
- LOG(ERROR) << __func__ << ": port id " << in_portId << " not found";
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << in_portId << " not found";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
std::vector<AudioRoute*> routes = getAudioRoutesForAudioPortImpl(in_portId);
@@ -830,12 +853,12 @@
ndk::ScopedAStatus Module::openInputStream(const OpenInputStreamArguments& in_args,
OpenInputStreamReturn* _aidl_return) {
- LOG(DEBUG) << __func__ << ": port config id " << in_args.portConfigId << ", buffer size "
- << in_args.bufferSizeFrames << " frames";
+ LOG(DEBUG) << __func__ << ": " << mType << ": port config id " << in_args.portConfigId
+ << ", buffer size " << in_args.bufferSizeFrames << " frames";
AudioPort* port = nullptr;
RETURN_STATUS_IF_ERROR(findPortIdForNewStream(in_args.portConfigId, &port));
if (port->flags.getTag() != AudioIoFlags::Tag::input) {
- LOG(ERROR) << __func__ << ": port config id " << in_args.portConfigId
+ LOG(ERROR) << __func__ << ": " << mType << ": port config id " << in_args.portConfigId
<< " does not correspond to an input mix port";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
@@ -851,8 +874,9 @@
RETURN_STATUS_IF_ERROR(
streamWrapper.setConnectedDevices(findConnectedDevices(in_args.portConfigId)));
}
- AIBinder_setMinSchedulerPolicy(streamWrapper.getBinder().get(), SCHED_NORMAL,
- ANDROID_PRIORITY_AUDIO);
+ auto streamBinder = streamWrapper.getBinder();
+ AIBinder_setMinSchedulerPolicy(streamBinder.get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
+ AIBinder_setInheritRt(streamBinder.get(), true);
mStreams.insert(port->id, in_args.portConfigId, std::move(streamWrapper));
_aidl_return->stream = std::move(stream);
return ndk::ScopedAStatus::ok();
@@ -860,27 +884,27 @@
ndk::ScopedAStatus Module::openOutputStream(const OpenOutputStreamArguments& in_args,
OpenOutputStreamReturn* _aidl_return) {
- LOG(DEBUG) << __func__ << ": port config id " << in_args.portConfigId << ", has offload info? "
- << (in_args.offloadInfo.has_value()) << ", buffer size " << in_args.bufferSizeFrames
- << " frames";
+ LOG(DEBUG) << __func__ << ": " << mType << ": port config id " << in_args.portConfigId
+ << ", has offload info? " << (in_args.offloadInfo.has_value()) << ", buffer size "
+ << in_args.bufferSizeFrames << " frames";
AudioPort* port = nullptr;
RETURN_STATUS_IF_ERROR(findPortIdForNewStream(in_args.portConfigId, &port));
if (port->flags.getTag() != AudioIoFlags::Tag::output) {
- LOG(ERROR) << __func__ << ": port config id " << in_args.portConfigId
+ LOG(ERROR) << __func__ << ": " << mType << ": port config id " << in_args.portConfigId
<< " does not correspond to an output mix port";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
const bool isOffload = isBitPositionFlagSet(port->flags.get<AudioIoFlags::Tag::output>(),
AudioOutputFlags::COMPRESS_OFFLOAD);
if (isOffload && !in_args.offloadInfo.has_value()) {
- LOG(ERROR) << __func__ << ": port id " << port->id
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << port->id
<< " has COMPRESS_OFFLOAD flag set, requires offload info";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
const bool isNonBlocking = isBitPositionFlagSet(port->flags.get<AudioIoFlags::Tag::output>(),
AudioOutputFlags::NON_BLOCKING);
if (isNonBlocking && in_args.callback == nullptr) {
- LOG(ERROR) << __func__ << ": port id " << port->id
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << port->id
<< " has NON_BLOCKING flag set, requires async callback";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
@@ -897,8 +921,9 @@
RETURN_STATUS_IF_ERROR(
streamWrapper.setConnectedDevices(findConnectedDevices(in_args.portConfigId)));
}
- AIBinder_setMinSchedulerPolicy(streamWrapper.getBinder().get(), SCHED_NORMAL,
- ANDROID_PRIORITY_AUDIO);
+ auto streamBinder = streamWrapper.getBinder();
+ AIBinder_setMinSchedulerPolicy(streamBinder.get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
+ AIBinder_setInheritRt(streamBinder.get(), true);
mStreams.insert(port->id, in_args.portConfigId, std::move(streamWrapper));
_aidl_return->stream = std::move(stream);
return ndk::ScopedAStatus::ok();
@@ -906,27 +931,29 @@
ndk::ScopedAStatus Module::getSupportedPlaybackRateFactors(
SupportedPlaybackRateFactors* _aidl_return) {
- LOG(DEBUG) << __func__;
+ LOG(DEBUG) << __func__ << ": " << mType;
(void)_aidl_return;
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
ndk::ScopedAStatus Module::setAudioPatch(const AudioPatch& in_requested, AudioPatch* _aidl_return) {
- LOG(DEBUG) << __func__ << ": requested patch " << in_requested.toString();
+ LOG(DEBUG) << __func__ << ": " << mType << ": requested patch " << in_requested.toString();
if (in_requested.sourcePortConfigIds.empty()) {
- LOG(ERROR) << __func__ << ": requested patch has empty sources list";
+ LOG(ERROR) << __func__ << ": " << mType << ": requested patch has empty sources list";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
if (!all_unique<int32_t>(in_requested.sourcePortConfigIds)) {
- LOG(ERROR) << __func__ << ": requested patch has duplicate ids in the sources list";
+ LOG(ERROR) << __func__ << ": " << mType
+ << ": requested patch has duplicate ids in the sources list";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
if (in_requested.sinkPortConfigIds.empty()) {
- LOG(ERROR) << __func__ << ": requested patch has empty sinks list";
+ LOG(ERROR) << __func__ << ": " << mType << ": requested patch has empty sinks list";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
if (!all_unique<int32_t>(in_requested.sinkPortConfigIds)) {
- LOG(ERROR) << __func__ << ": requested patch has duplicate ids in the sinks list";
+ LOG(ERROR) << __func__ << ": " << mType
+ << ": requested patch has duplicate ids in the sinks list";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
@@ -935,13 +962,13 @@
auto sources =
selectByIds<AudioPortConfig>(configs, in_requested.sourcePortConfigIds, &missingIds);
if (!missingIds.empty()) {
- LOG(ERROR) << __func__ << ": following source port config ids not found: "
+ LOG(ERROR) << __func__ << ": " << mType << ": following source port config ids not found: "
<< ::android::internal::ToString(missingIds);
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
auto sinks = selectByIds<AudioPortConfig>(configs, in_requested.sinkPortConfigIds, &missingIds);
if (!missingIds.empty()) {
- LOG(ERROR) << __func__ << ": following sink port config ids not found: "
+ LOG(ERROR) << __func__ << ": " << mType << ": following sink port config ids not found: "
<< ::android::internal::ToString(missingIds);
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
@@ -962,7 +989,8 @@
}
for (auto sink : sinks) {
if (allowedSinkPorts.count(sink->portId) == 0) {
- LOG(ERROR) << __func__ << ": there is no route to the sink port id " << sink->portId;
+ LOG(ERROR) << __func__ << ": " << mType << ": there is no route to the sink port id "
+ << sink->portId;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
}
@@ -977,14 +1005,15 @@
patchesBackup = mPatches;
cleanUpPatch(existing->id);
} else {
- LOG(ERROR) << __func__ << ": not found existing patch id " << in_requested.id;
+ LOG(ERROR) << __func__ << ": " << mType << ": not found existing patch id "
+ << in_requested.id;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
}
// Validate the requested patch.
for (const auto& [sinkPortId, nonExclusive] : allowedSinkPorts) {
if (!nonExclusive && mPatches.count(sinkPortId) != 0) {
- LOG(ERROR) << __func__ << ": sink port id " << sinkPortId
+ LOG(ERROR) << __func__ << ": " << mType << ": sink port id " << sinkPortId
<< "is exclusive and is already used by some other patch";
if (patchesBackup.has_value()) {
mPatches = std::move(*patchesBackup);
@@ -1027,8 +1056,8 @@
return status;
}
- LOG(DEBUG) << __func__ << ": " << (oldPatch.id == 0 ? "created" : "updated") << " patch "
- << _aidl_return->toString();
+ LOG(DEBUG) << __func__ << ": " << mType << ": " << (oldPatch.id == 0 ? "created" : "updated")
+ << " patch " << _aidl_return->toString();
return ndk::ScopedAStatus::ok();
}
@@ -1046,28 +1075,29 @@
::aidl::android::media::audio::common::AudioPortConfig* config)>&
fillPortConfig,
AudioPortConfig* out_suggested, bool* applied) {
- LOG(DEBUG) << __func__ << ": requested " << in_requested.toString();
+ LOG(DEBUG) << __func__ << ": " << mType << ": requested " << in_requested.toString();
auto& configs = getConfig().portConfigs;
auto existing = configs.end();
if (in_requested.id != 0) {
if (existing = findById<AudioPortConfig>(configs, in_requested.id);
existing == configs.end()) {
- LOG(ERROR) << __func__ << ": existing port config id " << in_requested.id
- << " not found";
+ LOG(ERROR) << __func__ << ": " << mType << ": existing port config id "
+ << in_requested.id << " not found";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
}
const int portId = existing != configs.end() ? existing->portId : in_requested.portId;
if (portId == 0) {
- LOG(ERROR) << __func__ << ": requested port config does not specify portId";
+ LOG(ERROR) << __func__ << ": " << mType
+ << ": requested port config does not specify portId";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
auto& ports = getConfig().ports;
auto portIt = findById<AudioPort>(ports, portId);
if (portIt == ports.end()) {
- LOG(ERROR) << __func__ << ": requested port config points to non-existent portId "
- << portId;
+ LOG(ERROR) << __func__ << ": " << mType
+ << ": requested port config points to non-existent portId " << portId;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
if (existing != configs.end()) {
@@ -1078,7 +1108,8 @@
if (fillPortConfig(*portIt, &newConfig)) {
*out_suggested = newConfig;
} else {
- LOG(ERROR) << __func__ << ": unable generate a default config for port " << portId;
+ LOG(ERROR) << __func__ << ": " << mType
+ << ": unable generate a default config for port " << portId;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
}
@@ -1095,7 +1126,7 @@
AudioIoFlags portFlags = portIt->flags;
if (in_requested.flags.has_value()) {
if (in_requested.flags.value() != portFlags) {
- LOG(WARNING) << __func__ << ": requested flags "
+ LOG(WARNING) << __func__ << ": " << mType << ": requested flags "
<< in_requested.flags.value().toString() << " do not match port's "
<< portId << " flags " << portFlags.toString();
requestedIsValid = false;
@@ -1111,7 +1142,7 @@
findAudioProfile(*portIt, format, &portProfile)) {
out_suggested->format = format;
} else {
- LOG(WARNING) << __func__ << ": requested format " << format.toString()
+ LOG(WARNING) << __func__ << ": " << mType << ": requested format " << format.toString()
<< " is not found in the profiles of port " << portId;
requestedIsValid = false;
}
@@ -1120,8 +1151,9 @@
}
if (!(out_suggested->format.value() == AudioFormatDescription{} && allowDynamicConfig) &&
!findAudioProfile(*portIt, out_suggested->format.value(), &portProfile)) {
- LOG(ERROR) << __func__ << ": port " << portId << " does not support format "
- << out_suggested->format.value().toString() << " anymore";
+ LOG(ERROR) << __func__ << ": " << mType << ": port " << portId
+ << " does not support format " << out_suggested->format.value().toString()
+ << " anymore";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
@@ -1132,9 +1164,9 @@
portProfile.channelMasks.end()) {
out_suggested->channelMask = channelMask;
} else {
- LOG(WARNING) << __func__ << ": requested channel mask " << channelMask.toString()
- << " is not supported for the format " << portProfile.format.toString()
- << " by the port " << portId;
+ LOG(WARNING) << __func__ << ": " << mType << ": requested channel mask "
+ << channelMask.toString() << " is not supported for the format "
+ << portProfile.format.toString() << " by the port " << portId;
requestedIsValid = false;
}
} else {
@@ -1148,9 +1180,9 @@
sampleRate.value) != portProfile.sampleRates.end()) {
out_suggested->sampleRate = sampleRate;
} else {
- LOG(WARNING) << __func__ << ": requested sample rate " << sampleRate.value
- << " is not supported for the format " << portProfile.format.toString()
- << " by the port " << portId;
+ LOG(WARNING) << __func__ << ": " << mType << ": requested sample rate "
+ << sampleRate.value << " is not supported for the format "
+ << portProfile.format.toString() << " by the port " << portId;
requestedIsValid = false;
}
} else {
@@ -1165,12 +1197,15 @@
if (in_requested.ext.getTag() != AudioPortExt::Tag::unspecified) {
if (in_requested.ext.getTag() == out_suggested->ext.getTag()) {
if (out_suggested->ext.getTag() == AudioPortExt::Tag::mix) {
- // 'AudioMixPortExt.handle' is set by the client, copy from in_requested
- out_suggested->ext.get<AudioPortExt::Tag::mix>().handle =
- in_requested.ext.get<AudioPortExt::Tag::mix>().handle;
+ // 'AudioMixPortExt.handle' and '.usecase' are set by the client,
+ // copy from in_requested.
+ const auto& src = in_requested.ext.get<AudioPortExt::Tag::mix>();
+ auto& dst = out_suggested->ext.get<AudioPortExt::Tag::mix>();
+ dst.handle = src.handle;
+ dst.usecase = src.usecase;
}
} else {
- LOG(WARNING) << __func__ << ": requested ext tag "
+ LOG(WARNING) << __func__ << ": " << mType << ": requested ext tag "
<< toString(in_requested.ext.getTag()) << " do not match port's tag "
<< toString(out_suggested->ext.getTag());
requestedIsValid = false;
@@ -1181,15 +1216,17 @@
out_suggested->id = getConfig().nextPortId++;
configs.push_back(*out_suggested);
*applied = true;
- LOG(DEBUG) << __func__ << ": created new port config " << out_suggested->toString();
+ LOG(DEBUG) << __func__ << ": " << mType << ": created new port config "
+ << out_suggested->toString();
} else if (existing != configs.end() && requestedIsValid) {
*existing = *out_suggested;
*applied = true;
- LOG(DEBUG) << __func__ << ": updated port config " << out_suggested->toString();
+ LOG(DEBUG) << __func__ << ": " << mType << ": updated port config "
+ << out_suggested->toString();
} else {
- LOG(DEBUG) << __func__ << ": not applied; existing config ? " << (existing != configs.end())
- << "; requested is valid? " << requestedIsValid << ", fully specified? "
- << requestedIsFullySpecified;
+ LOG(DEBUG) << __func__ << ": " << mType << ": not applied; existing config ? "
+ << (existing != configs.end()) << "; requested is valid? " << requestedIsValid
+ << ", fully specified? " << requestedIsFullySpecified;
*applied = false;
}
return ndk::ScopedAStatus::ok();
@@ -1206,10 +1243,10 @@
return status;
}
patches.erase(patchIt);
- LOG(DEBUG) << __func__ << ": erased patch " << in_patchId;
+ LOG(DEBUG) << __func__ << ": " << mType << ": erased patch " << in_patchId;
return ndk::ScopedAStatus::ok();
}
- LOG(ERROR) << __func__ << ": patch id " << in_patchId << " not found";
+ LOG(ERROR) << __func__ << ": " << mType << ": patch id " << in_patchId << " not found";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
@@ -1218,13 +1255,13 @@
auto configIt = findById<AudioPortConfig>(configs, in_portConfigId);
if (configIt != configs.end()) {
if (mStreams.count(in_portConfigId) != 0) {
- LOG(ERROR) << __func__ << ": port config id " << in_portConfigId
+ LOG(ERROR) << __func__ << ": " << mType << ": port config id " << in_portConfigId
<< " has a stream opened on it";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
auto patchIt = mPatches.find(in_portConfigId);
if (patchIt != mPatches.end()) {
- LOG(ERROR) << __func__ << ": port config id " << in_portConfigId
+ LOG(ERROR) << __func__ << ": " << mType << ": port config id " << in_portConfigId
<< " is used by the patch with id " << patchIt->second;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
@@ -1232,32 +1269,33 @@
auto initialIt = findById<AudioPortConfig>(initials, in_portConfigId);
if (initialIt == initials.end()) {
configs.erase(configIt);
- LOG(DEBUG) << __func__ << ": erased port config " << in_portConfigId;
+ LOG(DEBUG) << __func__ << ": " << mType << ": erased port config " << in_portConfigId;
} else if (*configIt != *initialIt) {
*configIt = *initialIt;
- LOG(DEBUG) << __func__ << ": reset port config " << in_portConfigId;
+ LOG(DEBUG) << __func__ << ": " << mType << ": reset port config " << in_portConfigId;
}
return ndk::ScopedAStatus::ok();
}
- LOG(ERROR) << __func__ << ": port config id " << in_portConfigId << " not found";
+ LOG(ERROR) << __func__ << ": " << mType << ": port config id " << in_portConfigId
+ << " not found";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
ndk::ScopedAStatus Module::getMasterMute(bool* _aidl_return) {
*_aidl_return = mMasterMute;
- LOG(DEBUG) << __func__ << ": returning " << *_aidl_return;
+ LOG(DEBUG) << __func__ << ": " << mType << ": returning " << *_aidl_return;
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::setMasterMute(bool in_mute) {
- LOG(DEBUG) << __func__ << ": " << in_mute;
+ LOG(DEBUG) << __func__ << ": " << mType << ": " << in_mute;
auto result = mDebug.simulateDeviceConnections ? ndk::ScopedAStatus::ok()
: onMasterMuteChanged(in_mute);
if (result.isOk()) {
mMasterMute = in_mute;
} else {
- LOG(ERROR) << __func__ << ": failed calling onMasterMuteChanged(" << in_mute
- << "), error=" << result;
+ LOG(ERROR) << __func__ << ": " << mType << ": failed calling onMasterMuteChanged("
+ << in_mute << "), error=" << result;
// Reset master mute if it failed.
onMasterMuteChanged(mMasterMute);
}
@@ -1266,12 +1304,12 @@
ndk::ScopedAStatus Module::getMasterVolume(float* _aidl_return) {
*_aidl_return = mMasterVolume;
- LOG(DEBUG) << __func__ << ": returning " << *_aidl_return;
+ LOG(DEBUG) << __func__ << ": " << mType << ": returning " << *_aidl_return;
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::setMasterVolume(float in_volume) {
- LOG(DEBUG) << __func__ << ": " << in_volume;
+ LOG(DEBUG) << __func__ << ": " << mType << ": " << in_volume;
if (in_volume >= 0.0f && in_volume <= 1.0f) {
auto result = mDebug.simulateDeviceConnections ? ndk::ScopedAStatus::ok()
: onMasterVolumeChanged(in_volume);
@@ -1279,51 +1317,52 @@
mMasterVolume = in_volume;
} else {
// Reset master volume if it failed.
- LOG(ERROR) << __func__ << ": failed calling onMasterVolumeChanged(" << in_volume
- << "), error=" << result;
+ LOG(ERROR) << __func__ << ": " << mType << ": failed calling onMasterVolumeChanged("
+ << in_volume << "), error=" << result;
onMasterVolumeChanged(mMasterVolume);
}
return result;
}
- LOG(ERROR) << __func__ << ": invalid master volume value: " << in_volume;
+ LOG(ERROR) << __func__ << ": " << mType << ": invalid master volume value: " << in_volume;
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
ndk::ScopedAStatus Module::getMicMute(bool* _aidl_return) {
*_aidl_return = mMicMute;
- LOG(DEBUG) << __func__ << ": returning " << *_aidl_return;
+ LOG(DEBUG) << __func__ << ": " << mType << ": returning " << *_aidl_return;
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::setMicMute(bool in_mute) {
- LOG(DEBUG) << __func__ << ": " << in_mute;
+ LOG(DEBUG) << __func__ << ": " << mType << ": " << in_mute;
mMicMute = in_mute;
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::getMicrophones(std::vector<MicrophoneInfo>* _aidl_return) {
*_aidl_return = getMicrophoneInfos();
- LOG(DEBUG) << __func__ << ": returning " << ::android::internal::ToString(*_aidl_return);
+ LOG(DEBUG) << __func__ << ": " << mType << ": returning "
+ << ::android::internal::ToString(*_aidl_return);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::updateAudioMode(AudioMode in_mode) {
if (!isValidAudioMode(in_mode)) {
- LOG(ERROR) << __func__ << ": invalid mode " << toString(in_mode);
+ LOG(ERROR) << __func__ << ": " << mType << ": invalid mode " << toString(in_mode);
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
// No checks for supported audio modes here, it's an informative notification.
- LOG(DEBUG) << __func__ << ": " << toString(in_mode);
+ LOG(DEBUG) << __func__ << ": " << mType << ": " << toString(in_mode);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::updateScreenRotation(ScreenRotation in_rotation) {
- LOG(DEBUG) << __func__ << ": " << toString(in_rotation);
+ LOG(DEBUG) << __func__ << ": " << mType << ": " << toString(in_rotation);
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::updateScreenState(bool in_isTurnedOn) {
- LOG(DEBUG) << __func__ << ": " << in_isTurnedOn;
+ LOG(DEBUG) << __func__ << ": " << mType << ": " << in_isTurnedOn;
return ndk::ScopedAStatus::ok();
}
@@ -1332,12 +1371,13 @@
mSoundDose = ndk::SharedRefBase::make<sounddose::SoundDose>();
}
*_aidl_return = mSoundDose.getInstance();
- LOG(DEBUG) << __func__ << ": returning instance of ISoundDose: " << _aidl_return->get();
+ LOG(DEBUG) << __func__ << ": " << mType
+ << ": returning instance of ISoundDose: " << _aidl_return->get();
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::generateHwAvSyncId(int32_t* _aidl_return) {
- LOG(DEBUG) << __func__;
+ LOG(DEBUG) << __func__ << ": " << mType;
(void)_aidl_return;
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
@@ -1347,7 +1387,7 @@
ndk::ScopedAStatus Module::getVendorParameters(const std::vector<std::string>& in_ids,
std::vector<VendorParameter>* _aidl_return) {
- LOG(DEBUG) << __func__ << ": id count: " << in_ids.size();
+ LOG(VERBOSE) << __func__ << ": " << mType << ": id count: " << in_ids.size();
bool allParametersKnown = true;
for (const auto& id : in_ids) {
if (id == VendorDebug::kForceTransientBurstName) {
@@ -1360,7 +1400,7 @@
_aidl_return->push_back(std::move(forceSynchronousDrain));
} else {
allParametersKnown = false;
- LOG(ERROR) << __func__ << ": unrecognized parameter \"" << id << "\"";
+ LOG(VERBOSE) << __func__ << ": " << mType << ": unrecognized parameter \"" << id << "\"";
}
}
if (allParametersKnown) return ndk::ScopedAStatus::ok();
@@ -1386,8 +1426,8 @@
ndk::ScopedAStatus Module::setVendorParameters(const std::vector<VendorParameter>& in_parameters,
bool in_async) {
- LOG(DEBUG) << __func__ << ": parameter count " << in_parameters.size()
- << ", async: " << in_async;
+ LOG(VERBOSE) << __func__ << ": " << mType << ": parameter count " << in_parameters.size()
+ << ", async: " << in_async;
bool allParametersKnown = true;
for (const auto& p : in_parameters) {
if (p.id == VendorDebug::kForceTransientBurstName) {
@@ -1400,7 +1440,8 @@
}
} else {
allParametersKnown = false;
- LOG(ERROR) << __func__ << ": unrecognized parameter \"" << p.id << "\"";
+ LOG(VERBOSE) << __func__ << ": " << mType << ": unrecognized parameter \"" << p.id
+ << "\"";
}
}
if (allParametersKnown) return ndk::ScopedAStatus::ok();
@@ -1411,10 +1452,11 @@
int32_t in_portConfigId,
const std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect>& in_effect) {
if (in_effect == nullptr) {
- LOG(DEBUG) << __func__ << ": port id " << in_portConfigId << ", null effect";
+ LOG(DEBUG) << __func__ << ": " << mType << ": port id " << in_portConfigId
+ << ", null effect";
} else {
- LOG(DEBUG) << __func__ << ": port id " << in_portConfigId << ", effect Binder "
- << in_effect->asBinder().get();
+ LOG(DEBUG) << __func__ << ": " << mType << ": port id " << in_portConfigId
+ << ", effect Binder " << in_effect->asBinder().get();
}
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
@@ -1423,17 +1465,18 @@
int32_t in_portConfigId,
const std::shared_ptr<::aidl::android::hardware::audio::effect::IEffect>& in_effect) {
if (in_effect == nullptr) {
- LOG(DEBUG) << __func__ << ": port id " << in_portConfigId << ", null effect";
+ LOG(DEBUG) << __func__ << ": " << mType << ": port id " << in_portConfigId
+ << ", null effect";
} else {
- LOG(DEBUG) << __func__ << ": port id " << in_portConfigId << ", effect Binder "
- << in_effect->asBinder().get();
+ LOG(DEBUG) << __func__ << ": " << mType << ": port id " << in_portConfigId
+ << ", effect Binder " << in_effect->asBinder().get();
}
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
ndk::ScopedAStatus Module::getMmapPolicyInfos(AudioMMapPolicyType mmapPolicyType,
std::vector<AudioMMapPolicyInfo>* _aidl_return) {
- LOG(DEBUG) << __func__ << ": mmap policy type " << toString(mmapPolicyType);
+ LOG(DEBUG) << __func__ << ": " << mType << ": mmap policy type " << toString(mmapPolicyType);
std::set<int32_t> mmapSinks;
std::set<int32_t> mmapSources;
auto& ports = getConfig().ports;
@@ -1461,7 +1504,8 @@
auto sourcePortIt = findById<AudioPort>(ports, sourcePortId);
if (sourcePortIt == ports.end()) {
// This must not happen
- LOG(ERROR) << __func__ << ": port id " << sourcePortId << " cannot be found";
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << sourcePortId
+ << " cannot be found";
continue;
}
if (sourcePortIt->ext.getTag() != AudioPortExt::Tag::device) {
@@ -1479,7 +1523,8 @@
auto sinkPortIt = findById<AudioPort>(ports, route.sinkPortId);
if (sinkPortIt == ports.end()) {
// This must not happen
- LOG(ERROR) << __func__ << ": port id " << route.sinkPortId << " cannot be found";
+ LOG(ERROR) << __func__ << ": " << mType << ": port id " << route.sinkPortId
+ << " cannot be found";
continue;
}
if (sinkPortIt->ext.getTag() != AudioPortExt::Tag::device) {
@@ -1500,28 +1545,28 @@
}
ndk::ScopedAStatus Module::supportsVariableLatency(bool* _aidl_return) {
- LOG(DEBUG) << __func__;
+ LOG(DEBUG) << __func__ << ": " << mType;
*_aidl_return = false;
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::getAAudioMixerBurstCount(int32_t* _aidl_return) {
if (!isMmapSupported()) {
- LOG(DEBUG) << __func__ << ": mmap is not supported ";
+ LOG(DEBUG) << __func__ << ": " << mType << ": mmap is not supported ";
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
*_aidl_return = DEFAULT_AAUDIO_MIXER_BURST_COUNT;
- LOG(DEBUG) << __func__ << ": returning " << *_aidl_return;
+ LOG(DEBUG) << __func__ << ": " << mType << ": returning " << *_aidl_return;
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::getAAudioHardwareBurstMinUsec(int32_t* _aidl_return) {
if (!isMmapSupported()) {
- LOG(DEBUG) << __func__ << ": mmap is not supported ";
+ LOG(DEBUG) << __func__ << ": " << mType << ": mmap is not supported ";
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
*_aidl_return = DEFAULT_AAUDIO_HARDWARE_BURST_MIN_DURATION_US;
- LOG(DEBUG) << __func__ << ": returning " << *_aidl_return;
+ LOG(DEBUG) << __func__ << ": " << mType << ": returning " << *_aidl_return;
return ndk::ScopedAStatus::ok();
}
@@ -1544,45 +1589,45 @@
ndk::ScopedAStatus Module::populateConnectedDevicePort(AudioPort* audioPort, int32_t) {
if (audioPort->ext.getTag() != AudioPortExt::device) {
- LOG(ERROR) << __func__ << ": not a device port: " << audioPort->toString();
+ LOG(ERROR) << __func__ << ": " << mType << ": not a device port: " << audioPort->toString();
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
const auto& devicePort = audioPort->ext.get<AudioPortExt::device>();
if (!devicePort.device.type.connection.empty()) {
- LOG(ERROR) << __func__
- << ": module implementation must override 'populateConnectedDevicePort' "
+ LOG(ERROR) << __func__ << ": " << mType << ": module implementation must override "
+ "'populateConnectedDevicePort' "
<< "to handle connection of external devices.";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
}
- LOG(VERBOSE) << __func__ << ": do nothing and return ok";
+ LOG(VERBOSE) << __func__ << ": " << mType << ": do nothing and return ok";
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::checkAudioPatchEndpointsMatch(
const std::vector<AudioPortConfig*>& sources __unused,
const std::vector<AudioPortConfig*>& sinks __unused) {
- LOG(VERBOSE) << __func__ << ": do nothing and return ok";
+ LOG(VERBOSE) << __func__ << ": " << mType << ": do nothing and return ok";
return ndk::ScopedAStatus::ok();
}
void Module::onExternalDeviceConnectionChanged(
const ::aidl::android::media::audio::common::AudioPort& audioPort __unused,
bool connected __unused) {
- LOG(DEBUG) << __func__ << ": do nothing and return";
+ LOG(DEBUG) << __func__ << ": " << mType << ": do nothing and return";
}
void Module::onPrepareToDisconnectExternalDevice(
const ::aidl::android::media::audio::common::AudioPort& audioPort __unused) {
- LOG(DEBUG) << __func__ << ": do nothing and return";
+ LOG(DEBUG) << __func__ << ": " << mType << ": do nothing and return";
}
ndk::ScopedAStatus Module::onMasterMuteChanged(bool mute __unused) {
- LOG(VERBOSE) << __func__ << ": do nothing and return ok";
+ LOG(VERBOSE) << __func__ << ": " << mType << ": do nothing and return ok";
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus Module::onMasterVolumeChanged(float volume __unused) {
- LOG(VERBOSE) << __func__ << ": do nothing and return ok";
+ LOG(VERBOSE) << __func__ << ": " << mType << ": do nothing and return ok";
return ndk::ScopedAStatus::ok();
}
diff --git a/audio/aidl/default/SoundDose.cpp b/audio/aidl/default/SoundDose.cpp
index f12ce5d..1c9e081 100644
--- a/audio/aidl/default/SoundDose.cpp
+++ b/audio/aidl/default/SoundDose.cpp
@@ -18,7 +18,15 @@
#include "core-impl/SoundDose.h"
+#include <aidl/android/hardware/audio/core/sounddose/ISoundDose.h>
#include <android-base/logging.h>
+#include <media/AidlConversionCppNdk.h>
+#include <utils/Timers.h>
+
+using aidl::android::hardware::audio::core::sounddose::ISoundDose;
+using aidl::android::media::audio::common::AudioDevice;
+using aidl::android::media::audio::common::AudioDeviceDescription;
+using aidl::android::media::audio::common::AudioFormatDescription;
namespace aidl::android::hardware::audio::core::sounddose {
@@ -28,11 +36,16 @@
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
+ ::android::audio_utils::lock_guard l(mMutex);
mRs2Value = in_rs2ValueDbA;
+ if (mMelProcessor != nullptr) {
+ mMelProcessor->setOutputRs2UpperBound(in_rs2ValueDbA);
+ }
return ndk::ScopedAStatus::ok();
}
ndk::ScopedAStatus SoundDose::getOutputRs2UpperBound(float* _aidl_return) {
+ ::android::audio_utils::lock_guard l(mMutex);
*_aidl_return = mRs2Value;
LOG(DEBUG) << __func__ << ": returning " << *_aidl_return;
return ndk::ScopedAStatus::ok();
@@ -44,6 +57,8 @@
LOG(ERROR) << __func__ << ": Callback is nullptr";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
+
+ ::android::audio_utils::lock_guard l(mCbMutex);
if (mCallback != nullptr) {
LOG(ERROR) << __func__ << ": Sound dose callback was already registered";
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
@@ -51,7 +66,81 @@
mCallback = in_callback;
LOG(DEBUG) << __func__ << ": Registered sound dose callback ";
+
return ndk::ScopedAStatus::ok();
}
+void SoundDose::setAudioDevice(const AudioDevice& audioDevice) {
+ ::android::audio_utils::lock_guard l(mCbMutex);
+ mAudioDevice = audioDevice;
+}
+
+void SoundDose::startDataProcessor(uint32_t sampleRate, uint32_t channelCount,
+ const AudioFormatDescription& aidlFormat) {
+ ::android::audio_utils::lock_guard l(mMutex);
+ const auto result = aidl2legacy_AudioFormatDescription_audio_format_t(aidlFormat);
+ const audio_format_t format = result.value_or(AUDIO_FORMAT_INVALID);
+
+ if (mMelProcessor == nullptr) {
+ // we don't have the deviceId concept on the vendor side so just pass 0
+ mMelProcessor = ::android::sp<::android::audio_utils::MelProcessor>::make(
+ sampleRate, channelCount, format, mMelCallback, /*deviceId=*/0, mRs2Value);
+ } else {
+ mMelProcessor->updateAudioFormat(sampleRate, channelCount, format);
+ }
+}
+
+void SoundDose::process(const void* buffer, size_t bytes) {
+ ::android::audio_utils::lock_guard l(mMutex);
+ if (mMelProcessor != nullptr) {
+ mMelProcessor->process(buffer, bytes);
+ }
+}
+
+void SoundDose::onNewMelValues(const std::vector<float>& mels, size_t offset, size_t length,
+ audio_port_handle_t deviceId __attribute__((__unused__))) const {
+ ::android::audio_utils::lock_guard l(mCbMutex);
+ if (!mAudioDevice.has_value()) {
+ LOG(WARNING) << __func__ << ": New mel values without a registered device";
+ return;
+ }
+ if (mCallback == nullptr) {
+ LOG(ERROR) << __func__ << ": New mel values without a registered callback";
+ return;
+ }
+
+ ISoundDose::IHalSoundDoseCallback::MelRecord melRecord;
+ melRecord.timestamp = nanoseconds_to_seconds(systemTime());
+ melRecord.melValues = std::vector<float>(mels.begin() + offset, mels.begin() + offset + length);
+
+ mCallback->onNewMelValues(melRecord, mAudioDevice.value());
+}
+
+void SoundDose::MelCallback::onNewMelValues(const std::vector<float>& mels, size_t offset,
+ size_t length,
+ audio_port_handle_t deviceId
+ __attribute__((__unused__))) const {
+ mSoundDose.onNewMelValues(mels, offset, length, deviceId);
+}
+
+void SoundDose::onMomentaryExposure(float currentMel, audio_port_handle_t deviceId
+ __attribute__((__unused__))) const {
+ ::android::audio_utils::lock_guard l(mCbMutex);
+ if (!mAudioDevice.has_value()) {
+ LOG(WARNING) << __func__ << ": Momentary exposure without a registered device";
+ return;
+ }
+ if (mCallback == nullptr) {
+ LOG(ERROR) << __func__ << ": Momentary exposure without a registered callback";
+ return;
+ }
+
+ mCallback->onMomentaryExposureWarning(currentMel, mAudioDevice.value());
+}
+
+void SoundDose::MelCallback::onMomentaryExposure(float currentMel, audio_port_handle_t deviceId
+ __attribute__((__unused__))) const {
+ mSoundDose.onMomentaryExposure(currentMel, deviceId);
+}
+
} // namespace aidl::android::hardware::audio::core::sounddose
diff --git a/audio/aidl/default/Stream.cpp b/audio/aidl/default/Stream.cpp
index 807348f..697ff0d 100644
--- a/audio/aidl/default/Stream.cpp
+++ b/audio/aidl/default/Stream.cpp
@@ -21,6 +21,7 @@
#include <Utils.h>
#include <android-base/logging.h>
#include <android/binder_ibinder_platform.h>
+#include <cutils/properties.h>
#include <utils/SystemClock.h>
#include <utils/Trace.h>
@@ -652,16 +653,34 @@
isBitPositionFlagSet(flags.template get<AudioIoFlags::Tag::input>(),
AudioInputFlags::FAST)) ||
(flags.getTag() == AudioIoFlags::Tag::output &&
- isBitPositionFlagSet(flags.template get<AudioIoFlags::Tag::output>(),
- AudioOutputFlags::FAST))) {
+ (isBitPositionFlagSet(flags.template get<AudioIoFlags::Tag::output>(),
+ AudioOutputFlags::FAST) ||
+ isBitPositionFlagSet(flags.template get<AudioIoFlags::Tag::output>(),
+ AudioOutputFlags::SPATIALIZER)))) {
// FAST workers should be run with a SCHED_FIFO scheduler, however the host process
// might be lacking the capability to request it, thus a failure to set is not an error.
pid_t workerTid = mWorker->getTid();
if (workerTid > 0) {
- struct sched_param param;
- param.sched_priority = 3; // Must match SchedulingPolicyService.PRIORITY_MAX (Java).
+ constexpr int32_t kRTPriorityMin = 1; // SchedulingPolicyService.PRIORITY_MIN (Java).
+ constexpr int32_t kRTPriorityMax = 3; // SchedulingPolicyService.PRIORITY_MAX (Java).
+ int priorityBoost = kRTPriorityMax;
+ if (flags.getTag() == AudioIoFlags::Tag::output &&
+ isBitPositionFlagSet(flags.template get<AudioIoFlags::Tag::output>(),
+ AudioOutputFlags::SPATIALIZER)) {
+ const int32_t sptPrio =
+ property_get_int32("audio.spatializer.priority", kRTPriorityMin);
+ if (sptPrio >= kRTPriorityMin && sptPrio <= kRTPriorityMax) {
+ priorityBoost = sptPrio;
+ } else {
+ LOG(WARNING) << __func__ << ": invalid spatializer priority: " << sptPrio;
+ return ndk::ScopedAStatus::ok();
+ }
+ }
+ struct sched_param param = {
+ .sched_priority = priorityBoost,
+ };
if (sched_setscheduler(workerTid, SCHED_FIFO | SCHED_RESET_ON_FORK, ¶m) != 0) {
- PLOG(WARNING) << __func__ << ": failed to set FIFO scheduler for a fast thread";
+ PLOG(WARNING) << __func__ << ": failed to set FIFO scheduler and priority";
}
} else {
LOG(WARNING) << __func__ << ": invalid worker tid: " << workerTid;
diff --git a/audio/aidl/default/apex/com.android.hardware.audio/Android.bp b/audio/aidl/default/apex/com.android.hardware.audio/Android.bp
index 9c91e27..ee92512 100644
--- a/audio/aidl/default/apex/com.android.hardware.audio/Android.bp
+++ b/audio/aidl/default/apex/com.android.hardware.audio/Android.bp
@@ -38,6 +38,7 @@
"libpreprocessingaidl",
"libpresetreverbsw",
"libreverbaidl",
+ "libspatializersw",
"libvirtualizersw",
"libvisualizeraidl",
"libvolumesw",
@@ -45,6 +46,6 @@
prebuilts: [
"android.hardware.audio.service-aidl.example.rc",
"android.hardware.audio.service-aidl.xml",
- "audio_effects_config.xml",
+ "android.hardware.bluetooth.audio.xml",
],
}
diff --git a/audio/aidl/default/audio_effects_config.xml b/audio/aidl/default/audio_effects_config.xml
index 827ff80..9547865 100644
--- a/audio/aidl/default/audio_effects_config.xml
+++ b/audio/aidl/default/audio_effects_config.xml
@@ -72,30 +72,20 @@
<effects>
<effect name="automatic_gain_control_v2" library="pre_processing" uuid="89f38e65-d4d2-4d64-ad0e-2b3e799ea886"/>
- <effectProxy name="bassboost" uuid="14804144-a5ee-4d24-aa88-0002a5d5c51b">
- <libsw library="bassboostsw" uuid="fa8181f2-588b-11ed-9b6a-0242ac120002"/>
- <libsw library="bundle" uuid="8631f300-72e2-11df-b57e-0002a5d5c51b"/>
- </effectProxy>
+ <effect name="bassboost" library="bundle" uuid="8631f300-72e2-11df-b57e-0002a5d5c51b"/>
<effect name="downmix" library="downmix" uuid="93f04452-e4fe-41cc-91f9-e475b6d1d69f"/>
<effect name="dynamics_processing" library="dynamics_processing" uuid="e0e6539b-1781-7261-676f-6d7573696340"/>
<effect name="haptic_generator" library="haptic_generator" uuid="97c4acd1-8b82-4f2f-832e-c2fe5d7a9931"/>
<effect name="loudness_enhancer" library="loudness_enhancer" uuid="fa415329-2034-4bea-b5dc-5b381c8d1e2c"/>
<effect name="env_reverb" library="env_reverbsw" uuid="fa819886-588b-11ed-9b6a-0242ac120002"/>
- <effect name="preset_reverb" library="preset_reverbsw" uuid="fa8199c6-588b-11ed-9b6a-0242ac120002"/>
<effect name="reverb_env_aux" library="reverb" uuid="4a387fc0-8ab3-11df-8bad-0002a5d5c51b"/>
<effect name="reverb_env_ins" library="reverb" uuid="c7a511a0-a3bb-11df-860e-0002a5d5c51b"/>
<effect name="reverb_pre_aux" library="reverb" uuid="f29a1400-a3bb-11df-8ddc-0002a5d5c51b"/>
<effect name="reverb_pre_ins" library="reverb" uuid="172cdf00-a3bc-11df-a72f-0002a5d5c51b"/>
- <effectProxy name="virtualizer" uuid="d3467faa-acc7-4d34-acaf-0002a5d5c51b">
- <libsw library="virtualizersw" uuid="fa819d86-588b-11ed-9b6a-0242ac120002"/>
- <libsw library="bundle" uuid="1d4033c0-8557-11df-9f2d-0002a5d5c51b"/>
- </effectProxy>
+ <effect name="virtualizer" library="bundle" uuid="1d4033c0-8557-11df-9f2d-0002a5d5c51b"/>
<effect name="visualizer" library="visualizer" uuid="d069d9e0-8329-11df-9168-0002a5d5c51b"/>
<effect name="volume" library="bundle" uuid="119341a0-8469-11df-81f9-0002a5d5c51b"/>
- <effectProxy name="equalizer" uuid="c8e70ecd-48ca-456e-8a4f-0002a5d5c51b">
- <libsw library="equalizersw" uuid="0bed4300-847d-11df-bb17-0002a5d5c51b"/>
- <libsw library="bundle" uuid="ce772f20-847d-11df-bb17-0002a5d5c51b"/>
- </effectProxy>
+ <effect name="equalizer" library="bundle" uuid="ce772f20-847d-11df-bb17-0002a5d5c51b"/>
<effect name="extension_effect" library="extensioneffect" uuid="fa81dd00-588b-11ed-9b6a-0242ac120002" type="fa81de0e-588b-11ed-9b6a-0242ac120002"/>
<effect name="acoustic_echo_canceler" library="pre_processing" uuid="bb392ec0-8d4d-11e0-a896-0002a5d5c51b"/>
<effect name="noise_suppression" library="pre_processing" uuid="c06c8400-8e06-11e0-9cb6-0002a5d5c51b"/>
diff --git a/audio/aidl/default/bluetooth/ModuleBluetooth.cpp b/audio/aidl/default/bluetooth/ModuleBluetooth.cpp
index ac375a0..8c381cd 100644
--- a/audio/aidl/default/bluetooth/ModuleBluetooth.cpp
+++ b/audio/aidl/default/bluetooth/ModuleBluetooth.cpp
@@ -224,31 +224,19 @@
const auto& devicePort = audioPort->ext.get<AudioPortExt::device>();
const auto& description = devicePort.device.type;
// This method must return an error when the device can not be connected.
- if (description.connection == AudioDeviceDescription::CONNECTION_BT_A2DP) {
- bool isA2dpEnabled = false;
- if (!!mBluetoothA2dp) {
- RETURN_STATUS_IF_ERROR((*mBluetoothA2dp).isEnabled(&isA2dpEnabled));
- }
- LOG(DEBUG) << __func__ << ": isA2dpEnabled: " << isA2dpEnabled;
- if (!isA2dpEnabled) return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
- } else if (description.connection == AudioDeviceDescription::CONNECTION_BT_LE) {
- bool isLeEnabled = false;
- if (!!mBluetoothLe) {
- RETURN_STATUS_IF_ERROR((*mBluetoothLe).isEnabled(&isLeEnabled));
- }
- LOG(DEBUG) << __func__ << ": isLeEnabled: " << isLeEnabled;
- if (!isLeEnabled) return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
- } else if (description.connection == AudioDeviceDescription::CONNECTION_WIRELESS &&
- description.type == AudioDeviceType::OUT_HEARING_AID) {
- // Hearing aids can use a number of profiles, no single switch exists.
- } else {
+ // Since A2DP/LE status events are sent asynchronously, it is more reliable
+ // to attempt connecting to the BT stack rather than judge by the A2DP/LE status.
+ if (description.connection != AudioDeviceDescription::CONNECTION_BT_A2DP &&
+ description.connection != AudioDeviceDescription::CONNECTION_BT_LE &&
+ !(description.connection == AudioDeviceDescription::CONNECTION_WIRELESS &&
+ description.type == AudioDeviceType::OUT_HEARING_AID)) {
LOG(ERROR) << __func__ << ": unsupported device type: " << audioPort->toString();
return ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
CachedProxy proxy;
RETURN_STATUS_IF_ERROR(createProxy(*audioPort, nextPortId, proxy));
- // Since the device is already connected and configured by the BT stack, provide
- // the current configuration instead of all possible profiles.
+ // If the device is actually connected, it is configured by the BT stack.
+ // Provide the current configuration instead of all possible profiles.
const auto& pcmConfig = proxy.pcmConfig;
audioPort->profiles.clear();
audioPort->profiles.push_back(
diff --git a/audio/aidl/default/bluetooth/StreamBluetooth.cpp b/audio/aidl/default/bluetooth/StreamBluetooth.cpp
index 77e48df..efab470 100644
--- a/audio/aidl/default/bluetooth/StreamBluetooth.cpp
+++ b/audio/aidl/default/bluetooth/StreamBluetooth.cpp
@@ -16,16 +16,13 @@
#include <algorithm>
-#define ATRACE_TAG ATRACE_TAG_AUDIO
#define LOG_TAG "AHAL_StreamBluetooth"
#include <Utils.h>
#include <android-base/logging.h>
#include <audio_utils/clock.h>
-#include <utils/Trace.h>
#include "core-impl/StreamBluetooth.h"
-using aidl::android::hardware::audio::common::frameCountFromDurationUs;
using aidl::android::hardware::audio::common::SinkMetadata;
using aidl::android::hardware::audio::common::SourceMetadata;
using aidl::android::hardware::audio::core::VendorParameter;
@@ -67,8 +64,6 @@
: (mIsInput ? kBluetoothDefaultInputBufferMs
: kBluetoothDefaultOutputBufferMs) *
1000),
- mPreferredFrameCount(
- frameCountFromDurationUs(mPreferredDataIntervalUs, pcmConfig.sampleRateHz)),
mBtDeviceProxy(btDeviceProxy) {}
::android::status_t StreamBluetooth::init() {
@@ -77,6 +72,7 @@
// This is a normal situation in VTS tests.
LOG(INFO) << __func__ << ": no BT HAL proxy, stream is non-functional";
}
+ LOG(INFO) << __func__ << ": preferred data interval (us): " << mPreferredDataIntervalUs;
return ::android::OK;
}
@@ -97,23 +93,22 @@
::android::status_t StreamBluetooth::transfer(void* buffer, size_t frameCount,
size_t* actualFrameCount, int32_t* latencyMs) {
std::lock_guard guard(mLock);
+ *actualFrameCount = 0;
+ *latencyMs = StreamDescriptor::LATENCY_UNKNOWN;
if (mBtDeviceProxy == nullptr || mBtDeviceProxy->getState() == BluetoothStreamState::DISABLED) {
- *actualFrameCount = 0;
- *latencyMs = StreamDescriptor::LATENCY_UNKNOWN;
+ // The BT session is turned down, silently ignore write.
return ::android::OK;
}
- *actualFrameCount = 0;
- *latencyMs = 0;
if (!mBtDeviceProxy->start()) {
- LOG(ERROR) << __func__ << ": state= " << mBtDeviceProxy->getState() << " failed to start";
- return -EIO;
+ LOG(WARNING) << __func__ << ": state= " << mBtDeviceProxy->getState()
+ << " failed to start, will retry";
+ return ::android::OK;
}
- const size_t fc = std::min(frameCount, mPreferredFrameCount);
- const size_t bytesToTransfer = fc * mFrameSizeBytes;
+ *latencyMs = 0;
+ const size_t bytesToTransfer = frameCount * mFrameSizeBytes;
const size_t bytesTransferred = mIsInput ? mBtDeviceProxy->readData(buffer, bytesToTransfer)
: mBtDeviceProxy->writeData(buffer, bytesToTransfer);
*actualFrameCount = bytesTransferred / mFrameSizeBytes;
- ATRACE_INT("BTdropped", bytesToTransfer - bytesTransferred);
PresentationPosition presentation_position;
if (!mBtDeviceProxy->getPresentationPosition(presentation_position)) {
presentation_position.remoteDeviceAudioDelayNanos =
diff --git a/audio/aidl/default/include/core-impl/ChildInterface.h b/audio/aidl/default/include/core-impl/ChildInterface.h
index f5f1855..161f6db 100644
--- a/audio/aidl/default/include/core-impl/ChildInterface.h
+++ b/audio/aidl/default/include/core-impl/ChildInterface.h
@@ -48,9 +48,9 @@
}
AIBinder* getBinder() {
if (this->second.get() == nullptr) {
- this->second = this->first->asBinder();
- AIBinder_setMinSchedulerPolicy(this->second.get(), SCHED_NORMAL,
- ANDROID_PRIORITY_AUDIO);
+ const auto binder = this->second = this->first->asBinder();
+ AIBinder_setMinSchedulerPolicy(binder.get(), SCHED_NORMAL, ANDROID_PRIORITY_AUDIO);
+ AIBinder_setInheritRt(binder.get(), true);
}
return this->second.get();
}
diff --git a/audio/aidl/default/include/core-impl/Module.h b/audio/aidl/default/include/core-impl/Module.h
index ce71d70..a326217 100644
--- a/audio/aidl/default/include/core-impl/Module.h
+++ b/audio/aidl/default/include/core-impl/Module.h
@@ -211,9 +211,12 @@
const int32_t rawSizeFrames =
aidl::android::hardware::audio::common::frameCountFromDurationMs(latencyMs,
sampleRateHz);
- if (latencyMs >= 5) return rawSizeFrames;
+ // Round up to nearest 16 frames since in the framework this is the size of a mixer burst.
+ const int32_t multipleOf16 = (rawSizeFrames + 15) & ~15;
+ if (sampleRateHz < 44100 || multipleOf16 <= 512) return multipleOf16;
+ // Larger buffers should use powers of 2.
int32_t powerOf2 = 1;
- while (powerOf2 < rawSizeFrames) powerOf2 <<= 1;
+ while (powerOf2 < multipleOf16) powerOf2 <<= 1;
return powerOf2;
}
diff --git a/audio/aidl/default/include/core-impl/SoundDose.h b/audio/aidl/default/include/core-impl/SoundDose.h
index c0edc9f..82c1077 100644
--- a/audio/aidl/default/include/core-impl/SoundDose.h
+++ b/audio/aidl/default/include/core-impl/SoundDose.h
@@ -21,6 +21,8 @@
#include <aidl/android/hardware/audio/core/sounddose/BnSoundDose.h>
#include <aidl/android/media/audio/common/AudioDevice.h>
#include <aidl/android/media/audio/common/AudioFormatDescription.h>
+#include <audio_utils/MelProcessor.h>
+#include <audio_utils/mutex.h>
namespace aidl::android::hardware::audio::core::sounddose {
@@ -37,18 +39,49 @@
virtual void process(const void* buffer, size_t size) = 0;
};
-class SoundDose : public BnSoundDose {
+class SoundDose final : public BnSoundDose, public StreamDataProcessorInterface {
public:
- SoundDose() : mRs2Value(DEFAULT_MAX_RS2){};
+ SoundDose() : mMelCallback(::android::sp<MelCallback>::make(this)){};
+ // -------------------------------------- BnSoundDose ------------------------------------------
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;
+ // ----------------------------- StreamDataProcessorInterface ----------------------------------
+ void setAudioDevice(
+ const ::aidl::android::media::audio::common::AudioDevice& audioDevice) override;
+ void startDataProcessor(
+ uint32_t samplerate, uint32_t channelCount,
+ const ::aidl::android::media::audio::common::AudioFormatDescription& format) override;
+ void process(const void* buffer, size_t size) override;
+
private:
- std::shared_ptr<ISoundDose::IHalSoundDoseCallback> mCallback;
- float mRs2Value;
+ class MelCallback : public ::android::audio_utils::MelProcessor::MelCallback {
+ public:
+ explicit MelCallback(SoundDose* soundDose) : mSoundDose(*soundDose) {}
+
+ // ------------------------------------ MelCallback ----------------------------------------
+ void onNewMelValues(const std::vector<float>& mels, size_t offset, size_t length,
+ audio_port_handle_t deviceId) const override;
+ void onMomentaryExposure(float currentMel, audio_port_handle_t deviceId) const override;
+
+ SoundDose& mSoundDose; // must outlive MelCallback, not owning
+ };
+
+ void onNewMelValues(const std::vector<float>& mels, size_t offset, size_t length,
+ audio_port_handle_t deviceId) const;
+ void onMomentaryExposure(float currentMel, audio_port_handle_t deviceId) const;
+
+ mutable ::android::audio_utils::mutex mCbMutex;
+ std::shared_ptr<ISoundDose::IHalSoundDoseCallback> mCallback GUARDED_BY(mCbMutex);
+ std::optional<::aidl::android::media::audio::common::AudioDevice> mAudioDevice
+ GUARDED_BY(mCbMutex);
+ mutable ::android::audio_utils::mutex mMutex;
+ float mRs2Value GUARDED_BY(mMutex) = DEFAULT_MAX_RS2;
+ ::android::sp<::android::audio_utils::MelProcessor> mMelProcessor GUARDED_BY(mMutex);
+ ::android::sp<MelCallback> mMelCallback GUARDED_BY(mMutex);
};
} // namespace aidl::android::hardware::audio::core::sounddose
diff --git a/audio/aidl/default/include/core-impl/StreamBluetooth.h b/audio/aidl/default/include/core-impl/StreamBluetooth.h
index 35c3183..7f4239c 100644
--- a/audio/aidl/default/include/core-impl/StreamBluetooth.h
+++ b/audio/aidl/default/include/core-impl/StreamBluetooth.h
@@ -63,7 +63,6 @@
const std::weak_ptr<IBluetoothA2dp> mBluetoothA2dp;
const std::weak_ptr<IBluetoothLe> mBluetoothLe;
const size_t mPreferredDataIntervalUs;
- const size_t mPreferredFrameCount;
mutable std::mutex mLock;
// The lock is also used to serialize calls to the proxy.
std::shared_ptr<::android::bluetooth::audio::aidl::BluetoothAudioPortAidl> mBtDeviceProxy
diff --git a/audio/aidl/default/include/core-impl/StreamRemoteSubmix.h b/audio/aidl/default/include/core-impl/StreamRemoteSubmix.h
index b2cdc28..0d50c96 100644
--- a/audio/aidl/default/include/core-impl/StreamRemoteSubmix.h
+++ b/audio/aidl/default/include/core-impl/StreamRemoteSubmix.h
@@ -55,8 +55,8 @@
r_submix::AudioConfig mStreamConfig;
std::shared_ptr<r_submix::SubmixRoute> mCurrentRoute = nullptr;
- // limit for number of read error log entries to avoid spamming the logs
- static constexpr int kMaxReadErrorLogs = 5;
+ // Limit for the number of error log entries to avoid spamming the logs.
+ static constexpr int kMaxErrorLogs = 5;
// The duration of kMaxReadFailureAttempts * READ_ATTEMPT_SLEEP_MS must be strictly inferior
// to the duration of a record buffer at the current record sample rate (of the device, not of
// the recording itself). Here we have: 3 * 5ms = 15ms < 1024 frames * 1000 / 48000 = 21.333ms
@@ -68,6 +68,7 @@
long mFramesSinceStart = 0;
int mReadErrorCount = 0;
int mReadFailureCount = 0;
+ int mWriteShutdownCount = 0;
};
class StreamInRemoteSubmix final : public StreamIn, public StreamSwitcher {
diff --git a/audio/aidl/default/include/effect-impl/EffectContext.h b/audio/aidl/default/include/effect-impl/EffectContext.h
index b3d730d..275378e 100644
--- a/audio/aidl/default/include/effect-impl/EffectContext.h
+++ b/audio/aidl/default/include/effect-impl/EffectContext.h
@@ -44,6 +44,7 @@
}
}
+ void setVersion(int version) { mVersion = version; }
std::shared_ptr<StatusMQ> getStatusFmq() const;
std::shared_ptr<DataMQ> getInputDataFmq() const;
std::shared_ptr<DataMQ> getOutputDataFmq() const;
@@ -82,10 +83,11 @@
virtual ::android::hardware::EventFlag* getStatusEventFlag();
protected:
- size_t mInputFrameSize;
- size_t mOutputFrameSize;
- size_t mInputChannelCount;
- size_t mOutputChannelCount;
+ int mVersion = 0;
+ size_t mInputFrameSize = 0;
+ size_t mOutputFrameSize = 0;
+ size_t mInputChannelCount = 0;
+ size_t mOutputChannelCount = 0;
Parameter::Common mCommon = {};
std::vector<aidl::android::media::audio::common::AudioDeviceDescription> mOutputDevice = {};
aidl::android::media::audio::common::AudioMode mMode =
@@ -98,13 +100,13 @@
private:
// fmq and buffers
- std::shared_ptr<StatusMQ> mStatusMQ;
- std::shared_ptr<DataMQ> mInputMQ;
- std::shared_ptr<DataMQ> mOutputMQ;
+ std::shared_ptr<StatusMQ> mStatusMQ = nullptr;
+ std::shared_ptr<DataMQ> mInputMQ = nullptr;
+ std::shared_ptr<DataMQ> mOutputMQ = nullptr;
// std::shared_ptr<IEffect::OpenEffectReturn> mRet;
// work buffer set by effect instances, the access and update are in same thread
- std::vector<float> mWorkBuffer;
+ std::vector<float> mWorkBuffer = {};
- ::android::hardware::EventFlag* mEfGroup;
+ ::android::hardware::EventFlag* mEfGroup = nullptr;
};
} // 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 3dbb0e6..ec2a658 100644
--- a/audio/aidl/default/include/effect-impl/EffectThread.h
+++ b/audio/aidl/default/include/effect-impl/EffectThread.h
@@ -31,11 +31,9 @@
class EffectThread {
public:
- // default priority is same as HIDL: ANDROID_PRIORITY_URGENT_AUDIO
- EffectThread();
virtual ~EffectThread();
- // called by effect implementation.
+ // called by effect implementation
RetCode createThread(const std::string& name, int priority = ANDROID_PRIORITY_URGENT_AUDIO);
RetCode destroyThread();
RetCode startThread();
diff --git a/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp b/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp
index fa4135d..ca3f91a 100644
--- a/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp
+++ b/audio/aidl/default/r_submix/StreamRemoteSubmix.cpp
@@ -134,12 +134,19 @@
*latencyMs = getDelayInUsForFrameCount(getStreamPipeSizeInFrames()) / 1000;
LOG(VERBOSE) << __func__ << ": Latency " << *latencyMs << "ms";
mCurrentRoute->exitStandby(mIsInput);
- RETURN_STATUS_IF_ERROR(mIsInput ? inRead(buffer, frameCount, actualFrameCount)
- : outWrite(buffer, frameCount, actualFrameCount));
+ ::android::status_t status = mIsInput ? inRead(buffer, frameCount, actualFrameCount)
+ : outWrite(buffer, frameCount, actualFrameCount);
+ if ((status != ::android::OK && mIsInput) ||
+ ((status != ::android::OK && status != ::android::DEAD_OBJECT) && !mIsInput)) {
+ return status;
+ }
+ mFramesSinceStart += *actualFrameCount;
+ if (!mIsInput && status != ::android::DEAD_OBJECT) return ::android::OK;
+ // Input streams always need to block, output streams need to block when there is no sink.
+ // When the sink exists, more sophisticated blocking algorithm is implemented by MonoPipe.
const long bufferDurationUs =
(*actualFrameCount) * MICROS_PER_SECOND / mContext.getSampleRate();
const auto totalDurationUs = (::android::uptimeNanos() - mStartTimeNs) / NANOS_PER_MICROSECOND;
- mFramesSinceStart += *actualFrameCount;
const long totalOffsetUs =
mFramesSinceStart * MICROS_PER_SECOND / mContext.getSampleRate() - totalDurationUs;
LOG(VERBOSE) << __func__ << ": totalOffsetUs " << totalOffsetUs;
@@ -186,14 +193,17 @@
if (sink != nullptr) {
if (sink->isShutdown()) {
sink.clear();
- LOG(DEBUG) << __func__ << ": pipe shutdown, ignoring the write";
+ if (++mWriteShutdownCount < kMaxErrorLogs) {
+ LOG(DEBUG) << __func__ << ": pipe shutdown, ignoring the write. (limited logging)";
+ }
*actualFrameCount = frameCount;
- return ::android::OK;
+ return ::android::DEAD_OBJECT; // Induce wait in `transfer`.
}
} else {
LOG(FATAL) << __func__ << ": without a pipe!";
return ::android::UNKNOWN_ERROR;
}
+ mWriteShutdownCount = 0;
LOG(VERBOSE) << __func__ << ": " << mDeviceAddress.toString() << ", " << frameCount
<< " frames";
@@ -260,7 +270,7 @@
// about to read from audio source
sp<MonoPipeReader> source = mCurrentRoute->getSource();
if (source == nullptr) {
- if (++mReadErrorCount < kMaxReadErrorLogs) {
+ if (++mReadErrorCount < kMaxErrorLogs) {
LOG(ERROR) << __func__
<< ": no audio pipe yet we're trying to read! (not all errors will be "
"logged)";
@@ -275,8 +285,9 @@
char* buff = (char*)buffer;
size_t actuallyRead = 0;
long remainingFrames = frameCount;
- const int64_t deadlineTimeNs = ::android::uptimeNanos() +
- getDelayInUsForFrameCount(frameCount) * NANOS_PER_MICROSECOND;
+ const int64_t deadlineTimeNs =
+ ::android::uptimeNanos() +
+ getDelayInUsForFrameCount(frameCount) * NANOS_PER_MICROSECOND / 2;
while (remainingFrames > 0) {
ssize_t framesRead = source->read(buff, remainingFrames);
LOG(VERBOSE) << __func__ << ": frames read " << framesRead;
diff --git a/audio/aidl/default/spatializer/Android.bp b/audio/aidl/default/spatializer/Android.bp
index 400629e..2c229fe 100644
--- a/audio/aidl/default/spatializer/Android.bp
+++ b/audio/aidl/default/spatializer/Android.bp
@@ -35,6 +35,6 @@
],
relative_install_path: "soundfx",
visibility: [
- "//hardware/interfaces/audio/aidl/default",
+ "//hardware/interfaces/audio/aidl/default:__subpackages__",
],
}
diff --git a/audio/aidl/default/spatializer/SpatializerSw.cpp b/audio/aidl/default/spatializer/SpatializerSw.cpp
index 6d3c4bd..ab4a53e 100644
--- a/audio/aidl/default/spatializer/SpatializerSw.cpp
+++ b/audio/aidl/default/spatializer/SpatializerSw.cpp
@@ -65,8 +65,6 @@
const std::string SpatializerSw::kEffectName = "SpatializerSw";
const std::vector<Range::SpatializerRange> SpatializerSw::kRanges = {
- MAKE_RANGE(Spatializer, supportedChannelLayout, std::vector<AudioChannelLayout>{},
- std::vector<AudioChannelLayout>{}),
MAKE_RANGE(Spatializer, spatializationLevel, Spatialization::Level::NONE,
Spatialization::Level::BED_PLUS_OBJECTS),
MAKE_RANGE(Spatializer, spatializationMode, Spatialization::Mode::BINAURAL,
@@ -108,6 +106,8 @@
ndk::ScopedAStatus SpatializerSw::getParameterSpecific(const Parameter::Id& id,
Parameter::Specific* specific) {
+ RETURN_IF(!mContext, EX_NULL_POINTER, "nullContext");
+
auto tag = id.getTag();
RETURN_IF(Parameter::Id::spatializerTag != tag, EX_ILLEGAL_ARGUMENT, "wrongIdTag");
auto spatializerId = id.get<Parameter::Id::spatializerTag>();
@@ -173,11 +173,19 @@
if (mParamsMap.find(tag) != mParamsMap.end()) {
return mParamsMap.at(tag);
}
+ if (tag == Spatializer::supportedChannelLayout) {
+ return Spatializer::make<Spatializer::supportedChannelLayout>(
+ {AudioChannelLayout::make<AudioChannelLayout::layoutMask>(
+ AudioChannelLayout::LAYOUT_5POINT1)});
+ }
return std::nullopt;
}
template <typename TAG>
ndk::ScopedAStatus SpatializerSwContext::setParam(TAG tag, Spatializer spatializer) {
+ RETURN_IF(tag == Spatializer::supportedChannelLayout, EX_ILLEGAL_ARGUMENT,
+ "supportedChannelLayoutGetOnly");
+
mParamsMap[tag] = spatializer;
return ndk::ScopedAStatus::ok();
}
diff --git a/audio/aidl/default/visualizer/VisualizerSw.h b/audio/aidl/default/visualizer/VisualizerSw.h
index 4b87b04..819351a 100644
--- a/audio/aidl/default/visualizer/VisualizerSw.h
+++ b/audio/aidl/default/visualizer/VisualizerSw.h
@@ -19,20 +19,22 @@
#include <vector>
#include <aidl/android/hardware/audio/effect/BnEffect.h>
+#include <system/audio_effects/effect_visualizer.h>
#include "effect-impl/EffectImpl.h"
namespace aidl::android::hardware::audio::effect {
class VisualizerSwContext final : public EffectContext {
public:
- static const int kMinCaptureSize = 0x80;
- static const int kMaxCaptureSize = 0x400;
- static const int kMaxLatencyMs = 3000;
- static const int kMaxCaptureBufSize = 0xffff;
+ // need align the min/max capture size to VISUALIZER_CAPTURE_SIZE_MIN and
+ // VISUALIZER_CAPTURE_SIZE_MAX because of limitation in audio_utils fixedfft.
+ static constexpr int32_t kMinCaptureSize = VISUALIZER_CAPTURE_SIZE_MIN;
+ static constexpr int32_t kMaxCaptureSize = VISUALIZER_CAPTURE_SIZE_MAX;
+ static constexpr int32_t kMaxLatencyMs = 3000;
VisualizerSwContext(int statusDepth, const Parameter::Common& common)
: EffectContext(statusDepth, common) {
LOG(DEBUG) << __func__;
- mCaptureSampleBuffer.resize(kMaxCaptureBufSize);
+ mCaptureSampleBuffer.resize(kMaxCaptureSize);
fill(mCaptureSampleBuffer.begin(), mCaptureSampleBuffer.end(), 0x80);
}
diff --git a/audio/aidl/sounddose/Android.bp b/audio/aidl/sounddose/Android.bp
index c65e4ff..de3ed64 100644
--- a/audio/aidl/sounddose/Android.bp
+++ b/audio/aidl/sounddose/Android.bp
@@ -48,11 +48,15 @@
version: "1",
imports: ["android.hardware.audio.core.sounddose-V1"],
},
+ {
+ version: "2",
+ imports: ["android.hardware.audio.core.sounddose-V2"],
+ },
// IMPORTANT: Update latest_android_hardware_audio_sounddose every time you
// add the latest frozen version to versions_with_info
],
- frozen: false,
+ frozen: true,
}
// Note: This should always be one version ahead of the last frozen version
diff --git a/audio/aidl/sounddose/aidl_api/android.hardware.audio.sounddose/2/.hash b/audio/aidl/sounddose/aidl_api/android.hardware.audio.sounddose/2/.hash
new file mode 100644
index 0000000..1aaad0e
--- /dev/null
+++ b/audio/aidl/sounddose/aidl_api/android.hardware.audio.sounddose/2/.hash
@@ -0,0 +1 @@
+f4469ffc7efc70957cbc2c7175c55adda2272f70
diff --git a/audio/aidl/sounddose/aidl_api/android.hardware.audio.sounddose/2/android/hardware/audio/sounddose/ISoundDoseFactory.aidl b/audio/aidl/sounddose/aidl_api/android.hardware.audio.sounddose/2/android/hardware/audio/sounddose/ISoundDoseFactory.aidl
new file mode 100644
index 0000000..148720c
--- /dev/null
+++ b/audio/aidl/sounddose/aidl_api/android.hardware.audio.sounddose/2/android/hardware/audio/sounddose/ISoundDoseFactory.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.sounddose;
+@VintfStability
+interface ISoundDoseFactory {
+ @nullable android.hardware.audio.core.sounddose.ISoundDose getSoundDose(in @utf8InCpp String module);
+}
diff --git a/audio/aidl/vts/Android.bp b/audio/aidl/vts/Android.bp
index 5218fdd..b236831 100644
--- a/audio/aidl/vts/Android.bp
+++ b/audio/aidl/vts/Android.bp
@@ -26,6 +26,7 @@
"android.hardware.common.fmq-V1-ndk",
"libaudioaidlcommon",
"libaidlcommonsupport",
+ "libpffft",
],
header_libs: [
"libaudioaidl_headers",
@@ -36,6 +37,7 @@
"-Wextra",
"-Werror",
"-Wthread-safety",
+ "-Wno-error=unused-parameter",
],
test_config_template: "VtsHalAudioTargetTestTemplate.xml",
test_suites: [
@@ -143,12 +145,18 @@
name: "VtsHalPresetReverbTargetTest",
defaults: ["VtsHalAudioEffectTargetTestDefaults"],
srcs: ["VtsHalPresetReverbTargetTest.cpp"],
+ shared_libs: [
+ "libaudioutils",
+ ],
}
cc_test {
name: "VtsHalVirtualizerTargetTest",
defaults: ["VtsHalAudioEffectTargetTestDefaults"],
srcs: ["VtsHalVirtualizerTargetTest.cpp"],
+ shared_libs: [
+ "libaudioutils",
+ ],
}
cc_test {
diff --git a/audio/aidl/vts/EffectFactoryHelper.h b/audio/aidl/vts/EffectFactoryHelper.h
index 7100431..54b82d3 100644
--- a/audio/aidl/vts/EffectFactoryHelper.h
+++ b/audio/aidl/vts/EffectFactoryHelper.h
@@ -23,6 +23,7 @@
#include <aidl/Vintf.h>
#include <android/binder_auto_utils.h>
+#include <system/audio_effects/aidl_effects_utils.h>
#include "AudioHalBinderServiceUtil.h"
#include "TestUtils.h"
@@ -35,21 +36,6 @@
class EffectFactoryHelper {
public:
- explicit EffectFactoryHelper(const std::string& name) : mServiceName(name) {}
-
- void ConnectToFactoryService() {
- mEffectFactory = IFactory::fromBinder(binderUtil.connectToService(mServiceName));
- ASSERT_NE(mEffectFactory, nullptr);
- }
-
- void RestartFactoryService() {
- ASSERT_NE(mEffectFactory, nullptr);
- mEffectFactory = IFactory::fromBinder(binderUtil.restartService());
- ASSERT_NE(mEffectFactory, nullptr);
- }
-
- std::shared_ptr<IFactory> GetFactory() const { return mEffectFactory; }
-
static std::vector<std::pair<std::shared_ptr<IFactory>, Descriptor>> getAllEffectDescriptors(
std::string serviceName, std::optional<AudioUuid> type = std::nullopt) {
AudioHalBinderServiceUtil util;
@@ -74,8 +60,13 @@
return result;
}
- private:
- std::shared_ptr<IFactory> mEffectFactory;
- std::string mServiceName;
- AudioHalBinderServiceUtil binderUtil;
+ static int getHalVersion(const std::shared_ptr<IFactory>& factory) {
+ int version = 0;
+ return (factory && factory->getInterfaceVersion(&version).isOk()) ? version : 0;
+ }
+
+ static bool isReopenSupported(const std::shared_ptr<IFactory>& factory) {
+ return EffectFactoryHelper::getHalVersion(factory) >=
+ aidl::android::hardware::audio::effect::kReopenSupportedVersion;
+ }
};
diff --git a/audio/aidl/vts/EffectHelper.h b/audio/aidl/vts/EffectHelper.h
index 0be4e50..0d1e0dc 100644
--- a/audio/aidl/vts/EffectHelper.h
+++ b/audio/aidl/vts/EffectHelper.h
@@ -37,6 +37,7 @@
#include "EffectFactoryHelper.h"
#include "TestUtils.h"
+#include "pffft.hpp"
using namespace android;
using aidl::android::hardware::audio::effect::CommandId;
@@ -69,6 +70,8 @@
static inline std::string getPrefix(Descriptor& descriptor) {
std::string prefix = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" + toString(descriptor.common.id.uuid);
+ std::replace_if(
+ prefix.begin(), prefix.end(), [](const char c) { return !std::isalnum(c); }, '_');
return prefix;
}
@@ -329,4 +332,45 @@
ASSERT_NO_FATAL_FAILURE(command(mEffect, CommandId::RESET));
ASSERT_NO_FATAL_FAILURE(expectState(mEffect, State::IDLE));
}
+
+ // Find FFT bin indices for testFrequencies and get bin center frequencies
+ void roundToFreqCenteredToFftBin(std::vector<int>& testFrequencies,
+ std::vector<int>& binOffsets, const float kBinWidth) {
+ for (size_t i = 0; i < testFrequencies.size(); i++) {
+ binOffsets[i] = std::round(testFrequencies[i] / kBinWidth);
+ testFrequencies[i] = std::round(binOffsets[i] * kBinWidth);
+ }
+ }
+
+ // Generate multitone input between -1 to +1 using testFrequencies
+ void generateMultiTone(const std::vector<int>& testFrequencies, std::vector<float>& input,
+ const int samplingFrequency) {
+ for (size_t i = 0; i < input.size(); i++) {
+ input[i] = 0;
+
+ for (size_t j = 0; j < testFrequencies.size(); j++) {
+ input[i] += sin(2 * M_PI * testFrequencies[j] * i / samplingFrequency);
+ }
+ input[i] /= testFrequencies.size();
+ }
+ }
+
+ // Use FFT transform to convert the buffer to frequency domain
+ // Compute its magnitude at binOffsets
+ std::vector<float> calculateMagnitude(const std::vector<float>& buffer,
+ const std::vector<int>& binOffsets, const int nPointFFT) {
+ std::vector<float> fftInput(nPointFFT);
+ PFFFT_Setup* inputHandle = pffft_new_setup(nPointFFT, PFFFT_REAL);
+ pffft_transform_ordered(inputHandle, buffer.data(), fftInput.data(), nullptr,
+ PFFFT_FORWARD);
+ pffft_destroy_setup(inputHandle);
+ std::vector<float> bufferMag(binOffsets.size());
+ for (size_t i = 0; i < binOffsets.size(); i++) {
+ size_t k = binOffsets[i];
+ bufferMag[i] = sqrt((fftInput[k * 2] * fftInput[k * 2]) +
+ (fftInput[k * 2 + 1] * fftInput[k * 2 + 1]));
+ }
+
+ return bufferMag;
+ }
};
diff --git a/audio/aidl/vts/ModuleConfig.cpp b/audio/aidl/vts/ModuleConfig.cpp
index 2b86271..d24c4c8 100644
--- a/audio/aidl/vts/ModuleConfig.cpp
+++ b/audio/aidl/vts/ModuleConfig.cpp
@@ -551,6 +551,11 @@
return result;
}
+std::optional<AudioPort> ModuleConfig::getPort(int32_t portId) {
+ auto portsIt = findById(mPorts, portId);
+ return portsIt != mPorts.end() ? std::optional<AudioPort>(*portsIt) : std::nullopt;
+}
+
ndk::ScopedAStatus ModuleConfig::onExternalDeviceConnected(IModule* module, const AudioPort& port) {
RETURN_STATUS_IF_ERROR(module->getAudioPorts(&mPorts));
RETURN_STATUS_IF_ERROR(module->getAudioRoutes(&mRoutes));
diff --git a/audio/aidl/vts/ModuleConfig.h b/audio/aidl/vts/ModuleConfig.h
index 4a87f8c..27286e5 100644
--- a/audio/aidl/vts/ModuleConfig.h
+++ b/audio/aidl/vts/ModuleConfig.h
@@ -166,6 +166,8 @@
return *config.begin();
}
+ std::optional<aidl::android::media::audio::common::AudioPort> getPort(int32_t portId);
+
ndk::ScopedAStatus onExternalDeviceConnected(
aidl::android::hardware::audio::core::IModule* module,
const aidl::android::media::audio::common::AudioPort& port);
diff --git a/audio/aidl/vts/TestUtils.h b/audio/aidl/vts/TestUtils.h
index 515b8a2..0a5addc 100644
--- a/audio/aidl/vts/TestUtils.h
+++ b/audio/aidl/vts/TestUtils.h
@@ -104,11 +104,13 @@
EXPECT_PRED_FORMAT2(::android::hardware::audio::common::testing::detail::assertResult, \
expected, ret)
-#define SKIP_TEST_IF_DATA_UNSUPPORTED(flags) \
- ({ \
- if ((flags).hwAcceleratorMode == Flags::HardwareAccelerator::TUNNEL || (flags).bypass) { \
- GTEST_SKIP() << "Skip data path for offload"; \
- } \
+#define SKIP_TEST_IF_DATA_UNSUPPORTED(flags) \
+ ({ \
+ if ((flags).hwAcceleratorMode == \
+ aidl::android::hardware::audio::effect::Flags::HardwareAccelerator::TUNNEL || \
+ (flags).bypass) { \
+ GTEST_SKIP() << "Skip data path for offload"; \
+ } \
})
// Test that the transaction status 'isOk' if it is a known transaction
diff --git a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
index 7373073..d576c7c 100644
--- a/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioCoreModuleTargetTest.cpp
@@ -56,6 +56,7 @@
using namespace android;
using aidl::android::hardware::audio::common::AudioOffloadMetadata;
using aidl::android::hardware::audio::common::getChannelCount;
+using aidl::android::hardware::audio::common::isAnyBitPositionFlagSet;
using aidl::android::hardware::audio::common::isBitPositionFlagSet;
using aidl::android::hardware::audio::common::isTelephonyDeviceType;
using aidl::android::hardware::audio::common::isValidAudioMode;
@@ -85,6 +86,7 @@
using aidl::android::media::audio::common::AudioDeviceType;
using aidl::android::media::audio::common::AudioDualMonoMode;
using aidl::android::media::audio::common::AudioFormatType;
+using aidl::android::media::audio::common::AudioInputFlags;
using aidl::android::media::audio::common::AudioIoFlags;
using aidl::android::media::audio::common::AudioLatencyMode;
using aidl::android::media::audio::common::AudioMMapPolicy;
@@ -131,13 +133,23 @@
}
template <typename C>
-std::vector<int32_t> GetNonExistentIds(const C& allIds) {
+std::vector<int32_t> GetNonExistentIds(const C& allIds, bool includeZero = true) {
if (allIds.empty()) {
- return std::vector<int32_t>{-1, 0, 1};
+ return includeZero ? std::vector<int32_t>{-1, 0, 1} : std::vector<int32_t>{-1, 1};
}
std::vector<int32_t> nonExistentIds;
- nonExistentIds.push_back(*std::min_element(allIds.begin(), allIds.end()) - 1);
- nonExistentIds.push_back(*std::max_element(allIds.begin(), allIds.end()) + 1);
+ if (auto value = *std::min_element(allIds.begin(), allIds.end()) - 1;
+ includeZero || value != 0) {
+ nonExistentIds.push_back(value);
+ } else {
+ nonExistentIds.push_back(value - 1);
+ }
+ if (auto value = *std::max_element(allIds.begin(), allIds.end()) + 1;
+ includeZero || value != 0) {
+ nonExistentIds.push_back(value);
+ } else {
+ nonExistentIds.push_back(value + 1);
+ }
return nonExistentIds;
}
@@ -779,6 +791,13 @@
};
return helper(v.begin(), helper);
}
+ Node makeNodes(StreamDescriptor::State s, TransitionTrigger t, size_t count, Node last) {
+ auto helper = [&](size_t c, auto&& h) -> Node {
+ if (c == 0) return last;
+ return makeNode(s, t, h(--c, h));
+ };
+ return helper(count, helper);
+ }
Node makeNodes(const std::vector<StateTransitionFrom>& v, StreamDescriptor::State f) {
return makeNodes(v, makeFinalNode(f));
}
@@ -1038,7 +1057,9 @@
<< ": received invalid byte count in the reply: " << reply.fmqByteCount;
return Status::ABORT;
}
- if (getDataMQ()->availableToWrite() != getDataMQ()->getQuantumCount()) {
+ // It is OK for the implementation to leave data in the MQ when the stream is paused.
+ if (reply.state != StreamDescriptor::State::PAUSED &&
+ getDataMQ()->availableToWrite() != getDataMQ()->getQuantumCount()) {
LOG(ERROR) << __func__ << ": the HAL module did not consume all data from the data MQ: "
<< "available to write " << getDataMQ()->availableToWrite()
<< ", total size: " << getDataMQ()->getQuantumCount();
@@ -1738,6 +1759,11 @@
}
TEST_P(AudioCoreModule, TryConnectMissingDevice) {
+ // Limit checks to connection types that are known to be detectable by HAL implementations.
+ static const std::set<std::string> kCheckedConnectionTypes{
+ AudioDeviceDescription::CONNECTION_HDMI, AudioDeviceDescription::CONNECTION_HDMI_ARC,
+ AudioDeviceDescription::CONNECTION_HDMI_EARC, AudioDeviceDescription::CONNECTION_IP_V4,
+ AudioDeviceDescription::CONNECTION_USB};
ASSERT_NO_FATAL_FAILURE(SetUpModuleConfig());
std::vector<AudioPort> ports = moduleConfig->getExternalDevicePorts();
if (ports.empty()) {
@@ -1746,11 +1772,12 @@
WithDebugFlags doNotSimulateConnections = WithDebugFlags::createNested(*debug);
doNotSimulateConnections.flags().simulateDeviceConnections = false;
ASSERT_NO_FATAL_FAILURE(doNotSimulateConnections.SetUp(module.get()));
+ bool hasAtLeastOneCheckedConnection = false;
for (const auto& port : ports) {
- // Virtual devices may not require external hardware and thus can always be connected.
- if (port.ext.get<AudioPortExt::device>().device.type.connection ==
- AudioDeviceDescription::CONNECTION_VIRTUAL)
+ if (kCheckedConnectionTypes.count(
+ port.ext.get<AudioPortExt::device>().device.type.connection) == 0) {
continue;
+ }
AudioPort portWithData = GenerateUniqueDeviceAddress(port), connectedPort;
ScopedAStatus status = module->connectExternalDevice(portWithData, &connectedPort);
EXPECT_STATUS(EX_ILLEGAL_STATE, status) << "static port " << portWithData.toString();
@@ -1761,6 +1788,10 @@
EXPECT_IS_OK(module->disconnectExternalDevice(connectedPort.id))
<< "when disconnecting device port ID " << connectedPort.id;
}
+ hasAtLeastOneCheckedConnection = true;
+ }
+ if (!hasAtLeastOneCheckedConnection) {
+ GTEST_SKIP() << "No external devices with connection types that can be checked.";
}
}
@@ -2871,6 +2902,182 @@
std::unique_ptr<WithStream<Stream>> mStream;
};
+class StreamLogicDefaultDriver : public StreamLogicDriver {
+ public:
+ StreamLogicDefaultDriver(std::shared_ptr<StateSequence> commands, size_t frameSizeBytes)
+ : mCommands(commands), mFrameSizeBytes(frameSizeBytes) {
+ mCommands->rewind();
+ }
+
+ // The three methods below is intended to be called after the worker
+ // thread has joined, thus no extra synchronization is needed.
+ bool hasObservablePositionIncrease() const { return mObservablePositionIncrease; }
+ bool hasRetrogradeObservablePosition() const { return mRetrogradeObservablePosition; }
+ std::string getUnexpectedStateTransition() const { return mUnexpectedTransition; }
+
+ bool done() override { return mCommands->done(); }
+ TransitionTrigger getNextTrigger(int maxDataSize, int* actualSize) override {
+ auto trigger = mCommands->getTrigger();
+ if (StreamDescriptor::Command* command = std::get_if<StreamDescriptor::Command>(&trigger);
+ command != nullptr) {
+ if (command->getTag() == StreamDescriptor::Command::Tag::burst) {
+ if (actualSize != nullptr) {
+ // In the output scenario, reduce slightly the fmqByteCount to verify
+ // that the HAL module always consumes all data from the MQ.
+ if (maxDataSize > static_cast<int>(mFrameSizeBytes)) {
+ LOG(DEBUG) << __func__ << ": reducing data size by " << mFrameSizeBytes;
+ maxDataSize -= mFrameSizeBytes;
+ }
+ *actualSize = maxDataSize;
+ }
+ command->set<StreamDescriptor::Command::Tag::burst>(maxDataSize);
+ } else {
+ if (actualSize != nullptr) *actualSize = 0;
+ }
+ }
+ return trigger;
+ }
+ bool interceptRawReply(const StreamDescriptor::Reply&) override { return false; }
+ bool processValidReply(const StreamDescriptor::Reply& reply) override {
+ if (reply.observable.frames != StreamDescriptor::Position::UNKNOWN) {
+ if (mPreviousFrames.has_value()) {
+ if (reply.observable.frames > mPreviousFrames.value()) {
+ mObservablePositionIncrease = true;
+ } else if (reply.observable.frames < mPreviousFrames.value()) {
+ mRetrogradeObservablePosition = true;
+ }
+ }
+ mPreviousFrames = reply.observable.frames;
+ }
+
+ auto expected = mCommands->getExpectedStates();
+ if (expected.count(reply.state) == 0) {
+ std::string s =
+ std::string("Unexpected transition from the state ")
+ .append(mPreviousState.has_value() ? toString(mPreviousState.value())
+ : "<initial state>")
+ .append(" to ")
+ .append(toString(reply.state))
+ .append(" (expected one of ")
+ .append(::android::internal::ToString(expected))
+ .append(") caused by the ")
+ .append(toString(mCommands->getTrigger()));
+ LOG(ERROR) << __func__ << ": " << s;
+ mUnexpectedTransition = std::move(s);
+ return false;
+ }
+ mCommands->advance(reply.state);
+ mPreviousState = reply.state;
+ return true;
+ }
+
+ protected:
+ std::shared_ptr<StateSequence> mCommands;
+ const size_t mFrameSizeBytes;
+ std::optional<StreamDescriptor::State> mPreviousState;
+ std::optional<int64_t> mPreviousFrames;
+ bool mObservablePositionIncrease = false;
+ bool mRetrogradeObservablePosition = false;
+ std::string mUnexpectedTransition;
+};
+
+// Defined later together with state transition sequences.
+std::shared_ptr<StateSequence> makeBurstCommands(bool isSync);
+
+// Certain types of ports can not be used without special preconditions.
+static bool skipStreamIoTestForMixPortConfig(const AudioPortConfig& portConfig) {
+ return (portConfig.flags.value().getTag() == AudioIoFlags::input &&
+ isAnyBitPositionFlagSet(portConfig.flags.value().template get<AudioIoFlags::input>(),
+ {AudioInputFlags::MMAP_NOIRQ, AudioInputFlags::VOIP_TX,
+ AudioInputFlags::HW_HOTWORD, AudioInputFlags::HOTWORD_TAP})) ||
+ (portConfig.flags.value().getTag() == AudioIoFlags::output &&
+ isAnyBitPositionFlagSet(
+ portConfig.flags.value().template get<AudioIoFlags::output>(),
+ {AudioOutputFlags::MMAP_NOIRQ, AudioOutputFlags::VOIP_RX,
+ AudioOutputFlags::COMPRESS_OFFLOAD, AudioOutputFlags::INCALL_MUSIC}));
+}
+
+// Certain types of devices can not be used without special preconditions.
+static bool skipStreamIoTestForDevice(const AudioDevice& device) {
+ return device.type.type == AudioDeviceType::IN_ECHO_REFERENCE;
+}
+
+template <typename Stream>
+class StreamFixtureWithWorker {
+ public:
+ explicit StreamFixtureWithWorker(bool isSync) : mIsSync(isSync) {}
+
+ void SetUp(IModule* module, ModuleConfig* moduleConfig, const AudioPort& devicePort) {
+ mStream = std::make_unique<StreamFixture<Stream>>();
+ ASSERT_NO_FATAL_FAILURE(
+ mStream->SetUpStreamForDevicePort(module, moduleConfig, devicePort));
+ MaybeSetSkipTestReason();
+ }
+
+ void SetUp(IModule* module, ModuleConfig* moduleConfig, const AudioPort& mixPort,
+ const AudioPort& devicePort) {
+ mStream = std::make_unique<StreamFixture<Stream>>();
+ ASSERT_NO_FATAL_FAILURE(
+ mStream->SetUpStreamForPortsPair(module, moduleConfig, mixPort, devicePort));
+ MaybeSetSkipTestReason();
+ }
+
+ void SendBurstCommands(bool validatePosition = true) {
+ ASSERT_NO_FATAL_FAILURE(StartWorkerToSendBurstCommands());
+ ASSERT_NO_FATAL_FAILURE(JoinWorkerAfterBurstCommands(validatePosition));
+ }
+
+ void StartWorkerToSendBurstCommands() {
+ const StreamContext* context = mStream->getStreamContext();
+ mWorkerDriver = std::make_unique<StreamLogicDefaultDriver>(makeBurstCommands(mIsSync),
+ context->getFrameSizeBytes());
+ mWorker = std::make_unique<typename IOTraits<Stream>::Worker>(
+ *context, mWorkerDriver.get(), mStream->getStreamEventReceiver());
+ LOG(DEBUG) << __func__ << ": starting " << IOTraits<Stream>::directionStr << " worker...";
+ ASSERT_TRUE(mWorker->start());
+ }
+
+ void JoinWorkerAfterBurstCommands(bool validatePosition = true) {
+ // Must call 'prepareToClose' before attempting to join because the stream may be stuck.
+ std::shared_ptr<IStreamCommon> common;
+ ASSERT_IS_OK(mStream->getStream()->getStreamCommon(&common));
+ ASSERT_IS_OK(common->prepareToClose());
+ LOG(DEBUG) << __func__ << ": joining " << IOTraits<Stream>::directionStr << " worker...";
+ mWorker->join();
+ EXPECT_FALSE(mWorker->hasError()) << mWorker->getError();
+ EXPECT_EQ("", mWorkerDriver->getUnexpectedStateTransition());
+ if (validatePosition) {
+ if (IOTraits<Stream>::is_input) {
+ EXPECT_TRUE(mWorkerDriver->hasObservablePositionIncrease());
+ }
+ EXPECT_FALSE(mWorkerDriver->hasRetrogradeObservablePosition());
+ }
+ mWorker.reset();
+ mWorkerDriver.reset();
+ }
+
+ void TeardownPatch() { mStream->TeardownPatch(); }
+
+ const AudioDevice& getDevice() const { return mStream->getDevice(); }
+ Stream* getStream() const { return mStream->getStream(); }
+ std::string skipTestReason() const {
+ return !mSkipTestReason.empty() ? mSkipTestReason : mStream->skipTestReason();
+ }
+
+ private:
+ void MaybeSetSkipTestReason() {
+ if (skipStreamIoTestForMixPortConfig(mStream->getPortConfig())) {
+ mSkipTestReason = "Mix port config is not supported for stream I/O tests";
+ }
+ }
+
+ const bool mIsSync;
+ std::string mSkipTestReason;
+ std::unique_ptr<StreamFixture<Stream>> mStream;
+ std::unique_ptr<StreamLogicDefaultDriver> mWorkerDriver;
+ std::unique_ptr<typename IOTraits<Stream>::Worker> mWorker;
+};
+
template <typename Stream>
class AudioStream : public AudioCoreModule {
public:
@@ -3276,10 +3483,12 @@
if (micDevicePorts.empty()) continue;
atLeastOnePort = true;
SCOPED_TRACE(port.toString());
- StreamFixture<IStreamIn> stream;
- ASSERT_NO_FATAL_FAILURE(stream.SetUpStreamForPortsPair(module.get(), moduleConfig.get(),
- port, micDevicePorts[0]));
+ StreamFixtureWithWorker<IStreamIn> stream(true /*isSync*/);
+ ASSERT_NO_FATAL_FAILURE(
+ stream.SetUp(module.get(), moduleConfig.get(), port, micDevicePorts[0]));
if (!stream.skipTestReason().empty()) continue;
+
+ ASSERT_NO_FATAL_FAILURE(stream.SendBurstCommands(false /*validatePosition*/));
std::vector<MicrophoneDynamicInfo> activeMics;
EXPECT_IS_OK(stream.getStream()->getActiveMicrophones(&activeMics));
EXPECT_FALSE(activeMics.empty());
@@ -3293,6 +3502,7 @@
EXPECT_NE(0UL, mic.channelMapping.size())
<< "No channels specified for the microphone \"" << mic.id << "\"";
}
+
stream.TeardownPatch();
// Now the port of the stream is not connected, check that there are no active microphones.
std::vector<MicrophoneDynamicInfo> emptyMics;
@@ -3670,85 +3880,6 @@
}
}
-class StreamLogicDefaultDriver : public StreamLogicDriver {
- public:
- StreamLogicDefaultDriver(std::shared_ptr<StateSequence> commands, size_t frameSizeBytes)
- : mCommands(commands), mFrameSizeBytes(frameSizeBytes) {
- mCommands->rewind();
- }
-
- // The three methods below is intended to be called after the worker
- // thread has joined, thus no extra synchronization is needed.
- bool hasObservablePositionIncrease() const { return mObservablePositionIncrease; }
- bool hasRetrogradeObservablePosition() const { return mRetrogradeObservablePosition; }
- std::string getUnexpectedStateTransition() const { return mUnexpectedTransition; }
-
- bool done() override { return mCommands->done(); }
- TransitionTrigger getNextTrigger(int maxDataSize, int* actualSize) override {
- auto trigger = mCommands->getTrigger();
- if (StreamDescriptor::Command* command = std::get_if<StreamDescriptor::Command>(&trigger);
- command != nullptr) {
- if (command->getTag() == StreamDescriptor::Command::Tag::burst) {
- if (actualSize != nullptr) {
- // In the output scenario, reduce slightly the fmqByteCount to verify
- // that the HAL module always consumes all data from the MQ.
- if (maxDataSize > static_cast<int>(mFrameSizeBytes)) {
- LOG(DEBUG) << __func__ << ": reducing data size by " << mFrameSizeBytes;
- maxDataSize -= mFrameSizeBytes;
- }
- *actualSize = maxDataSize;
- }
- command->set<StreamDescriptor::Command::Tag::burst>(maxDataSize);
- } else {
- if (actualSize != nullptr) *actualSize = 0;
- }
- }
- return trigger;
- }
- bool interceptRawReply(const StreamDescriptor::Reply&) override { return false; }
- bool processValidReply(const StreamDescriptor::Reply& reply) override {
- if (reply.observable.frames != StreamDescriptor::Position::UNKNOWN) {
- if (mPreviousFrames.has_value()) {
- if (reply.observable.frames > mPreviousFrames.value()) {
- mObservablePositionIncrease = true;
- } else if (reply.observable.frames < mPreviousFrames.value()) {
- mRetrogradeObservablePosition = true;
- }
- }
- mPreviousFrames = reply.observable.frames;
- }
-
- auto expected = mCommands->getExpectedStates();
- if (expected.count(reply.state) == 0) {
- std::string s =
- std::string("Unexpected transition from the state ")
- .append(mPreviousState.has_value() ? toString(mPreviousState.value())
- : "<initial state>")
- .append(" to ")
- .append(toString(reply.state))
- .append(" (expected one of ")
- .append(::android::internal::ToString(expected))
- .append(") caused by the ")
- .append(toString(mCommands->getTrigger()));
- LOG(ERROR) << __func__ << ": " << s;
- mUnexpectedTransition = std::move(s);
- return false;
- }
- mCommands->advance(reply.state);
- mPreviousState = reply.state;
- return true;
- }
-
- protected:
- std::shared_ptr<StateSequence> mCommands;
- const size_t mFrameSizeBytes;
- std::optional<StreamDescriptor::State> mPreviousState;
- std::optional<int64_t> mPreviousFrames;
- bool mObservablePositionIncrease = false;
- bool mRetrogradeObservablePosition = false;
- std::string mUnexpectedTransition;
-};
-
enum {
NAMED_CMD_NAME,
NAMED_CMD_DELAY_MS,
@@ -3779,7 +3910,11 @@
GTEST_SKIP() << "No mix ports have attached devices";
}
for (const auto& portConfig : allPortConfigs) {
+ auto port = moduleConfig->getPort(portConfig.portId);
+ ASSERT_TRUE(port.has_value());
+ SCOPED_TRACE(port->toString());
SCOPED_TRACE(portConfig.toString());
+ if (skipStreamIoTestForMixPortConfig(portConfig)) continue;
const bool isNonBlocking =
IOTraits<Stream>::is_input
? false
@@ -3860,6 +3995,7 @@
StreamFixture<Stream> stream;
ASSERT_NO_FATAL_FAILURE(
stream.SetUpStreamForMixPortConfig(module.get(), moduleConfig.get(), portConfig));
+ if (skipStreamIoTestForDevice(stream.getDevice())) return;
ASSERT_EQ("", stream.skipTestReason());
StreamLogicDefaultDriver driver(commandsAndStates,
stream.getStreamContext()->getFrameSizeBytes());
@@ -3888,6 +4024,7 @@
StreamFixture<Stream> stream;
ASSERT_NO_FATAL_FAILURE(
stream.SetUpPatchForMixPortConfig(module.get(), moduleConfig.get(), portConfig));
+ if (skipStreamIoTestForDevice(stream.getDevice())) return;
ASSERT_EQ("", stream.skipTestReason());
ASSERT_NO_FATAL_FAILURE(stream.TeardownPatchSetUpStream(module.get()));
StreamLogicDefaultDriver driver(commandsAndStates,
@@ -4086,7 +4223,7 @@
// Then use the same patch setting, except for having an invalid ID.
std::set<int32_t> patchIds;
ASSERT_NO_FATAL_FAILURE(GetAllPatchIds(&patchIds));
- for (const auto patchId : GetNonExistentIds(patchIds)) {
+ for (const auto patchId : GetNonExistentIds(patchIds, false /*includeZero*/)) {
AudioPatch patchWithNonExistendId = patch.get();
patchWithNonExistendId.id = patchId;
EXPECT_STATUS(EX_ILLEGAL_ARGUMENT,
@@ -4269,17 +4406,22 @@
using State = StreamDescriptor::State;
auto d = std::make_unique<StateDag>();
StateDag::Node last = d->makeFinalNode(State::ACTIVE);
- // Use a couple of bursts to ensure that the driver starts reporting the position.
- StateDag::Node active2 = d->makeNode(State::ACTIVE, kBurstCommand, last);
- StateDag::Node active = d->makeNode(State::ACTIVE, kBurstCommand, active2);
- StateDag::Node idle = d->makeNode(State::IDLE, kBurstCommand, active);
- if (!isSync) {
+ if (isSync) {
+ StateDag::Node idle = d->makeNode(
+ State::IDLE, kBurstCommand,
+ // Use several bursts to ensure that the driver starts reporting the position.
+ d->makeNodes(State::ACTIVE, kBurstCommand, 10, last));
+ d->makeNode(State::STANDBY, kStartCommand, idle);
+ } else {
+ StateDag::Node active2 = d->makeNode(State::ACTIVE, kBurstCommand, last);
+ StateDag::Node active = d->makeNode(State::ACTIVE, kBurstCommand, active2);
+ StateDag::Node idle = d->makeNode(State::IDLE, kBurstCommand, active);
// Allow optional routing via the TRANSFERRING state on bursts.
active2.children().push_back(d->makeNode(State::TRANSFERRING, kTransferReadyEvent, last));
active.children().push_back(d->makeNode(State::TRANSFERRING, kTransferReadyEvent, active2));
idle.children().push_back(d->makeNode(State::TRANSFERRING, kTransferReadyEvent, active));
+ d->makeNode(State::STANDBY, kStartCommand, idle);
}
- d->makeNode(State::STANDBY, kStartCommand, idle);
return std::make_shared<StateSequenceFollower>(std::move(d));
}
static const NamedCommandSequence kReadSeq =
@@ -4442,9 +4584,8 @@
std::make_pair(State::PAUSED, kStartCommand),
std::make_pair(State::ACTIVE, kPauseCommand),
std::make_pair(State::PAUSED, kBurstCommand),
- std::make_pair(State::PAUSED, kStartCommand),
- std::make_pair(State::ACTIVE, kPauseCommand)},
- State::PAUSED);
+ std::make_pair(State::PAUSED, kFlushCommand)},
+ State::IDLE);
if (!isSync) {
idle.children().push_back(
d->makeNodes({std::make_pair(State::TRANSFERRING, kPauseCommand),
@@ -4591,8 +4732,9 @@
template <typename Stream>
class WithRemoteSubmix {
public:
- WithRemoteSubmix() = default;
- explicit WithRemoteSubmix(AudioDeviceAddress address) : mAddress(address) {}
+ WithRemoteSubmix() : mStream(true /*isSync*/) {}
+ explicit WithRemoteSubmix(AudioDeviceAddress address)
+ : mStream(true /*isSync*/), mAddress(address) {}
WithRemoteSubmix(const WithRemoteSubmix&) = delete;
WithRemoteSubmix& operator=(const WithRemoteSubmix&) = delete;
@@ -4612,57 +4754,31 @@
void SetUp(IModule* module, ModuleConfig* moduleConfig) {
auto devicePort = getRemoteSubmixAudioPort(moduleConfig, mAddress);
ASSERT_TRUE(devicePort.has_value()) << "Device port for remote submix device not found";
- ASSERT_NO_FATAL_FAILURE(SetUp(module, moduleConfig, *devicePort));
+ ASSERT_NO_FATAL_FAILURE(mStream.SetUp(module, moduleConfig, *devicePort));
+ mAddress = mStream.getDevice().address;
}
- void SendBurstCommandsStartWorker() {
- const StreamContext* context = mStream->getStreamContext();
- mWorkerDriver = std::make_unique<StreamLogicDefaultDriver>(makeBurstCommands(true),
- context->getFrameSizeBytes());
- mWorker = std::make_unique<typename IOTraits<Stream>::Worker>(
- *context, mWorkerDriver.get(), mStream->getStreamEventReceiver());
- LOG(DEBUG) << __func__ << ": starting " << IOTraits<Stream>::directionStr << " worker...";
- ASSERT_TRUE(mWorker->start());
+ void StartWorkerToSendBurstCommands() {
+ ASSERT_NO_FATAL_FAILURE(mStream.StartWorkerToSendBurstCommands());
}
- void SendBurstCommandsJoinWorker() {
- // Must call 'prepareToClose' before attempting to join because the stream may be
- // stuck due to absence of activity from the other side of the remote submix pipe.
- std::shared_ptr<IStreamCommon> common;
- ASSERT_IS_OK(mStream->getStream()->getStreamCommon(&common));
- ASSERT_IS_OK(common->prepareToClose());
- LOG(DEBUG) << __func__ << ": joining " << IOTraits<Stream>::directionStr << " worker...";
- mWorker->join();
- EXPECT_FALSE(mWorker->hasError()) << mWorker->getError();
- EXPECT_EQ("", mWorkerDriver->getUnexpectedStateTransition());
- if (IOTraits<Stream>::is_input) {
- EXPECT_TRUE(mWorkerDriver->hasObservablePositionIncrease());
- }
- EXPECT_FALSE(mWorkerDriver->hasRetrogradeObservablePosition());
- mWorker.reset();
- mWorkerDriver.reset();
+ void JoinWorkerAfterBurstCommands() {
+ ASSERT_NO_FATAL_FAILURE(mStream.JoinWorkerAfterBurstCommands());
}
void SendBurstCommands() {
- ASSERT_NO_FATAL_FAILURE(SendBurstCommandsStartWorker());
- ASSERT_NO_FATAL_FAILURE(SendBurstCommandsJoinWorker());
+ ASSERT_NO_FATAL_FAILURE(mStream.StartWorkerToSendBurstCommands());
+ ASSERT_NO_FATAL_FAILURE(mStream.JoinWorkerAfterBurstCommands());
}
std::optional<AudioDeviceAddress> getAudioDeviceAddress() const { return mAddress; }
- std::string skipTestReason() const { return mStream->skipTestReason(); }
+ std::string skipTestReason() const { return mStream.skipTestReason(); }
private:
- void SetUp(IModule* module, ModuleConfig* moduleConfig, const AudioPort& devicePort) {
- mStream = std::make_unique<StreamFixture<Stream>>();
- ASSERT_NO_FATAL_FAILURE(
- mStream->SetUpStreamForDevicePort(module, moduleConfig, devicePort));
- mAddress = mStream->getDevice().address;
- }
+ void SetUp(IModule* module, ModuleConfig* moduleConfig, const AudioPort& devicePort) {}
+ StreamFixtureWithWorker<Stream> mStream;
std::optional<AudioDeviceAddress> mAddress;
- std::unique_ptr<StreamFixture<Stream>> mStream;
- std::unique_ptr<StreamLogicDefaultDriver> mWorkerDriver;
- std::unique_ptr<typename IOTraits<Stream>::Worker> mWorker;
};
class AudioModuleRemoteSubmix : public AudioCoreModule {
@@ -4712,10 +4828,10 @@
ASSERT_EQ("", streamIn.skipTestReason());
// Start writing into the output stream.
- ASSERT_NO_FATAL_FAILURE(streamOut.SendBurstCommandsStartWorker());
+ ASSERT_NO_FATAL_FAILURE(streamOut.StartWorkerToSendBurstCommands());
// Simultaneously, read from the input stream.
ASSERT_NO_FATAL_FAILURE(streamIn.SendBurstCommands());
- ASSERT_NO_FATAL_FAILURE(streamOut.SendBurstCommandsJoinWorker());
+ ASSERT_NO_FATAL_FAILURE(streamOut.JoinWorkerAfterBurstCommands());
}
TEST_P(AudioModuleRemoteSubmix, OpenInputMultipleTimes) {
@@ -4733,15 +4849,15 @@
ASSERT_EQ("", streamIns[i]->skipTestReason());
}
// Start writing into the output stream.
- ASSERT_NO_FATAL_FAILURE(streamOut.SendBurstCommandsStartWorker());
+ ASSERT_NO_FATAL_FAILURE(streamOut.StartWorkerToSendBurstCommands());
// Simultaneously, read from input streams.
for (size_t i = 0; i < streamInCount; i++) {
- ASSERT_NO_FATAL_FAILURE(streamIns[i]->SendBurstCommandsStartWorker());
+ ASSERT_NO_FATAL_FAILURE(streamIns[i]->StartWorkerToSendBurstCommands());
}
for (size_t i = 0; i < streamInCount; i++) {
- ASSERT_NO_FATAL_FAILURE(streamIns[i]->SendBurstCommandsJoinWorker());
+ ASSERT_NO_FATAL_FAILURE(streamIns[i]->JoinWorkerAfterBurstCommands());
}
- ASSERT_NO_FATAL_FAILURE(streamOut.SendBurstCommandsJoinWorker());
+ ASSERT_NO_FATAL_FAILURE(streamOut.JoinWorkerAfterBurstCommands());
// Clean up input streams in the reverse order because the device connection is owned
// by the first one.
for (size_t i = streamInCount; i != 0; --i) {
diff --git a/audio/aidl/vts/VtsHalAudioEffectFactoryTargetTest.cpp b/audio/aidl/vts/VtsHalAudioEffectFactoryTargetTest.cpp
index adf1da7..a19aa56 100644
--- a/audio/aidl/vts/VtsHalAudioEffectFactoryTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioEffectFactoryTargetTest.cpp
@@ -56,10 +56,7 @@
/// Effect factory testing.
class EffectFactoryTest : public testing::TestWithParam<std::string> {
public:
- void SetUp() override {
- mFactoryHelper = std::make_unique<EffectFactoryHelper>(GetParam());
- connectAndGetFactory();
- }
+ void SetUp() override { connectAndGetFactory(); }
void TearDown() override {
for (auto& effect : mEffects) {
@@ -68,13 +65,14 @@
}
}
- std::unique_ptr<EffectFactoryHelper> mFactoryHelper;
+ const std::string kServiceName = GetParam();
std::shared_ptr<IFactory> mEffectFactory;
std::vector<std::shared_ptr<IEffect>> mEffects;
const Descriptor::Identity kNullId = {.uuid = getEffectUuidNull()};
const Descriptor::Identity kZeroId = {.uuid = getEffectUuidZero()};
const Descriptor kNullDesc = {.common.id = kNullId};
const Descriptor kZeroDesc = {.common.id = kZeroId};
+ AudioHalBinderServiceUtil mBinderUtil;
template <typename Functor>
void ForEachId(const std::vector<Descriptor::Identity> ids, Functor functor) {
@@ -117,8 +115,11 @@
}
}
void connectAndGetFactory() {
- ASSERT_NO_FATAL_FAILURE(mFactoryHelper->ConnectToFactoryService());
- mEffectFactory = mFactoryHelper->GetFactory();
+ mEffectFactory = IFactory::fromBinder(mBinderUtil.connectToService(kServiceName));
+ ASSERT_NE(mEffectFactory, nullptr);
+ }
+ void restartAndGetFactory() {
+ mEffectFactory = IFactory::fromBinder(mBinderUtil.restartService());
ASSERT_NE(mEffectFactory, nullptr);
}
};
@@ -128,7 +129,8 @@
}
TEST_P(EffectFactoryTest, CanBeRestarted) {
- ASSERT_NO_FATAL_FAILURE(mFactoryHelper->RestartFactoryService());
+ ASSERT_NE(mEffectFactory, nullptr);
+ restartAndGetFactory();
}
/**
@@ -250,8 +252,7 @@
EXPECT_NE(descs.size(), 0UL);
creatAndDestroyDescs(descs);
- mFactoryHelper->RestartFactoryService();
-
+ restartAndGetFactory();
connectAndGetFactory();
creatAndDestroyDescs(descs);
}
@@ -263,8 +264,7 @@
EXPECT_NE(descs.size(), 0UL);
std::vector<std::shared_ptr<IEffect>> effects = createWithDescs(descs);
- ASSERT_NO_FATAL_FAILURE(mFactoryHelper->RestartFactoryService());
-
+ restartAndGetFactory();
connectAndGetFactory();
destroyEffects(effects, EX_ILLEGAL_ARGUMENT);
}
@@ -296,6 +296,25 @@
[&](const auto& proc) { return processingSet.find(proc) != processingSet.end(); }));
}
+// Make sure all effect instances have same HAL version number as IFactory.
+TEST_P(EffectFactoryTest, VersionNumberForAllEffectsEqualsToIFactory) {
+ std::vector<Descriptor> descs;
+ EXPECT_IS_OK(mEffectFactory->queryEffects(std::nullopt, std::nullopt, std::nullopt, &descs));
+ EXPECT_NE(descs.size(), 0UL);
+
+ std::vector<std::shared_ptr<IEffect>> effects = createWithDescs(descs);
+ int factoryVersion = 0;
+ EXPECT_IS_OK(mEffectFactory->getInterfaceVersion(&factoryVersion));
+
+ for (const auto& effect : effects) {
+ int effectVersion = 0;
+ EXPECT_NE(nullptr, effect);
+ EXPECT_IS_OK(effect->getInterfaceVersion(&effectVersion));
+ EXPECT_EQ(factoryVersion, effectVersion);
+ }
+ ASSERT_NO_FATAL_FAILURE(destroyEffects(effects));
+}
+
INSTANTIATE_TEST_SUITE_P(EffectFactoryTest, EffectFactoryTest,
testing::ValuesIn(android::getAidlHalInstanceNames(IFactory::descriptor)),
android::PrintInstanceNameToString);
diff --git a/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp b/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
index 5479825..4693f10 100644
--- a/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalAudioEffectTargetTest.cpp
@@ -42,6 +42,7 @@
using aidl::android::hardware::audio::effect::Flags;
using aidl::android::hardware::audio::effect::IEffect;
using aidl::android::hardware::audio::effect::IFactory;
+using aidl::android::hardware::audio::effect::kReopenSupportedVersion;
using aidl::android::hardware::audio::effect::Parameter;
using aidl::android::hardware::audio::effect::State;
using aidl::android::media::audio::common::AudioDeviceDescription;
@@ -613,6 +614,10 @@
* verify reopen sequence.
*/
TEST_P(AudioEffectDataPathTest, SetCommonParameterAndReopen) {
+ if (!EffectFactoryHelper::isReopenSupported(mFactory)) {
+ GTEST_SKIP() << "Skipping test as effect does not support reopen";
+ }
+
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
Parameter::Common common = EffectHelper::createParamCommon(
@@ -732,6 +737,10 @@
// Send data to effects and expect it to be consumed after effect reopen (IO AudioConfig change).
// Effects exposing bypass flags or operating in offload mode will be skipped.
TEST_P(AudioEffectDataPathTest, ConsumeDataAfterReopen) {
+ if (!EffectFactoryHelper::isReopenSupported(mFactory)) {
+ GTEST_SKIP() << "Skipping test as effect does not support reopen";
+ }
+
ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
Parameter::Common common = EffectHelper::createParamCommon(
diff --git a/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp b/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp
index b54b442..4cb1f49 100644
--- a/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalBassBoostTargetTest.cpp
@@ -166,6 +166,7 @@
}
void SetUp() override {
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
ASSERT_NO_FATAL_FAILURE(SetUpBassBoost(mChannelLayout));
if (int32_t version;
mEffect->getInterfaceVersion(&version).isOk() && version < kMinDataTestHalVersion) {
@@ -173,7 +174,10 @@
}
}
- void TearDown() override { TearDownBassBoost(); }
+ void TearDown() override {
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ TearDownBassBoost();
+ }
// Find FFT bin indices for testFrequencies and get bin center frequencies
void roundToFreqCenteredToFftBin(std::vector<int>& testFrequencies,
diff --git a/audio/aidl/vts/VtsHalDownmixTargetTest.cpp b/audio/aidl/vts/VtsHalDownmixTargetTest.cpp
index 360bf26..ef77f4d 100644
--- a/audio/aidl/vts/VtsHalDownmixTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalDownmixTargetTest.cpp
@@ -230,6 +230,7 @@
}
void SetUp() override {
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
SetUpDownmix(mInputChannelLayout);
if (int32_t version;
mEffect->getInterfaceVersion(&version).isOk() && version < kMinDataTestHalVersion) {
@@ -241,7 +242,10 @@
setDataTestParams(mInputChannelLayout);
}
- void TearDown() override { TearDownDownmix(); }
+ void TearDown() override {
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ TearDownDownmix();
+ }
void checkAtLeft(int32_t position) {
for (size_t i = 0, j = position; i < mOutputBufferSize;
diff --git a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
index 3f7a76d..69ab91b 100644
--- a/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
+++ b/audio/aidl/vts/VtsHalDynamicsProcessingTest.cpp
@@ -559,7 +559,7 @@
::android::internal::ToString(std::get<INPUT_GAIN_PARAM>(info.param));
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_inputGains_" + gains;
+ toString(descriptor.common.id.uuid) + "_inputGains_" + gains;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -652,7 +652,7 @@
std::to_string(std::get<LIMITER_ENGINE_IN_USE>(info.param));
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_limiterConfig_" +
+ toString(descriptor.common.id.uuid) + "_limiterConfig_" +
cfg.toString() + "_engineSetting_" + engineLimiterInUse;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
@@ -726,7 +726,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_" + channelConfig +
+ toString(descriptor.common.id.uuid) + "_" + channelConfig +
"_engineInUse_" + engineInUse;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
@@ -868,7 +868,7 @@
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() + "_bands_" + bands +
+ toString(descriptor.common.id.uuid) + "_bands_" + bands +
"_stageInUse_" + stageInUse;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
@@ -986,7 +986,7 @@
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() + "_bands_" + mbcBands +
+ toString(descriptor.common.id.uuid) + "_bands_" + mbcBands +
"_stageInUse_" + stageInUse;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
diff --git a/audio/aidl/vts/VtsHalEnvironmentalReverbTargetTest.cpp b/audio/aidl/vts/VtsHalEnvironmentalReverbTargetTest.cpp
index 765c377..f641fa5 100644
--- a/audio/aidl/vts/VtsHalEnvironmentalReverbTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalEnvironmentalReverbTargetTest.cpp
@@ -249,7 +249,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_roomHfLevel" + roomHfLevel;
+ toString(descriptor.common.id.uuid) + "_roomHfLevel" + roomHfLevel;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -289,7 +289,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_decayTime" + decayTime;
+ toString(descriptor.common.id.uuid) + "_decayTime" + decayTime;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -329,8 +329,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_decayHfRatio" +
- decayHfRatio;
+ toString(descriptor.common.id.uuid) + "_decayHfRatio" + decayHfRatio;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -370,7 +369,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_level" + level;
+ toString(descriptor.common.id.uuid) + "_level" + level;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -410,7 +409,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_delay" + delay;
+ toString(descriptor.common.id.uuid) + "_delay" + delay;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -450,7 +449,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_diffusion" + diffusion;
+ toString(descriptor.common.id.uuid) + "_diffusion" + diffusion;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -490,7 +489,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_density" + density;
+ toString(descriptor.common.id.uuid) + "_density" + density;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
@@ -527,7 +526,7 @@
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_bypass" + bypass;
+ toString(descriptor.common.id.uuid) + "_bypass" + bypass;
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
diff --git a/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp b/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp
index d312111..48e59dc 100644
--- a/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalHapticGeneratorTargetTest.cpp
@@ -225,7 +225,7 @@
std::to_string(std::get<PARAM_VIBRATION_INFORMATION_MAX_AMPLITUDE>(info.param));
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString() + "_hapticScaleId" +
+ toString(descriptor.common.id.uuid) + "_hapticScaleId" +
hapticScaleID + "_hapticScaleVibScale" + hapticScaleVibScale +
"_resonantFrequency" + resonantFrequency + "_qFactor" + qFactor +
"_maxAmplitude" + maxAmplitude;
@@ -422,7 +422,7 @@
auto descriptor = std::get<PARAM_INSTANCE_NAME>(info.param).second;
std::string name = "Implementor_" + descriptor.common.implementor + "_name_" +
descriptor.common.name + "_UUID_" +
- descriptor.common.id.uuid.toString();
+ toString(descriptor.common.id.uuid);
std::replace_if(
name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
return name;
diff --git a/audio/aidl/vts/VtsHalLoudnessEnhancerTargetTest.cpp b/audio/aidl/vts/VtsHalLoudnessEnhancerTargetTest.cpp
index 7f0091f..a075423 100644
--- a/audio/aidl/vts/VtsHalLoudnessEnhancerTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalLoudnessEnhancerTargetTest.cpp
@@ -156,6 +156,7 @@
}
void SetUp() override {
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
SetUpLoudnessEnhancer();
// Creating AidlMessageQueues
@@ -164,7 +165,10 @@
mOutputMQ = std::make_unique<EffectHelper::DataMQ>(mOpenEffectReturn.outputDataMQ);
}
- void TearDown() override { TearDownLoudnessEnhancer(); }
+ void TearDown() override {
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ TearDownLoudnessEnhancer();
+ }
// Fill inputBuffer with random values between -kMaxAudioSample to kMaxAudioSample
void generateInputBuffer() {
diff --git a/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp b/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp
index 1453495..300939e 100644
--- a/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalPresetReverbTargetTest.cpp
@@ -17,11 +17,14 @@
#define LOG_TAG "VtsHalPresetReverbTargetTest"
#include <android-base/logging.h>
#include <android/binder_enums.h>
+#include <audio_utils/power.h>
+#include <system/audio.h>
#include "EffectHelper.h"
using namespace android;
+using aidl::android::hardware::audio::common::getChannelCount;
using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::getEffectTypeUuidPresetReverb;
using aidl::android::hardware::audio::effect::IEffect;
@@ -30,6 +33,68 @@
using aidl::android::hardware::audio::effect::PresetReverb;
using android::hardware::audio::common::testing::detail::TestExecutionTracer;
+class PresetReverbHelper : public EffectHelper {
+ public:
+ void SetUpPresetReverb() {
+ ASSERT_NE(nullptr, mFactory);
+ ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
+ Parameter::Specific specific = getDefaultParamSpecific();
+ Parameter::Common common = EffectHelper::createParamCommon(
+ 0 /* session */, 1 /* ioHandle */, kSamplingFrequency /* iSampleRate */,
+ kSamplingFrequency /* oSampleRate */, mFrameCount /* iFrameCount */,
+ mFrameCount /* oFrameCount */);
+ ASSERT_NO_FATAL_FAILURE(open(mEffect, common, specific, &mOpenEffectReturn, EX_NONE));
+ ASSERT_NE(nullptr, mEffect);
+ }
+
+ void TearDownPresetReverb() {
+ ASSERT_NO_FATAL_FAILURE(close(mEffect));
+ ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
+ mOpenEffectReturn = IEffect::OpenEffectReturn{};
+ }
+
+ Parameter::Specific getDefaultParamSpecific() {
+ PresetReverb pr = PresetReverb::make<PresetReverb::preset>(kDefaultPreset);
+ Parameter::Specific specific =
+ Parameter::Specific::make<Parameter::Specific::presetReverb>(pr);
+ return specific;
+ }
+
+ Parameter createPresetReverbParam(const PresetReverb::Presets& param) {
+ return Parameter::make<Parameter::specific>(
+ Parameter::Specific::make<Parameter::Specific::presetReverb>(
+ PresetReverb::make<PresetReverb::preset>(param)));
+ }
+
+ void setAndVerifyPreset(const PresetReverb::Presets& param) {
+ auto expectedParam = createPresetReverbParam(param);
+ EXPECT_STATUS(EX_NONE, mEffect->setParameter(expectedParam)) << expectedParam.toString();
+
+ PresetReverb::Id revId =
+ PresetReverb::Id::make<PresetReverb::Id::commonTag>(PresetReverb::preset);
+
+ auto id = Parameter::Id::make<Parameter::Id::presetReverbTag>(revId);
+ // get parameter
+ Parameter getParam;
+ EXPECT_STATUS(EX_NONE, mEffect->getParameter(id, &getParam));
+ EXPECT_EQ(expectedParam, getParam) << "\nexpectedParam:" << expectedParam.toString()
+ << "\ngetParam:" << getParam.toString();
+ }
+
+ static constexpr int kSamplingFrequency = 44100;
+ static constexpr int kDurationMilliSec = 2000;
+ static constexpr int kBufferSize = kSamplingFrequency * kDurationMilliSec / 1000;
+ int mStereoChannelCount =
+ getChannelCount(AudioChannelLayout::make<AudioChannelLayout::layoutMask>(
+ AudioChannelLayout::LAYOUT_STEREO));
+ PresetReverb::Presets kDefaultPreset = PresetReverb::Presets::NONE;
+ int mFrameCount = kBufferSize / mStereoChannelCount;
+ std::shared_ptr<IFactory> mFactory;
+ std::shared_ptr<IEffect> mEffect;
+ IEffect::OpenEffectReturn mOpenEffectReturn;
+ Descriptor mDescriptor;
+};
+
/**
* Here we focus on specific parameter checking, general IEffect interfaces testing performed in
* VtsAudioEffectTargetTest.
@@ -44,88 +109,116 @@
ndk::enum_range<PresetReverb::Presets>().end()};
class PresetReverbParamTest : public ::testing::TestWithParam<PresetReverbParamTestParam>,
- public EffectHelper {
+ public PresetReverbHelper {
public:
- PresetReverbParamTest() : mParamPresets(std::get<PARAM_PRESETS>(GetParam())) {
+ PresetReverbParamTest() : mParamPreset(std::get<PARAM_PRESETS>(GetParam())) {
std::tie(mFactory, mDescriptor) = std::get<PARAM_INSTANCE_NAME>(GetParam());
}
- void SetUp() override {
- ASSERT_NE(nullptr, mFactory);
- ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
+ void SetUp() override { ASSERT_NO_FATAL_FAILURE(SetUpPresetReverb()); }
- Parameter::Specific specific = getDefaultParamSpecific();
- Parameter::Common common = EffectHelper::createParamCommon(
- 0 /* session */, 1 /* ioHandle */, 44100 /* iSampleRate */, 44100 /* oSampleRate */,
- kInputFrameCount /* iFrameCount */, kOutputFrameCount /* oFrameCount */);
- IEffect::OpenEffectReturn ret;
- ASSERT_NO_FATAL_FAILURE(open(mEffect, common, specific, &ret, EX_NONE));
- ASSERT_NE(nullptr, mEffect);
- }
+ void TearDown() override { TearDownPresetReverb(); }
- void TearDown() override {
- ASSERT_NO_FATAL_FAILURE(close(mEffect));
- ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
- }
-
- static const long kInputFrameCount = 0x100, kOutputFrameCount = 0x100;
- std::shared_ptr<IFactory> mFactory;
- std::shared_ptr<IEffect> mEffect;
- Descriptor mDescriptor;
- PresetReverb::Presets mParamPresets = PresetReverb::Presets::NONE;
-
- void SetAndGetPresetReverbParameters() {
- for (auto& it : mTags) {
- auto& tag = it.first;
- auto& pr = it.second;
-
- // validate parameter
- Descriptor desc;
- ASSERT_STATUS(EX_NONE, mEffect->getDescriptor(&desc));
- const bool valid = isParameterValid<PresetReverb, Range::presetReverb>(it.second, desc);
- const binder_exception_t expected = valid ? EX_NONE : EX_ILLEGAL_ARGUMENT;
-
- // set parameter
- Parameter expectParam;
- Parameter::Specific specific;
- specific.set<Parameter::Specific::presetReverb>(pr);
- expectParam.set<Parameter::specific>(specific);
- // All values are valid, set parameter should succeed
- EXPECT_STATUS(expected, mEffect->setParameter(expectParam)) << expectParam.toString();
-
- // get parameter
- Parameter getParam;
- Parameter::Id id;
- PresetReverb::Id prId;
- prId.set<PresetReverb::Id::commonTag>(tag);
- id.set<Parameter::Id::presetReverbTag>(prId);
- EXPECT_STATUS(expected, mEffect->getParameter(id, &getParam));
-
- EXPECT_EQ(expectParam, getParam);
- }
- }
-
- void addPresetsParam(PresetReverb::Presets preset) {
- PresetReverb pr;
- pr.set<PresetReverb::preset>(preset);
- mTags.push_back({PresetReverb::preset, pr});
- }
-
- Parameter::Specific getDefaultParamSpecific() {
- PresetReverb pr = PresetReverb::make<PresetReverb::preset>(PresetReverb::Presets::NONE);
- Parameter::Specific specific =
- Parameter::Specific::make<Parameter::Specific::presetReverb>(pr);
- return specific;
- }
-
- private:
- std::vector<std::pair<PresetReverb::Tag, PresetReverb>> mTags;
- void CleanUp() { mTags.clear(); }
+ const PresetReverb::Presets mParamPreset;
};
TEST_P(PresetReverbParamTest, SetAndGetPresets) {
- EXPECT_NO_FATAL_FAILURE(addPresetsParam(mParamPresets));
- SetAndGetPresetReverbParameters();
+ ASSERT_NO_FATAL_FAILURE(setAndVerifyPreset(mParamPreset));
+}
+
+using PresetReverbProcessTestParam = std::pair<std::shared_ptr<IFactory>, Descriptor>;
+
+class PresetReverbProcessTest : public ::testing::TestWithParam<PresetReverbProcessTestParam>,
+ public PresetReverbHelper {
+ public:
+ PresetReverbProcessTest() {
+ std::tie(mFactory, mDescriptor) = GetParam();
+ generateSineWaveInput();
+ }
+
+ void SetUp() override {
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ ASSERT_NO_FATAL_FAILURE(SetUpPresetReverb());
+ }
+ void TearDown() override {
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ ASSERT_NO_FATAL_FAILURE(TearDownPresetReverb());
+ }
+
+ void generateSineWaveInput() {
+ int frequency = 1000;
+ for (size_t i = 0; i < kBufferSize; i++) {
+ mInput.push_back(sin(2 * M_PI * frequency * i / kSamplingFrequency));
+ }
+ }
+
+ bool isAuxiliary() {
+ return mDescriptor.common.flags.type ==
+ aidl::android::hardware::audio::effect::Flags::Type::AUXILIARY;
+ }
+
+ float computeReverbOutputEnergy(std::vector<float> output) {
+ if (!isAuxiliary()) {
+ // Extract auxiliary output
+ for (size_t i = 0; i < output.size(); i++) {
+ output[i] -= mInput[i];
+ }
+ }
+ return (audio_utils_compute_energy_mono(output.data(), AUDIO_FORMAT_PCM_FLOAT,
+ output.size()));
+ }
+
+ void setPresetAndProcess(const PresetReverb::Presets& preset, std::vector<float>& output) {
+ ASSERT_NO_FATAL_FAILURE(setAndVerifyPreset(preset));
+ ASSERT_NO_FATAL_FAILURE(
+ processAndWriteToOutput(mInput, output, mEffect, &mOpenEffectReturn));
+ }
+
+ void validateIncreasingEnergy(const std::vector<PresetReverb::Presets>& presets) {
+ float baseOutputEnergy = 0;
+
+ for (PresetReverb::Presets preset : presets) {
+ std::vector<float> output(kBufferSize);
+ setPresetAndProcess(preset, output);
+ float outputEnergy = computeReverbOutputEnergy(output);
+
+ ASSERT_GT(outputEnergy, baseOutputEnergy);
+ baseOutputEnergy = outputEnergy;
+ }
+ }
+
+ std::vector<float> mInput;
+};
+
+TEST_P(PresetReverbProcessTest, DecreasingRoomSize) {
+ std::vector<PresetReverb::Presets> roomPresets = {PresetReverb::Presets::LARGEROOM,
+ PresetReverb::Presets::MEDIUMROOM,
+ PresetReverb::Presets::SMALLROOM};
+ validateIncreasingEnergy(roomPresets);
+}
+
+TEST_P(PresetReverbProcessTest, DecreasingHallSize) {
+ std::vector<PresetReverb::Presets> hallPresets = {PresetReverb::Presets::LARGEHALL,
+ PresetReverb::Presets::MEDIUMHALL};
+ validateIncreasingEnergy(hallPresets);
+}
+
+TEST_P(PresetReverbProcessTest, PresetPlate) {
+ std::vector<float> output(kBufferSize);
+
+ setPresetAndProcess(PresetReverb::Presets::PLATE, output);
+ float outputEnergy = computeReverbOutputEnergy(output);
+ // Since there is no comparator preset, validating it is greater than zero
+ ASSERT_GT(outputEnergy, 0);
+}
+
+TEST_P(PresetReverbProcessTest, PresetNone) {
+ std::vector<float> output(kBufferSize);
+
+ setPresetAndProcess(kDefaultPreset, output);
+ float outputEnergy = computeReverbOutputEnergy(output);
+ // NONE type doesn't create reverb effect
+ ASSERT_EQ(outputEnergy, 0);
}
INSTANTIATE_TEST_SUITE_P(
@@ -145,6 +238,17 @@
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(PresetReverbParamTest);
+INSTANTIATE_TEST_SUITE_P(
+ PresetReverbTest, PresetReverbProcessTest,
+ testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, getEffectTypeUuidPresetReverb())),
+ [](const testing::TestParamInfo<PresetReverbProcessTest::ParamType>& info) {
+ auto descriptor = info.param;
+ return getPrefix(descriptor.second);
+ });
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(PresetReverbProcessTest);
+
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
::testing::UnitTest::GetInstance()->listeners().Append(new TestExecutionTracer());
diff --git a/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp b/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp
index 0c24f90..2f6af08 100644
--- a/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalVirtualizerTargetTest.cpp
@@ -16,11 +16,14 @@
#define LOG_TAG "VtsHalVirtualizerTest"
#include <android-base/logging.h>
+#include <audio_utils/power.h>
+#include <system/audio.h>
#include "EffectHelper.h"
using namespace android;
+using aidl::android::hardware::audio::common::getChannelCount;
using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::getEffectTypeUuidVirtualizer;
using aidl::android::hardware::audio::effect::IEffect;
@@ -29,6 +32,82 @@
using aidl::android::hardware::audio::effect::Virtualizer;
using android::hardware::audio::common::testing::detail::TestExecutionTracer;
+class VirtualizerHelper : public EffectHelper {
+ public:
+ void SetUpVirtualizer() {
+ ASSERT_NE(nullptr, mFactory);
+ ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
+ initFrameCount();
+ Parameter::Specific specific = getDefaultParamSpecific();
+ Parameter::Common common = EffectHelper::createParamCommon(
+ 0 /* session */, 1 /* ioHandle */, kSamplingFrequency /* iSampleRate */,
+ kSamplingFrequency /* oSampleRate */, mInputFrameCount /* iFrameCount */,
+ mInputFrameCount /* oFrameCount */);
+ ASSERT_NO_FATAL_FAILURE(open(mEffect, common, specific, &mOpenEffectReturn, EX_NONE));
+ ASSERT_NE(nullptr, mEffect);
+ }
+
+ void TearDownVirtualizer() {
+ ASSERT_NO_FATAL_FAILURE(close(mEffect));
+ ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
+ mOpenEffectReturn = IEffect::OpenEffectReturn{};
+ }
+
+ Parameter::Specific getDefaultParamSpecific() {
+ Virtualizer vr = Virtualizer::make<Virtualizer::strengthPm>(0);
+ Parameter::Specific specific =
+ Parameter::Specific::make<Parameter::Specific::virtualizer>(vr);
+ return specific;
+ }
+
+ Parameter createVirtualizerStrengthParam(int param) {
+ return Parameter::make<Parameter::specific>(
+ Parameter::Specific::make<Parameter::Specific::virtualizer>(
+ Virtualizer::make<Virtualizer::strengthPm>(param)));
+ }
+
+ void initFrameCount() {
+ mInputFrameCount = kBufferSize / kChannelCount;
+ mOutputFrameCount = kBufferSize / kChannelCount;
+ }
+
+ bool isStrengthValid(int level) {
+ auto vir = Virtualizer::make<Virtualizer::strengthPm>(level);
+ return isParameterValid<Virtualizer, Range::virtualizer>(vir, mDescriptor);
+ }
+
+ void setAndVerifyStrength(int param, binder_exception_t expected) {
+ auto expectedParam = createVirtualizerStrengthParam(param);
+ EXPECT_STATUS(expected, mEffect->setParameter(expectedParam)) << expectedParam.toString();
+
+ if (expected == EX_NONE) {
+ Virtualizer::Id vrlId =
+ Virtualizer::Id::make<Virtualizer::Id::commonTag>(Virtualizer::strengthPm);
+
+ auto id = Parameter::Id::make<Parameter::Id::virtualizerTag>(vrlId);
+ // get parameter
+ Parameter getParam;
+ // if set success, then get should match
+ EXPECT_STATUS(expected, mEffect->getParameter(id, &getParam));
+ EXPECT_EQ(expectedParam, getParam) << "\nexpectedParam:" << expectedParam.toString()
+ << "\ngetParam:" << getParam.toString();
+ }
+ }
+
+ static constexpr int kSamplingFrequency = 44100;
+ static constexpr int kDefaultChannelLayout = AudioChannelLayout::LAYOUT_STEREO;
+ static constexpr int kDurationMilliSec = 2000;
+ static constexpr int kBufferSize = kSamplingFrequency * kDurationMilliSec / 1000;
+ int kChannelCount = getChannelCount(
+ AudioChannelLayout::make<AudioChannelLayout::layoutMask>(kDefaultChannelLayout));
+ long mInputFrameCount;
+ long mOutputFrameCount;
+ std::shared_ptr<IFactory> mFactory;
+ std::shared_ptr<IEffect> mEffect;
+ IEffect::OpenEffectReturn mOpenEffectReturn;
+ Descriptor mDescriptor;
+};
+
/**
* Here we focus on specific parameter checking, general IEffect interfaces testing performed in
* VtsAudioEffectTargetTest.
@@ -44,89 +123,89 @@
*/
class VirtualizerParamTest : public ::testing::TestWithParam<VirtualizerParamTestParam>,
- public EffectHelper {
+ public VirtualizerHelper {
public:
VirtualizerParamTest() : mParamStrength(std::get<PARAM_STRENGTH>(GetParam())) {
std::tie(mFactory, mDescriptor) = std::get<PARAM_INSTANCE_NAME>(GetParam());
}
+ void SetUp() override { ASSERT_NO_FATAL_FAILURE(SetUpVirtualizer()); }
+ void TearDown() override { TearDownVirtualizer(); }
+
+ int mParamStrength = 0;
+};
+
+TEST_P(VirtualizerParamTest, SetAndGetStrength) {
+ ASSERT_NO_FATAL_FAILURE(setAndVerifyStrength(
+ mParamStrength, isStrengthValid(mParamStrength) ? EX_NONE : EX_ILLEGAL_ARGUMENT));
+}
+
+enum ProcessTestParam { PROCESS_INSTANCE_NAME, PROCESS_ZERO_INPUT };
+using VirtualizerProcessTestParam =
+ std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, bool>;
+
+class VirtualizerProcessTest : public ::testing::TestWithParam<VirtualizerProcessTestParam>,
+ public VirtualizerHelper {
+ public:
+ VirtualizerProcessTest() : mZeroInput(std::get<PROCESS_ZERO_INPUT>(GetParam())) {
+ std::tie(mFactory, mDescriptor) = std::get<PROCESS_INSTANCE_NAME>(GetParam());
+ }
void SetUp() override {
- ASSERT_NE(nullptr, mFactory);
- ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
-
- Parameter::Specific specific = getDefaultParamSpecific();
- Parameter::Common common = EffectHelper::createParamCommon(
- 0 /* session */, 1 /* ioHandle */, 44100 /* iSampleRate */, 44100 /* oSampleRate */,
- kInputFrameCount /* iFrameCount */, kOutputFrameCount /* oFrameCount */);
- IEffect::OpenEffectReturn ret;
- ASSERT_NO_FATAL_FAILURE(open(mEffect, common, specific, &ret, EX_NONE));
- ASSERT_NE(nullptr, mEffect);
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ ASSERT_NO_FATAL_FAILURE(SetUpVirtualizer());
}
void TearDown() override {
- ASSERT_NO_FATAL_FAILURE(close(mEffect));
- ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ ASSERT_NO_FATAL_FAILURE(TearDownVirtualizer());
}
- Parameter::Specific getDefaultParamSpecific() {
- Virtualizer vr = Virtualizer::make<Virtualizer::strengthPm>(0);
- Parameter::Specific specific =
- Parameter::Specific::make<Parameter::Specific::virtualizer>(vr);
- return specific;
- }
-
- static const long kInputFrameCount = 0x100, kOutputFrameCount = 0x100;
- std::shared_ptr<IFactory> mFactory;
- std::shared_ptr<IEffect> mEffect;
- Descriptor mDescriptor;
- int mParamStrength = 0;
-
- void SetAndGetVirtualizerParameters() {
- for (auto& it : mTags) {
- auto& tag = it.first;
- auto& vr = it.second;
-
- // validate parameter
- Descriptor desc;
- ASSERT_STATUS(EX_NONE, mEffect->getDescriptor(&desc));
- const bool valid = isParameterValid<Virtualizer, Range::virtualizer>(it.second, desc);
- const binder_exception_t expected = valid ? EX_NONE : EX_ILLEGAL_ARGUMENT;
-
- // set parameter
- Parameter expectParam;
- Parameter::Specific specific;
- specific.set<Parameter::Specific::virtualizer>(vr);
- expectParam.set<Parameter::specific>(specific);
- EXPECT_STATUS(expected, mEffect->setParameter(expectParam)) << expectParam.toString();
-
- // only get if parameter in range and set success
- if (expected == EX_NONE) {
- Parameter getParam;
- Parameter::Id id;
- Virtualizer::Id vrId;
- vrId.set<Virtualizer::Id::commonTag>(tag);
- id.set<Parameter::Id::virtualizerTag>(vrId);
- // if set success, then get should match
- EXPECT_STATUS(expected, mEffect->getParameter(id, &getParam));
- EXPECT_EQ(expectParam, getParam);
+ void generateInput(std::vector<float>& buffer) {
+ if (mZeroInput) {
+ std::fill(buffer.begin(), buffer.end(), 0);
+ } else {
+ int frequency = 100;
+ for (size_t i = 0; i < buffer.size(); i++) {
+ buffer[i] = sin(2 * M_PI * frequency * i / kSamplingFrequency);
}
}
}
- void addStrengthParam(int strength) {
- Virtualizer vr;
- vr.set<Virtualizer::strengthPm>(strength);
- mTags.push_back({Virtualizer::strengthPm, vr});
- }
-
- private:
- std::vector<std::pair<Virtualizer::Tag, Virtualizer>> mTags;
- void CleanUp() { mTags.clear(); }
+ static constexpr float kAbsError = 0.00001;
+ bool mZeroInput;
};
-TEST_P(VirtualizerParamTest, SetAndGetStrength) {
- EXPECT_NO_FATAL_FAILURE(addStrengthParam(mParamStrength));
- SetAndGetVirtualizerParameters();
+TEST_P(VirtualizerProcessTest, IncreasingStrength) {
+ std::vector<float> input(kBufferSize);
+ std::vector<float> output(kBufferSize);
+ std::vector<int> strengths = {250, 500, 750, 1000};
+
+ generateInput(input);
+
+ const float inputRmse =
+ audio_utils_compute_energy_mono(input.data(), AUDIO_FORMAT_PCM_FLOAT, input.size());
+
+ for (int strength : strengths) {
+ // Skipping the further steps for unnsupported Strength values
+ if (!isStrengthValid(strength)) {
+ continue;
+ }
+ setAndVerifyStrength(strength, EX_NONE);
+ ASSERT_NO_FATAL_FAILURE(
+ processAndWriteToOutput(input, output, mEffect, &mOpenEffectReturn));
+
+ const float outputRmse = audio_utils_compute_energy_mono(
+ output.data(), AUDIO_FORMAT_PCM_FLOAT, output.size());
+
+ if (inputRmse != 0) {
+ EXPECT_NE(outputRmse, 0);
+ if (strength != 0) {
+ EXPECT_GT(abs(outputRmse - inputRmse), kAbsError);
+ }
+ } else {
+ EXPECT_NEAR(outputRmse, inputRmse, kAbsError);
+ }
+ }
}
std::vector<std::pair<std::shared_ptr<IFactory>, Descriptor>> kDescPair;
@@ -149,6 +228,22 @@
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(VirtualizerParamTest);
+INSTANTIATE_TEST_SUITE_P(
+ VirtualizerTest, VirtualizerProcessTest,
+ ::testing::Combine(testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, getEffectTypeUuidVirtualizer())),
+ testing::Bool()),
+ [](const testing::TestParamInfo<VirtualizerProcessTest::ParamType>& info) {
+ auto descriptor = std::get<PROCESS_INSTANCE_NAME>(info.param).second;
+ std::string isInputZero = std::to_string(std::get<PROCESS_ZERO_INPUT>(info.param));
+ std::string name = getPrefix(descriptor) + "_isInputZero_" + isInputZero;
+ std::replace_if(
+ name.begin(), name.end(), [](const char c) { return !std::isalnum(c); }, '_');
+ return name;
+ });
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(VirtualizerProcessTest);
+
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
::testing::UnitTest::GetInstance()->listeners().Append(new TestExecutionTracer());
diff --git a/audio/aidl/vts/VtsHalVolumeTargetTest.cpp b/audio/aidl/vts/VtsHalVolumeTargetTest.cpp
index aa2c05f..1c1489d 100644
--- a/audio/aidl/vts/VtsHalVolumeTargetTest.cpp
+++ b/audio/aidl/vts/VtsHalVolumeTargetTest.cpp
@@ -21,6 +21,7 @@
using namespace android;
+using aidl::android::hardware::audio::common::getChannelCount;
using aidl::android::hardware::audio::effect::Descriptor;
using aidl::android::hardware::audio::effect::getEffectTypeUuidVolume;
using aidl::android::hardware::audio::effect::IEffect;
@@ -29,6 +30,80 @@
using aidl::android::hardware::audio::effect::Volume;
using android::hardware::audio::common::testing::detail::TestExecutionTracer;
+class VolumeControlHelper : public EffectHelper {
+ public:
+ void SetUpVolumeControl() {
+ ASSERT_NE(nullptr, mFactory);
+ ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
+ initFrameCount();
+ Parameter::Specific specific = getDefaultParamSpecific();
+ Parameter::Common common = EffectHelper::createParamCommon(
+ 0 /* session */, 1 /* ioHandle */, kSamplingFrequency /* iSampleRate */,
+ kSamplingFrequency /* oSampleRate */, mInputFrameCount /* iFrameCount */,
+ mInputFrameCount /* oFrameCount */);
+ ASSERT_NO_FATAL_FAILURE(open(mEffect, common, specific, &mOpenEffectReturn, EX_NONE));
+ ASSERT_NE(nullptr, mEffect);
+ }
+
+ void TearDownVolumeControl() {
+ ASSERT_NO_FATAL_FAILURE(close(mEffect));
+ ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
+ mOpenEffectReturn = IEffect::OpenEffectReturn{};
+ }
+
+ Parameter::Specific getDefaultParamSpecific() {
+ Volume vol = Volume::make<Volume::levelDb>(kMinLevel);
+ Parameter::Specific specific = Parameter::Specific::make<Parameter::Specific::volume>(vol);
+ return specific;
+ }
+
+ Parameter createVolumeParam(int param, Volume::Tag volTag) {
+ return Parameter::make<Parameter::specific>(
+ Parameter::Specific::make<Parameter::Specific::volume>(
+ (volTag == Volume::mute) ? Volume::make<Volume::mute>(param)
+ : Volume::make<Volume::levelDb>(param)));
+ }
+
+ void initFrameCount() {
+ int channelCount = getChannelCount(
+ AudioChannelLayout::make<AudioChannelLayout::layoutMask>(kDefaultChannelLayout));
+ mInputFrameCount = kBufferSize / channelCount;
+ mOutputFrameCount = kBufferSize / channelCount;
+ }
+
+ bool isLevelValid(int level) {
+ auto vol = Volume::make<Volume::levelDb>(level);
+ return isParameterValid<Volume, Range::volume>(vol, mDescriptor);
+ }
+
+ void setAndVerifyParameters(Volume::Tag volTag, int param, binder_exception_t expected) {
+ auto expectedParam = createVolumeParam(param, volTag);
+ EXPECT_STATUS(expected, mEffect->setParameter(expectedParam)) << expectedParam.toString();
+
+ if (expected == EX_NONE) {
+ Volume::Id volId = Volume::Id::make<Volume::Id::commonTag>(volTag);
+
+ auto id = Parameter::Id::make<Parameter::Id::volumeTag>(volId);
+ // get parameter
+ Parameter getParam;
+ // if set success, then get should match
+ EXPECT_STATUS(expected, mEffect->getParameter(id, &getParam));
+ EXPECT_EQ(expectedParam, getParam) << "\nexpectedParam:" << expectedParam.toString()
+ << "\ngetParam:" << getParam.toString();
+ }
+ }
+
+ static constexpr int kSamplingFrequency = 44100;
+ static constexpr int kDurationMilliSec = 2000;
+ static constexpr int kBufferSize = kSamplingFrequency * kDurationMilliSec / 1000;
+ static constexpr int kMinLevel = -96;
+ static constexpr int kDefaultChannelLayout = AudioChannelLayout::LAYOUT_STEREO;
+ long mInputFrameCount, mOutputFrameCount;
+ std::shared_ptr<IFactory> mFactory;
+ std::shared_ptr<IEffect> mEffect;
+ IEffect::OpenEffectReturn mOpenEffectReturn;
+ Descriptor mDescriptor;
+};
/**
* Here we focus on specific parameter checking, general IEffect interfaces testing performed in
* VtsAudioEffectTargetTest.
@@ -37,7 +112,8 @@
using VolumeParamTestParam =
std::tuple<std::pair<std::shared_ptr<IFactory>, Descriptor>, int, bool>;
-class VolumeParamTest : public ::testing::TestWithParam<VolumeParamTestParam>, public EffectHelper {
+class VolumeParamTest : public ::testing::TestWithParam<VolumeParamTestParam>,
+ public VolumeControlHelper {
public:
VolumeParamTest()
: mParamLevel(std::get<PARAM_LEVEL>(GetParam())),
@@ -45,94 +121,173 @@
std::tie(mFactory, mDescriptor) = std::get<PARAM_INSTANCE_NAME>(GetParam());
}
- void SetUp() override {
- ASSERT_NE(nullptr, mFactory);
- ASSERT_NO_FATAL_FAILURE(create(mFactory, mEffect, mDescriptor));
+ void SetUp() override { ASSERT_NO_FATAL_FAILURE(SetUpVolumeControl()); }
+ void TearDown() override { TearDownVolumeControl(); }
- Parameter::Specific specific = getDefaultParamSpecific();
- Parameter::Common common = EffectHelper::createParamCommon(
- 0 /* session */, 1 /* ioHandle */, 44100 /* iSampleRate */, 44100 /* oSampleRate */,
- kInputFrameCount /* iFrameCount */, kOutputFrameCount /* oFrameCount */);
- IEffect::OpenEffectReturn ret;
- ASSERT_NO_FATAL_FAILURE(open(mEffect, common, specific, &ret, EX_NONE));
- ASSERT_NE(nullptr, mEffect);
- }
- void TearDown() override {
- ASSERT_NO_FATAL_FAILURE(close(mEffect));
- ASSERT_NO_FATAL_FAILURE(destroy(mFactory, mEffect));
- }
-
- Parameter::Specific getDefaultParamSpecific() {
- Volume vol = Volume::make<Volume::levelDb>(-9600);
- Parameter::Specific specific = Parameter::Specific::make<Parameter::Specific::volume>(vol);
- return specific;
- }
-
- static const long kInputFrameCount = 0x100, kOutputFrameCount = 0x100;
- std::shared_ptr<IFactory> mFactory;
- std::shared_ptr<IEffect> mEffect;
- Descriptor mDescriptor;
int mParamLevel = 0;
bool mParamMute = false;
-
- void SetAndGetParameters() {
- for (auto& it : mTags) {
- auto& tag = it.first;
- auto& vol = it.second;
-
- // validate parameter
- Descriptor desc;
- ASSERT_STATUS(EX_NONE, mEffect->getDescriptor(&desc));
- const bool valid = isParameterValid<Volume, Range::volume>(it.second, desc);
- const binder_exception_t expected = valid ? EX_NONE : EX_ILLEGAL_ARGUMENT;
-
- // set parameter
- Parameter expectParam;
- Parameter::Specific specific;
- specific.set<Parameter::Specific::volume>(vol);
- expectParam.set<Parameter::specific>(specific);
- EXPECT_STATUS(expected, mEffect->setParameter(expectParam)) << expectParam.toString();
-
- // only get if parameter is in range and set success
- if (expected == EX_NONE) {
- Parameter getParam;
- Parameter::Id id;
- Volume::Id volId;
- volId.set<Volume::Id::commonTag>(tag);
- id.set<Parameter::Id::volumeTag>(volId);
- EXPECT_STATUS(EX_NONE, mEffect->getParameter(id, &getParam));
-
- EXPECT_EQ(expectParam, getParam) << "\nexpect:" << expectParam.toString()
- << "\ngetParam:" << getParam.toString();
- }
- }
- }
-
- void addLevelParam(int level) {
- Volume vol;
- vol.set<Volume::levelDb>(level);
- mTags.push_back({Volume::levelDb, vol});
- }
-
- void addMuteParam(bool mute) {
- Volume vol;
- vol.set<Volume::mute>(mute);
- mTags.push_back({Volume::mute, vol});
- }
-
- private:
- std::vector<std::pair<Volume::Tag, Volume>> mTags;
- void CleanUp() { mTags.clear(); }
};
-TEST_P(VolumeParamTest, SetAndGetLevel) {
- EXPECT_NO_FATAL_FAILURE(addLevelParam(mParamLevel));
- SetAndGetParameters();
+TEST_P(VolumeParamTest, SetAndGetParams) {
+ ASSERT_NO_FATAL_FAILURE(
+ setAndVerifyParameters(Volume::levelDb, mParamLevel,
+ isLevelValid(mParamLevel) ? EX_NONE : EX_ILLEGAL_ARGUMENT));
+ ASSERT_NO_FATAL_FAILURE(setAndVerifyParameters(Volume::mute, mParamMute, EX_NONE));
}
-TEST_P(VolumeParamTest, SetAndGetMute) {
- EXPECT_NO_FATAL_FAILURE(addMuteParam(mParamMute));
- SetAndGetParameters();
+using VolumeDataTestParam = std::pair<std::shared_ptr<IFactory>, Descriptor>;
+
+class VolumeDataTest : public ::testing::TestWithParam<VolumeDataTestParam>,
+ public VolumeControlHelper {
+ public:
+ VolumeDataTest() {
+ std::tie(mFactory, mDescriptor) = GetParam();
+ mInput.resize(kBufferSize);
+ mInputMag.resize(mTestFrequencies.size());
+ mBinOffsets.resize(mTestFrequencies.size());
+ roundToFreqCenteredToFftBin(mTestFrequencies, mBinOffsets, kBinWidth);
+ generateMultiTone(mTestFrequencies, mInput, kSamplingFrequency);
+ mInputMag = calculateMagnitude(mInput, mBinOffsets, kNPointFFT);
+ }
+
+ std::vector<int> calculatePercentageDiff(const std::vector<float>& outputMag) {
+ std::vector<int> percentages(mTestFrequencies.size());
+
+ for (size_t i = 0; i < mInputMag.size(); i++) {
+ float diff = mInputMag[i] - outputMag[i];
+ percentages[i] = std::round(diff / mInputMag[i] * 100);
+ }
+ return percentages;
+ }
+
+ // Convert Decibel value to Percentage
+ int percentageDb(float level) { return std::round((1 - (pow(10, level / 20))) * 100); }
+
+ void SetUp() override {
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ ASSERT_NO_FATAL_FAILURE(SetUpVolumeControl());
+ }
+ void TearDown() override {
+ SKIP_TEST_IF_DATA_UNSUPPORTED(mDescriptor.common.flags);
+ TearDownVolumeControl();
+ }
+
+ static constexpr int kMaxAudioSample = 1;
+ static constexpr int kTransitionDuration = 300;
+ static constexpr int kNPointFFT = 32768;
+ static constexpr float kBinWidth = (float)kSamplingFrequency / kNPointFFT;
+ static constexpr size_t offset = kSamplingFrequency * kTransitionDuration / 1000;
+ static constexpr float kBaseLevel = 0;
+ std::vector<int> mTestFrequencies = {100, 1000};
+ std::vector<float> mInput;
+ std::vector<float> mInputMag;
+ std::vector<int> mBinOffsets;
+};
+
+TEST_P(VolumeDataTest, ApplyLevelMuteUnmute) {
+ std::vector<float> output(kBufferSize);
+ std::vector<int> diffs(mTestFrequencies.size());
+ std::vector<float> outputMag(mTestFrequencies.size());
+
+ if (!isLevelValid(kBaseLevel)) {
+ GTEST_SKIP() << "Volume Level not supported, skipping the test\n";
+ }
+
+ // Apply Volume Level
+
+ ASSERT_NO_FATAL_FAILURE(setAndVerifyParameters(Volume::levelDb, kBaseLevel, EX_NONE));
+ ASSERT_NO_FATAL_FAILURE(processAndWriteToOutput(mInput, output, mEffect, &mOpenEffectReturn));
+
+ outputMag = calculateMagnitude(output, mBinOffsets, kNPointFFT);
+ diffs = calculatePercentageDiff(outputMag);
+
+ for (size_t i = 0; i < diffs.size(); i++) {
+ ASSERT_EQ(diffs[i], percentageDb(kBaseLevel));
+ }
+
+ // Apply Mute
+
+ ASSERT_NO_FATAL_FAILURE(setAndVerifyParameters(Volume::mute, true /*mute*/, EX_NONE));
+ ASSERT_NO_FATAL_FAILURE(processAndWriteToOutput(mInput, output, mEffect, &mOpenEffectReturn));
+
+ std::vector<float> subOutputMute(output.begin() + offset, output.end());
+ outputMag = calculateMagnitude(subOutputMute, mBinOffsets, kNPointFFT);
+ diffs = calculatePercentageDiff(outputMag);
+
+ for (size_t i = 0; i < diffs.size(); i++) {
+ ASSERT_EQ(diffs[i], percentageDb(kMinLevel /*Mute*/));
+ }
+
+ // Verifying Fade out
+ outputMag = calculateMagnitude(output, mBinOffsets, kNPointFFT);
+ diffs = calculatePercentageDiff(outputMag);
+
+ for (size_t i = 0; i < diffs.size(); i++) {
+ ASSERT_LT(diffs[i], percentageDb(kMinLevel /*Mute*/));
+ }
+
+ // Apply Unmute
+
+ ASSERT_NO_FATAL_FAILURE(setAndVerifyParameters(Volume::mute, false /*unmute*/, EX_NONE));
+ ASSERT_NO_FATAL_FAILURE(processAndWriteToOutput(mInput, output, mEffect, &mOpenEffectReturn));
+
+ std::vector<float> subOutputUnmute(output.begin() + offset, output.end());
+
+ outputMag = calculateMagnitude(subOutputUnmute, mBinOffsets, kNPointFFT);
+ diffs = calculatePercentageDiff(outputMag);
+
+ for (size_t i = 0; i < diffs.size(); i++) {
+ ASSERT_EQ(diffs[i], percentageDb(kBaseLevel));
+ }
+
+ // Verifying Fade in
+ outputMag = calculateMagnitude(output, mBinOffsets, kNPointFFT);
+ diffs = calculatePercentageDiff(outputMag);
+
+ for (size_t i = 0; i < diffs.size(); i++) {
+ ASSERT_GT(diffs[i], percentageDb(kBaseLevel));
+ }
+}
+
+TEST_P(VolumeDataTest, DecreasingLevels) {
+ std::vector<int> decreasingLevels = {-24, -48, -96};
+ std::vector<float> baseOutput(kBufferSize);
+ std::vector<int> baseDiffs(mTestFrequencies.size());
+ std::vector<float> outputMag(mTestFrequencies.size());
+
+ if (!isLevelValid(kBaseLevel)) {
+ GTEST_SKIP() << "Volume Level not supported, skipping the test\n";
+ }
+
+ ASSERT_NO_FATAL_FAILURE(setAndVerifyParameters(Volume::levelDb, kBaseLevel, EX_NONE));
+ ASSERT_NO_FATAL_FAILURE(
+ processAndWriteToOutput(mInput, baseOutput, mEffect, &mOpenEffectReturn));
+
+ outputMag = calculateMagnitude(baseOutput, mBinOffsets, kNPointFFT);
+ baseDiffs = calculatePercentageDiff(outputMag);
+
+ for (int level : decreasingLevels) {
+ std::vector<float> output(kBufferSize);
+ std::vector<int> diffs(mTestFrequencies.size());
+
+ // Skipping the further steps for unnsupported level values
+ if (!isLevelValid(level)) {
+ continue;
+ }
+ ASSERT_NO_FATAL_FAILURE(setAndVerifyParameters(Volume::levelDb, level, EX_NONE));
+ ASSERT_NO_FATAL_FAILURE(
+ processAndWriteToOutput(mInput, output, mEffect, &mOpenEffectReturn));
+
+ outputMag = calculateMagnitude(output, mBinOffsets, kNPointFFT);
+ diffs = calculatePercentageDiff(outputMag);
+
+ // Decrease in volume level results in greater magnitude difference
+ for (size_t i = 0; i < diffs.size(); i++) {
+ ASSERT_GT(diffs[i], baseDiffs[i]);
+ }
+
+ baseDiffs = diffs;
+ }
}
std::vector<std::pair<std::shared_ptr<IFactory>, Descriptor>> kDescPair;
@@ -157,6 +312,20 @@
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(VolumeParamTest);
+INSTANTIATE_TEST_SUITE_P(VolumeTest, VolumeDataTest,
+ testing::ValuesIn(EffectFactoryHelper::getAllEffectDescriptors(
+ IFactory::descriptor, getEffectTypeUuidVolume())),
+ [](const testing::TestParamInfo<VolumeDataTest::ParamType>& info) {
+ auto descriptor = info.param;
+ std::string name = getPrefix(descriptor.second);
+ std::replace_if(
+ name.begin(), name.end(),
+ [](const char c) { return !std::isalnum(c); }, '_');
+ return name;
+ });
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(VolumeDataTest);
+
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
::testing::UnitTest::GetInstance()->listeners().Append(new TestExecutionTracer());
diff --git a/audio/common/2.0/Android.bp b/audio/common/2.0/Android.bp
index 450e04f..679d6b0 100644
--- a/audio/common/2.0/Android.bp
+++ b/audio/common/2.0/Android.bp
@@ -15,9 +15,6 @@
root: "android.hardware",
// TODO(b/153609531): remove when no longer needed.
native_bridge_supported: true,
- vndk: {
- enabled: true,
- },
srcs: [
"types.hal",
],
diff --git a/audio/effect/all-versions/default/Effect.cpp b/audio/effect/all-versions/default/Effect.cpp
index 5aecd32..4a9e144 100644
--- a/audio/effect/all-versions/default/Effect.cpp
+++ b/audio/effect/all-versions/default/Effect.cpp
@@ -315,7 +315,7 @@
Effect::~Effect() {
ATRACE_CALL();
- (void)close();
+ auto [_, handle] = closeImpl();
if (mProcessThread.get()) {
ATRACE_NAME("mProcessThread->join");
status_t status = mProcessThread->join();
@@ -328,11 +328,10 @@
mInBuffer.clear();
mOutBuffer.clear();
#if MAJOR_VERSION <= 5
- int status = EffectRelease(mHandle);
- ALOGW_IF(status, "Error releasing effect %p: %s", mHandle, strerror(-status));
+ int status = EffectRelease(handle);
+ ALOGW_IF(status, "Error releasing effect %p: %s", handle, strerror(-status));
#endif
- EffectMap::getInstance().remove(mHandle);
- mHandle = 0;
+ EffectMap::getInstance().remove(handle);
}
// static
@@ -459,7 +458,19 @@
}
}
-void Effect::getConfigImpl(int commandCode, const char* commandName, GetConfigCallback cb) {
+#define RETURN_IF_EFFECT_CLOSED() \
+ if (mHandle == kInvalidEffectHandle) { \
+ return Result::INVALID_STATE; \
+ }
+#define RETURN_RESULT_IF_EFFECT_CLOSED(result) \
+ if (mHandle == kInvalidEffectHandle) { \
+ _hidl_cb(Result::INVALID_STATE, result); \
+ return Void(); \
+ }
+
+Return<void> Effect::getConfigImpl(int commandCode, const char* commandName,
+ GetConfigCallback _hidl_cb) {
+ RETURN_RESULT_IF_EFFECT_CLOSED(EffectConfig());
uint32_t halResultSize = sizeof(effect_config_t);
effect_config_t halConfig{};
status_t status =
@@ -468,7 +479,8 @@
if (status == OK) {
status = EffectUtils::effectConfigFromHal(halConfig, mIsInput, &config);
}
- cb(analyzeCommandStatus(commandName, sContextCallToCommand, status), config);
+ _hidl_cb(analyzeCommandStatus(commandName, sContextCallToCommand, status), config);
+ return Void();
}
Result Effect::getCurrentConfigImpl(uint32_t featureId, uint32_t configSize,
@@ -530,6 +542,7 @@
}
Return<void> Effect::prepareForProcessing(prepareForProcessing_cb _hidl_cb) {
+ RETURN_RESULT_IF_EFFECT_CLOSED(StatusMQ::Descriptor());
status_t status;
// Create message queue.
if (mStatusMQ) {
@@ -576,6 +589,7 @@
Return<Result> Effect::setProcessBuffers(const AudioBuffer& inBuffer,
const AudioBuffer& outBuffer) {
+ RETURN_IF_EFFECT_CLOSED();
AudioBufferManager& manager = AudioBufferManager::getInstance();
sp<AudioBufferWrapper> tempInBuffer, tempOutBuffer;
if (!manager.wrap(inBuffer, &tempInBuffer)) {
@@ -600,6 +614,7 @@
}
Result Effect::sendCommand(int commandCode, const char* commandName, uint32_t size, void* data) {
+ RETURN_IF_EFFECT_CLOSED();
status_t status = (*mHandle)->command(mHandle, commandCode, size, data, 0, NULL);
return analyzeCommandStatus(commandName, sContextCallToCommand, status);
}
@@ -611,6 +626,7 @@
Result Effect::sendCommandReturningData(int commandCode, const char* commandName, uint32_t size,
void* data, uint32_t* replySize, void* replyData) {
+ RETURN_IF_EFFECT_CLOSED();
uint32_t expectedReplySize = *replySize;
status_t status = (*mHandle)->command(mHandle, commandCode, size, data, replySize, replyData);
if (status == OK && *replySize != expectedReplySize) {
@@ -635,6 +651,7 @@
uint32_t size, void* data, uint32_t* replySize,
void* replyData, uint32_t minReplySize,
CommandSuccessCallback onSuccess) {
+ RETURN_IF_EFFECT_CLOSED();
status_t status = (*mHandle)->command(mHandle, commandCode, size, data, replySize, replyData);
Result retval;
if (status == OK && minReplySize >= sizeof(uint32_t) && *replySize >= minReplySize) {
@@ -792,13 +809,11 @@
}
Return<void> Effect::getConfig(getConfig_cb _hidl_cb) {
- getConfigImpl(EFFECT_CMD_GET_CONFIG, "GET_CONFIG", _hidl_cb);
- return Void();
+ return getConfigImpl(EFFECT_CMD_GET_CONFIG, "GET_CONFIG", _hidl_cb);
}
Return<void> Effect::getConfigReverse(getConfigReverse_cb _hidl_cb) {
- getConfigImpl(EFFECT_CMD_GET_CONFIG_REVERSE, "GET_CONFIG_REVERSE", _hidl_cb);
- return Void();
+ return getConfigImpl(EFFECT_CMD_GET_CONFIG_REVERSE, "GET_CONFIG_REVERSE", _hidl_cb);
}
Return<void> Effect::getSupportedAuxChannelsConfigs(uint32_t maxConfigs,
@@ -845,6 +860,7 @@
}
Return<void> Effect::getDescriptor(getDescriptor_cb _hidl_cb) {
+ RETURN_RESULT_IF_EFFECT_CLOSED(EffectDescriptor());
effect_descriptor_t halDescriptor;
memset(&halDescriptor, 0, sizeof(effect_descriptor_t));
status_t status = (*mHandle)->get_descriptor(mHandle, &halDescriptor);
@@ -858,6 +874,10 @@
Return<void> Effect::command(uint32_t commandId, const hidl_vec<uint8_t>& data,
uint32_t resultMaxSize, command_cb _hidl_cb) {
+ if (mHandle == kInvalidEffectHandle) {
+ _hidl_cb(-ENODATA, hidl_vec<uint8_t>());
+ return Void();
+ }
uint32_t halDataSize;
std::unique_ptr<uint8_t[]> halData = hidlVecToHal(data, &halDataSize);
uint32_t halResultSize = resultMaxSize;
@@ -942,26 +962,33 @@
halCmd.size(), &halCmd[0]);
}
-Return<Result> Effect::close() {
+std::tuple<Result, effect_handle_t> Effect::closeImpl() {
if (mStopProcessThread.load(std::memory_order_relaxed)) { // only this thread modifies
- return Result::INVALID_STATE;
+ return {Result::INVALID_STATE, kInvalidEffectHandle};
}
mStopProcessThread.store(true, std::memory_order_release);
if (mEfGroup) {
mEfGroup->wake(static_cast<uint32_t>(MessageQueueFlagBits::REQUEST_QUIT));
}
+ effect_handle_t handle = mHandle;
+ mHandle = kInvalidEffectHandle;
#if MAJOR_VERSION <= 5
- return Result::OK;
+ return {Result::OK, handle};
#elif MAJOR_VERSION >= 6
// No need to join the processing thread, it is part of the API contract that the client
// must finish processing before closing the effect.
- Result retval =
- analyzeStatus("EffectRelease", "", sContextCallFunction, EffectRelease(mHandle));
- EffectMap::getInstance().remove(mHandle);
- return retval;
+ Result retval = analyzeStatus("EffectRelease", "", sContextCallFunction, EffectRelease(handle));
+ EffectMap::getInstance().remove(handle);
+ return {retval, handle};
#endif
}
+Return<Result> Effect::close() {
+ RETURN_IF_EFFECT_CLOSED();
+ auto [result, _] = closeImpl();
+ return result;
+}
+
Return<void> Effect::debug(const hidl_handle& fd, const hidl_vec<hidl_string>& /* options */) {
if (fd.getNativeHandle() != nullptr && fd->numFds == 1) {
uint32_t cmdData = fd->data[0];
diff --git a/audio/effect/all-versions/default/Effect.h b/audio/effect/all-versions/default/Effect.h
index 5d8dccc..2bcecec 100644
--- a/audio/effect/all-versions/default/Effect.h
+++ b/audio/effect/all-versions/default/Effect.h
@@ -23,6 +23,7 @@
#include <atomic>
#include <memory>
+#include <tuple>
#include <vector>
#include <fmq/EventFlag.h>
@@ -186,6 +187,7 @@
// Sets the limit on the maximum size of vendor-provided data structures.
static constexpr size_t kMaxDataSize = 1 << 20;
+ static constexpr effect_handle_t kInvalidEffectHandle = nullptr;
static const char* sContextResultOfCommand;
static const char* sContextCallToCommand;
@@ -208,6 +210,7 @@
static size_t alignedSizeIn(size_t s);
template <typename T>
std::unique_ptr<uint8_t[]> hidlVecToHal(const hidl_vec<T>& vec, uint32_t* halDataSize);
+ std::tuple<Result, effect_handle_t> closeImpl();
void effectAuxChannelsConfigFromHal(const channel_config_t& halConfig,
EffectAuxChannelsConfig* config);
static void effectAuxChannelsConfigToHal(const EffectAuxChannelsConfig& config,
@@ -218,7 +221,8 @@
const void** valueData, std::vector<uint8_t>* halParamBuffer);
Result analyzeCommandStatus(const char* commandName, const char* context, status_t status);
- void getConfigImpl(int commandCode, const char* commandName, GetConfigCallback cb);
+ Return<void> getConfigImpl(int commandCode, const char* commandName,
+ GetConfigCallback _hidl_cb);
Result getCurrentConfigImpl(uint32_t featureId, uint32_t configSize,
GetCurrentConfigSuccessCallback onSuccess);
Result getSupportedConfigsImpl(uint32_t featureId, uint32_t maxConfigs, uint32_t configSize,
diff --git a/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp
index d95bb06..ff84f9d 100644
--- a/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp
+++ b/audio/effect/all-versions/vts/functional/VtsHalAudioEffectTargetTest.cpp
@@ -169,13 +169,15 @@
0xfe3199be, 0xaed0, 0x413f, 0x87bb,
std::array<uint8_t, 6>{{0x11, 0x26, 0x0e, 0xb6, 0x3c, 0xf1}}};
-enum { PARAM_FACTORY_NAME, PARAM_EFFECT_UUID };
-using EffectParameter = std::tuple<std::string, Uuid>;
+enum { PARAM_FACTORY_NAME, PARAM_EFFECT_UUID, PARAM_USE_AFTER_CLOSE };
+using EffectParameter = std::tuple<std::string, Uuid, bool>;
static inline std::string EffectParameterToString(
const ::testing::TestParamInfo<EffectParameter>& info) {
- return ::android::hardware::PrintInstanceNameToString(::testing::TestParamInfo<std::string>{
- std::get<PARAM_FACTORY_NAME>(info.param), info.index});
+ std::string prefix = std::get<PARAM_USE_AFTER_CLOSE>(info.param) ? "UseAfterClose_" : "";
+ return prefix.append(
+ ::android::hardware::PrintInstanceNameToString(::testing::TestParamInfo<std::string>{
+ std::get<PARAM_FACTORY_NAME>(info.param), info.index}));
}
// The main test class for Audio Effect HIDL HAL.
@@ -191,6 +193,13 @@
Return<Result> ret = effect->init();
ASSERT_TRUE(ret.isOk());
ASSERT_EQ(Result::OK, ret);
+
+ useAfterClose = std::get<PARAM_USE_AFTER_CLOSE>(GetParam());
+ if (useAfterClose) {
+ Return<Result> ret = effect->close();
+ ASSERT_TRUE(ret.isOk());
+ ASSERT_EQ(Result::OK, ret);
+ }
}
void TearDown() override {
@@ -205,14 +214,34 @@
Uuid getEffectType() const { return std::get<PARAM_EFFECT_UUID>(GetParam()); }
+ void checkResult(const Result& result);
+ void checkResultForUseAfterClose(const Result& result);
void findAndCreateEffect(const Uuid& type);
void findEffectInstance(const Uuid& type, Uuid* uuid);
void getChannelCount(uint32_t* channelCount);
sp<IEffectsFactory> effectsFactory;
sp<IEffect> effect;
+ bool useAfterClose;
};
+void AudioEffectHidlTest::checkResult(const Result& result) {
+ if (!useAfterClose) {
+ ASSERT_EQ(Result::OK, result);
+ } else {
+ ASSERT_NO_FATAL_FAILURE(checkResultForUseAfterClose(result));
+ }
+}
+
+void AudioEffectHidlTest::checkResultForUseAfterClose(const Result& result) {
+ if (useAfterClose) {
+ // The actual error does not matter. It's important that the effect did not crash
+ // while executing any command after a call to "close", and that the returned status
+ // is not OK.
+ ASSERT_NE(Result::OK, result);
+ }
+}
+
void AudioEffectHidlTest::findAndCreateEffect(const Uuid& type) {
Uuid effectUuid;
ASSERT_NO_FATAL_FAILURE(findEffectInstance(type, &effectUuid));
@@ -257,7 +286,11 @@
}
});
ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Result::OK, retval);
+ ASSERT_NO_FATAL_FAILURE(checkResult(retval));
+ if (useAfterClose) {
+ *channelCount = 1;
+ return;
+ }
#if MAJOR_VERSION <= 6
ASSERT_TRUE(audio_channel_mask_is_valid(
static_cast<audio_channel_mask_t>(currentConfig.outputCfg.channels)));
@@ -276,7 +309,7 @@
description("Verify that an effect can be closed");
Return<Result> ret = effect->close();
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
+ ASSERT_NO_FATAL_FAILURE(checkResult(ret));
}
TEST_P(AudioEffectHidlTest, GetDescriptor) {
@@ -290,7 +323,8 @@
}
});
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, retval);
+ ASSERT_NO_FATAL_FAILURE(checkResult(retval));
+ if (useAfterClose) return;
EXPECT_EQ(getEffectType(), actualType);
}
@@ -307,7 +341,8 @@
}
});
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, retval);
+ EXPECT_NO_FATAL_FAILURE(checkResult(retval));
+ if (useAfterClose) return;
Return<Result> ret2 = effect->setConfig(currentConfig, nullptr, nullptr);
EXPECT_TRUE(ret2.isOk());
EXPECT_EQ(Result::OK, ret2);
@@ -336,7 +371,8 @@
}
});
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, retval);
+ EXPECT_NO_FATAL_FAILURE(checkResult(retval));
+ if (useAfterClose) return;
for (const auto& invalidInputCfg : generateInvalidConfigs(currentConfig.inputCfg)) {
EffectConfig invalidConfig = currentConfig;
invalidConfig.inputCfg = invalidInputCfg;
@@ -356,27 +392,35 @@
TEST_P(AudioEffectHidlTest, GetConfigReverse) {
description("Verify that GetConfigReverse does not crash");
- Return<void> ret = effect->getConfigReverse([&](Result, const EffectConfig&) {});
+ Result retval = Result::OK;
+ Return<void> ret = effect->getConfigReverse([&](Result r, const EffectConfig&) { retval = r; });
EXPECT_TRUE(ret.isOk());
+ EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(retval));
}
TEST_P(AudioEffectHidlTest, GetSupportedAuxChannelsConfigs) {
description("Verify that GetSupportedAuxChannelsConfigs does not crash");
+ Result retval = Result::OK;
Return<void> ret = effect->getSupportedAuxChannelsConfigs(
- 0, [&](Result, const hidl_vec<EffectAuxChannelsConfig>&) {});
+ 0, [&](Result r, const hidl_vec<EffectAuxChannelsConfig>&) { retval = r; });
EXPECT_TRUE(ret.isOk());
+ EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(retval));
}
TEST_P(AudioEffectHidlTest, GetAuxChannelsConfig) {
description("Verify that GetAuxChannelsConfig does not crash");
- Return<void> ret = effect->getAuxChannelsConfig([&](Result, const EffectAuxChannelsConfig&) {});
+ Result retval = Result::OK;
+ Return<void> ret = effect->getAuxChannelsConfig(
+ [&](Result r, const EffectAuxChannelsConfig&) { retval = r; });
EXPECT_TRUE(ret.isOk());
+ EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(retval));
}
TEST_P(AudioEffectHidlTest, SetAuxChannelsConfig) {
description("Verify that SetAuxChannelsConfig does not crash");
Return<Result> ret = effect->setAuxChannelsConfig(EffectAuxChannelsConfig());
EXPECT_TRUE(ret.isOk());
+ EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(ret));
}
// Not generated automatically because AudioBuffer contains
@@ -427,45 +471,56 @@
description("Verify that Reset preserves effect configuration");
Result retval = Result::NOT_INITIALIZED;
EffectConfig originalConfig;
- Return<void> ret = effect->getConfig([&](Result r, const EffectConfig& conf) {
- retval = r;
- if (r == Result::OK) {
- originalConfig = conf;
- }
- });
- ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Result::OK, retval);
+ if (!useAfterClose) {
+ Return<void> ret = effect->getConfig([&](Result r, const EffectConfig& conf) {
+ retval = r;
+ if (r == Result::OK) {
+ originalConfig = conf;
+ }
+ });
+ ASSERT_TRUE(ret.isOk());
+ ASSERT_EQ(Result::OK, retval);
+ }
Return<Result> ret2 = effect->reset();
EXPECT_TRUE(ret2.isOk());
- EXPECT_EQ(Result::OK, ret2);
- EffectConfig configAfterReset;
- ret = effect->getConfig([&](Result r, const EffectConfig& conf) {
- retval = r;
- if (r == Result::OK) {
- configAfterReset = conf;
- }
- });
- EXPECT_EQ(originalConfig, configAfterReset);
+ EXPECT_NO_FATAL_FAILURE(checkResult(ret2));
+ if (!useAfterClose) {
+ EffectConfig configAfterReset;
+ Return<void> ret = effect->getConfig([&](Result r, const EffectConfig& conf) {
+ retval = r;
+ if (r == Result::OK) {
+ configAfterReset = conf;
+ }
+ });
+ EXPECT_EQ(originalConfig, configAfterReset);
+ }
}
TEST_P(AudioEffectHidlTest, DisableEnableDisable) {
description("Verify Disable -> Enable -> Disable sequence for an effect");
Return<Result> ret = effect->disable();
EXPECT_TRUE(ret.isOk());
- // Note: some legacy effects may return -EINVAL (INVALID_ARGUMENTS),
- // more canonical is to return -ENOSYS (NOT_SUPPORTED)
- EXPECT_TRUE(ret == Result::NOT_SUPPORTED || ret == Result::INVALID_ARGUMENTS);
+ if (!useAfterClose) {
+ // Note: some legacy effects may return -EINVAL (INVALID_ARGUMENTS),
+ // more canonical is to return -ENOSYS (NOT_SUPPORTED)
+ EXPECT_TRUE(ret == Result::NOT_SUPPORTED || ret == Result::INVALID_ARGUMENTS);
+ } else {
+ EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(ret));
+ }
ret = effect->enable();
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
+ EXPECT_NO_FATAL_FAILURE(checkResult(ret));
ret = effect->disable();
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
+ EXPECT_NO_FATAL_FAILURE(checkResult(ret));
}
#if MAJOR_VERSION >= 7
TEST_P(AudioEffectHidlTest, SetDeviceInvalidDeviceAddress) {
description("Verify that invalid device address is rejected by SetDevice");
+ if (useAfterClose) {
+ GTEST_SKIP() << "Does not make sense for the useAfterClose case";
+ }
DeviceAddress device{.deviceType = "random_string"};
Return<Result> ret = effect->setDevice(device);
EXPECT_TRUE(ret.isOk());
@@ -482,13 +537,13 @@
Return<Result> ret = effect->setDevice(device);
#endif
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
+ EXPECT_NO_FATAL_FAILURE(checkResult(ret));
}
TEST_P(AudioEffectHidlTest, SetAndGetVolume) {
description("Verify that SetAndGetVolume method works for an effect");
uint32_t channelCount;
- getChannelCount(&channelCount);
+ ASSERT_NO_FATAL_FAILURE(getChannelCount(&channelCount));
hidl_vec<uint32_t> volumes;
volumes.resize(channelCount);
for (uint32_t i = 0; i < channelCount; ++i) {
@@ -498,13 +553,13 @@
Return<void> ret =
effect->setAndGetVolume(volumes, [&](Result r, const hidl_vec<uint32_t>&) { retval = r; });
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, retval);
+ EXPECT_NO_FATAL_FAILURE(checkResult(retval));
}
TEST_P(AudioEffectHidlTest, VolumeChangeNotification) {
description("Verify that effect accepts VolumeChangeNotification");
uint32_t channelCount;
- getChannelCount(&channelCount);
+ ASSERT_NO_FATAL_FAILURE(getChannelCount(&channelCount));
hidl_vec<uint32_t> volumes;
volumes.resize(channelCount);
for (uint32_t i = 0; i < channelCount; ++i) {
@@ -512,25 +567,29 @@
}
Return<Result> ret = effect->volumeChangeNotification(volumes);
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
+ EXPECT_NO_FATAL_FAILURE(checkResult(ret));
}
TEST_P(AudioEffectHidlTest, SetAudioMode) {
description("Verify that SetAudioMode works for an effect");
Return<Result> ret = effect->setAudioMode(AudioMode::NORMAL);
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
+ EXPECT_NO_FATAL_FAILURE(checkResult(ret));
}
TEST_P(AudioEffectHidlTest, SetConfigReverse) {
description("Verify that SetConfigReverse does not crash");
Return<Result> ret = effect->setConfigReverse(EffectConfig(), nullptr, nullptr);
EXPECT_TRUE(ret.isOk());
+ EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(ret));
}
#if MAJOR_VERSION >= 7
TEST_P(AudioEffectHidlTest, SetInputDeviceInvalidDeviceAddress) {
description("Verify that invalid device address is rejected by SetInputDevice");
+ if (useAfterClose) {
+ GTEST_SKIP() << "Does not make sense for the useAfterClose case";
+ }
DeviceAddress device{.deviceType = "random_string"};
Return<Result> ret = effect->setInputDevice(device);
EXPECT_TRUE(ret.isOk());
@@ -548,11 +607,15 @@
Return<Result> ret = effect->setInputDevice(device);
#endif
EXPECT_TRUE(ret.isOk());
+ EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(ret));
}
#if MAJOR_VERSION >= 7
TEST_P(AudioEffectHidlTest, SetInvalidAudioSource) {
description("Verify that an invalid audio source is rejected by SetAudioSource");
+ if (useAfterClose) {
+ GTEST_SKIP() << "Does not make sense for the useAfterClose case";
+ }
Return<Result> ret = effect->setAudioSource("random_string");
ASSERT_TRUE(ret.isOk());
EXPECT_TRUE(ret == Result::INVALID_ARGUMENTS || ret == Result::NOT_SUPPORTED)
@@ -568,12 +631,14 @@
Return<Result> ret = effect->setAudioSource(toString(xsd::AudioSource::AUDIO_SOURCE_MIC));
#endif
EXPECT_TRUE(ret.isOk());
+ EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(ret));
}
TEST_P(AudioEffectHidlTest, Offload) {
description("Verify that calling Offload method does not crash");
Return<Result> ret = effect->offload(EffectOffloadParameter{});
EXPECT_TRUE(ret.isOk());
+ EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(ret));
}
TEST_P(AudioEffectHidlTest, PrepareForProcessing) {
@@ -582,7 +647,7 @@
Return<void> ret = effect->prepareForProcessing(
[&](Result r, const MQDescriptorSync<Result>&) { retval = r; });
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, retval);
+ EXPECT_NO_FATAL_FAILURE(checkResult(retval));
}
TEST_P(AudioEffectHidlTest, SetProcessBuffers) {
@@ -601,7 +666,7 @@
ASSERT_TRUE(success);
Return<Result> ret2 = effect->setProcessBuffers(buffer, buffer);
EXPECT_TRUE(ret2.isOk());
- EXPECT_EQ(Result::OK, ret2);
+ EXPECT_NO_FATAL_FAILURE(checkResult(ret2));
}
TEST_P(AudioEffectHidlTest, Command) {
@@ -615,6 +680,7 @@
description("Verify that SetParameter does not crash");
Return<Result> ret = effect->setParameter(hidl_vec<uint8_t>(), hidl_vec<uint8_t>());
EXPECT_TRUE(ret.isOk());
+ EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(ret));
}
TEST_P(AudioEffectHidlTest, GetParameter) {
@@ -630,6 +696,9 @@
if (!isNewDeviceLaunchingOnTPlus) {
GTEST_SKIP() << "The test only applies to devices launching on T or later";
}
+ if (useAfterClose) {
+ GTEST_SKIP() << "Does not make sense for the useAfterClose case";
+ }
// Use a non-empty parameter to avoid being rejected by any earlier checks.
hidl_vec<uint8_t> parameter;
parameter.resize(16);
@@ -647,16 +716,20 @@
TEST_P(AudioEffectHidlTest, GetSupportedConfigsForFeature) {
description("Verify that GetSupportedConfigsForFeature does not crash");
+ Result retval = Result::OK;
Return<void> ret = effect->getSupportedConfigsForFeature(
- 0, 0, 0, [&](Result, uint32_t, const hidl_vec<uint8_t>&) {});
+ 0, 0, 0, [&](Result r, uint32_t, const hidl_vec<uint8_t>&) { retval = r; });
EXPECT_TRUE(ret.isOk());
+ EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(retval));
}
TEST_P(AudioEffectHidlTest, GetCurrentConfigForFeature) {
description("Verify that GetCurrentConfigForFeature does not crash");
- Return<void> ret =
- effect->getCurrentConfigForFeature(0, 0, [&](Result, const hidl_vec<uint8_t>&) {});
+ Result retval = Result::OK;
+ Return<void> ret = effect->getCurrentConfigForFeature(
+ 0, 0, [&](Result r, const hidl_vec<uint8_t>&) { retval = r; });
EXPECT_TRUE(ret.isOk());
+ EXPECT_NO_FATAL_FAILURE(checkResultForUseAfterClose(retval));
}
TEST_P(AudioEffectHidlTest, SetCurrentConfigForFeature) {
@@ -671,6 +744,9 @@
if (!isNewDeviceLaunchingOnTPlus) {
GTEST_SKIP() << "The test only applies to devices launching on T or later";
}
+ if (useAfterClose) {
+ GTEST_SKIP() << "Does not make sense for the useAfterClose case";
+ }
// Use very large size to ensure that the service does not crash.
const uint32_t veryLargeConfigSize = std::numeric_limits<uint32_t>::max() - 100;
Result retval = Result::OK;
@@ -687,6 +763,9 @@
if (!isNewDeviceLaunchingOnTPlus) {
GTEST_SKIP() << "The test only applies to devices launching on T or later";
}
+ if (useAfterClose) {
+ GTEST_SKIP() << "Does not make sense for the useAfterClose case";
+ }
// Use very large size to ensure that the service does not crash.
const uint32_t veryLargeConfigSize = std::numeric_limits<uint32_t>::max() - 100;
Result retval = Result::OK;
@@ -729,7 +808,8 @@
}
});
ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Result::OK, retval);
+ ASSERT_NO_FATAL_FAILURE(checkResult(retval));
+ if (useAfterClose) *numBands = 1;
}
void EqualizerAudioEffectHidlTest::getLevelRange(int16_t* minLevel, int16_t* maxLevel) {
@@ -742,7 +822,11 @@
}
});
ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Result::OK, retval);
+ ASSERT_NO_FATAL_FAILURE(checkResult(retval));
+ if (useAfterClose) {
+ *minLevel = 0;
+ *maxLevel = 255;
+ }
}
void EqualizerAudioEffectHidlTest::getBandFrequencyRange(uint16_t band, uint32_t* minFreq,
@@ -757,7 +841,7 @@
}
});
ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Result::OK, retval);
+ ASSERT_NO_FATAL_FAILURE(checkResult(retval));
ret = equalizer->getBandCenterFrequency(band, [&](Result r, uint32_t center) {
retval = r;
if (retval == Result::OK) {
@@ -765,7 +849,12 @@
}
});
ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Result::OK, retval);
+ ASSERT_NO_FATAL_FAILURE(checkResult(retval));
+ if (useAfterClose) {
+ *minFreq = 20;
+ *centerFreq = 10000;
+ *maxFreq = 20000;
+ }
}
void EqualizerAudioEffectHidlTest::getPresetCount(size_t* count) {
@@ -777,37 +866,38 @@
}
});
ASSERT_TRUE(ret.isOk());
- ASSERT_EQ(Result::OK, retval);
+ ASSERT_NO_FATAL_FAILURE(checkResult(retval));
+ if (useAfterClose) *count = 1;
}
TEST_P(EqualizerAudioEffectHidlTest, GetNumBands) {
description("Verify that Equalizer effect reports at least one band");
uint16_t numBands = 0;
- getNumBands(&numBands);
+ ASSERT_NO_FATAL_FAILURE(getNumBands(&numBands));
EXPECT_GT(numBands, 0);
}
TEST_P(EqualizerAudioEffectHidlTest, GetLevelRange) {
description("Verify that Equalizer effect reports adequate band level range");
int16_t minLevel = 0x7fff, maxLevel = 0;
- getLevelRange(&minLevel, &maxLevel);
+ ASSERT_NO_FATAL_FAILURE(getLevelRange(&minLevel, &maxLevel));
EXPECT_GT(maxLevel, minLevel);
}
TEST_P(EqualizerAudioEffectHidlTest, GetSetBandLevel) {
description("Verify that manipulating band levels works for Equalizer effect");
uint16_t numBands = 0;
- getNumBands(&numBands);
+ ASSERT_NO_FATAL_FAILURE(getNumBands(&numBands));
ASSERT_GT(numBands, 0);
int16_t levels[3]{0x7fff, 0, 0};
- getLevelRange(&levels[0], &levels[2]);
+ ASSERT_NO_FATAL_FAILURE(getLevelRange(&levels[0], &levels[2]));
ASSERT_GT(levels[2], levels[0]);
levels[1] = (levels[2] + levels[0]) / 2;
for (uint16_t i = 0; i < numBands; ++i) {
for (size_t j = 0; j < ARRAY_SIZE(levels); ++j) {
Return<Result> ret = equalizer->setBandLevel(i, levels[j]);
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
+ EXPECT_NO_FATAL_FAILURE(checkResult(ret));
Result retval = Result::NOT_INITIALIZED;
int16_t actualLevel;
Return<void> ret2 = equalizer->getBandLevel(i, [&](Result r, int16_t l) {
@@ -817,8 +907,10 @@
}
});
EXPECT_TRUE(ret2.isOk());
- EXPECT_EQ(Result::OK, retval);
- EXPECT_EQ(levels[j], actualLevel);
+ EXPECT_NO_FATAL_FAILURE(checkResult(retval));
+ if (!useAfterClose) {
+ EXPECT_EQ(levels[j], actualLevel);
+ }
}
}
}
@@ -826,11 +918,11 @@
TEST_P(EqualizerAudioEffectHidlTest, GetBandCenterFrequencyAndRange) {
description("Verify that Equalizer effect reports adequate band frequency range");
uint16_t numBands = 0;
- getNumBands(&numBands);
+ ASSERT_NO_FATAL_FAILURE(getNumBands(&numBands));
ASSERT_GT(numBands, 0);
for (uint16_t i = 0; i < numBands; ++i) {
uint32_t minFreq = 0xffffffff, centerFreq = 0xffffffff, maxFreq = 0xffffffff;
- getBandFrequencyRange(i, &minFreq, ¢erFreq, &maxFreq);
+ ASSERT_NO_FATAL_FAILURE(getBandFrequencyRange(i, &minFreq, ¢erFreq, &maxFreq));
// Note: NXP legacy implementation reports "1" as upper bound for last band,
// so this check fails.
EXPECT_GE(maxFreq, centerFreq);
@@ -841,7 +933,7 @@
TEST_P(EqualizerAudioEffectHidlTest, GetBandForFrequency) {
description("Verify that Equalizer effect supports GetBandForFrequency correctly");
uint16_t numBands = 0;
- getNumBands(&numBands);
+ ASSERT_NO_FATAL_FAILURE(getNumBands(&numBands));
ASSERT_GT(numBands, 0);
for (uint16_t i = 0; i < numBands; ++i) {
uint32_t freqs[3]{0, 0, 0};
@@ -861,8 +953,10 @@
}
});
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, retval);
- EXPECT_EQ(i, actualBand) << "Frequency: " << freqs[j];
+ EXPECT_NO_FATAL_FAILURE(checkResult(retval));
+ if (!useAfterClose) {
+ EXPECT_EQ(i, actualBand) << "Frequency: " << freqs[j];
+ }
}
}
}
@@ -870,19 +964,19 @@
TEST_P(EqualizerAudioEffectHidlTest, GetPresetNames) {
description("Verify that Equalizer effect reports at least one preset");
size_t presetCount;
- getPresetCount(&presetCount);
+ ASSERT_NO_FATAL_FAILURE(getPresetCount(&presetCount));
EXPECT_GT(presetCount, 0u);
}
TEST_P(EqualizerAudioEffectHidlTest, GetSetCurrentPreset) {
description("Verify that manipulating the current preset for Equalizer effect");
size_t presetCount;
- getPresetCount(&presetCount);
+ ASSERT_NO_FATAL_FAILURE(getPresetCount(&presetCount));
ASSERT_GT(presetCount, 0u);
for (uint16_t i = 0; i < presetCount; ++i) {
Return<Result> ret = equalizer->setCurrentPreset(i);
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
+ EXPECT_NO_FATAL_FAILURE(checkResult(ret));
Result retval = Result::NOT_INITIALIZED;
uint16_t actualPreset = 0xffff;
Return<void> ret2 = equalizer->getCurrentPreset([&](Result r, uint16_t p) {
@@ -892,8 +986,10 @@
}
});
EXPECT_TRUE(ret2.isOk());
- EXPECT_EQ(Result::OK, retval);
- EXPECT_EQ(i, actualPreset);
+ EXPECT_NO_FATAL_FAILURE(checkResult(retval));
+ if (!useAfterClose) {
+ EXPECT_EQ(i, actualPreset);
+ }
}
}
@@ -904,7 +1000,7 @@
using AllProperties =
::android::hardware::audio::effect::CPP_VERSION::IEqualizerEffect::AllProperties;
uint16_t numBands = 0;
- getNumBands(&numBands);
+ ASSERT_NO_FATAL_FAILURE(getNumBands(&numBands));
ASSERT_GT(numBands, 0);
AllProperties props;
props.bandLevels.resize(numBands);
@@ -919,7 +1015,7 @@
props.curPreset = -1;
Return<Result> ret = equalizer->setAllProperties(props);
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
+ EXPECT_NO_FATAL_FAILURE(checkResult(ret));
Return<void> ret2 = equalizer->getAllProperties([&](Result r, AllProperties p) {
retval = r;
if (retval == Result::OK) {
@@ -927,14 +1023,16 @@
}
});
EXPECT_TRUE(ret2.isOk());
- EXPECT_EQ(Result::OK, retval);
- EXPECT_EQ(props.bandLevels, actualProps.bandLevels);
+ EXPECT_NO_FATAL_FAILURE(checkResult(retval));
+ if (!useAfterClose) {
+ EXPECT_EQ(props.bandLevels, actualProps.bandLevels);
+ }
// Verify setting of the current preset via properties.
props.curPreset = 0; // Assuming there is at least one preset.
ret = equalizer->setAllProperties(props);
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
+ EXPECT_NO_FATAL_FAILURE(checkResult(ret));
ret2 = equalizer->getAllProperties([&](Result r, AllProperties p) {
retval = r;
if (retval == Result::OK) {
@@ -942,8 +1040,10 @@
}
});
EXPECT_TRUE(ret2.isOk());
- EXPECT_EQ(Result::OK, retval);
- EXPECT_EQ(props.curPreset, actualProps.curPreset);
+ EXPECT_NO_FATAL_FAILURE(checkResult(retval));
+ if (!useAfterClose) {
+ EXPECT_EQ(props.curPreset, actualProps.curPreset);
+ }
}
// The main test class for Equalizer Audio Effect HIDL HAL.
@@ -971,7 +1071,7 @@
const int32_t gain = 100;
Return<Result> ret = enhancer->setTargetGain(gain);
EXPECT_TRUE(ret.isOk());
- EXPECT_EQ(Result::OK, ret);
+ EXPECT_NO_FATAL_FAILURE(checkResult(ret));
int32_t actualGain = 0;
Result retval;
Return<void> ret2 = enhancer->getTargetGain([&](Result r, int32_t g) {
@@ -981,8 +1081,10 @@
}
});
EXPECT_TRUE(ret2.isOk());
- EXPECT_EQ(Result::OK, retval);
- EXPECT_EQ(gain, actualGain);
+ EXPECT_NO_FATAL_FAILURE(checkResult(retval));
+ if (!useAfterClose) {
+ EXPECT_EQ(gain, actualGain);
+ }
}
INSTANTIATE_TEST_SUITE_P(EffectsFactory, AudioEffectsFactoryHidlTest,
@@ -993,25 +1095,29 @@
Equalizer_IEffect, AudioEffectHidlTest,
::testing::Combine(::testing::ValuesIn(::android::hardware::getAllHalInstanceNames(
IEffectsFactory::descriptor)),
- ::testing::Values(EQUALIZER_EFFECT_TYPE)),
+ ::testing::Values(EQUALIZER_EFFECT_TYPE),
+ ::testing::Values(false, true) /*useAfterClose*/),
EffectParameterToString);
INSTANTIATE_TEST_SUITE_P(
LoudnessEnhancer_IEffect, AudioEffectHidlTest,
::testing::Combine(::testing::ValuesIn(::android::hardware::getAllHalInstanceNames(
IEffectsFactory::descriptor)),
- ::testing::Values(LOUDNESS_ENHANCER_EFFECT_TYPE)),
+ ::testing::Values(LOUDNESS_ENHANCER_EFFECT_TYPE),
+ ::testing::Values(false, true) /*useAfterClose*/),
EffectParameterToString);
INSTANTIATE_TEST_SUITE_P(
Equalizer, EqualizerAudioEffectHidlTest,
::testing::Combine(::testing::ValuesIn(::android::hardware::getAllHalInstanceNames(
IEffectsFactory::descriptor)),
- ::testing::Values(EQUALIZER_EFFECT_TYPE)),
+ ::testing::Values(EQUALIZER_EFFECT_TYPE),
+ ::testing::Values(false, true) /*useAfterClose*/),
EffectParameterToString);
INSTANTIATE_TEST_SUITE_P(
LoudnessEnhancer, LoudnessEnhancerAudioEffectHidlTest,
::testing::Combine(::testing::ValuesIn(::android::hardware::getAllHalInstanceNames(
IEffectsFactory::descriptor)),
- ::testing::Values(LOUDNESS_ENHANCER_EFFECT_TYPE)),
+ ::testing::Values(LOUDNESS_ENHANCER_EFFECT_TYPE),
+ ::testing::Values(false, true) /*useAfterClose*/),
EffectParameterToString);
// When the VTS test runs on a device lacking the corresponding HAL version the parameter
// list is empty, this isn't a problem.
diff --git a/audio/policy/1.0/vts/functional/Android.bp b/audio/policy/1.0/vts/functional/Android.bp
index cccb2fc..b32c223 100644
--- a/audio/policy/1.0/vts/functional/Android.bp
+++ b/audio/policy/1.0/vts/functional/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/audio/policy/1.0/xml/Android.bp b/audio/policy/1.0/xml/Android.bp
index 403278c..d644570 100644
--- a/audio/policy/1.0/xml/Android.bp
+++ b/audio/policy/1.0/xml/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/audio/policy/1.0/xml/pfw_schemas/Android.bp b/audio/policy/1.0/xml/pfw_schemas/Android.bp
index 225c065..18284e9 100644
--- a/audio/policy/1.0/xml/pfw_schemas/Android.bp
+++ b/audio/policy/1.0/xml/pfw_schemas/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/automotive/evs/aidl/Android.bp b/automotive/evs/aidl/Android.bp
index bafb4af..dfb15c6 100644
--- a/automotive/evs/aidl/Android.bp
+++ b/automotive/evs/aidl/Android.bp
@@ -30,7 +30,7 @@
stability: "vintf",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V4",
+ "android.hardware.graphics.common-V5",
],
backend: {
java: {
@@ -42,9 +42,6 @@
enabled: false,
},
ndk: {
- vndk: {
- enabled: false,
- },
min_sdk_version: "29",
},
},
@@ -53,14 +50,14 @@
version: "1",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V4",
+ "android.hardware.graphics.common-V5",
],
},
{
version: "2",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V4",
+ "android.hardware.graphics.common-V5",
],
},
diff --git a/automotive/evs/aidl/impl/default/Android.bp b/automotive/evs/aidl/impl/default/Android.bp
index f7f8b1d..7818804 100644
--- a/automotive/evs/aidl/impl/default/Android.bp
+++ b/automotive/evs/aidl/impl/default/Android.bp
@@ -22,24 +22,11 @@
default_applicable_licenses: ["hardware_interfaces_license"],
}
-cc_binary {
- name: "android.hardware.automotive.evs-aidl-default-service",
+cc_defaults {
+ name: "android.hardware.automotive.evs-aidl-default-service-default",
defaults: ["EvsHalDefaults"],
- vintf_fragments: ["manifest_evs-default-service.xml"],
- init_rc: ["evs-default-service.rc"],
- vendor: true,
- relative_install_path: "hw",
- cflags: [
- "-DGL_GLEXT_PROTOTYPES",
- "-DEGL_EGLEXT_PROTOTYPES",
- "-Wall",
- "-Wextra",
- "-Werror",
- "-Wthread-safety",
- ],
- srcs: [
- ":libgui_frame_event_aidl",
- "src/*.cpp",
+ header_libs: [
+ "libstagefright_headers",
],
shared_libs: [
"android.hardware.graphics.bufferqueue@1.0",
@@ -47,28 +34,63 @@
"android.hidl.token@1.0-utils",
"libEGL",
"libGLESv2",
- "libbase",
"libbinder_ndk",
"libbufferqueueconverter",
"libcamera_metadata",
"libhardware_legacy",
"libhidlbase",
- "liblog",
+ "libmediandk",
"libnativewindow",
"libtinyxml2",
"libui",
- "libutils",
"libyuv",
],
- static_libs: [
- "android.frameworks.automotive.display-V1-ndk",
+}
+
+cc_library {
+ name: "android.hardware.automotive.evs-aidl-default-service-lib",
+ defaults: ["android.hardware.automotive.evs-aidl-default-service-default"],
+ vendor: true,
+ cflags: [
+ "-DGL_GLEXT_PROTOTYPES",
+ "-DEGL_EGLEXT_PROTOTYPES",
+ ],
+ srcs: [
+ ":libgui_frame_event_aidl",
+ "src/*.cpp",
+ ],
+ exclude_srcs: ["src/service.cpp"],
+ whole_static_libs: [
+ "android.frameworks.automotive.display-V2-ndk",
"android.hardware.automotive.evs-V2-ndk",
"android.hardware.common-V2-ndk",
"libaidlcommonsupport",
"libcutils",
],
+ header_libs: [
+ "libgui_aidl_headers",
+ ],
local_include_dirs: ["include"],
include_dirs: ["frameworks/native/include/"],
+ export_include_dirs: ["include"],
+}
+
+cc_binary {
+ name: "android.hardware.automotive.evs-aidl-default-service",
+ defaults: ["android.hardware.automotive.evs-aidl-default-service-default"],
+ vintf_fragments: ["manifest_evs-default-service.xml"],
+ init_rc: ["evs-default-service.rc"],
+ vendor: true,
+ relative_install_path: "hw",
+ cflags: [
+ "-DGL_GLEXT_PROTOTYPES",
+ "-DEGL_EGLEXT_PROTOTYPES",
+ ],
+ srcs: ["src/service.cpp"],
+ static_libs: [
+ "android.hardware.automotive.evs-aidl-default-service-lib",
+ ],
+ include_dirs: ["frameworks/native/include/"],
required: ["evs_mock_hal_configuration.xml"],
}
@@ -78,3 +100,31 @@
src: "resources/evs_mock_configuration.xml",
sub_dir: "automotive/evs",
}
+
+cc_test {
+ name: "android.hardware.automotive.evs-aidl-default-service_cam_buffer_test",
+ defaults: ["android.hardware.automotive.evs-aidl-default-service-default"],
+ vendor: true,
+ srcs: ["tests/EvsCameraBufferTest.cpp"],
+ static_libs: [
+ "android.hardware.automotive.evs-aidl-default-service-lib",
+ "libgmock",
+ ],
+ test_suites: [
+ "general-tests",
+ ],
+}
+
+cc_test {
+ name: "android.hardware.automotive.evs-aidl-default-service_cam_state_test",
+ defaults: ["android.hardware.automotive.evs-aidl-default-service-default"],
+ vendor: true,
+ srcs: ["tests/EvsCameraStateTest.cpp"],
+ static_libs: [
+ "android.hardware.automotive.evs-aidl-default-service-lib",
+ "libgmock",
+ ],
+ test_suites: [
+ "general-tests",
+ ],
+}
diff --git a/automotive/evs/aidl/impl/default/include/ConfigManager.h b/automotive/evs/aidl/impl/default/include/ConfigManager.h
index 1d5fe77..37a17dc 100644
--- a/automotive/evs/aidl/impl/default/include/ConfigManager.h
+++ b/automotive/evs/aidl/impl/default/include/ConfigManager.h
@@ -25,8 +25,10 @@
#include <tinyxml2.h>
+#include <limits>
#include <string>
#include <string_view>
+#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <vector>
@@ -54,6 +56,15 @@
/* Camera device's capabilities and metadata */
class CameraInfo {
public:
+ enum class DeviceType : std::int32_t {
+ NONE = 0,
+ MOCK = 1,
+ V4L2 = 2,
+ VIDEO = 3,
+
+ UNKNOWN = std::numeric_limits<std::underlying_type_t<DeviceType>>::max(),
+ };
+
CameraInfo() : characteristics(nullptr) {}
virtual ~CameraInfo();
@@ -69,6 +80,10 @@
return characteristics != nullptr;
}
+ static DeviceType deviceTypeFromSV(const std::string_view sv);
+
+ DeviceType deviceType{DeviceType::NONE};
+
/*
* List of supported controls that the primary client can program.
* Paraemters are stored with its valid range
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/automotive/evs/aidl/impl/default/include/EvsAllCameras.h
similarity index 65%
copy from automotive/vehicle/aidl/impl/utils/test/Android.bp
copy to automotive/evs/aidl/impl/default/include/EvsAllCameras.h
index ad9954f..a76501d 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/automotive/evs/aidl/impl/default/include/EvsAllCameras.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -14,13 +14,7 @@
* limitations under the License.
*/
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
+#pragma once
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
-}
+#include "EvsMockCamera.h"
+#include "EvsVideoEmulatedCamera.h"
diff --git a/automotive/evs/aidl/impl/default/include/EvsCamera.h b/automotive/evs/aidl/impl/default/include/EvsCamera.h
new file mode 100644
index 0000000..539d5f6
--- /dev/null
+++ b/automotive/evs/aidl/impl/default/include/EvsCamera.h
@@ -0,0 +1,144 @@
+/*
+ * 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 "EvsCameraBase.h"
+
+#include <aidl/android/hardware/automotive/evs/IEvsCameraStream.h>
+#include <cutils/native_handle.h>
+
+#include <cstddef>
+#include <mutex>
+#include <utility>
+#include <vector>
+
+namespace aidl::android::hardware::automotive::evs::implementation {
+
+class EvsCamera : public EvsCameraBase {
+ private:
+ using Base = EvsCameraBase;
+ using Self = EvsCamera;
+
+ public:
+ using Base::Base;
+
+ ~EvsCamera() override;
+
+ // Methods from ::android::hardware::automotive::evs::IEvsCamera follow.
+ ndk::ScopedAStatus doneWithFrame(const std::vector<evs::BufferDesc>& buffers) override;
+
+ ndk::ScopedAStatus importExternalBuffers(const std::vector<evs::BufferDesc>& buffers,
+ int32_t* _aidl_return) override;
+
+ ndk::ScopedAStatus setMaxFramesInFlight(int32_t bufferCount) override;
+
+ ndk::ScopedAStatus startVideoStream(
+ const std::shared_ptr<evs::IEvsCameraStream>& receiver) override;
+
+ ndk::ScopedAStatus stopVideoStream() override;
+
+ ndk::ScopedAStatus pauseVideoStream() override;
+
+ ndk::ScopedAStatus resumeVideoStream() override;
+
+ protected:
+ virtual ::android::status_t allocateOneFrame(buffer_handle_t* handle) = 0;
+
+ virtual void freeOneFrame(const buffer_handle_t handle);
+
+ virtual bool preVideoStreamStart_locked(const std::shared_ptr<evs::IEvsCameraStream>& receiver,
+ ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck);
+
+ virtual bool startVideoStreamImpl_locked(const std::shared_ptr<evs::IEvsCameraStream>& receiver,
+ ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck) = 0;
+
+ virtual bool postVideoStreamStart_locked(const std::shared_ptr<evs::IEvsCameraStream>& receiver,
+ ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck);
+
+ virtual bool preVideoStreamStop_locked(ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck);
+
+ virtual bool stopVideoStreamImpl_locked(ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck) = 0;
+
+ virtual bool postVideoStreamStop_locked(ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck);
+
+ void shutdown() override;
+
+ void closeAllBuffers_unsafe();
+
+ // Returns (ID, handle) if succeeds. (kInvalidBufferID, nullptr) otherwise.
+ [[nodiscard]] std::pair<std::size_t, buffer_handle_t> useBuffer_unsafe();
+
+ void returnBuffer_unsafe(const std::size_t id);
+
+ bool increaseAvailableFrames_unsafe(const buffer_handle_t handle);
+
+ bool decreaseAvailableFrames_unsafe();
+
+ bool setAvailableFrames_unsafe(const std::size_t bufferCount);
+
+ void swapBufferFrames_unsafe(const std::size_t pos1, const std::size_t pos2);
+
+ struct BufferRecord {
+ BufferRecord() = default;
+ BufferRecord(const BufferRecord&) = default;
+ BufferRecord(BufferRecord&&) = default;
+ BufferRecord& operator=(const BufferRecord&) = default;
+ BufferRecord& operator=(BufferRecord&&) = default;
+ ~BufferRecord() = default;
+
+ explicit BufferRecord(buffer_handle_t h) : handle(h) {}
+
+ buffer_handle_t handle{nullptr};
+ bool inUse{false};
+ };
+
+ enum class StreamState {
+ STOPPED = 0,
+ RUNNING = 1,
+ STOPPING = 2,
+ DEAD = 3,
+ };
+
+ StreamState mStreamState{StreamState::STOPPED};
+
+ std::mutex mMutex;
+
+ // Graphics buffers to transfer images, always in the order of:
+ // In use buffers ... available buffers ... unavailable (unallocated) buffers.
+ std::vector<BufferRecord> mBuffers;
+
+ // Double-mapping between buffer position and ID.
+ std::vector<std::size_t> mBufferPosToId;
+ std::vector<std::size_t> mBufferIdToPos;
+
+ std::size_t mAvailableFrames{0};
+ std::size_t mFramesInUse{0};
+
+ // We use all 1's as a reserved invalid buffer ID.
+ static constexpr std::size_t kInvalidBufferID = ~static_cast<std::size_t>(0);
+
+ public:
+ static bool IsBufferIDValid(const std::size_t bufferId) { return ~bufferId; }
+};
+
+} // namespace aidl::android::hardware::automotive::evs::implementation
diff --git a/automotive/evs/aidl/impl/default/include/EvsCameraBase.h b/automotive/evs/aidl/impl/default/include/EvsCameraBase.h
new file mode 100644
index 0000000..c3e9dfc
--- /dev/null
+++ b/automotive/evs/aidl/impl/default/include/EvsCameraBase.h
@@ -0,0 +1,43 @@
+/*
+ * 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 <aidl/android/hardware/automotive/evs/BnEvsCamera.h>
+
+namespace aidl::android::hardware::automotive::evs::implementation {
+
+class EvsCameraBase : public evs::BnEvsCamera {
+ private:
+ using Base = evs::BnEvsCamera;
+ using Self = EvsCameraBase;
+
+ public:
+ using Base::Base;
+
+ ~EvsCameraBase() override = default;
+
+ virtual void shutdown() = 0;
+
+ protected:
+ // This is used for the derived classes and it prevents constructors from direct access
+ // while it allows this class to be instantiated via ndk::SharedRefBase::make<>.
+ struct Sigil {
+ explicit Sigil() = default;
+ };
+};
+
+} // namespace aidl::android::hardware::automotive::evs::implementation
diff --git a/automotive/evs/aidl/impl/default/include/EvsEnumerator.h b/automotive/evs/aidl/impl/default/include/EvsEnumerator.h
index 259c266..9dcc774 100644
--- a/automotive/evs/aidl/impl/default/include/EvsEnumerator.h
+++ b/automotive/evs/aidl/impl/default/include/EvsEnumerator.h
@@ -17,8 +17,8 @@
#pragma once
#include "ConfigManager.h"
+#include "EvsCameraBase.h"
#include "EvsGlDisplay.h"
-#include "EvsMockCamera.h"
#include <aidl/android/frameworks/automotive/display/ICarDisplayProxy.h>
#include <aidl/android/hardware/automotive/evs/BnEvsEnumerator.h>
@@ -27,6 +27,7 @@
#include <aidl/android/hardware/automotive/evs/IEvsCamera.h>
#include <aidl/android/hardware/automotive/evs/IEvsEnumeratorStatusCallback.h>
#include <aidl/android/hardware/automotive/evs/Stream.h>
+#include <android-base/thread_annotations.h>
#include <utils/Thread.h>
#include <atomic>
@@ -72,7 +73,7 @@
private:
struct CameraRecord {
evs::CameraDesc desc;
- std::weak_ptr<EvsMockCamera> activeInstance;
+ std::weak_ptr<EvsCameraBase> activeInstance;
CameraRecord(const char* cameraId) : desc() { desc.id = cameraId; }
};
diff --git a/automotive/evs/aidl/impl/default/include/EvsGlDisplay.h b/automotive/evs/aidl/impl/default/include/EvsGlDisplay.h
index ceabd9e..0865a04 100644
--- a/automotive/evs/aidl/impl/default/include/EvsGlDisplay.h
+++ b/automotive/evs/aidl/impl/default/include/EvsGlDisplay.h
@@ -23,6 +23,7 @@
#include <aidl/android/hardware/automotive/evs/BufferDesc.h>
#include <aidl/android/hardware/automotive/evs/DisplayDesc.h>
#include <aidl/android/hardware/automotive/evs/DisplayState.h>
+#include <android-base/thread_annotations.h>
#include <thread>
diff --git a/automotive/evs/aidl/impl/default/include/EvsMockCamera.h b/automotive/evs/aidl/impl/default/include/EvsMockCamera.h
index 7e010a2..cd68532 100644
--- a/automotive/evs/aidl/impl/default/include/EvsMockCamera.h
+++ b/automotive/evs/aidl/impl/default/include/EvsMockCamera.h
@@ -17,36 +17,36 @@
#pragma once
#include "ConfigManager.h"
+#include "EvsCamera.h"
-#include <aidl/android/hardware/automotive/evs/BnEvsCamera.h>
-#include <aidl/android/hardware/automotive/evs/BufferDesc.h>
#include <aidl/android/hardware/automotive/evs/CameraDesc.h>
#include <aidl/android/hardware/automotive/evs/CameraParam.h>
-#include <aidl/android/hardware/automotive/evs/EvsResult.h>
#include <aidl/android/hardware/automotive/evs/IEvsCameraStream.h>
#include <aidl/android/hardware/automotive/evs/IEvsDisplay.h>
#include <aidl/android/hardware/automotive/evs/ParameterRange.h>
#include <aidl/android/hardware/automotive/evs/Stream.h>
-// #include <android-base/result.h>
#include <android/hardware_buffer.h>
#include <ui/GraphicBuffer.h>
-#include <functional>
+#include <cstdint>
+#include <memory>
#include <thread>
+#include <unordered_map>
+#include <vector>
namespace aidl::android::hardware::automotive::evs::implementation {
-class EvsMockCamera : public evs::BnEvsCamera {
- // This prevents constructors from direct access while it allows this class to
- // be instantiated via ndk::SharedRefBase::make<>.
+class EvsMockCamera : public EvsCamera {
private:
- struct Sigil {
- explicit Sigil() = default;
- };
+ using Base = EvsCamera;
public:
+ EvsMockCamera(Sigil sigil, const char* deviceName,
+ std::unique_ptr<ConfigManager::CameraInfo>& camInfo);
+ EvsMockCamera(const EvsMockCamera&) = delete;
+ EvsMockCamera& operator=(const EvsMockCamera&) = delete;
+
// Methods from ::android::hardware::automotive::evs::IEvsCamera follow.
- ndk::ScopedAStatus doneWithFrame(const std::vector<evs::BufferDesc>& buffers) override;
ndk::ScopedAStatus forcePrimaryClient(
const std::shared_ptr<evs::IEvsDisplay>& display) override;
ndk::ScopedAStatus getCameraInfo(evs::CameraDesc* _aidl_return) override;
@@ -58,47 +58,37 @@
ndk::ScopedAStatus getParameterList(std::vector<evs::CameraParam>* _aidl_return) override;
ndk::ScopedAStatus getPhysicalCameraInfo(const std::string& deviceId,
evs::CameraDesc* _aidl_return) override;
- ndk::ScopedAStatus importExternalBuffers(const std::vector<evs::BufferDesc>& buffers,
- int32_t* _aidl_return) override;
- ndk::ScopedAStatus pauseVideoStream() override;
- ndk::ScopedAStatus resumeVideoStream() override;
ndk::ScopedAStatus setExtendedInfo(int32_t opaqueIdentifier,
const std::vector<uint8_t>& opaqueValue) override;
ndk::ScopedAStatus setIntParameter(evs::CameraParam id, int32_t value,
std::vector<int32_t>* effectiveValue) override;
ndk::ScopedAStatus setPrimaryClient() override;
- ndk::ScopedAStatus setMaxFramesInFlight(int32_t bufferCount) override;
- ndk::ScopedAStatus startVideoStream(
- const std::shared_ptr<evs::IEvsCameraStream>& receiver) override;
- ndk::ScopedAStatus stopVideoStream() override;
ndk::ScopedAStatus unsetPrimaryClient() override;
+ const evs::CameraDesc& getDesc() { return mDescription; }
+
static std::shared_ptr<EvsMockCamera> Create(const char* deviceName);
static std::shared_ptr<EvsMockCamera> Create(
const char* deviceName, std::unique_ptr<ConfigManager::CameraInfo>& camInfo,
const evs::Stream* streamCfg = nullptr);
- EvsMockCamera(const EvsMockCamera&) = delete;
- EvsMockCamera& operator=(const EvsMockCamera&) = delete;
-
- virtual ~EvsMockCamera() override;
- void shutdown();
-
- const evs::CameraDesc& getDesc() { return mDescription; }
-
- // Constructors
- EvsMockCamera(Sigil sigil, const char* deviceName,
- std::unique_ptr<ConfigManager::CameraInfo>& camInfo);
private:
- // These three functions are expected to be called while mAccessLock is held
- bool setAvailableFrames_Locked(unsigned bufferCount);
- unsigned increaseAvailableFrames_Locked(unsigned numToAdd);
- unsigned decreaseAvailableFrames_Locked(unsigned numToRemove);
-
void generateFrames();
void fillMockFrame(buffer_handle_t handle, const AHardwareBuffer_Desc* pDesc);
- void returnBufferLocked(const uint32_t bufferId);
- ndk::ScopedAStatus stopVideoStream_impl();
+
+ ::android::status_t allocateOneFrame(buffer_handle_t* handle) override;
+
+ bool startVideoStreamImpl_locked(const std::shared_ptr<evs::IEvsCameraStream>& receiver,
+ ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck) override;
+
+ bool stopVideoStreamImpl_locked(ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck) override;
+
+ bool postVideoStreamStop_locked(ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck) override;
+
+ void initializeParameters();
CameraDesc mDescription = {}; // The properties of this camera
@@ -119,28 +109,6 @@
// Bytes per line in the buffers
uint32_t mStride = 0;
- struct BufferRecord {
- buffer_handle_t handle;
- bool inUse;
-
- explicit BufferRecord(buffer_handle_t h) : handle(h), inUse(false){};
- };
-
- std::vector<BufferRecord> mBuffers; // Graphics buffers to transfer images
- unsigned mFramesAllowed; // How many buffers are we currently using
- unsigned mFramesInUse; // How many buffers are currently outstanding
-
- enum StreamStateValues {
- STOPPED,
- RUNNING,
- STOPPING,
- DEAD,
- };
- StreamStateValues mStreamState;
-
- // Synchronization necessary to deconflict mCaptureThread from the main service thread
- std::mutex mAccessLock;
-
// Static camera module information
std::unique_ptr<ConfigManager::CameraInfo>& mCameraInfo;
@@ -160,7 +128,6 @@
int32_t value;
};
std::unordered_map<CameraParam, std::shared_ptr<CameraParameterDesc>> mParams;
- void initializeParameters();
};
} // namespace aidl::android::hardware::automotive::evs::implementation
diff --git a/automotive/evs/aidl/impl/default/include/EvsVideoEmulatedCamera.h b/automotive/evs/aidl/impl/default/include/EvsVideoEmulatedCamera.h
new file mode 100644
index 0000000..a850d65
--- /dev/null
+++ b/automotive/evs/aidl/impl/default/include/EvsVideoEmulatedCamera.h
@@ -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.
+ */
+
+#pragma once
+
+#include "ConfigManager.h"
+#include "EvsCamera.h"
+
+#include <aidl/android/hardware/automotive/evs/BufferDesc.h>
+#include <aidl/android/hardware/automotive/evs/CameraDesc.h>
+#include <aidl/android/hardware/automotive/evs/CameraParam.h>
+#include <aidl/android/hardware/automotive/evs/IEvsCameraStream.h>
+#include <aidl/android/hardware/automotive/evs/IEvsDisplay.h>
+#include <aidl/android/hardware/automotive/evs/ParameterRange.h>
+#include <aidl/android/hardware/automotive/evs/Stream.h>
+#include <media/NdkMediaExtractor.h>
+
+#include <ui/GraphicBuffer.h>
+
+#include <cstdint>
+#include <memory>
+#include <thread>
+#include <unordered_map>
+#include <vector>
+
+namespace aidl::android::hardware::automotive::evs::implementation {
+
+class EvsVideoEmulatedCamera : public EvsCamera {
+ private:
+ using Base = EvsCamera;
+
+ public:
+ EvsVideoEmulatedCamera(Sigil sigil, const char* deviceName,
+ std::unique_ptr<ConfigManager::CameraInfo>& camInfo);
+
+ ~EvsVideoEmulatedCamera() override = default;
+
+ // Methods from ::android::hardware::automotive::evs::IEvsCamera follow.
+ ndk::ScopedAStatus forcePrimaryClient(
+ const std::shared_ptr<evs::IEvsDisplay>& display) override;
+ ndk::ScopedAStatus getCameraInfo(evs::CameraDesc* _aidl_return) override;
+ ndk::ScopedAStatus getExtendedInfo(int32_t opaqueIdentifier,
+ std::vector<uint8_t>* value) override;
+ ndk::ScopedAStatus getIntParameter(evs::CameraParam id, std::vector<int32_t>* value) override;
+ ndk::ScopedAStatus getIntParameterRange(evs::CameraParam id,
+ evs::ParameterRange* _aidl_return) override;
+ ndk::ScopedAStatus getParameterList(std::vector<evs::CameraParam>* _aidl_return) override;
+ ndk::ScopedAStatus getPhysicalCameraInfo(const std::string& deviceId,
+ evs::CameraDesc* _aidl_return) override;
+ ndk::ScopedAStatus setExtendedInfo(int32_t opaqueIdentifier,
+ const std::vector<uint8_t>& opaqueValue) override;
+ ndk::ScopedAStatus setIntParameter(evs::CameraParam id, int32_t value,
+ std::vector<int32_t>* effectiveValue) override;
+ ndk::ScopedAStatus setPrimaryClient() override;
+ ndk::ScopedAStatus unsetPrimaryClient() override;
+
+ // Methods from EvsCameraBase follow.
+ void shutdown() override;
+
+ const evs::CameraDesc& getDesc() { return mDescription; }
+
+ static std::shared_ptr<EvsVideoEmulatedCamera> Create(const char* deviceName);
+ static std::shared_ptr<EvsVideoEmulatedCamera> Create(
+ const char* deviceName, std::unique_ptr<ConfigManager::CameraInfo>& camInfo,
+ const evs::Stream* streamCfg = nullptr);
+
+ private:
+ // For the camera parameters.
+ struct CameraParameterDesc {
+ CameraParameterDesc(int min = 0, int max = 0, int step = 0, int value = 0) {
+ this->range.min = min;
+ this->range.max = max;
+ this->range.step = step;
+ this->value = value;
+ }
+
+ ParameterRange range;
+ int32_t value;
+ };
+
+ bool initialize();
+
+ void generateFrames();
+
+ void renderOneFrame();
+
+ void initializeParameters();
+
+ void onCodecInputAvailable(const int32_t index);
+
+ void onCodecOutputAvailable(const int32_t index, const AMediaCodecBufferInfo& info);
+
+ ::android::status_t allocateOneFrame(buffer_handle_t* handle) override;
+
+ bool startVideoStreamImpl_locked(const std::shared_ptr<evs::IEvsCameraStream>& receiver,
+ ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck) override;
+
+ bool stopVideoStreamImpl_locked(ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck) override;
+
+ bool postVideoStreamStop_locked(ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck) override;
+
+ // The properties of this camera.
+ CameraDesc mDescription = {};
+
+ std::thread mCaptureThread;
+
+ // The callback used to deliver each frame
+ std::shared_ptr<evs::IEvsCameraStream> mStream;
+
+ std::string mVideoFileName;
+ // Media decoder resources - Owned by mDecoderThead when thread is running.
+ int mVideoFd = 0;
+
+ struct AMediaExtractorDeleter {
+ void operator()(AMediaExtractor* extractor) const { AMediaExtractor_delete(extractor); }
+ };
+ struct AMediaCodecDeleter {
+ void operator()(AMediaCodec* codec) const { AMediaCodec_delete(codec); }
+ };
+
+ std::unique_ptr<AMediaExtractor, AMediaExtractorDeleter> mVideoExtractor;
+ std::unique_ptr<AMediaCodec, AMediaCodecDeleter> mVideoCodec;
+
+ // Horizontal pixel count in the buffers
+ int32_t mWidth = 0;
+ // Vertical pixel count in the buffers
+ int32_t mHeight = 0;
+ // Values from android_pixel_format_t
+ uint32_t mFormat = 0;
+ // Values from from Gralloc.h
+ uint64_t mUsage = 0;
+ // Bytes per line in the buffers
+ uint32_t mStride = 0;
+
+ // Camera parameters.
+ std::unordered_map<CameraParam, std::shared_ptr<CameraParameterDesc>> mParams;
+
+ // Static camera module information
+ std::unique_ptr<ConfigManager::CameraInfo>& mCameraInfo;
+
+ // For the extended info
+ std::unordered_map<uint32_t, std::vector<uint8_t>> mExtInfo;
+};
+
+} // namespace aidl::android::hardware::automotive::evs::implementation
diff --git a/automotive/evs/aidl/impl/default/include/GlWrapper.h b/automotive/evs/aidl/impl/default/include/GlWrapper.h
index adb250c..7ff6104 100644
--- a/automotive/evs/aidl/impl/default/include/GlWrapper.h
+++ b/automotive/evs/aidl/impl/default/include/GlWrapper.h
@@ -25,7 +25,7 @@
#include <aidl/android/frameworks/automotive/display/ICarDisplayProxy.h>
#include <aidl/android/hardware/automotive/evs/BufferDesc.h>
#include <android-base/logging.h>
-#include <bufferqueueconverter/BufferQueueConverter.h>
+#include <cutils/native_handle.h>
namespace aidl::android::hardware::automotive::evs::implementation {
@@ -33,7 +33,6 @@
class GlWrapper {
public:
- GlWrapper() : mSurfaceHolder(::android::SurfaceHolderUniquePtr(nullptr, nullptr)) {}
bool initialize(const std::shared_ptr<automotivedisplay::ICarDisplayProxy>& svc,
uint64_t displayId);
void shutdown();
@@ -53,9 +52,6 @@
unsigned getHeight() { return mHeight; };
private:
- ::android::sp<::android::hardware::graphics::bufferqueue::V2_0::IGraphicBufferProducer>
- mGfxBufferProducer;
-
EGLDisplay mDisplay;
EGLSurface mSurface;
EGLContext mContext;
@@ -71,9 +67,6 @@
// Opaque handle for a native hardware buffer defined in
// frameworks/native/opengl/include/EGL/eglplatform.h
ANativeWindow* mWindow;
-
- // Pointer to a Surface wrapper.
- ::android::SurfaceHolderUniquePtr mSurfaceHolder;
};
} // namespace aidl::android::hardware::automotive::evs::implementation
diff --git a/automotive/evs/aidl/impl/default/src/ConfigManager.cpp b/automotive/evs/aidl/impl/default/src/ConfigManager.cpp
index da791ed..ba4cdc0 100644
--- a/automotive/evs/aidl/impl/default/src/ConfigManager.cpp
+++ b/automotive/evs/aidl/impl/default/src/ConfigManager.cpp
@@ -40,6 +40,18 @@
std::string_view ConfigManager::sConfigOverridePath =
"/vendor/etc/automotive/evs/evs_configuration_override.xml";
+ConfigManager::CameraInfo::DeviceType ConfigManager::CameraInfo::deviceTypeFromSV(
+ const std::string_view sv) {
+ using namespace std::string_view_literals;
+ static const std::unordered_map<std::string_view, DeviceType> nameToType = {
+ {"mock"sv, DeviceType::MOCK},
+ {"v4l2"sv, DeviceType::V4L2},
+ {"video"sv, DeviceType::VIDEO},
+ };
+ const auto search = nameToType.find(sv);
+ return search == nameToType.end() ? DeviceType::UNKNOWN : search->second;
+}
+
void ConfigManager::printElementNames(const XMLElement* rootElem, const std::string& prefix) const {
const XMLElement* curElem = rootElem;
@@ -128,6 +140,10 @@
return false;
}
+ if (const auto typeAttr = aDeviceElem->FindAttribute("type")) {
+ aCamera->deviceType = CameraInfo::deviceTypeFromSV(typeAttr->Value());
+ }
+
/* size information to allocate camera_metadata_t */
size_t totalEntries = 0;
size_t totalDataSize = 0;
diff --git a/automotive/evs/aidl/impl/default/src/EvsCamera.cpp b/automotive/evs/aidl/impl/default/src/EvsCamera.cpp
new file mode 100644
index 0000000..bc3bfdd
--- /dev/null
+++ b/automotive/evs/aidl/impl/default/src/EvsCamera.cpp
@@ -0,0 +1,378 @@
+/*
+ * 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 "EvsCamera.h"
+
+#include <aidl/android/hardware/automotive/evs/EvsResult.h>
+#include <aidlcommonsupport/NativeHandle.h>
+#include <android-base/logging.h>
+#include <android/hardware_buffer.h>
+#include <ui/GraphicBufferAllocator.h>
+#include <ui/GraphicBufferMapper.h>
+
+#include <cstddef>
+#include <mutex>
+
+namespace aidl::android::hardware::automotive::evs::implementation {
+
+// Arbitrary limit on number of graphics buffers allowed to be allocated
+// Safeguards against unreasonable resource consumption and provides a testable limit
+constexpr std::size_t kMaxBuffersInFlight = 100;
+
+// Minimum number of buffers to run a video stream
+constexpr int kMinimumBuffersInFlight = 1;
+
+EvsCamera::~EvsCamera() {
+ shutdown();
+}
+
+ndk::ScopedAStatus EvsCamera::doneWithFrame(const std::vector<evs::BufferDesc>& buffers) {
+ std::lock_guard lck(mMutex);
+ for (const auto& desc : buffers) {
+ returnBuffer_unsafe(desc.bufferId);
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus EvsCamera::importExternalBuffers(const std::vector<evs::BufferDesc>& buffers,
+ int32_t* _aidl_return) {
+ if (buffers.empty()) {
+ LOG(DEBUG) << __func__
+ << ": Ignoring a request to import external buffers with an empty list.";
+ return ndk::ScopedAStatus::ok();
+ }
+ static auto& mapper = ::android::GraphicBufferMapper::get();
+ std::lock_guard lck(mMutex);
+ std::size_t numBuffersToAdd = std::min(buffers.size(), kMaxBuffersInFlight - mAvailableFrames);
+ if (numBuffersToAdd == 0) {
+ LOG(WARNING) << __func__ << ": The number of buffers has hit the upper limit ("
+ << kMaxBuffersInFlight << "). Stop importing.";
+ return ndk::ScopedAStatus::ok();
+ } else if (numBuffersToAdd < buffers.size()) {
+ LOG(WARNING) << "Exceeds the limit on the number of buffers. Only " << numBuffersToAdd
+ << " buffers will be imported. " << buffers.size() << " are asked.";
+ }
+ const size_t before = mAvailableFrames;
+ for (std::size_t idx = 0; idx < numBuffersToAdd; ++idx) {
+ auto& buffer = buffers[idx];
+ const AHardwareBuffer_Desc* pDesc =
+ reinterpret_cast<const AHardwareBuffer_Desc*>(&buffer.buffer.description);
+
+ buffer_handle_t handleToImport = ::android::dupFromAidl(buffer.buffer.handle);
+ buffer_handle_t handleToStore = nullptr;
+ if (handleToImport == nullptr) {
+ LOG(WARNING) << "Failed to duplicate a memory handle. Ignoring a buffer "
+ << buffer.bufferId;
+ continue;
+ }
+
+ ::android::status_t result =
+ mapper.importBuffer(handleToImport, pDesc->width, pDesc->height, pDesc->layers,
+ pDesc->format, pDesc->usage, pDesc->stride, &handleToStore);
+ if (result != ::android::NO_ERROR || handleToStore == nullptr ||
+ !increaseAvailableFrames_unsafe(handleToStore)) {
+ LOG(WARNING) << "Failed to import a buffer " << buffer.bufferId;
+ }
+ }
+ *_aidl_return = mAvailableFrames - before;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus EvsCamera::setMaxFramesInFlight(int32_t bufferCount) {
+ std::lock_guard lock(mMutex);
+ if (bufferCount < 1) {
+ LOG(ERROR) << "Ignoring setMaxFramesInFlight with less than one buffer requested.";
+ return ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int>(EvsResult::INVALID_ARG));
+ }
+ if (!setAvailableFrames_unsafe(bufferCount)) {
+ LOG(ERROR) << "Failed to adjust the maximum number of frames in flight.";
+ return ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int>(EvsResult::BUFFER_NOT_AVAILABLE));
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+void EvsCamera::freeOneFrame(const buffer_handle_t handle) {
+ static auto& alloc = ::android::GraphicBufferAllocator::get();
+ alloc.free(handle);
+}
+
+bool EvsCamera::preVideoStreamStart_locked(const std::shared_ptr<evs::IEvsCameraStream>& receiver,
+ ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& /* lck */) {
+ if (!receiver) {
+ LOG(ERROR) << __func__ << ": Null receiver.";
+ status = ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int>(EvsResult::INVALID_ARG));
+ return false;
+ }
+
+ // If we've been displaced by another owner of the camera, then we can't do anything else
+ if (mStreamState == StreamState::DEAD) {
+ LOG(ERROR) << __func__ << ": Ignoring when camera has been lost.";
+ status = ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int>(EvsResult::OWNERSHIP_LOST));
+ return false;
+ }
+
+ if (mStreamState != StreamState::STOPPED) {
+ LOG(ERROR) << __func__ << ": Ignoring when a stream is already running.";
+ status = ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int>(EvsResult::STREAM_ALREADY_RUNNING));
+ return false;
+ }
+
+ // If the client never indicated otherwise, configure ourselves for a single streaming buffer
+ if (mAvailableFrames < kMinimumBuffersInFlight &&
+ !setAvailableFrames_unsafe(kMinimumBuffersInFlight)) {
+ LOG(ERROR) << __func__ << "Failed to because we could not get a graphics buffer.";
+ status = ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int>(EvsResult::BUFFER_NOT_AVAILABLE));
+ return false;
+ }
+ mStreamState = StreamState::RUNNING;
+ return true;
+}
+
+bool EvsCamera::postVideoStreamStart_locked(
+ const std::shared_ptr<evs::IEvsCameraStream>& /* receiver */,
+ ndk::ScopedAStatus& /* status */, std::unique_lock<std::mutex>& /* lck */) {
+ return true;
+}
+
+bool EvsCamera::preVideoStreamStop_locked(ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& /* lck */) {
+ if (mStreamState != StreamState::RUNNING) {
+ // Terminate the stop process because a stream is not running.
+ status = ndk::ScopedAStatus::ok();
+ return false;
+ }
+ mStreamState = StreamState::STOPPING;
+ return true;
+}
+
+bool EvsCamera::postVideoStreamStop_locked(ndk::ScopedAStatus& /* status */,
+ std::unique_lock<std::mutex>& /* lck */) {
+ mStreamState = StreamState::STOPPED;
+ return true;
+}
+
+ndk::ScopedAStatus EvsCamera::startVideoStream(
+ const std::shared_ptr<evs::IEvsCameraStream>& receiver) {
+ bool needShutdown = false;
+ auto status = ndk::ScopedAStatus::ok();
+ {
+ std::unique_lock lck(mMutex);
+ if (!preVideoStreamStart_locked(receiver, status, lck)) {
+ return status;
+ }
+
+ if ((!startVideoStreamImpl_locked(receiver, status, lck) ||
+ !postVideoStreamStart_locked(receiver, status, lck)) &&
+ !status.isOk()) {
+ needShutdown = true;
+ }
+ }
+ if (needShutdown) {
+ shutdown();
+ }
+ return status;
+}
+
+ndk::ScopedAStatus EvsCamera::stopVideoStream() {
+ bool needShutdown = false;
+ auto status = ndk::ScopedAStatus::ok();
+ {
+ std::unique_lock lck(mMutex);
+ if ((!preVideoStreamStop_locked(status, lck) || !stopVideoStreamImpl_locked(status, lck) ||
+ !postVideoStreamStop_locked(status, lck)) &&
+ !status.isOk()) {
+ needShutdown = true;
+ }
+ }
+ if (needShutdown) {
+ shutdown();
+ }
+ return status;
+}
+
+ndk::ScopedAStatus EvsCamera::pauseVideoStream() {
+ return ndk::ScopedAStatus::fromServiceSpecificError(static_cast<int>(EvsResult::NOT_SUPPORTED));
+}
+
+ndk::ScopedAStatus EvsCamera::resumeVideoStream() {
+ return ndk::ScopedAStatus::fromServiceSpecificError(static_cast<int>(EvsResult::NOT_SUPPORTED));
+}
+
+bool EvsCamera::setAvailableFrames_unsafe(const std::size_t bufferCount) {
+ if (bufferCount < 1) {
+ LOG(ERROR) << "Ignoring request to set buffer count to zero.";
+ return false;
+ }
+ if (bufferCount > kMaxBuffersInFlight) {
+ LOG(ERROR) << "Rejecting buffer request in excess of internal limit";
+ return false;
+ }
+
+ if (bufferCount > mAvailableFrames) {
+ bool success = true;
+ const std::size_t numBufferBeforeAlloc = mAvailableFrames;
+ for (int numBufferToAllocate = bufferCount - mAvailableFrames;
+ success && numBufferToAllocate > 0; --numBufferToAllocate) {
+ buffer_handle_t handle = nullptr;
+ const auto result = allocateOneFrame(&handle);
+ if (result != ::android::NO_ERROR || !handle) {
+ LOG(ERROR) << __func__ << ": Failed to allocate a graphics buffer. Error " << result
+ << ", handle: " << handle;
+ success = false;
+ break;
+ }
+ success &= increaseAvailableFrames_unsafe(handle);
+ }
+ if (!success) {
+ // Rollback when failure.
+ for (int numBufferToRelease = mAvailableFrames - numBufferBeforeAlloc;
+ numBufferToRelease > 0; --numBufferToRelease) {
+ decreaseAvailableFrames_unsafe();
+ }
+ return false;
+ }
+ } else {
+ for (int numBufferToRelease = mAvailableFrames - std::max(bufferCount, mFramesInUse);
+ numBufferToRelease > 0; --numBufferToRelease) {
+ decreaseAvailableFrames_unsafe();
+ }
+ if (mAvailableFrames > bufferCount) {
+ // This shouldn't happen with a properly behaving client because the client
+ // should only make this call after returning sufficient outstanding buffers
+ // to allow a clean resize.
+ LOG(ERROR) << "Buffer queue shrink failed, asked: " << bufferCount
+ << ", actual: " << mAvailableFrames
+ << " -- too many buffers currently in use?";
+ }
+ }
+ return true;
+}
+
+void EvsCamera::shutdown() {
+ stopVideoStream();
+ std::lock_guard lck(mMutex);
+ closeAllBuffers_unsafe();
+ mStreamState = StreamState::DEAD;
+}
+
+void EvsCamera::closeAllBuffers_unsafe() {
+ if (mFramesInUse > 0) {
+ LOG(WARNING) << __func__ << ": Closing while " << mFramesInUse
+ << " frame(s) are still in use.";
+ }
+ for (auto& buffer : mBuffers) {
+ freeOneFrame(buffer.handle);
+ buffer.handle = nullptr;
+ }
+ mBuffers.clear();
+ mBufferPosToId.clear();
+ mBufferIdToPos.clear();
+}
+
+std::pair<std::size_t, buffer_handle_t> EvsCamera::useBuffer_unsafe() {
+ if (mFramesInUse >= mAvailableFrames) {
+ DCHECK_EQ(mFramesInUse, mAvailableFrames);
+ return {kInvalidBufferID, nullptr};
+ }
+ const std::size_t pos = mFramesInUse++;
+ auto& buffer = mBuffers[pos];
+ DCHECK(!buffer.inUse);
+ DCHECK(buffer.handle);
+ buffer.inUse = true;
+ return {mBufferPosToId[pos], buffer.handle};
+}
+
+void EvsCamera::returnBuffer_unsafe(const std::size_t id) {
+ if (id >= mBuffers.size()) {
+ LOG(ERROR) << __func__ << ": ID out-of-bound. id: " << id
+ << " max: " << mBuffers.size() - 1;
+ return;
+ }
+ const std::size_t pos = mBufferIdToPos[id];
+
+ if (!mBuffers[pos].inUse) {
+ LOG(ERROR) << __func__ << ": Ignoring returning frame " << id << " which is already free.";
+ return;
+ }
+ DCHECK_LT(pos, mFramesInUse);
+ const std::size_t last_in_use_pos = --mFramesInUse;
+ swapBufferFrames_unsafe(pos, last_in_use_pos);
+ mBuffers[last_in_use_pos].inUse = false;
+}
+
+bool EvsCamera::increaseAvailableFrames_unsafe(const buffer_handle_t handle) {
+ if (mAvailableFrames >= kMaxBuffersInFlight) {
+ LOG(WARNING) << __func__ << ": The number of buffers has hit the upper limit ("
+ << kMaxBuffersInFlight << "). Stop increasing.";
+ return false;
+ }
+ const std::size_t pos = mAvailableFrames++;
+ if (mAvailableFrames > mBuffers.size()) {
+ const std::size_t oldBufferSize = mBuffers.size();
+ mBuffers.resize(mAvailableFrames);
+ mBufferPosToId.resize(mAvailableFrames);
+ mBufferIdToPos.resize(mAvailableFrames);
+ // Build position/ID mapping.
+ for (std::size_t idx = oldBufferSize; idx < mBuffers.size(); ++idx) {
+ mBufferPosToId[idx] = idx;
+ mBufferIdToPos[idx] = idx;
+ }
+ }
+ auto& buffer = mBuffers[pos];
+ DCHECK(!buffer.inUse);
+ DCHECK(!buffer.handle);
+ buffer.handle = handle;
+ return true;
+}
+
+bool EvsCamera::decreaseAvailableFrames_unsafe() {
+ if (mFramesInUse >= mAvailableFrames) {
+ DCHECK_EQ(mFramesInUse, mAvailableFrames);
+ return false;
+ }
+ const std::size_t pos = --mAvailableFrames;
+ auto& buffer = mBuffers[pos];
+ DCHECK(!buffer.inUse);
+ DCHECK(buffer.handle);
+ freeOneFrame(buffer.handle);
+ buffer.handle = nullptr;
+ return true;
+}
+
+void EvsCamera::swapBufferFrames_unsafe(const std::size_t pos1, const std::size_t pos2) {
+ if (pos1 == pos2) {
+ return;
+ }
+ if (pos1 >= mBuffers.size() || pos2 >= mBuffers.size()) {
+ LOG(ERROR) << __func__ << ": Index out-of-bound. pos1: " << pos1 << ", pos2: " << pos2
+ << ", buffer size: " << mBuffers.size();
+ return;
+ }
+ const std::size_t id1 = mBufferPosToId[pos1];
+ const std::size_t id2 = mBufferPosToId[pos2];
+ std::swap(mBufferPosToId[pos1], mBufferPosToId[pos2]);
+ std::swap(mBufferIdToPos[id1], mBufferIdToPos[id2]);
+ std::swap(mBuffers[pos1], mBuffers[pos2]);
+}
+
+} // namespace aidl::android::hardware::automotive::evs::implementation
diff --git a/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp b/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp
index 5178958..80e72a7 100644
--- a/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp
+++ b/automotive/evs/aidl/impl/default/src/EvsEnumerator.cpp
@@ -17,8 +17,9 @@
#include "EvsEnumerator.h"
#include "ConfigManager.h"
+#include "EvsAllCameras.h"
+#include "EvsCameraBase.h"
#include "EvsGlDisplay.h"
-#include "EvsMockCamera.h"
#include <aidl/android/hardware/automotive/evs/EvsResult.h>
#include <aidl/android/hardware/graphics/common/BufferUsage.h>
@@ -243,7 +244,7 @@
}
// Has this camera already been instantiated by another caller?
- std::shared_ptr<EvsMockCamera> pActiveCamera = pRecord->activeInstance.lock();
+ std::shared_ptr<EvsCameraBase> pActiveCamera = pRecord->activeInstance.lock();
if (pActiveCamera) {
LOG(WARNING) << "Killing previous camera because of new caller";
closeCamera(pActiveCamera);
@@ -253,12 +254,31 @@
if (!sConfigManager) {
pActiveCamera = EvsMockCamera::Create(id.data());
} else {
- pActiveCamera = EvsMockCamera::Create(id.data(), sConfigManager->getCameraInfo(id), &cfg);
+ auto& cameraInfo = sConfigManager->getCameraInfo(id);
+ switch (cameraInfo->deviceType) {
+ using DeviceType = ConfigManager::CameraInfo::DeviceType;
+
+ // Default to MOCK for backward compatibility.
+ case DeviceType::NONE:
+ case DeviceType::MOCK:
+ pActiveCamera = EvsMockCamera::Create(id.data(), cameraInfo, &cfg);
+ break;
+
+ case DeviceType::VIDEO:
+ pActiveCamera = EvsVideoEmulatedCamera::Create(id.data(), cameraInfo, &cfg);
+ break;
+
+ default:
+ LOG(ERROR) << __func__ << ": camera device type "
+ << static_cast<std::int32_t>(cameraInfo->deviceType)
+ << " is not supported.";
+ break;
+ }
}
pRecord->activeInstance = pActiveCamera;
if (!pActiveCamera) {
- LOG(ERROR) << "Failed to create new EvsMockCamera object for " << id;
+ LOG(ERROR) << "Failed to create new EVS camera object for " << id;
return ScopedAStatus::fromServiceSpecificError(
static_cast<int>(EvsResult::UNDERLYING_SERVICE_ERROR));
}
@@ -445,7 +465,7 @@
if (!pRecord) {
LOG(ERROR) << "Asked to close a camera whose name isn't recognized";
} else {
- std::shared_ptr<EvsMockCamera> pActiveCamera = pRecord->activeInstance.lock();
+ std::shared_ptr<EvsCameraBase> pActiveCamera = pRecord->activeInstance.lock();
if (!pActiveCamera) {
LOG(WARNING) << "Somehow a camera is being destroyed "
<< "when the enumerator didn't know one existed";
diff --git a/automotive/evs/aidl/impl/default/src/EvsGlDisplay.cpp b/automotive/evs/aidl/impl/default/src/EvsGlDisplay.cpp
index e5f8e4c..5b5cbcc 100644
--- a/automotive/evs/aidl/impl/default/src/EvsGlDisplay.cpp
+++ b/automotive/evs/aidl/impl/default/src/EvsGlDisplay.cpp
@@ -352,8 +352,8 @@
BufferDesc bufferDescToSend = {
.buffer =
{
- .handle = std::move(::android::dupToAidl(mBuffer.handle)),
.description = mBuffer.description,
+ .handle = std::move(::android::dupToAidl(mBuffer.handle)),
},
.pixelSizeBytes = 4, // RGBA_8888 is 4-byte-per-pixel format
.bufferId = mBuffer.fingerprint,
diff --git a/automotive/evs/aidl/impl/default/src/EvsMockCamera.cpp b/automotive/evs/aidl/impl/default/src/EvsMockCamera.cpp
index 797b221..ef43925 100644
--- a/automotive/evs/aidl/impl/default/src/EvsMockCamera.cpp
+++ b/automotive/evs/aidl/impl/default/src/EvsMockCamera.cpp
@@ -15,28 +15,25 @@
*/
#include "EvsMockCamera.h"
-#include "ConfigManager.h"
-#include "EvsEnumerator.h"
+
+#include <aidl/android/hardware/automotive/evs/EvsResult.h>
#include <aidlcommonsupport/NativeHandle.h>
+#include <android-base/logging.h>
#include <ui/GraphicBufferAllocator.h>
#include <ui/GraphicBufferMapper.h>
#include <utils/SystemClock.h>
+#include <cstddef>
+#include <cstdint>
#include <memory>
+#include <tuple>
namespace {
using ::aidl::android::hardware::graphics::common::BufferUsage;
using ::ndk::ScopedAStatus;
-// Arbitrary limit on number of graphics buffers allowed to be allocated
-// Safeguards against unreasonable resource consumption and provides a testable limit
-constexpr unsigned kMaxBuffersInFlight = 100;
-
-// Minimum number of buffers to run a video stream
-constexpr int kMinimumBuffersInFlight = 1;
-
// Colors for the colorbar test pattern in ABGR format
constexpr uint32_t kColors[] = {
0xFFFFFFFF, // white
@@ -56,7 +53,7 @@
EvsMockCamera::EvsMockCamera([[maybe_unused]] Sigil sigil, const char* id,
std::unique_ptr<ConfigManager::CameraInfo>& camInfo)
- : mFramesAllowed(0), mFramesInUse(0), mStreamState(STOPPED), mCameraInfo(camInfo) {
+ : mCameraInfo(camInfo) {
LOG(DEBUG) << __FUNCTION__;
/* set a camera id */
@@ -73,11 +70,6 @@
initializeParameters();
}
-EvsMockCamera::~EvsMockCamera() {
- LOG(DEBUG) << __FUNCTION__;
- shutdown();
-}
-
void EvsMockCamera::initializeParameters() {
mParams.emplace(
CameraParam::BRIGHTNESS,
@@ -90,35 +82,6 @@
new CameraParameterDesc(/* min= */ 0, /* max= */ 255, /* step= */ 1, /* value= */ 255));
}
-// This gets called if another caller "steals" ownership of the camera
-void EvsMockCamera::shutdown() {
- LOG(DEBUG) << __FUNCTION__;
-
- // Make sure our output stream is cleaned up
- // (It really should be already)
- stopVideoStream_impl();
-
- // Claim the lock while we work on internal state
- std::lock_guard lock(mAccessLock);
-
- // Drop all the graphics buffers we've been using
- if (mBuffers.size() > 0) {
- ::android::GraphicBufferAllocator& alloc(::android::GraphicBufferAllocator::get());
- for (auto&& rec : mBuffers) {
- if (rec.inUse) {
- LOG(WARNING) << "WARNING: releasing a buffer remotely owned.";
- }
- alloc.free(rec.handle);
- rec.handle = nullptr;
- }
- mBuffers.clear();
- }
-
- // Put this object into an unrecoverable error state since somebody else
- // is going to own the underlying camera now
- mStreamState = DEAD;
-}
-
// Methods from ::aidl::android::hardware::automotive::evs::IEvsCamera follow.
ScopedAStatus EvsMockCamera::getCameraInfo(CameraDesc* _aidl_return) {
LOG(DEBUG) << __FUNCTION__;
@@ -128,115 +91,6 @@
return ScopedAStatus::ok();
}
-ScopedAStatus EvsMockCamera::setMaxFramesInFlight(int32_t bufferCount) {
- LOG(DEBUG) << __FUNCTION__ << ", bufferCount = " << bufferCount;
- ;
-
- std::lock_guard lock(mAccessLock);
-
- // If we've been displaced by another owner of the camera, then we can't do anything else
- if (mStreamState == DEAD) {
- LOG(ERROR) << "Ignoring setMaxFramesInFlight call when camera has been lost.";
- return ScopedAStatus::fromServiceSpecificError(static_cast<int>(EvsResult::OWNERSHIP_LOST));
- }
-
- // We cannot function without at least one video buffer to send data
- if (bufferCount < 1) {
- LOG(ERROR) << "Ignoring setMaxFramesInFlight with less than one buffer requested.";
- return ScopedAStatus::fromServiceSpecificError(static_cast<int>(EvsResult::INVALID_ARG));
- }
-
- // Update our internal state
- if (!setAvailableFrames_Locked(bufferCount)) {
- LOG(ERROR) << "Failed to adjust the maximum number of frames in flight.";
- return ScopedAStatus::fromServiceSpecificError(
- static_cast<int>(EvsResult::BUFFER_NOT_AVAILABLE));
- }
-
- return ScopedAStatus::ok();
-}
-
-ScopedAStatus EvsMockCamera::startVideoStream(const std::shared_ptr<IEvsCameraStream>& cb) {
- LOG(DEBUG) << __FUNCTION__;
-
- if (!cb) {
- LOG(ERROR) << "A given stream callback is invalid.";
- return ScopedAStatus::fromServiceSpecificError(static_cast<int>(EvsResult::INVALID_ARG));
- }
-
- std::lock_guard lock(mAccessLock);
-
- // If we've been displaced by another owner of the camera, then we can't do anything else
- if (mStreamState == DEAD) {
- LOG(ERROR) << "Ignoring startVideoStream call when camera has been lost.";
- return ScopedAStatus::fromServiceSpecificError(static_cast<int>(EvsResult::OWNERSHIP_LOST));
- }
-
- if (mStreamState != STOPPED) {
- LOG(ERROR) << "Ignoring startVideoStream call when a stream is already running.";
- return ScopedAStatus::fromServiceSpecificError(
- static_cast<int>(EvsResult::STREAM_ALREADY_RUNNING));
- }
-
- // If the client never indicated otherwise, configure ourselves for a single streaming buffer
- if (mFramesAllowed < kMinimumBuffersInFlight &&
- !setAvailableFrames_Locked(kMinimumBuffersInFlight)) {
- LOG(ERROR) << "Failed to start stream because we couldn't get a graphics buffer";
- return ScopedAStatus::fromServiceSpecificError(
- static_cast<int>(EvsResult::BUFFER_NOT_AVAILABLE));
- }
-
- // Record the user's callback for use when we have a frame ready
- mStream = cb;
-
- // Start the frame generation thread
- mStreamState = RUNNING;
- mCaptureThread = std::thread([this]() { generateFrames(); });
-
- return ScopedAStatus::ok();
-}
-
-ScopedAStatus EvsMockCamera::doneWithFrame(const std::vector<BufferDesc>& list) {
- std::lock_guard lock(mAccessLock);
- for (const auto& desc : list) {
- returnBufferLocked(desc.bufferId);
- }
-
- return ScopedAStatus::ok();
-}
-
-ScopedAStatus EvsMockCamera::stopVideoStream() {
- LOG(DEBUG) << __FUNCTION__;
- return stopVideoStream_impl();
-}
-
-ScopedAStatus EvsMockCamera::stopVideoStream_impl() {
- std::unique_lock lock(mAccessLock);
-
- if (mStreamState != RUNNING) {
- // Safely return here because a stream is not running.
- return ScopedAStatus::ok();
- }
-
- // Tell the GenerateFrames loop we want it to stop
- mStreamState = STOPPING;
-
- // Block outside the mutex until the "stop" flag has been acknowledged
- // We won't send any more frames, but the client might still get some already in flight
- LOG(DEBUG) << "Waiting for stream thread to end...";
- lock.unlock();
- if (mCaptureThread.joinable()) {
- mCaptureThread.join();
- }
- lock.lock();
-
- mStreamState = STOPPED;
- mStream = nullptr;
- LOG(DEBUG) << "Stream marked STOPPED.";
-
- return ScopedAStatus::ok();
-}
-
ScopedAStatus EvsMockCamera::getExtendedInfo(int32_t opaqueIdentifier,
std::vector<uint8_t>* opaqueValue) {
const auto it = mExtInfo.find(opaqueIdentifier);
@@ -264,14 +118,6 @@
return ScopedAStatus::ok();
}
-ScopedAStatus EvsMockCamera::pauseVideoStream() {
- return ScopedAStatus::fromServiceSpecificError(static_cast<int>(EvsResult::NOT_SUPPORTED));
-}
-
-ScopedAStatus EvsMockCamera::resumeVideoStream() {
- return ScopedAStatus::fromServiceSpecificError(static_cast<int>(EvsResult::NOT_SUPPORTED));
-}
-
ScopedAStatus EvsMockCamera::setPrimaryClient() {
/* Because EVS HW module reference implementation expects a single client at
* a time, this returns a success code always.
@@ -346,232 +192,27 @@
return ScopedAStatus::ok();
}
-ScopedAStatus EvsMockCamera::importExternalBuffers(const std::vector<BufferDesc>& buffers,
- int32_t* _aidl_return) {
- size_t numBuffersToAdd = buffers.size();
- if (numBuffersToAdd < 1) {
- LOG(DEBUG) << "Ignoring a request to import external buffers with an empty list.";
- return ScopedAStatus::ok();
- }
-
- std::lock_guard lock(mAccessLock);
- if (numBuffersToAdd > (kMaxBuffersInFlight - mFramesAllowed)) {
- numBuffersToAdd -= (kMaxBuffersInFlight - mFramesAllowed);
- LOG(WARNING) << "Exceed the limit on the number of buffers. " << numBuffersToAdd
- << " buffers will be imported only.";
- }
-
- ::android::GraphicBufferMapper& mapper = ::android::GraphicBufferMapper::get();
- const size_t before = mFramesAllowed;
- for (size_t i = 0; i < numBuffersToAdd; ++i) {
- auto& b = buffers[i];
- const AHardwareBuffer_Desc* pDesc =
- reinterpret_cast<const AHardwareBuffer_Desc*>(&b.buffer.description);
-
- buffer_handle_t handleToImport = ::android::dupFromAidl(b.buffer.handle);
- buffer_handle_t handleToStore = nullptr;
- if (handleToImport == nullptr) {
- LOG(WARNING) << "Failed to duplicate a memory handle. Ignoring a buffer " << b.bufferId;
- continue;
- }
-
- ::android::status_t result =
- mapper.importBuffer(handleToImport, pDesc->width, pDesc->height, pDesc->layers,
- pDesc->format, pDesc->usage, pDesc->stride, &handleToStore);
- if (result != ::android::NO_ERROR || handleToStore == nullptr) {
- LOG(WARNING) << "Failed to import a buffer " << b.bufferId;
- continue;
- }
-
- bool stored = false;
- for (auto&& rec : mBuffers) {
- if (rec.handle != nullptr) {
- continue;
- }
-
- // Use this existing entry.
- rec.handle = handleToStore;
- rec.inUse = false;
- stored = true;
- break;
- }
-
- if (!stored) {
- // Add a BufferRecord wrapping this handle to our set of available buffers.
- mBuffers.push_back(BufferRecord(handleToStore));
- }
- ++mFramesAllowed;
- }
-
- *_aidl_return = mFramesAllowed - before;
- return ScopedAStatus::ok();
-}
-
-bool EvsMockCamera::setAvailableFrames_Locked(unsigned bufferCount) {
- if (bufferCount < 1) {
- LOG(ERROR) << "Ignoring request to set buffer count to zero";
- return false;
- }
- if (bufferCount > kMaxBuffersInFlight) {
- LOG(ERROR) << "Rejecting buffer request in excess of internal limit";
- return false;
- }
-
- // Is an increase required?
- if (mFramesAllowed < bufferCount) {
- // An increase is required
- auto needed = bufferCount - mFramesAllowed;
- LOG(INFO) << "Allocating " << needed << " buffers for camera frames";
-
- auto added = increaseAvailableFrames_Locked(needed);
- if (added != needed) {
- // If we didn't add all the frames we needed, then roll back to the previous state
- LOG(ERROR) << "Rolling back to previous frame queue size";
- decreaseAvailableFrames_Locked(added);
- return false;
- }
- } else if (mFramesAllowed > bufferCount) {
- // A decrease is required
- auto framesToRelease = mFramesAllowed - bufferCount;
- LOG(INFO) << "Returning " << framesToRelease << " camera frame buffers";
-
- auto released = decreaseAvailableFrames_Locked(framesToRelease);
- if (released != framesToRelease) {
- // This shouldn't happen with a properly behaving client because the client
- // should only make this call after returning sufficient outstanding buffers
- // to allow a clean resize.
- LOG(ERROR) << "Buffer queue shrink failed -- too many buffers currently in use?";
- }
- }
-
- return true;
-}
-
-unsigned EvsMockCamera::increaseAvailableFrames_Locked(unsigned numToAdd) {
- // Acquire the graphics buffer allocator
- ::android::GraphicBufferAllocator& alloc(::android::GraphicBufferAllocator::get());
-
- unsigned added = 0;
- while (added < numToAdd) {
- unsigned pixelsPerLine = 0;
- buffer_handle_t memHandle = nullptr;
- auto result = alloc.allocate(mWidth, mHeight, mFormat, 1, mUsage, &memHandle,
- &pixelsPerLine, 0, "EvsMockCamera");
- if (result != ::android::NO_ERROR) {
- LOG(ERROR) << "Error " << result << " allocating " << mWidth << " x " << mHeight
- << " graphics buffer";
- break;
- }
- if (memHandle == nullptr) {
- LOG(ERROR) << "We didn't get a buffer handle back from the allocator";
- break;
- }
- if (mStride > 0) {
- if (mStride != pixelsPerLine) {
- LOG(ERROR) << "We did not expect to get buffers with different strides!";
- }
- } else {
- // Gralloc defines stride in terms of pixels per line
- mStride = pixelsPerLine;
- }
-
- // Find a place to store the new buffer
- auto stored = false;
- for (auto&& rec : mBuffers) {
- if (rec.handle == nullptr) {
- // Use this existing entry
- rec.handle = memHandle;
- rec.inUse = false;
- stored = true;
- break;
- }
- }
- if (!stored) {
- // Add a BufferRecord wrapping this handle to our set of available buffers
- mBuffers.push_back(BufferRecord(memHandle));
- }
-
- ++mFramesAllowed;
- ++added;
- }
-
- return added;
-}
-
-unsigned EvsMockCamera::decreaseAvailableFrames_Locked(unsigned numToRemove) {
- // Acquire the graphics buffer allocator
- ::android::GraphicBufferAllocator& alloc(::android::GraphicBufferAllocator::get());
-
- unsigned removed = 0;
- for (auto&& rec : mBuffers) {
- // Is this record not in use, but holding a buffer that we can free?
- if ((rec.inUse == false) && (rec.handle != nullptr)) {
- // Release buffer and update the record so we can recognize it as "empty"
- alloc.free(rec.handle);
- rec.handle = nullptr;
-
- --mFramesAllowed;
- ++removed;
-
- if (removed == numToRemove) {
- break;
- }
- }
- }
-
- return removed;
-}
-
// This is the asynchronous frame generation thread that runs in parallel with the
// main serving thread. There is one for each active camera instance.
void EvsMockCamera::generateFrames() {
LOG(DEBUG) << "Frame generation loop started.";
- unsigned idx = 0;
while (true) {
- bool timeForFrame = false;
const nsecs_t startTime = systemTime(SYSTEM_TIME_MONOTONIC);
-
- // Lock scope for updating shared state
+ std::size_t bufferId = kInvalidBufferID;
+ buffer_handle_t bufferHandle = nullptr;
{
- std::lock_guard lock(mAccessLock);
-
- if (mStreamState != RUNNING) {
- // Break out of our main thread loop
+ std::lock_guard lock(mMutex);
+ if (mStreamState != StreamState::RUNNING) {
break;
}
-
- // Are we allowed to issue another buffer?
- if (mFramesInUse >= mFramesAllowed) {
- // Can't do anything right now -- skip this frame
- LOG(WARNING) << "Skipped a frame because too many are in flight.";
- } else {
- // Identify an available buffer to fill
- for (idx = 0; idx < mBuffers.size(); idx++) {
- if (!mBuffers[idx].inUse) {
- if (mBuffers[idx].handle != nullptr) {
- // Found an available record, so stop looking
- break;
- }
- }
- }
- if (idx >= mBuffers.size()) {
- // This shouldn't happen since we already checked mFramesInUse vs mFramesAllowed
- ALOGE("Failed to find an available buffer slot\n");
- } else {
- // We're going to make the frame busy
- mBuffers[idx].inUse = true;
- mFramesInUse++;
- timeForFrame = true;
- }
- }
+ std::tie(bufferId, bufferHandle) = useBuffer_unsafe();
}
- if (timeForFrame) {
+ if (bufferHandle != nullptr) {
using AidlPixelFormat = ::aidl::android::hardware::graphics::common::PixelFormat;
// Assemble the buffer description we'll transmit below
- buffer_handle_t memHandle = mBuffers[idx].handle;
BufferDesc newBuffer = {
.buffer =
{
@@ -584,39 +225,31 @@
.usage = static_cast<BufferUsage>(mUsage),
.stride = static_cast<int32_t>(mStride),
},
- .handle = ::android::dupToAidl(memHandle),
+ .handle = ::android::dupToAidl(bufferHandle),
},
- .bufferId = static_cast<int32_t>(idx),
+ .bufferId = static_cast<int32_t>(bufferId),
.deviceId = mDescription.id,
.timestamp = static_cast<int64_t>(::android::elapsedRealtimeNano() *
1e+3), // timestamps is in microseconds
};
// Write test data into the image buffer
- fillMockFrame(memHandle, reinterpret_cast<const AHardwareBuffer_Desc*>(
- &newBuffer.buffer.description));
+ fillMockFrame(bufferHandle, reinterpret_cast<const AHardwareBuffer_Desc*>(
+ &newBuffer.buffer.description));
+
+ std::vector<BufferDesc> frames;
+ frames.push_back(std::move(newBuffer));
// Issue the (asynchronous) callback to the client -- can't be holding the lock
- auto flag = false;
- if (mStream) {
- std::vector<BufferDesc> frames;
- frames.push_back(std::move(newBuffer));
- flag = mStream->deliverFrame(frames).isOk();
- }
-
- if (flag) {
- LOG(DEBUG) << "Delivered " << memHandle << ", id = " << mBuffers[idx].handle;
+ if (mStream && mStream->deliverFrame(frames).isOk()) {
+ LOG(DEBUG) << "Delivered " << bufferHandle << ", id = " << bufferId;
} else {
// This can happen if the client dies and is likely unrecoverable.
// To avoid consuming resources generating failing calls, we stop sending
// frames. Note, however, that the stream remains in the "STREAMING" state
// until cleaned up on the main thread.
LOG(ERROR) << "Frame delivery call failed in the transport layer.";
-
- // Since we didn't actually deliver it, mark the frame as available
- std::lock_guard<std::mutex> lock(mAccessLock);
- mBuffers[idx].inUse = false;
- mFramesInUse--;
+ doneWithFrame(frames);
}
}
@@ -671,34 +304,45 @@
mapper.unlock(handle);
}
-void EvsMockCamera::returnBufferLocked(const uint32_t bufferId) {
- if (bufferId >= mBuffers.size()) {
- ALOGE("ignoring doneWithFrame called with invalid bufferId %d (max is %zu)", bufferId,
- mBuffers.size() - 1);
- return;
+::android::status_t EvsMockCamera::allocateOneFrame(buffer_handle_t* handle) {
+ static auto& alloc = ::android::GraphicBufferAllocator::get();
+ unsigned pixelsPerLine = 0;
+ const auto result = alloc.allocate(mWidth, mHeight, mFormat, 1, mUsage, handle, &pixelsPerLine,
+ 0, "EvsMockCamera");
+ if (mStride < mWidth) {
+ // Gralloc defines stride in terms of pixels per line
+ mStride = pixelsPerLine;
+ } else if (mStride != pixelsPerLine) {
+ LOG(ERROR) << "We did not expect to get buffers with different strides!";
}
+ return result;
+}
- if (!mBuffers[bufferId].inUse) {
- ALOGE("ignoring doneWithFrame called on frame %d which is already free", bufferId);
- return;
+bool EvsMockCamera::startVideoStreamImpl_locked(
+ const std::shared_ptr<evs::IEvsCameraStream>& receiver, ndk::ScopedAStatus& /* status */,
+ std::unique_lock<std::mutex>& /* lck */) {
+ mStream = receiver;
+ mCaptureThread = std::thread([this]() { generateFrames(); });
+ return true;
+}
+
+bool EvsMockCamera::stopVideoStreamImpl_locked(ndk::ScopedAStatus& /* status */,
+ std::unique_lock<std::mutex>& lck) {
+ lck.unlock();
+ if (mCaptureThread.joinable()) {
+ mCaptureThread.join();
}
+ lck.lock();
+ return true;
+}
- // Mark the frame as available
- mBuffers[bufferId].inUse = false;
- mFramesInUse--;
-
- // If this frame's index is high in the array, try to move it down
- // to improve locality after mFramesAllowed has been reduced.
- if (bufferId >= mFramesAllowed) {
- // Find an empty slot lower in the array (which should always exist in this case)
- for (auto&& rec : mBuffers) {
- if (rec.handle == nullptr) {
- rec.handle = mBuffers[bufferId].handle;
- mBuffers[bufferId].handle = nullptr;
- break;
- }
- }
+bool EvsMockCamera::postVideoStreamStop_locked(ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck) {
+ if (!Base::postVideoStreamStop_locked(status, lck)) {
+ return false;
}
+ mStream = nullptr;
+ return true;
}
std::shared_ptr<EvsMockCamera> EvsMockCamera::Create(const char* deviceName) {
diff --git a/automotive/evs/aidl/impl/default/src/EvsVideoEmulatedCamera.cpp b/automotive/evs/aidl/impl/default/src/EvsVideoEmulatedCamera.cpp
new file mode 100644
index 0000000..8181e47
--- /dev/null
+++ b/automotive/evs/aidl/impl/default/src/EvsVideoEmulatedCamera.cpp
@@ -0,0 +1,507 @@
+/*
+ * 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 "EvsVideoEmulatedCamera.h"
+
+#include <aidl/android/hardware/automotive/evs/EvsResult.h>
+
+#include <aidlcommonsupport/NativeHandle.h>
+#include <android-base/logging.h>
+#include <android-base/strings.h>
+#include <media/stagefright/MediaCodecConstants.h>
+#include <ui/GraphicBufferAllocator.h>
+#include <utils/SystemClock.h>
+
+#include <fcntl.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include <chrono>
+#include <cstddef>
+#include <cstdint>
+#include <tuple>
+#include <utility>
+
+namespace aidl::android::hardware::automotive::evs::implementation {
+
+namespace {
+struct FormatDeleter {
+ void operator()(AMediaFormat* format) const { AMediaFormat_delete(format); }
+};
+} // namespace
+
+EvsVideoEmulatedCamera::EvsVideoEmulatedCamera(Sigil, const char* deviceName,
+ std::unique_ptr<ConfigManager::CameraInfo>& camInfo)
+ : mVideoFileName(deviceName), mCameraInfo(camInfo) {
+ mDescription.id = mVideoFileName;
+
+ /* set camera metadata */
+ if (camInfo) {
+ uint8_t* ptr = reinterpret_cast<uint8_t*>(camInfo->characteristics);
+ const size_t len = get_camera_metadata_size(camInfo->characteristics);
+ mDescription.metadata.insert(mDescription.metadata.end(), ptr, ptr + len);
+ }
+
+ initializeParameters();
+}
+
+bool EvsVideoEmulatedCamera::initialize() {
+ // Open file.
+ mVideoFd = open(mVideoFileName.c_str(), 0, O_RDONLY);
+ if (mVideoFd < 0) {
+ PLOG(ERROR) << __func__ << ": Failed to open video file \"" << mVideoFileName << "\".";
+ return false;
+ }
+
+ // Initialize Media Extractor.
+ {
+ mVideoExtractor.reset(AMediaExtractor_new());
+ off64_t filesize = lseek64(mVideoFd, 0, SEEK_END);
+ lseek(mVideoFd, 0, SEEK_SET);
+ const media_status_t status =
+ AMediaExtractor_setDataSourceFd(mVideoExtractor.get(), mVideoFd, 0, filesize);
+ if (status != AMEDIA_OK) {
+ LOG(ERROR) << __func__
+ << ": Received error when initializing media extractor. Error code: "
+ << status << ".";
+ return false;
+ }
+ }
+
+ // Initialize Media Codec and file format.
+ std::unique_ptr<AMediaFormat, FormatDeleter> format;
+ const char* mime;
+ bool selected = false;
+ int numTracks = AMediaExtractor_getTrackCount(mVideoExtractor.get());
+ for (int i = 0; i < numTracks; i++) {
+ format.reset(AMediaExtractor_getTrackFormat(mVideoExtractor.get(), i));
+ if (!AMediaFormat_getString(format.get(), AMEDIAFORMAT_KEY_MIME, &mime)) {
+ LOG(ERROR) << __func__ << ": Error in fetching format string";
+ continue;
+ }
+ if (!::android::base::StartsWith(mime, "video/")) {
+ continue;
+ }
+ const media_status_t status = AMediaExtractor_selectTrack(mVideoExtractor.get(), i);
+ if (status != AMEDIA_OK) {
+ LOG(ERROR) << __func__
+ << ": Media extractor returned error to select track. Error Code: " << status
+ << ".";
+ return false;
+ }
+ selected = true;
+ break;
+ }
+ if (!selected) {
+ LOG(ERROR) << __func__ << ": No video track in video file \"" << mVideoFileName << "\".";
+ return false;
+ }
+
+ mVideoCodec.reset(AMediaCodec_createDecoderByType(mime));
+ if (!mVideoCodec) {
+ LOG(ERROR) << __func__ << ": Unable to create decoder.";
+ return false;
+ }
+
+ mDescription.vendorFlags = 0xFFFFFFFF; // Arbitrary test value
+ mUsage = GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_CAMERA_WRITE |
+ GRALLOC_USAGE_SW_READ_RARELY | GRALLOC_USAGE_SW_WRITE_RARELY;
+ mFormat = HAL_PIXEL_FORMAT_YCBCR_420_888;
+ AMediaFormat_setInt32(format.get(), AMEDIAFORMAT_KEY_COLOR_FORMAT, COLOR_FormatYUV420Flexible);
+ {
+ const media_status_t status =
+ AMediaCodec_configure(mVideoCodec.get(), format.get(), nullptr, nullptr, 0);
+ if (status != AMEDIA_OK) {
+ LOG(ERROR) << __func__
+ << ": Received error in configuring mCodec. Error code: " << status << ".";
+ return false;
+ }
+ }
+ format.reset(AMediaCodec_getOutputFormat(mVideoCodec.get()));
+ AMediaFormat_getInt32(format.get(), AMEDIAFORMAT_KEY_WIDTH, &mWidth);
+ AMediaFormat_getInt32(format.get(), AMEDIAFORMAT_KEY_HEIGHT, &mHeight);
+ return true;
+}
+
+void EvsVideoEmulatedCamera::generateFrames() {
+ while (true) {
+ {
+ std::lock_guard lock(mMutex);
+ if (mStreamState != StreamState::RUNNING) {
+ return;
+ }
+ }
+ renderOneFrame();
+ }
+}
+
+void EvsVideoEmulatedCamera::onCodecInputAvailable(const int32_t index) {
+ const size_t sampleSize = AMediaExtractor_getSampleSize(mVideoExtractor.get());
+ const int64_t presentationTime = AMediaExtractor_getSampleTime(mVideoExtractor.get());
+ size_t bufferSize = 0;
+ uint8_t* const codecInputBuffer =
+ AMediaCodec_getInputBuffer(mVideoCodec.get(), index, &bufferSize);
+ if (sampleSize > bufferSize) {
+ LOG(ERROR) << __func__ << ": Buffer is not large enough.";
+ }
+ if (presentationTime < 0) {
+ AMediaCodec_queueInputBuffer(mVideoCodec.get(), index, /* offset = */ 0,
+ /* size = */ 0, presentationTime,
+ AMEDIACODEC_BUFFER_FLAG_END_OF_STREAM);
+ LOG(INFO) << __func__ << ": Reaching the end of stream.";
+ return;
+ }
+ const size_t readSize =
+ AMediaExtractor_readSampleData(mVideoExtractor.get(), codecInputBuffer, sampleSize);
+ const media_status_t status = AMediaCodec_queueInputBuffer(
+ mVideoCodec.get(), index, /*offset = */ 0, readSize, presentationTime, /* flags = */ 0);
+ if (status != AMEDIA_OK) {
+ LOG(ERROR) << __func__
+ << ": Received error in queueing input buffer. Error code: " << status;
+ }
+}
+
+void EvsVideoEmulatedCamera::onCodecOutputAvailable(const int32_t index,
+ const AMediaCodecBufferInfo& info) {
+ using std::chrono::duration_cast;
+ using std::chrono::microseconds;
+ using std::chrono::nanoseconds;
+ using AidlPixelFormat = ::aidl::android::hardware::graphics::common::PixelFormat;
+ using ::aidl::android::hardware::graphics::common::BufferUsage;
+
+ size_t decodedOutSize = 0;
+ uint8_t* const codecOutputBuffer =
+ AMediaCodec_getOutputBuffer(mVideoCodec.get(), index, &decodedOutSize) + info.offset;
+
+ std::size_t renderBufferId = static_cast<std::size_t>(-1);
+ buffer_handle_t renderBufferHandle = nullptr;
+ {
+ std::lock_guard lock(mMutex);
+ if (mStreamState != StreamState::RUNNING) {
+ return;
+ }
+ std::tie(renderBufferId, renderBufferHandle) = useBuffer_unsafe();
+ }
+ if (!renderBufferHandle) {
+ LOG(ERROR) << __func__ << ": Camera failed to get an available render buffer.";
+ return;
+ }
+ std::vector<BufferDesc> renderBufferDescs;
+ renderBufferDescs.push_back({
+ .buffer =
+ {
+ .description =
+ {
+ .width = static_cast<int32_t>(mWidth),
+ .height = static_cast<int32_t>(mHeight),
+ .layers = 1,
+ .format = static_cast<AidlPixelFormat>(mFormat),
+ .usage = static_cast<BufferUsage>(mUsage),
+ .stride = static_cast<int32_t>(mStride),
+ },
+ .handle = ::android::dupToAidl(renderBufferHandle),
+ },
+ .bufferId = static_cast<int32_t>(renderBufferId),
+ .deviceId = mDescription.id,
+ .timestamp = duration_cast<microseconds>(nanoseconds(::android::elapsedRealtimeNano()))
+ .count(),
+ });
+
+ // Lock our output buffer for writing
+ uint8_t* pixels = nullptr;
+ int32_t bytesPerStride = 0;
+ auto& mapper = ::android::GraphicBufferMapper::get();
+ mapper.lock(renderBufferHandle, GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_NEVER,
+ ::android::Rect(mWidth, mHeight), (void**)&pixels, nullptr, &bytesPerStride);
+
+ // If we failed to lock the pixel buffer, we're about to crash, but log it first
+ if (!pixels) {
+ LOG(ERROR) << __func__ << ": Camera failed to gain access to image buffer for writing";
+ return;
+ }
+
+ std::size_t ySize = mHeight * mStride;
+ std::size_t uvSize = ySize / 4;
+
+ std::memcpy(pixels, codecOutputBuffer, ySize);
+ pixels += ySize;
+
+ uint8_t* u_head = codecOutputBuffer + ySize;
+ uint8_t* v_head = u_head + uvSize;
+
+ for (size_t i = 0; i < uvSize; ++i) {
+ *(pixels++) = *(u_head++);
+ *(pixels++) = *(v_head++);
+ }
+
+ const auto status =
+ AMediaCodec_releaseOutputBuffer(mVideoCodec.get(), index, /* render = */ false);
+ if (status != AMEDIA_OK) {
+ LOG(ERROR) << __func__
+ << ": Received error in releasing output buffer. Error code: " << status;
+ }
+
+ // Release our output buffer
+ mapper.unlock(renderBufferHandle);
+
+ // Issue the (asynchronous) callback to the client -- can't be holding the lock
+ if (mStream && mStream->deliverFrame(renderBufferDescs).isOk()) {
+ LOG(DEBUG) << __func__ << ": Delivered " << renderBufferHandle
+ << ", id = " << renderBufferId;
+ } else {
+ // This can happen if the client dies and is likely unrecoverable.
+ // To avoid consuming resources generating failing calls, we stop sending
+ // frames. Note, however, that the stream remains in the "STREAMING" state
+ // until cleaned up on the main thread.
+ LOG(ERROR) << __func__ << ": Frame delivery call failed in the transport layer.";
+ doneWithFrame(renderBufferDescs);
+ }
+}
+
+void EvsVideoEmulatedCamera::renderOneFrame() {
+ using std::chrono::duration_cast;
+ using std::chrono::microseconds;
+ using namespace std::chrono_literals;
+
+ // push to codec input
+ while (true) {
+ int codecInputBufferIdx =
+ AMediaCodec_dequeueInputBuffer(mVideoCodec.get(), /* timeoutUs = */ 0);
+ if (codecInputBufferIdx < 0) {
+ if (codecInputBufferIdx != AMEDIACODEC_INFO_TRY_AGAIN_LATER) {
+ LOG(ERROR) << __func__
+ << ": Received error in AMediaCodec_dequeueInputBuffer. Error code: "
+ << codecInputBufferIdx;
+ }
+ break;
+ }
+ onCodecInputAvailable(codecInputBufferIdx);
+ AMediaExtractor_advance(mVideoExtractor.get());
+ }
+
+ // pop from codec output
+
+ AMediaCodecBufferInfo info;
+ int codecOutputputBufferIdx = AMediaCodec_dequeueOutputBuffer(
+ mVideoCodec.get(), &info, /* timeoutUs = */ duration_cast<microseconds>(1ms).count());
+ if (codecOutputputBufferIdx < 0) {
+ if (codecOutputputBufferIdx != AMEDIACODEC_INFO_TRY_AGAIN_LATER) {
+ LOG(ERROR) << __func__
+ << ": Received error in AMediaCodec_dequeueOutputBuffer. Error code: "
+ << codecOutputputBufferIdx;
+ }
+ return;
+ }
+ onCodecOutputAvailable(codecOutputputBufferIdx, info);
+}
+
+void EvsVideoEmulatedCamera::initializeParameters() {
+ mParams.emplace(
+ CameraParam::BRIGHTNESS,
+ new CameraParameterDesc(/* min= */ 0, /* max= */ 255, /* step= */ 1, /* value= */ 255));
+ mParams.emplace(
+ CameraParam::CONTRAST,
+ new CameraParameterDesc(/* min= */ 0, /* max= */ 255, /* step= */ 1, /* value= */ 255));
+ mParams.emplace(
+ CameraParam::SHARPNESS,
+ new CameraParameterDesc(/* min= */ 0, /* max= */ 255, /* step= */ 1, /* value= */ 255));
+}
+
+::android::status_t EvsVideoEmulatedCamera::allocateOneFrame(buffer_handle_t* handle) {
+ static auto& alloc = ::android::GraphicBufferAllocator::get();
+ unsigned pixelsPerLine = 0;
+ const auto result = alloc.allocate(mWidth, mHeight, mFormat, 1, mUsage, handle, &pixelsPerLine,
+ 0, "EvsVideoEmulatedCamera");
+ if (mStride == 0) {
+ // Gralloc defines stride in terms of pixels per line
+ mStride = pixelsPerLine;
+ } else if (mStride != pixelsPerLine) {
+ LOG(ERROR) << "We did not expect to get buffers with different strides!";
+ }
+ return result;
+}
+
+bool EvsVideoEmulatedCamera::startVideoStreamImpl_locked(
+ const std::shared_ptr<evs::IEvsCameraStream>& receiver, ndk::ScopedAStatus& /* status */,
+ std::unique_lock<std::mutex>& /* lck */) {
+ mStream = receiver;
+
+ const media_status_t status = AMediaCodec_start(mVideoCodec.get());
+ if (status != AMEDIA_OK) {
+ LOG(ERROR) << __func__ << ": Received error in starting decoder. Error code: " << status
+ << ".";
+ return false;
+ }
+ mCaptureThread = std::thread([this]() { generateFrames(); });
+
+ return true;
+}
+
+bool EvsVideoEmulatedCamera::stopVideoStreamImpl_locked(ndk::ScopedAStatus& /* status */,
+ std::unique_lock<std::mutex>& lck) {
+ const media_status_t status = AMediaCodec_stop(mVideoCodec.get());
+ lck.unlock();
+ if (mCaptureThread.joinable()) {
+ mCaptureThread.join();
+ }
+ lck.lock();
+ return status == AMEDIA_OK;
+}
+
+bool EvsVideoEmulatedCamera::postVideoStreamStop_locked(ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck) {
+ if (!Base::postVideoStreamStop_locked(status, lck)) {
+ return false;
+ }
+ mStream = nullptr;
+ return true;
+}
+
+ndk::ScopedAStatus EvsVideoEmulatedCamera::forcePrimaryClient(
+ const std::shared_ptr<evs::IEvsDisplay>& /* display */) {
+ /* Because EVS HW module reference implementation expects a single client at
+ * a time, this returns a success code always.
+ */
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus EvsVideoEmulatedCamera::getCameraInfo(evs::CameraDesc* _aidl_return) {
+ *_aidl_return = mDescription;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus EvsVideoEmulatedCamera::getExtendedInfo(int32_t opaqueIdentifier,
+ std::vector<uint8_t>* value) {
+ const auto it = mExtInfo.find(opaqueIdentifier);
+ if (it == mExtInfo.end()) {
+ return ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int>(EvsResult::INVALID_ARG));
+ } else {
+ *value = mExtInfo[opaqueIdentifier];
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus EvsVideoEmulatedCamera::getIntParameter(evs::CameraParam id,
+ std::vector<int32_t>* value) {
+ const auto it = mParams.find(id);
+ if (it == mParams.end()) {
+ return ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int>(EvsResult::NOT_SUPPORTED));
+ }
+ value->push_back(it->second->value);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus EvsVideoEmulatedCamera::getIntParameterRange(evs::CameraParam id,
+ evs::ParameterRange* _aidl_return) {
+ const auto it = mParams.find(id);
+ if (it == mParams.end()) {
+ return ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int>(EvsResult::NOT_SUPPORTED));
+ }
+ _aidl_return->min = it->second->range.min;
+ _aidl_return->max = it->second->range.max;
+ _aidl_return->step = it->second->range.step;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus EvsVideoEmulatedCamera::getParameterList(
+ std::vector<evs::CameraParam>* _aidl_return) {
+ if (mCameraInfo) {
+ _aidl_return->resize(mCameraInfo->controls.size());
+ std::size_t idx = 0;
+ for (const auto& [name, range] : mCameraInfo->controls) {
+ (*_aidl_return)[idx++] = name;
+ }
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus EvsVideoEmulatedCamera::getPhysicalCameraInfo(const std::string& /* deviceId */,
+ evs::CameraDesc* _aidl_return) {
+ return getCameraInfo(_aidl_return);
+}
+
+ndk::ScopedAStatus EvsVideoEmulatedCamera::setExtendedInfo(
+ int32_t opaqueIdentifier, const std::vector<uint8_t>& opaqueValue) {
+ mExtInfo.insert_or_assign(opaqueIdentifier, opaqueValue);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus EvsVideoEmulatedCamera::setIntParameter(evs::CameraParam id, int32_t value,
+ std::vector<int32_t>* effectiveValue) {
+ const auto it = mParams.find(id);
+ if (it == mParams.end()) {
+ return ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int>(EvsResult::NOT_SUPPORTED));
+ }
+ // Rounding down to the closest value.
+ int32_t candidate = value / it->second->range.step * it->second->range.step;
+ if (candidate < it->second->range.min || candidate > it->second->range.max) {
+ return ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int>(EvsResult::INVALID_ARG));
+ }
+ it->second->value = candidate;
+ effectiveValue->push_back(candidate);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus EvsVideoEmulatedCamera::setPrimaryClient() {
+ /* Because EVS HW module reference implementation expects a single client at
+ * a time, this returns a success code always.
+ */
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus EvsVideoEmulatedCamera::unsetPrimaryClient() {
+ /* Because EVS HW module reference implementation expects a single client at
+ * a time, there is no chance that this is called by the secondary client and
+ * therefore returns a success code always.
+ */
+ return ndk::ScopedAStatus::ok();
+}
+
+std::shared_ptr<EvsVideoEmulatedCamera> EvsVideoEmulatedCamera::Create(const char* deviceName) {
+ std::unique_ptr<ConfigManager::CameraInfo> nullCamInfo = nullptr;
+ return Create(deviceName, nullCamInfo);
+}
+
+std::shared_ptr<EvsVideoEmulatedCamera> EvsVideoEmulatedCamera::Create(
+ const char* deviceName, std::unique_ptr<ConfigManager::CameraInfo>& camInfo,
+ const evs::Stream* /* streamCfg */) {
+ std::shared_ptr<EvsVideoEmulatedCamera> c =
+ ndk::SharedRefBase::make<EvsVideoEmulatedCamera>(Sigil{}, deviceName, camInfo);
+ if (!c) {
+ LOG(ERROR) << "Failed to instantiate EvsVideoEmulatedCamera.";
+ return nullptr;
+ }
+ if (!c->initialize()) {
+ LOG(ERROR) << "Failed to initialize EvsVideoEmulatedCamera.";
+ return nullptr;
+ }
+ return c;
+}
+
+void EvsVideoEmulatedCamera::shutdown() {
+ mVideoCodec.reset();
+ mVideoExtractor.reset();
+ close(mVideoFd);
+ mVideoFd = 0;
+ Base::shutdown();
+}
+
+} // namespace aidl::android::hardware::automotive::evs::implementation
diff --git a/automotive/evs/aidl/impl/default/src/GlWrapper.cpp b/automotive/evs/aidl/impl/default/src/GlWrapper.cpp
index 0ee5ecb..a9d0213 100644
--- a/automotive/evs/aidl/impl/default/src/GlWrapper.cpp
+++ b/automotive/evs/aidl/impl/default/src/GlWrapper.cpp
@@ -19,6 +19,7 @@
#include <aidl/android/frameworks/automotive/display/DisplayDesc.h>
#include <aidl/android/hardware/graphics/common/HardwareBufferDescription.h>
#include <aidlcommonsupport/NativeHandle.h>
+#include <gui/view/Surface.h>
#include <ui/DisplayMode.h>
#include <ui/DisplayState.h>
#include <ui/GraphicBuffer.h>
@@ -183,20 +184,6 @@
return program;
}
-::android::sp<HGraphicBufferProducer> convertNativeHandleToHGBP(const NativeHandle& aidlHandle) {
- native_handle_t* handle = ::android::dupFromAidl(aidlHandle);
- if (handle->numFds != 0 || handle->numInts < std::ceil(sizeof(size_t) / sizeof(int))) {
- LOG(ERROR) << "Invalid native handle";
- return nullptr;
- }
- ::android::hardware::hidl_vec<uint8_t> halToken;
- halToken.setToExternal(reinterpret_cast<uint8_t*>(const_cast<int*>(&(handle->data[1]))),
- handle->data[0]);
- ::android::sp<HGraphicBufferProducer> hgbp =
- HGraphicBufferProducer::castFrom(::android::retrieveHalInterface(halToken));
- return std::move(hgbp);
-}
-
} // namespace
namespace aidl::android::hardware::automotive::evs::implementation {
@@ -226,30 +213,19 @@
}
LOG(INFO) << "Display resolution is " << mWidth << "x" << mHeight;
- NativeHandle aidlHandle;
- status = pWindowProxy->getHGraphicBufferProducer(displayId, &aidlHandle);
+ aidl::android::view::Surface shimSurface;
+ status = pWindowProxy->getSurface(displayId, &shimSurface);
if (!status.isOk()) {
- LOG(ERROR) << "Failed to get IGraphicBufferProducer from ICarDisplayProxy.";
+ LOG(ERROR) << "Failed to obtain the surface.";
return false;
}
- mGfxBufferProducer = convertNativeHandleToHGBP(aidlHandle);
- if (!mGfxBufferProducer) {
- LOG(ERROR) << "Failed to convert a NativeHandle to HGBP.";
- return false;
- }
-
- mSurfaceHolder = getSurfaceFromHGBP(mGfxBufferProducer);
- if (mSurfaceHolder == nullptr) {
- LOG(ERROR) << "Failed to get a Surface from HGBP.";
- return false;
- }
-
- mWindow = getNativeWindow(mSurfaceHolder.get());
+ mWindow = shimSurface.get();
if (mWindow == nullptr) {
LOG(ERROR) << "Failed to get a native window from Surface.";
return false;
}
+ ANativeWindow_acquire(mWindow);
// Set up our OpenGL ES context associated with the default display
mDisplay = eglGetDisplay(EGL_DEFAULT_DISPLAY);
@@ -350,7 +326,12 @@
mDisplay = EGL_NO_DISPLAY;
// Release the window
- mSurfaceHolder = nullptr;
+ if (mWindow == nullptr) {
+ return;
+ }
+
+ ANativeWindow_release(mWindow);
+ mWindow = nullptr;
}
void GlWrapper::showWindow(const std::shared_ptr<ICarDisplayProxy>& pWindowProxy, uint64_t id) {
diff --git a/automotive/evs/aidl/impl/default/tests/EvsCameraBufferTest.cpp b/automotive/evs/aidl/impl/default/tests/EvsCameraBufferTest.cpp
new file mode 100644
index 0000000..8b4676e
--- /dev/null
+++ b/automotive/evs/aidl/impl/default/tests/EvsCameraBufferTest.cpp
@@ -0,0 +1,210 @@
+/*
+ * 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 "EvsCamera.h"
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <cstdint>
+#include <unordered_set>
+#include <vector>
+
+namespace aidl::android::hardware::automotive::evs::implementation {
+
+class EvsCameraForTest : public EvsCamera {
+ public:
+ using EvsCamera::increaseAvailableFrames_unsafe;
+ using EvsCamera::returnBuffer_unsafe;
+ using EvsCamera::useBuffer_unsafe;
+
+ ~EvsCameraForTest() override { shutdown(); }
+
+ ::android::status_t allocateOneFrame(buffer_handle_t* handle) override {
+ static std::intptr_t handle_cnt = 0;
+ *handle = reinterpret_cast<buffer_handle_t>(++handle_cnt);
+ return ::android::OK;
+ }
+
+ void freeOneFrame(const buffer_handle_t /* handle */) override {
+ // Nothing to free because the handles are fake.
+ }
+
+ void checkBufferOrder() {
+ for (std::size_t idx = 0; idx < mBuffers.size(); ++idx) {
+ const auto& buffer = mBuffers[idx];
+ EXPECT_EQ(idx < mFramesInUse, buffer.inUse);
+ EXPECT_EQ(idx < mAvailableFrames, buffer.handle != nullptr);
+ EXPECT_LE(mFramesInUse, mAvailableFrames);
+ }
+ }
+
+ MOCK_METHOD(::ndk::ScopedAStatus, forcePrimaryClient,
+ (const std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsDisplay>&
+ in_display),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, getCameraInfo,
+ (::aidl::android::hardware::automotive::evs::CameraDesc * _aidl_return),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, getExtendedInfo,
+ (int32_t in_opaqueIdentifier, std::vector<uint8_t>* _aidl_return), (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, getIntParameter,
+ (::aidl::android::hardware::automotive::evs::CameraParam in_id,
+ std::vector<int32_t>* _aidl_return),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, getIntParameterRange,
+ (::aidl::android::hardware::automotive::evs::CameraParam in_id,
+ ::aidl::android::hardware::automotive::evs::ParameterRange* _aidl_return),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, getParameterList,
+ (std::vector<::aidl::android::hardware::automotive::evs::CameraParam> *
+ _aidl_return),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, getPhysicalCameraInfo,
+ (const std::string& in_deviceId,
+ ::aidl::android::hardware::automotive::evs::CameraDesc* _aidl_return),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, setExtendedInfo,
+ (int32_t in_opaqueIdentifier, const std::vector<uint8_t>& in_opaqueValue),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, setIntParameter,
+ (::aidl::android::hardware::automotive::evs::CameraParam in_id, int32_t in_value,
+ std::vector<int32_t>* _aidl_return),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, setPrimaryClient, (), (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, unsetPrimaryClient, (), (override));
+ MOCK_METHOD(bool, startVideoStreamImpl_locked,
+ (const std::shared_ptr<evs::IEvsCameraStream>& receiver, ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck),
+ (override));
+ MOCK_METHOD(bool, stopVideoStreamImpl_locked,
+ (ndk::ScopedAStatus & status, std::unique_lock<std::mutex>& lck), (override));
+};
+
+TEST(EvsCameraBufferTest, ChangeBufferPoolSize) {
+ auto evsCam = ndk::SharedRefBase::make<EvsCameraForTest>();
+ EXPECT_TRUE(evsCam->setMaxFramesInFlight(100).isOk());
+ evsCam->checkBufferOrder();
+ EXPECT_TRUE(evsCam->setMaxFramesInFlight(50).isOk());
+ evsCam->checkBufferOrder();
+
+ // 2 buffers in use.
+ const auto [id1, handle1] = evsCam->useBuffer_unsafe();
+ const auto [id2, handle2] = evsCam->useBuffer_unsafe();
+ std::ignore = evsCam->useBuffer_unsafe();
+
+ // It allows you to set the buffer pool size to 1, but it will keep the space for the in use
+ // buffers.
+ EXPECT_TRUE(evsCam->setMaxFramesInFlight(1).isOk());
+ evsCam->checkBufferOrder();
+
+ evsCam->returnBuffer_unsafe(id1);
+ evsCam->checkBufferOrder();
+ evsCam->returnBuffer_unsafe(id2);
+ evsCam->checkBufferOrder();
+}
+
+TEST(EvsCameraBufferTest, UseAndReturn) {
+ constexpr std::size_t kNumOfHandles = 20;
+ auto evsCam = ndk::SharedRefBase::make<EvsCameraForTest>();
+
+ // Our "fake handles" of this test case is 1 to kNumOfHandles.
+ for (std::size_t i = 1; i <= kNumOfHandles; ++i) {
+ evsCam->increaseAvailableFrames_unsafe(reinterpret_cast<buffer_handle_t>(i));
+ }
+ evsCam->checkBufferOrder();
+
+ {
+ std::vector<std::pair<std::size_t, std::intptr_t>> inUseIDHandlePairs;
+ std::unordered_set<std::size_t> inUseIDs;
+ std::unordered_set<std::intptr_t> inUseHandles;
+ for (std::size_t i = 0; i < kNumOfHandles; ++i) {
+ const auto [id, handle] = evsCam->useBuffer_unsafe();
+ const std::size_t handleInt = reinterpret_cast<std::size_t>(handle);
+ EXPECT_TRUE(EvsCamera::IsBufferIDValid(id));
+ EXPECT_NE(handle, nullptr);
+ EXPECT_LT(id, kNumOfHandles);
+
+ // handleInt must be between [1, kNumOfHandles] as we "allocated" above.
+ EXPECT_LT(0u, handleInt);
+ EXPECT_LE(handleInt, kNumOfHandles);
+
+ inUseIDHandlePairs.push_back({id, handleInt});
+ EXPECT_TRUE(inUseIDs.insert(id).second);
+ EXPECT_TRUE(inUseHandles.insert(handleInt).second);
+ evsCam->checkBufferOrder();
+ }
+ // Return buffers in the order of acquiring.
+ for (const auto [id, handleInt] : inUseIDHandlePairs) {
+ evsCam->returnBuffer_unsafe(id);
+ evsCam->checkBufferOrder();
+ }
+ }
+
+ {
+ std::vector<std::pair<std::size_t, std::intptr_t>> inUseIDHandlePairs;
+ std::unordered_set<std::size_t> inUseIDs;
+ std::unordered_set<std::intptr_t> inUseHandles;
+ for (std::size_t i = 0; i < kNumOfHandles; ++i) {
+ const auto [id, handle] = evsCam->useBuffer_unsafe();
+ const std::size_t handleInt = reinterpret_cast<std::size_t>(handle);
+ EXPECT_TRUE(EvsCamera::IsBufferIDValid(id));
+ EXPECT_NE(handle, nullptr);
+ EXPECT_LT(id, kNumOfHandles);
+
+ // handleInt must be between [1, kNumOfHandles] as we "allocated" above.
+ EXPECT_LT(0u, handleInt);
+ EXPECT_LE(handleInt, kNumOfHandles);
+
+ inUseIDHandlePairs.push_back({id, handleInt});
+ EXPECT_TRUE(inUseIDs.insert(id).second);
+ EXPECT_TRUE(inUseHandles.insert(handleInt).second);
+ evsCam->checkBufferOrder();
+ }
+ // Return buffers in the reverse order of acquiring.
+ std::reverse(inUseIDHandlePairs.begin(), inUseIDHandlePairs.end());
+ for (const auto [id, handleInt] : inUseIDHandlePairs) {
+ evsCam->returnBuffer_unsafe(id);
+ evsCam->checkBufferOrder();
+ }
+ }
+
+ {
+ // Making sure the handles are still in [1, kNumOfHandles] and IDs are still [0,
+ // kNumOfHandles). The mapping may be different, though.
+ std::vector<std::pair<std::size_t, std::intptr_t>> inUseIDHandlePairs;
+ std::unordered_set<std::size_t> inUseIDs;
+ std::unordered_set<std::intptr_t> inUseHandles;
+ for (std::size_t i = 0; i < kNumOfHandles; ++i) {
+ const auto [id, handle] = evsCam->useBuffer_unsafe();
+ const std::size_t handleInt = reinterpret_cast<std::size_t>(handle);
+ EXPECT_TRUE(EvsCamera::IsBufferIDValid(id));
+ EXPECT_NE(handle, nullptr);
+ EXPECT_LT(id, kNumOfHandles);
+
+ // handleInt must be between [1, kNumOfHandles] as we "allocated" above.
+ EXPECT_LT(0u, handleInt);
+ EXPECT_LE(handleInt, kNumOfHandles);
+
+ inUseIDHandlePairs.push_back({id, handleInt});
+ EXPECT_TRUE(inUseIDs.insert(id).second);
+ EXPECT_TRUE(inUseHandles.insert(handleInt).second);
+ evsCam->checkBufferOrder();
+ }
+ }
+}
+
+} // namespace aidl::android::hardware::automotive::evs::implementation
diff --git a/automotive/evs/aidl/impl/default/tests/EvsCameraStateTest.cpp b/automotive/evs/aidl/impl/default/tests/EvsCameraStateTest.cpp
new file mode 100644
index 0000000..1925c79
--- /dev/null
+++ b/automotive/evs/aidl/impl/default/tests/EvsCameraStateTest.cpp
@@ -0,0 +1,202 @@
+/*
+ * 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 "EvsCamera.h"
+
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <cstdint>
+#include <unordered_set>
+#include <vector>
+
+namespace aidl::android::hardware::automotive::evs::implementation {
+
+class EvsCameraForTest : public EvsCamera {
+ private:
+ using Base = EvsCamera;
+
+ public:
+ using EvsCamera::mStreamState;
+ using EvsCamera::shutdown;
+ using EvsCamera::StreamState;
+
+ ~EvsCameraForTest() override { shutdown(); }
+
+ ::android::status_t allocateOneFrame(buffer_handle_t* handle) override {
+ static std::intptr_t handle_cnt = 0;
+ *handle = reinterpret_cast<buffer_handle_t>(++handle_cnt);
+ return ::android::OK;
+ }
+
+ void freeOneFrame(const buffer_handle_t /* handle */) override {
+ // Nothing to free because the handles are fake.
+ }
+
+ bool preVideoStreamStart_locked(const std::shared_ptr<evs::IEvsCameraStream>& receiver,
+ ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck) override {
+ mPreStartCalled = true;
+ EXPECT_EQ(mStreamState, StreamState::STOPPED);
+ EXPECT_FALSE(mStreamStarted);
+ EXPECT_FALSE(mStreamStopped);
+ return Base::preVideoStreamStart_locked(receiver, status, lck);
+ }
+
+ bool startVideoStreamImpl_locked(const std::shared_ptr<evs::IEvsCameraStream>& /* receiver */,
+ ndk::ScopedAStatus& /* status */,
+ std::unique_lock<std::mutex>& /* lck */) override {
+ EXPECT_EQ(mStreamState, StreamState::RUNNING);
+ EXPECT_FALSE(mStreamStarted);
+ EXPECT_FALSE(mStreamStopped);
+ mStreamStarted = true;
+ return true;
+ }
+
+ bool postVideoStreamStart_locked(const std::shared_ptr<evs::IEvsCameraStream>& receiver,
+ ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck) override {
+ mPostStartCalled = true;
+ EXPECT_EQ(mStreamState, StreamState::RUNNING);
+ EXPECT_TRUE(mStreamStarted);
+ EXPECT_FALSE(mStreamStopped);
+ return Base::postVideoStreamStart_locked(receiver, status, lck);
+ }
+
+ bool preVideoStreamStop_locked(ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck) override {
+ // Skip the check if stop was called before.
+ if (!mPreStopCalled) {
+ mPreStopCalled = true;
+ EXPECT_EQ(mStreamState, StreamState::RUNNING);
+ EXPECT_TRUE(mStreamStarted);
+ EXPECT_FALSE(mStreamStopped);
+ }
+ return Base::preVideoStreamStop_locked(status, lck);
+ }
+
+ bool stopVideoStreamImpl_locked(ndk::ScopedAStatus& /* status */,
+ std::unique_lock<std::mutex>& /* lck */) override {
+ EXPECT_EQ(mStreamState, StreamState::STOPPING);
+ EXPECT_TRUE(mStreamStarted);
+ EXPECT_FALSE(mStreamStopped);
+ mStreamStopped = true;
+ return true;
+ }
+
+ bool postVideoStreamStop_locked(ndk::ScopedAStatus& status,
+ std::unique_lock<std::mutex>& lck) override {
+ mPostStopCalled = true;
+ const auto ret = Base::postVideoStreamStop_locked(status, lck);
+ EXPECT_EQ(mStreamState, StreamState::STOPPED);
+ EXPECT_TRUE(mStreamStarted);
+ EXPECT_TRUE(mStreamStopped);
+ return ret;
+ }
+
+ MOCK_METHOD(::ndk::ScopedAStatus, forcePrimaryClient,
+ (const std::shared_ptr<::aidl::android::hardware::automotive::evs::IEvsDisplay>&
+ in_display),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, getCameraInfo,
+ (::aidl::android::hardware::automotive::evs::CameraDesc * _aidl_return),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, getExtendedInfo,
+ (int32_t in_opaqueIdentifier, std::vector<uint8_t>* _aidl_return), (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, getIntParameter,
+ (::aidl::android::hardware::automotive::evs::CameraParam in_id,
+ std::vector<int32_t>* _aidl_return),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, getIntParameterRange,
+ (::aidl::android::hardware::automotive::evs::CameraParam in_id,
+ ::aidl::android::hardware::automotive::evs::ParameterRange* _aidl_return),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, getParameterList,
+ (std::vector<::aidl::android::hardware::automotive::evs::CameraParam> *
+ _aidl_return),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, getPhysicalCameraInfo,
+ (const std::string& in_deviceId,
+ ::aidl::android::hardware::automotive::evs::CameraDesc* _aidl_return),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, setExtendedInfo,
+ (int32_t in_opaqueIdentifier, const std::vector<uint8_t>& in_opaqueValue),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, setIntParameter,
+ (::aidl::android::hardware::automotive::evs::CameraParam in_id, int32_t in_value,
+ std::vector<int32_t>* _aidl_return),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, setPrimaryClient, (), (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, unsetPrimaryClient, (), (override));
+
+ bool mStreamStarted = false;
+ bool mStreamStopped = false;
+ bool mPreStartCalled = false;
+ bool mPostStartCalled = false;
+ bool mPreStopCalled = false;
+ bool mPostStopCalled = false;
+};
+
+class MockEvsCameraStream : public evs::IEvsCameraStream {
+ MOCK_METHOD(::ndk::SpAIBinder, asBinder, (), (override));
+ MOCK_METHOD(bool, isRemote, (), (override));
+ MOCK_METHOD(
+ ::ndk::ScopedAStatus, deliverFrame,
+ (const std::vector<::aidl::android::hardware::automotive::evs::BufferDesc>& in_buffer),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, notify,
+ (const ::aidl::android::hardware::automotive::evs::EvsEventDesc& in_event),
+ (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, getInterfaceVersion, (int32_t * _aidl_return), (override));
+ MOCK_METHOD(::ndk::ScopedAStatus, getInterfaceHash, (std::string * _aidl_return), (override));
+};
+
+using StreamState = EvsCameraForTest::StreamState;
+
+TEST(EvsCameraStateTest, StateChangeHooks) {
+ auto evsCam = ndk::SharedRefBase::make<EvsCameraForTest>();
+ auto mockStream = ndk::SharedRefBase::make<MockEvsCameraStream>();
+ EXPECT_FALSE(evsCam->mPreStartCalled);
+ EXPECT_FALSE(evsCam->mPostStartCalled);
+ EXPECT_FALSE(evsCam->mPreStopCalled);
+ EXPECT_FALSE(evsCam->mPostStopCalled);
+ EXPECT_FALSE(evsCam->mStreamStarted);
+ EXPECT_FALSE(evsCam->mStreamStopped);
+ EXPECT_EQ(evsCam->mStreamState, StreamState::STOPPED);
+ evsCam->startVideoStream(mockStream);
+
+ EXPECT_TRUE(evsCam->mPreStartCalled);
+ EXPECT_TRUE(evsCam->mPostStartCalled);
+ EXPECT_FALSE(evsCam->mPreStopCalled);
+ EXPECT_FALSE(evsCam->mPostStopCalled);
+ EXPECT_TRUE(evsCam->mStreamStarted);
+ EXPECT_FALSE(evsCam->mStreamStopped);
+ EXPECT_EQ(evsCam->mStreamState, StreamState::RUNNING);
+ evsCam->stopVideoStream();
+
+ EXPECT_TRUE(evsCam->mPreStartCalled);
+ EXPECT_TRUE(evsCam->mPostStartCalled);
+ EXPECT_TRUE(evsCam->mPreStopCalled);
+ EXPECT_TRUE(evsCam->mPostStopCalled);
+ EXPECT_TRUE(evsCam->mStreamStarted);
+ EXPECT_TRUE(evsCam->mStreamStopped);
+ EXPECT_EQ(evsCam->mStreamState, StreamState::STOPPED);
+
+ evsCam->shutdown();
+ EXPECT_EQ(evsCam->mStreamState, StreamState::DEAD);
+}
+
+} // namespace aidl::android::hardware::automotive::evs::implementation
diff --git a/automotive/remoteaccess/Android.bp b/automotive/remoteaccess/Android.bp
index 7cd6f60..e1e9041 100644
--- a/automotive/remoteaccess/Android.bp
+++ b/automotive/remoteaccess/Android.bp
@@ -42,6 +42,5 @@
imports: [],
},
],
- frozen: true,
-
+ frozen: false,
}
diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
index b0935c2..ccfa22d 100644
--- a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
+++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
@@ -40,4 +40,10 @@
void setRemoteTaskCallback(android.hardware.automotive.remoteaccess.IRemoteTaskCallback callback);
void clearRemoteTaskCallback();
void notifyApStateChange(in android.hardware.automotive.remoteaccess.ApState state);
+ boolean isTaskScheduleSupported();
+ void scheduleTask(in android.hardware.automotive.remoteaccess.ScheduleInfo scheduleInfo);
+ void unscheduleTask(String clientId, String scheduleId);
+ void unscheduleAllTasks(String clientId);
+ boolean isTaskScheduled(String clientId, String scheduleId);
+ List<android.hardware.automotive.remoteaccess.ScheduleInfo> getAllScheduledTasks(String clientId);
}
diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
new file mode 100644
index 0000000..a929e10
--- /dev/null
+++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
@@ -0,0 +1,43 @@
+/*
+ * 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.automotive.remoteaccess;
+@JavaDerive(equals=true, toString=true) @VintfStability
+parcelable ScheduleInfo {
+ String clientId;
+ String scheduleId;
+ byte[] taskData;
+ int count;
+ long startTimeInEpochSeconds;
+ long periodicInSeconds;
+}
diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
index 0f4125f..4912651 100644
--- a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
+++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
@@ -18,6 +18,7 @@
import android.hardware.automotive.remoteaccess.ApState;
import android.hardware.automotive.remoteaccess.IRemoteTaskCallback;
+import android.hardware.automotive.remoteaccess.ScheduleInfo;
/**
* Interface representing a remote wakeup client.
@@ -96,4 +97,69 @@
* <p>If {@code isWakeupRequired} is false, it must not try to wake up AP.
*/
void notifyApStateChange(in ApState state);
+
+ /**
+ * Returns whether task scheduling is supported.
+ *
+ * <p>If this returns {@code true}, user may use {@link scheduleTask} to schedule a task to be
+ * executed at a later time. If the device is off when the task is scheduled to be executed,
+ * the device will be woken up to execute the task.
+ *
+ * @return {@code true} if serverless remote task scheduling is supported.
+ */
+ boolean isTaskScheduleSupported();
+
+ /**
+ * Schedules a task to be executed later even when the vehicle is off.
+ *
+ * <p>If {@link isTaskScheduleSupported} returns {@code false}. This is no-op.
+ *
+ * <p>This sends a scheduled task message to a device external to Android so that the device
+ * can wake up Android and deliver the task through {@link IRemoteTaskCallback}.
+ *
+ * <p>Note that the scheduled task execution is on a best-effort basis. Multiple situations
+ * might cause the task not to execute successfully:
+ *
+ * <ul>
+ * <li>The vehicle is low on battery and the other device decides not to wake up Android.
+ * <li>User turns off vehicle while the task is executing.
+ * <li>The task logic itself fails.
+ *
+ * <p>Must return {@code EX_ILLEGAL_ARGUMENT} if a pending schedule with the same
+ * {@code scheduleId} for this client exists.
+ */
+ void scheduleTask(in ScheduleInfo scheduleInfo);
+
+ /**
+ * Unschedules a scheduled task.
+ *
+ * <p>If {@link isTaskScheduleSupported} returns {@code false}. This is no-op.
+ *
+ * <p>Does nothing if a pending schedule with {@code clientId} and {@code scheduleId} does not
+ * exist.
+ */
+ void unscheduleTask(String clientId, String scheduleId);
+
+ /**
+ * Unschedules all scheduled tasks for the client.
+ *
+ * <p>If {@link isTaskScheduleSupported} returns {@code false}. This is no-op.
+ */
+ void unscheduleAllTasks(String clientId);
+
+ /**
+ * Returns whether the specified task is scheduled.
+ *
+ * <p>If {@link isTaskScheduleSupported} returns {@code false}, This must return {@code false}.
+ */
+ boolean isTaskScheduled(String clientId, String scheduleId);
+
+ /**
+ * Gets all pending scheduled tasks for the client.
+ *
+ * <p>If {@link isTaskScheduleSupported} returns {@code false}. This must return empty array.
+ *
+ * <p>The finished scheduled tasks will not be included.
+ */
+ List<ScheduleInfo> getAllScheduledTasks(String clientId);
}
diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
new file mode 100644
index 0000000..cf1437b
--- /dev/null
+++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ */
+
+package android.hardware.automotive.remoteaccess;
+
+@VintfStability
+@JavaDerive(equals=true, toString=true)
+parcelable ScheduleInfo {
+ /**
+ * The ID used to identify the client this schedule is for. This must be one of the
+ * preconfigured remote access serverless client ID defined in car service resource
+ * {@code R.xml.remote_access_serverless_client_map}.
+ */
+ String clientId;
+ /**
+ * A unique scheduling ID (among the same client). Adding a new schedule info with a duplicate
+ * scheduleId will return {@code EX_ILLEGAL_ARGUMENT}.
+ */
+ String scheduleId;
+ /**
+ * The opaque task data that will be sent back to the remote task client app when the task is
+ * executed. It is not interpreted/parsed by the Android system.
+ */
+ byte[] taskData;
+ /**
+ * How many times this task will be executed. 0 means infinite.
+ *
+ * <p>This must be >= 0.
+ */
+ int count;
+ /**
+ * The start time in epoch seconds.
+ *
+ * <p>The external device issuing remote task must have a clock synced with the
+ * {@code System.currentTimeMillis()} used in Android system.
+ *
+ * <p>Optionally, the VHAL property {@code EPOCH_TIME} can be used to sync the time.
+ *
+ * <p>This must be >= 0.
+ */
+ long startTimeInEpochSeconds;
+ /**
+ * The interval (in seconds) between scheduled task execution.
+ *
+ * <p>This must be >=0. This is not useful when {@code count} is 1. If this is 0,
+ * The tasks will be delivered multiple times with no interval in between.
+ */
+ long periodicInSeconds;
+}
diff --git a/automotive/remoteaccess/hal/default/Android.bp b/automotive/remoteaccess/hal/default/Android.bp
index a16e22f..9d86740 100644
--- a/automotive/remoteaccess/hal/default/Android.bp
+++ b/automotive/remoteaccess/hal/default/Android.bp
@@ -49,17 +49,17 @@
}
cc_binary {
- name: "android.hardware.automotive.remoteaccess@V1-default-service",
+ name: "android.hardware.automotive.remoteaccess@V2-default-service",
defaults: ["remote-access-hal-defaults"],
vintf_fragments: ["remoteaccess-default-service.xml"],
init_rc: ["remoteaccess-default-service.rc"],
cflags: [
- "-DGRPC_SERVICE_ADDRESS=\"localhost:50051\"",
+ "-DGRPC_SERVICE_ADDRESS=\"10.0.2.2:50051\"",
],
}
cc_binary {
- name: "android.hardware.automotive.remoteaccess@V1-tcu-test-service",
+ name: "android.hardware.automotive.remoteaccess@V2-tcu-test-service",
defaults: ["remote-access-hal-defaults"],
vintf_fragments: ["remoteaccess-default-service.xml"],
init_rc: ["remoteaccess-tcu-test-service.rc"],
@@ -78,7 +78,7 @@
"src/RemoteAccessService.cpp",
],
whole_static_libs: [
- "android.hardware.automotive.remoteaccess-V1-ndk",
+ "android.hardware.automotive.remoteaccess-V2-ndk",
"wakeup_client_protos",
"libvhalclient",
],
@@ -100,7 +100,7 @@
}
cc_fuzz {
- name: "android.hardware.automotive.remoteaccess@V1-default-service.aidl_fuzzer",
+ name: "android.hardware.automotive.remoteaccess@V2-default-service.aidl_fuzzer",
srcs: ["fuzzer/fuzzer.cpp"],
whole_static_libs: [
"RemoteAccessService",
diff --git a/automotive/remoteaccess/hal/default/fuzzer/fuzzer.cpp b/automotive/remoteaccess/hal/default/fuzzer/fuzzer.cpp
index 292c80e..9224ebc 100644
--- a/automotive/remoteaccess/hal/default/fuzzer/fuzzer.cpp
+++ b/automotive/remoteaccess/hal/default/fuzzer/fuzzer.cpp
@@ -55,6 +55,31 @@
return Status::OK;
}
+ Status ScheduleTask(ClientContext* context, const ScheduleTaskRequest& request,
+ ScheduleTaskResponse* response) {
+ return Status::OK;
+ }
+
+ Status UnscheduleTask(ClientContext* context, const UnscheduleTaskRequest& request,
+ UnscheduleTaskResponse* response) {
+ return Status::OK;
+ }
+
+ Status UnscheduleAllTasks(ClientContext* context, const UnscheduleAllTasksRequest& request,
+ UnscheduleAllTasksResponse* response) {
+ return Status::OK;
+ }
+
+ Status IsTaskScheduled(ClientContext* context, const IsTaskScheduledRequest& request,
+ IsTaskScheduledResponse* response) {
+ return Status::OK;
+ }
+
+ Status GetAllScheduledTasks(ClientContext* context, const GetAllScheduledTasksRequest& request,
+ GetAllScheduledTasksResponse* response) {
+ return Status::OK;
+ }
+
// Async methods which we do not care.
ClientAsyncReaderInterface<GetRemoteTasksResponse>* AsyncGetRemoteTasksRaw(
[[maybe_unused]] ClientContext* context,
@@ -83,6 +108,76 @@
[[maybe_unused]] CompletionQueue* c) {
return nullptr;
}
+
+ ClientAsyncResponseReaderInterface<ScheduleTaskResponse>* AsyncScheduleTaskRaw(
+ [[maybe_unused]] ClientContext* context,
+ [[maybe_unused]] const ScheduleTaskRequest& request,
+ [[maybe_unused]] CompletionQueue* cq) {
+ return nullptr;
+ }
+
+ ClientAsyncResponseReaderInterface<ScheduleTaskResponse>* PrepareAsyncScheduleTaskRaw(
+ [[maybe_unused]] ClientContext* context,
+ [[maybe_unused]] const ScheduleTaskRequest& request,
+ [[maybe_unused]] CompletionQueue* c) {
+ return nullptr;
+ }
+
+ ClientAsyncResponseReaderInterface<UnscheduleTaskResponse>* AsyncUnscheduleTaskRaw(
+ [[maybe_unused]] ClientContext* context,
+ [[maybe_unused]] const UnscheduleTaskRequest& request,
+ [[maybe_unused]] CompletionQueue* cq) {
+ return nullptr;
+ }
+
+ ClientAsyncResponseReaderInterface<UnscheduleTaskResponse>* PrepareAsyncUnscheduleTaskRaw(
+ [[maybe_unused]] ClientContext* context,
+ [[maybe_unused]] const UnscheduleTaskRequest& request,
+ [[maybe_unused]] CompletionQueue* c) {
+ return nullptr;
+ }
+
+ ClientAsyncResponseReaderInterface<UnscheduleAllTasksResponse>* AsyncUnscheduleAllTasksRaw(
+ [[maybe_unused]] ClientContext* context,
+ [[maybe_unused]] const UnscheduleAllTasksRequest& request,
+ [[maybe_unused]] CompletionQueue* cq) {
+ return nullptr;
+ }
+
+ ClientAsyncResponseReaderInterface<UnscheduleAllTasksResponse>*
+ PrepareAsyncUnscheduleAllTasksRaw([[maybe_unused]] ClientContext* context,
+ [[maybe_unused]] const UnscheduleAllTasksRequest& request,
+ [[maybe_unused]] CompletionQueue* c) {
+ return nullptr;
+ }
+
+ ClientAsyncResponseReaderInterface<IsTaskScheduledResponse>* AsyncIsTaskScheduledRaw(
+ [[maybe_unused]] ClientContext* context,
+ [[maybe_unused]] const IsTaskScheduledRequest& request,
+ [[maybe_unused]] CompletionQueue* cq) {
+ return nullptr;
+ }
+
+ ClientAsyncResponseReaderInterface<IsTaskScheduledResponse>* PrepareAsyncIsTaskScheduledRaw(
+ [[maybe_unused]] ClientContext* context,
+ [[maybe_unused]] const IsTaskScheduledRequest& request,
+ [[maybe_unused]] CompletionQueue* c) {
+ return nullptr;
+ }
+
+ ClientAsyncResponseReaderInterface<GetAllScheduledTasksResponse>* AsyncGetAllScheduledTasksRaw(
+ [[maybe_unused]] ClientContext* context,
+ [[maybe_unused]] const GetAllScheduledTasksRequest& request,
+ [[maybe_unused]] CompletionQueue* cq) {
+ return nullptr;
+ }
+
+ ClientAsyncResponseReaderInterface<GetAllScheduledTasksResponse>*
+ PrepareAsyncGetAllScheduledTasksRaw([[maybe_unused]] ClientContext* context,
+ [[maybe_unused]] const GetAllScheduledTasksRequest& request,
+ [[maybe_unused]] CompletionQueue* c) {
+ return nullptr;
+ }
};
} // namespace remoteaccess
diff --git a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
index b18986a..1fc4037 100644
--- a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
+++ b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
@@ -21,6 +21,7 @@
#include <aidl/android/hardware/automotive/remoteaccess/BnRemoteAccess.h>
#include <aidl/android/hardware/automotive/remoteaccess/BnRemoteTaskCallback.h>
#include <aidl/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.h>
+#include <aidl/android/hardware/automotive/remoteaccess/ScheduleInfo.h>
#include <android-base/thread_annotations.h>
#include <android/binder_auto_utils.h>
#include <utils/SystemClock.h>
@@ -78,6 +79,25 @@
ndk::ScopedAStatus notifyApStateChange(
const aidl::android::hardware::automotive::remoteaccess::ApState& newState) override;
+ ndk::ScopedAStatus isTaskScheduleSupported(bool* out) override;
+
+ ndk::ScopedAStatus scheduleTask(
+ const aidl::android::hardware::automotive::remoteaccess::ScheduleInfo& scheduleInfo)
+ override;
+
+ ndk::ScopedAStatus unscheduleTask(const std::string& clientId,
+ const std::string& scheduleId) override;
+
+ ndk::ScopedAStatus unscheduleAllTasks(const std::string& clientId) override;
+
+ ndk::ScopedAStatus isTaskScheduled(const std::string& clientId, const std::string& scheduleId,
+ bool* out) override;
+
+ ndk::ScopedAStatus getAllScheduledTasks(
+ const std::string& clientId,
+ std::vector<aidl::android::hardware::automotive::remoteaccess::ScheduleInfo>* out)
+ override;
+
binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
private:
diff --git a/automotive/remoteaccess/hal/default/proto/wakeup_client.proto b/automotive/remoteaccess/hal/default/proto/wakeup_client.proto
index 4fe0d01..e061016 100644
--- a/automotive/remoteaccess/hal/default/proto/wakeup_client.proto
+++ b/automotive/remoteaccess/hal/default/proto/wakeup_client.proto
@@ -18,6 +18,12 @@
package android.hardware.automotive.remoteaccess;
+enum ErrorCode {
+ OK = 0;
+ UNSPECIFIED = 1;
+ INVALID_ARG = 2;
+}
+
/**
* Service provided by a wakeup client running on TCU.
*/
@@ -50,6 +56,50 @@
* to wake up AP.
*/
rpc NotifyWakeupRequired(NotifyWakeupRequiredRequest) returns (NotifyWakeupRequiredResponse) {}
+
+ /**
+ * Schedules a task to be executed later even when the vehicle is off.
+ *
+ * <p>This sends a scheduled task message to a device external to Android so that the device
+ * can wake up Android and deliver the task through {@link IRemoteTaskCallback}.
+ *
+ * <p>Note that the scheduled task execution is on a best-effort basis. Multiple situations
+ * might cause the task not to execute successfully:
+ *
+ * <ul>
+ * <li>The vehicle is low on battery and the other device decides not to wake up Android.
+ * <li>User turns off vehicle while the task is executing.
+ * <li>The task logic itself fails.
+ *
+ * <p>Must return a response with error code: {@code INVALID_ARG} if a pending schedule with the
+ * same {@code scheduleId} for this client exists.
+ */
+ rpc ScheduleTask(ScheduleTaskRequest) returns (ScheduleTaskResponse) {}
+
+ /**
+ * Unschedules a scheduled task.
+ *
+ * <p>Does nothing if a pending schedule with {@code clientId} and {@code scheduleId} does not
+ * exist.
+ */
+ rpc UnscheduleTask(UnscheduleTaskRequest) returns (UnscheduleTaskResponse) {}
+
+ /**
+ * Unschedules all scheduled tasks for the client.
+ */
+ rpc UnscheduleAllTasks(UnscheduleAllTasksRequest) returns (UnscheduleAllTasksResponse) {}
+
+ /**
+ * Returns whether the specified task is scheduled.
+ */
+ rpc IsTaskScheduled(IsTaskScheduledRequest) returns (IsTaskScheduledResponse) {}
+
+ /**
+ * Gets all pending scheduled tasks for the client.
+ *
+ * <p>The finished scheduled tasks will not be included.
+ */
+ rpc GetAllScheduledTasks(GetAllScheduledTasksRequest) returns (GetAllScheduledTasksResponse) {}
}
message GetRemoteTasksRequest {}
@@ -64,3 +114,50 @@
}
message NotifyWakeupRequiredResponse {}
+
+message ScheduleTaskRequest {
+ GrpcScheduleInfo scheduleInfo = 1;
+}
+
+message ScheduleTaskResponse {
+ ErrorCode errorCode = 1;
+}
+
+message GrpcScheduleInfo {
+ string clientId = 1;
+ string scheduleId = 2;
+ bytes data = 3;
+ int32 count = 4;
+ int64 startTimeInEpochSeconds = 5;
+ int64 periodicInSeconds = 6;
+}
+
+message UnscheduleTaskRequest {
+ string clientId = 1;
+ string scheduleId = 2;
+}
+
+message UnscheduleTaskResponse {}
+
+message UnscheduleAllTasksRequest {
+ string clientId = 1;
+}
+
+message UnscheduleAllTasksResponse {}
+
+message IsTaskScheduledRequest {
+ string clientId = 1;
+ string scheduleId = 2;
+}
+
+message IsTaskScheduledResponse {
+ bool isTaskScheduled = 1;
+}
+
+message GetAllScheduledTasksRequest {
+ string clientId = 1;
+}
+
+message GetAllScheduledTasksResponse {
+ repeated GrpcScheduleInfo allScheduledTasks = 1;
+}
diff --git a/automotive/remoteaccess/hal/default/remoteaccess-default-service.rc b/automotive/remoteaccess/hal/default/remoteaccess-default-service.rc
index b7a9cdc..c9b282c 100644
--- a/automotive/remoteaccess/hal/default/remoteaccess-default-service.rc
+++ b/automotive/remoteaccess/hal/default/remoteaccess-default-service.rc
@@ -1,4 +1,4 @@
-service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V1-default-service
+service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V2-default-service
class hal
user vehicle_network
group system inet
diff --git a/automotive/remoteaccess/hal/default/remoteaccess-default-service.xml b/automotive/remoteaccess/hal/default/remoteaccess-default-service.xml
index d050a1b..44ac309 100644
--- a/automotive/remoteaccess/hal/default/remoteaccess-default-service.xml
+++ b/automotive/remoteaccess/hal/default/remoteaccess-default-service.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.automotive.remoteaccess</name>
- <version>1</version>
+ <version>2</version>
<fqname>IRemoteAccess/default</fqname>
</hal>
</manifest>
diff --git a/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service.rc b/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service.rc
index 59315eb..19faaf4 100644
--- a/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service.rc
+++ b/automotive/remoteaccess/hal/default/remoteaccess-tcu-test-service.rc
@@ -1,4 +1,4 @@
-service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V1-tcu-test-service
+service vendor.remoteaccess-default /vendor/bin/hw/android.hardware.automotive.remoteaccess@V2-tcu-test-service
class hal
user vehicle_network
group system inet
diff --git a/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp b/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp
index b091162..d4ba864 100644
--- a/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp
+++ b/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp
@@ -30,12 +30,12 @@
constexpr char SERVICE_NAME[] = "android.hardware.automotive.remoteaccess.IRemoteAccess/default";
int main(int /* argc */, char* /* argv */[]) {
- LOG(INFO) << "Registering RemoteAccessService as service...";
-
#ifndef GRPC_SERVICE_ADDRESS
LOG(ERROR) << "GRPC_SERVICE_ADDRESS is not defined, exiting";
exit(1);
#endif
+ LOG(INFO) << "Registering RemoteAccessService as service, server: " << GRPC_SERVICE_ADDRESS
+ << "...";
grpc::ChannelArguments grpcargs = {};
#ifdef GRPC_SERVICE_IFNAME
@@ -48,8 +48,7 @@
android::netdevice::WaitCondition::PRESENT_AND_UP);
LOG(INFO) << "Waiting for interface: " << GRPC_SERVICE_IFNAME << " done";
#endif
- auto channel = grpc::CreateCustomChannel(GRPC_SERVICE_ADDRESS,
- grpc::InsecureChannelCredentials(), grpcargs);
+ auto channel = grpc::CreateChannel(GRPC_SERVICE_ADDRESS, grpc::InsecureChannelCredentials());
auto clientStub = android::hardware::automotive::remoteaccess::WakeupClient::NewStub(channel);
auto service = ndk::SharedRefBase::make<
android::hardware::automotive::remoteaccess::RemoteAccessService>(clientStub.get());
diff --git a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
index 5081ac0..0944d86 100644
--- a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
+++ b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
@@ -39,6 +39,7 @@
using ::aidl::android::hardware::automotive::remoteaccess::ApState;
using ::aidl::android::hardware::automotive::remoteaccess::IRemoteTaskCallback;
+using ::aidl::android::hardware::automotive::remoteaccess::ScheduleInfo;
using ::aidl::android::hardware::automotive::vehicle::VehicleProperty;
using ::android::base::Error;
using ::android::base::ParseInt;
@@ -313,6 +314,109 @@
return ScopedAStatus::ok();
}
+ScopedAStatus RemoteAccessService::isTaskScheduleSupported(bool* out) {
+ *out = true;
+ return ScopedAStatus::ok();
+}
+
+ScopedAStatus RemoteAccessService::scheduleTask(const ScheduleInfo& scheduleInfo) {
+ ClientContext context;
+ ScheduleTaskRequest request = {};
+ ScheduleTaskResponse response = {};
+ request.mutable_scheduleinfo()->set_clientid(scheduleInfo.clientId);
+ request.mutable_scheduleinfo()->set_scheduleid(scheduleInfo.scheduleId);
+ request.mutable_scheduleinfo()->set_data(scheduleInfo.taskData.data(),
+ scheduleInfo.taskData.size());
+ request.mutable_scheduleinfo()->set_count(scheduleInfo.count);
+ request.mutable_scheduleinfo()->set_starttimeinepochseconds(
+ scheduleInfo.startTimeInEpochSeconds);
+ request.mutable_scheduleinfo()->set_periodicinseconds(scheduleInfo.periodicInSeconds);
+ Status status = mGrpcStub->ScheduleTask(&context, request, &response);
+ if (!status.ok()) {
+ return rpcStatusToScopedAStatus(status, "Failed to call ScheduleTask");
+ }
+ int errorCode = response.errorcode();
+ switch (errorCode) {
+ case ErrorCode::OK:
+ return ScopedAStatus::ok();
+ case ErrorCode::INVALID_ARG:
+ return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ default:
+ // Should not happen.
+ return ScopedAStatus::fromServiceSpecificErrorWithMessage(
+ -1, ("Got unknown error code: " + ErrorCode_Name(errorCode) +
+ " from remote access HAL")
+ .c_str());
+ }
+}
+
+ScopedAStatus RemoteAccessService::unscheduleTask(const std::string& clientId,
+ const std::string& scheduleId) {
+ ClientContext context;
+ UnscheduleTaskRequest request = {};
+ UnscheduleTaskResponse response = {};
+ request.set_clientid(clientId);
+ request.set_scheduleid(scheduleId);
+ Status status = mGrpcStub->UnscheduleTask(&context, request, &response);
+ if (!status.ok()) {
+ return rpcStatusToScopedAStatus(status, "Failed to call UnscheduleTask");
+ }
+ return ScopedAStatus::ok();
+}
+
+ScopedAStatus RemoteAccessService::unscheduleAllTasks(const std::string& clientId) {
+ ClientContext context;
+ UnscheduleAllTasksRequest request = {};
+ UnscheduleAllTasksResponse response = {};
+ request.set_clientid(clientId);
+ Status status = mGrpcStub->UnscheduleAllTasks(&context, request, &response);
+ if (!status.ok()) {
+ return rpcStatusToScopedAStatus(status, "Failed to call UnscheduleAllTasks");
+ }
+ return ScopedAStatus::ok();
+}
+
+ScopedAStatus RemoteAccessService::isTaskScheduled(const std::string& clientId,
+ const std::string& scheduleId, bool* out) {
+ ClientContext context;
+ IsTaskScheduledRequest request = {};
+ IsTaskScheduledResponse response = {};
+ request.set_clientid(clientId);
+ request.set_scheduleid(scheduleId);
+ Status status = mGrpcStub->IsTaskScheduled(&context, request, &response);
+ if (!status.ok()) {
+ return rpcStatusToScopedAStatus(status, "Failed to call isTaskScheduled");
+ }
+ *out = response.istaskscheduled();
+ return ScopedAStatus::ok();
+}
+
+ScopedAStatus RemoteAccessService::getAllScheduledTasks(const std::string& clientId,
+ std::vector<ScheduleInfo>* out) {
+ ClientContext context;
+ GetAllScheduledTasksRequest request = {};
+ GetAllScheduledTasksResponse response = {};
+ request.set_clientid(clientId);
+ Status status = mGrpcStub->GetAllScheduledTasks(&context, request, &response);
+ if (!status.ok()) {
+ return rpcStatusToScopedAStatus(status, "Failed to call isTaskScheduled");
+ }
+ out->clear();
+ for (int i = 0; i < response.allscheduledtasks_size(); i++) {
+ const GrpcScheduleInfo& rpcScheduleInfo = response.allscheduledtasks(i);
+ ScheduleInfo scheduleInfo = {
+ .clientId = rpcScheduleInfo.clientid(),
+ .scheduleId = rpcScheduleInfo.scheduleid(),
+ .taskData = stringToBytes(rpcScheduleInfo.data()),
+ .count = rpcScheduleInfo.count(),
+ .startTimeInEpochSeconds = rpcScheduleInfo.starttimeinepochseconds(),
+ .periodicInSeconds = rpcScheduleInfo.periodicinseconds(),
+ };
+ out->push_back(std::move(scheduleInfo));
+ }
+ return ScopedAStatus::ok();
+}
+
bool RemoteAccessService::checkDumpPermission() {
uid_t uid = AIBinder_getCallingUid();
return uid == AID_ROOT || uid == AID_SHELL || uid == AID_SYSTEM;
diff --git a/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp b/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp
index c5afd63..c0038c2 100644
--- a/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp
+++ b/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp
@@ -21,6 +21,7 @@
#include <aidl/android/hardware/automotive/remoteaccess/ApState.h>
#include <aidl/android/hardware/automotive/remoteaccess/BnRemoteTaskCallback.h>
#include <aidl/android/hardware/automotive/vehicle/VehiclePropValue.h>
+#include <android/binder_status.h>
#include <gmock/gmock.h>
#include <grpcpp/test/mock_stream.h>
#include <gtest/gtest.h>
@@ -46,6 +47,7 @@
using ::aidl::android::hardware::automotive::remoteaccess::ApState;
using ::aidl::android::hardware::automotive::remoteaccess::BnRemoteTaskCallback;
+using ::aidl::android::hardware::automotive::remoteaccess::ScheduleInfo;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue;
using ::grpc::ClientAsyncReaderInterface;
@@ -63,6 +65,12 @@
using ::testing::SetArgPointee;
constexpr char kTestVin[] = "test_VIN";
+const std::string kTestClientId = "test client id";
+const std::string kTestScheduleId = "test schedule id";
+const std::vector<uint8_t> kTestData = {0xde, 0xad, 0xbe, 0xef};
+constexpr int32_t kTestCount = 1234;
+constexpr int64_t kTestStartTimeInEpochSeconds = 2345;
+constexpr int64_t kTestPeriodicInSeconds = 123;
} // namespace
@@ -73,6 +81,21 @@
MOCK_METHOD(Status, NotifyWakeupRequired,
(ClientContext * context, const NotifyWakeupRequiredRequest& request,
NotifyWakeupRequiredResponse* response));
+ MOCK_METHOD(Status, ScheduleTask,
+ (ClientContext * context, const ScheduleTaskRequest& request,
+ ScheduleTaskResponse* response));
+ MOCK_METHOD(Status, UnscheduleTask,
+ (ClientContext * context, const UnscheduleTaskRequest& request,
+ UnscheduleTaskResponse* response));
+ MOCK_METHOD(Status, UnscheduleAllTasks,
+ (ClientContext * context, const UnscheduleAllTasksRequest& request,
+ UnscheduleAllTasksResponse* response));
+ MOCK_METHOD(Status, IsTaskScheduled,
+ (ClientContext * context, const IsTaskScheduledRequest& request,
+ IsTaskScheduledResponse* response));
+ MOCK_METHOD(Status, GetAllScheduledTasks,
+ (ClientContext * context, const GetAllScheduledTasksRequest& request,
+ GetAllScheduledTasksResponse* response));
// Async methods which we do not care.
MOCK_METHOD(ClientAsyncReaderInterface<GetRemoteTasksResponse>*, AsyncGetRemoteTasksRaw,
(ClientContext * context, const GetRemoteTasksRequest& request, CompletionQueue* cq,
@@ -88,6 +111,42 @@
PrepareAsyncNotifyWakeupRequiredRaw,
(ClientContext * context, const NotifyWakeupRequiredRequest& request,
CompletionQueue* cq));
+ MOCK_METHOD(ClientAsyncResponseReaderInterface<ScheduleTaskResponse>*, AsyncScheduleTaskRaw,
+ (ClientContext * context, const ScheduleTaskRequest& request, CompletionQueue* cq));
+ MOCK_METHOD(ClientAsyncResponseReaderInterface<ScheduleTaskResponse>*,
+ PrepareAsyncScheduleTaskRaw,
+ (ClientContext * context, const ScheduleTaskRequest& request, CompletionQueue* cq));
+ MOCK_METHOD(ClientAsyncResponseReaderInterface<UnscheduleTaskResponse>*, AsyncUnscheduleTaskRaw,
+ (ClientContext * context, const UnscheduleTaskRequest& request,
+ CompletionQueue* cq));
+ MOCK_METHOD(ClientAsyncResponseReaderInterface<UnscheduleTaskResponse>*,
+ PrepareAsyncUnscheduleTaskRaw,
+ (ClientContext * context, const UnscheduleTaskRequest& request,
+ CompletionQueue* cq));
+ MOCK_METHOD(ClientAsyncResponseReaderInterface<UnscheduleAllTasksResponse>*,
+ AsyncUnscheduleAllTasksRaw,
+ (ClientContext * context, const UnscheduleAllTasksRequest& request,
+ CompletionQueue* cq));
+ MOCK_METHOD(ClientAsyncResponseReaderInterface<UnscheduleAllTasksResponse>*,
+ PrepareAsyncUnscheduleAllTasksRaw,
+ (ClientContext * context, const UnscheduleAllTasksRequest& request,
+ CompletionQueue* cq));
+ MOCK_METHOD(ClientAsyncResponseReaderInterface<IsTaskScheduledResponse>*,
+ AsyncIsTaskScheduledRaw,
+ (ClientContext * context, const IsTaskScheduledRequest& request,
+ CompletionQueue* cq));
+ MOCK_METHOD(ClientAsyncResponseReaderInterface<IsTaskScheduledResponse>*,
+ PrepareAsyncIsTaskScheduledRaw,
+ (ClientContext * context, const IsTaskScheduledRequest& request,
+ CompletionQueue* cq));
+ MOCK_METHOD(ClientAsyncResponseReaderInterface<GetAllScheduledTasksResponse>*,
+ AsyncGetAllScheduledTasksRaw,
+ (ClientContext * context, const GetAllScheduledTasksRequest& request,
+ CompletionQueue* cq));
+ MOCK_METHOD(ClientAsyncResponseReaderInterface<GetAllScheduledTasksResponse>*,
+ PrepareAsyncGetAllScheduledTasksRaw,
+ (ClientContext * context, const GetAllScheduledTasksRequest& request,
+ CompletionQueue* cq));
};
class FakeVhalClient final : public android::frameworks::automotive::vhal::IVhalClient {
@@ -367,6 +426,174 @@
ASSERT_EQ(vehicleId, kTestVin);
}
+TEST_F(RemoteAccessServiceUnitTest, TestIsTaskScheduleSupported) {
+ bool out = false;
+ ScopedAStatus status = getService()->isTaskScheduleSupported(&out);
+
+ EXPECT_TRUE(status.isOk());
+ EXPECT_TRUE(out);
+}
+
+TEST_F(RemoteAccessServiceUnitTest, TestScheduleTask) {
+ ScheduleTaskRequest grpcRequest = {};
+ EXPECT_CALL(*getGrpcWakeupClientStub(), ScheduleTask)
+ .WillOnce([&grpcRequest]([[maybe_unused]] ClientContext* context,
+ const ScheduleTaskRequest& request,
+ [[maybe_unused]] ScheduleTaskResponse* response) {
+ grpcRequest = request;
+ return Status();
+ });
+ ScheduleInfo scheduleInfo = {
+ .clientId = kTestClientId,
+ .scheduleId = kTestScheduleId,
+ .taskData = kTestData,
+ .count = kTestCount,
+ .startTimeInEpochSeconds = kTestStartTimeInEpochSeconds,
+ .periodicInSeconds = kTestPeriodicInSeconds,
+ };
+
+ ScopedAStatus status = getService()->scheduleTask(scheduleInfo);
+
+ ASSERT_TRUE(status.isOk());
+ EXPECT_EQ(grpcRequest.scheduleinfo().clientid(), kTestClientId);
+ EXPECT_EQ(grpcRequest.scheduleinfo().scheduleid(), kTestScheduleId);
+ EXPECT_EQ(grpcRequest.scheduleinfo().data(), std::string(kTestData.begin(), kTestData.end()));
+ EXPECT_EQ(grpcRequest.scheduleinfo().count(), kTestCount);
+ EXPECT_EQ(grpcRequest.scheduleinfo().starttimeinepochseconds(), kTestStartTimeInEpochSeconds);
+ EXPECT_EQ(grpcRequest.scheduleinfo().periodicinseconds(), kTestPeriodicInSeconds);
+}
+
+TEST_F(RemoteAccessServiceUnitTest, TestScheduleTask_InvalidArg) {
+ EXPECT_CALL(*getGrpcWakeupClientStub(), ScheduleTask)
+ .WillOnce([]([[maybe_unused]] ClientContext* context,
+ [[maybe_unused]] const ScheduleTaskRequest& request,
+ ScheduleTaskResponse* response) {
+ response->set_errorcode(ErrorCode::INVALID_ARG);
+ return Status();
+ });
+ ScheduleInfo scheduleInfo = {
+ .clientId = kTestClientId,
+ .scheduleId = kTestScheduleId,
+ .taskData = kTestData,
+ .count = kTestCount,
+ .startTimeInEpochSeconds = kTestStartTimeInEpochSeconds,
+ .periodicInSeconds = kTestPeriodicInSeconds,
+ };
+
+ ScopedAStatus status = getService()->scheduleTask(scheduleInfo);
+
+ ASSERT_FALSE(status.isOk());
+ ASSERT_EQ(status.getExceptionCode(), EX_ILLEGAL_ARGUMENT);
+}
+
+TEST_F(RemoteAccessServiceUnitTest, TestScheduleTask_UnspecifiedError) {
+ EXPECT_CALL(*getGrpcWakeupClientStub(), ScheduleTask)
+ .WillOnce([]([[maybe_unused]] ClientContext* context,
+ [[maybe_unused]] const ScheduleTaskRequest& request,
+ ScheduleTaskResponse* response) {
+ response->set_errorcode(ErrorCode::UNSPECIFIED);
+ return Status();
+ });
+ ScheduleInfo scheduleInfo = {
+ .clientId = kTestClientId,
+ .scheduleId = kTestScheduleId,
+ .taskData = kTestData,
+ .count = kTestCount,
+ .startTimeInEpochSeconds = kTestStartTimeInEpochSeconds,
+ .periodicInSeconds = kTestPeriodicInSeconds,
+ };
+
+ ScopedAStatus status = getService()->scheduleTask(scheduleInfo);
+
+ ASSERT_FALSE(status.isOk());
+ ASSERT_EQ(status.getExceptionCode(), EX_SERVICE_SPECIFIC);
+}
+
+TEST_F(RemoteAccessServiceUnitTest, TestUnscheduleTask) {
+ UnscheduleTaskRequest grpcRequest = {};
+ EXPECT_CALL(*getGrpcWakeupClientStub(), UnscheduleTask)
+ .WillOnce([&grpcRequest]([[maybe_unused]] ClientContext* context,
+ const UnscheduleTaskRequest& request,
+ [[maybe_unused]] UnscheduleTaskResponse* response) {
+ grpcRequest = request;
+ return Status();
+ });
+
+ ScopedAStatus status = getService()->unscheduleTask(kTestClientId, kTestScheduleId);
+
+ ASSERT_TRUE(status.isOk());
+ EXPECT_EQ(grpcRequest.clientid(), kTestClientId);
+ EXPECT_EQ(grpcRequest.scheduleid(), kTestScheduleId);
+}
+
+TEST_F(RemoteAccessServiceUnitTest, TestUnscheduleAllTasks) {
+ UnscheduleAllTasksRequest grpcRequest = {};
+ EXPECT_CALL(*getGrpcWakeupClientStub(), UnscheduleAllTasks)
+ .WillOnce([&grpcRequest]([[maybe_unused]] ClientContext* context,
+ const UnscheduleAllTasksRequest& request,
+ [[maybe_unused]] UnscheduleAllTasksResponse* response) {
+ grpcRequest = request;
+ return Status();
+ });
+
+ ScopedAStatus status = getService()->unscheduleAllTasks(kTestClientId);
+
+ ASSERT_TRUE(status.isOk());
+ EXPECT_EQ(grpcRequest.clientid(), kTestClientId);
+}
+
+TEST_F(RemoteAccessServiceUnitTest, TestIsTaskScheduled) {
+ bool isTaskScheduled = false;
+ IsTaskScheduledRequest grpcRequest = {};
+ EXPECT_CALL(*getGrpcWakeupClientStub(), IsTaskScheduled)
+ .WillOnce([&grpcRequest]([[maybe_unused]] ClientContext* context,
+ const IsTaskScheduledRequest& request,
+ IsTaskScheduledResponse* response) {
+ grpcRequest = request;
+ response->set_istaskscheduled(true);
+ return Status();
+ });
+
+ ScopedAStatus status =
+ getService()->isTaskScheduled(kTestClientId, kTestScheduleId, &isTaskScheduled);
+
+ ASSERT_TRUE(status.isOk());
+ EXPECT_TRUE(isTaskScheduled);
+ EXPECT_EQ(grpcRequest.clientid(), kTestClientId);
+ EXPECT_EQ(grpcRequest.scheduleid(), kTestScheduleId);
+}
+
+TEST_F(RemoteAccessServiceUnitTest, testGetAllScheduledTasks) {
+ std::vector<ScheduleInfo> result;
+ GetAllScheduledTasksRequest grpcRequest = {};
+ EXPECT_CALL(*getGrpcWakeupClientStub(), GetAllScheduledTasks)
+ .WillOnce([&grpcRequest]([[maybe_unused]] ClientContext* context,
+ const GetAllScheduledTasksRequest& request,
+ GetAllScheduledTasksResponse* response) {
+ grpcRequest = request;
+ GrpcScheduleInfo* newInfo = response->add_allscheduledtasks();
+ newInfo->set_clientid(kTestClientId);
+ newInfo->set_scheduleid(kTestScheduleId);
+ newInfo->set_data(kTestData.data(), kTestData.size());
+ newInfo->set_count(kTestCount);
+ newInfo->set_starttimeinepochseconds(kTestStartTimeInEpochSeconds);
+ newInfo->set_periodicinseconds(kTestPeriodicInSeconds);
+ return Status();
+ });
+
+ ScopedAStatus status = getService()->getAllScheduledTasks(kTestClientId, &result);
+
+ ASSERT_TRUE(status.isOk());
+ EXPECT_EQ(grpcRequest.clientid(), kTestClientId);
+ ASSERT_EQ(result.size(), 1u);
+ ASSERT_EQ(result[0].clientId, kTestClientId);
+ ASSERT_EQ(result[0].scheduleId, kTestScheduleId);
+ ASSERT_EQ(result[0].taskData, kTestData);
+ ASSERT_EQ(result[0].count, kTestCount);
+ ASSERT_EQ(result[0].startTimeInEpochSeconds, kTestStartTimeInEpochSeconds);
+ ASSERT_EQ(result[0].periodicInSeconds, kTestPeriodicInSeconds);
+}
+
} // namespace remoteaccess
} // namespace automotive
} // namespace hardware
diff --git a/automotive/remoteaccess/test_grpc_server/README.md b/automotive/remoteaccess/test_grpc_server/README.md
index af3d54a..d2b6bbe 100644
--- a/automotive/remoteaccess/test_grpc_server/README.md
+++ b/automotive/remoteaccess/test_grpc_server/README.md
@@ -141,7 +141,7 @@
* The android lunch target: sdk_car_x86_64-userdebug and
cf_x86_64_auto-userdebug already contains the default remote access HAL. For
other lunch target, you can add the default remote access HAL by adding
- 'android.hardware.automotive.remoteaccess@V1-default-service' to
+ 'android.hardware.automotive.remoteaccess@V2-default-service' to
'PRODUCT_PACKAGES' variable in mk file, see `device/generic/car/common/car.mk`
as example.
diff --git a/automotive/remoteaccess/test_grpc_server/impl/Android.bp b/automotive/remoteaccess/test_grpc_server/impl/Android.bp
index 74bac8b..8d8d72a 100644
--- a/automotive/remoteaccess/test_grpc_server/impl/Android.bp
+++ b/automotive/remoteaccess/test_grpc_server/impl/Android.bp
@@ -39,6 +39,50 @@
],
cflags: [
"-Wno-unused-parameter",
- "-DGRPC_SERVICE_ADDRESS=\"localhost:50051\"",
+ "-DGRPC_SERVICE_ADDRESS=\"127.0.0.1:50051\"",
+ ],
+}
+
+cc_binary_host {
+ name: "TestWakeupClientServerHost",
+ srcs: ["src/*.cpp"],
+ local_include_dirs: ["include"],
+ shared_libs: [
+ "libbase",
+ "libutils",
+ "libgrpc++",
+ "libprotobuf-cpp-full",
+ ],
+ whole_static_libs: [
+ "wakeup_client_protos",
+ ],
+ cflags: [
+ "-Wno-unused-parameter",
+ "-DGRPC_SERVICE_ADDRESS=\"127.0.0.1:50051\"",
+ "-DHOST",
+ ],
+}
+
+cc_test_host {
+ name: "TestWakeupClientServerHostUnitTest",
+ srcs: [
+ "test/*.cpp",
+ "src/TestWakeupClientServiceImpl.cpp",
+ ],
+ local_include_dirs: ["include"],
+ shared_libs: [
+ "libbase",
+ "libutils",
+ "libgrpc++",
+ "libprotobuf-cpp-full",
+ ],
+ static_libs: [
+ "libgtest",
+ ],
+ whole_static_libs: [
+ "wakeup_client_protos",
+ ],
+ cflags: [
+ "-Wno-unused-parameter",
],
}
diff --git a/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h b/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h
index 6b86b35..2aab904 100644
--- a/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h
+++ b/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h
@@ -34,11 +34,9 @@
// implementation, the task should come from remote task server. This class is thread-safe.
class FakeTaskGenerator final {
public:
- GetRemoteTasksResponse generateTask();
+ GetRemoteTasksResponse generateTask(const std::string& clientId);
private:
- // Simulates the client ID for each task.
- std::atomic<int> mCurrentClientId = 0;
constexpr static uint8_t DATA[] = {0xde, 0xad, 0xbe, 0xef};
};
@@ -73,38 +71,52 @@
// TaskQueue is thread-safe.
class TaskQueue final {
public:
- TaskQueue();
- ~TaskQueue();
+ TaskQueue(android::sp<Looper> looper);
void add(const GetRemoteTasksResponse& response);
std::optional<GetRemoteTasksResponse> maybePopOne();
void waitForTask();
void stopWait();
- void handleTaskTimeout();
bool isEmpty();
private:
- std::thread mCheckTaskTimeoutThread;
+ friend class TaskTimeoutMessageHandler;
+
std::mutex mLock;
std::priority_queue<TaskInfo, std::vector<TaskInfo>, TaskInfoComparator> mTasks
GUARDED_BY(mLock);
// A variable to notify mTasks is not empty.
std::condition_variable mTasksNotEmptyCv;
- bool mStopped GUARDED_BY(mLock);
+ std::atomic<bool> mStopped;
android::sp<Looper> mLooper;
android::sp<TaskTimeoutMessageHandler> mTaskTimeoutMessageHandler;
std::atomic<int> mTaskIdCounter = 0;
- void checkForTestTimeoutLoop();
- void waitForTaskWithLock(std::unique_lock<std::mutex>& lock);
+ void loop();
+ void handleTaskTimeout();
};
-class TestWakeupClientServiceImpl final : public WakeupClient::Service {
+// forward-declaration
+class TestWakeupClientServiceImpl;
+
+class TaskScheduleMsgHandler final : public android::MessageHandler {
+ public:
+ TaskScheduleMsgHandler(TestWakeupClientServiceImpl* mImpl);
+ void handleMessage(const android::Message& message) override;
+
+ private:
+ TestWakeupClientServiceImpl* mImpl;
+};
+
+class TestWakeupClientServiceImpl : public WakeupClient::Service {
public:
TestWakeupClientServiceImpl();
~TestWakeupClientServiceImpl();
+ // Stop the handling for all income requests. Prepare for shutdown.
+ void stopServer();
+
grpc::Status GetRemoteTasks(grpc::ServerContext* context, const GetRemoteTasksRequest* request,
grpc::ServerWriter<GetRemoteTasksResponse>* writer) override;
@@ -112,25 +124,111 @@
const NotifyWakeupRequiredRequest* request,
NotifyWakeupRequiredResponse* response) override;
+ grpc::Status ScheduleTask(grpc::ServerContext* context, const ScheduleTaskRequest* request,
+ ScheduleTaskResponse* response) override;
+
+ grpc::Status UnscheduleTask(grpc::ServerContext* context, const UnscheduleTaskRequest* request,
+ UnscheduleTaskResponse* response) override;
+
+ grpc::Status UnscheduleAllTasks(grpc::ServerContext* context,
+ const UnscheduleAllTasksRequest* request,
+ UnscheduleAllTasksResponse* response) override;
+
+ grpc::Status IsTaskScheduled(grpc::ServerContext* context,
+ const IsTaskScheduledRequest* request,
+ IsTaskScheduledResponse* response) override;
+
+ grpc::Status GetAllScheduledTasks(grpc::ServerContext* context,
+ const GetAllScheduledTasksRequest* request,
+ GetAllScheduledTasksResponse* response) override;
+
+ /**
+ * Starts generating fake tasks for the specific client repeatedly.
+ *
+ * The fake task will have {0xDE 0xAD 0xBE 0xEF} as payload. A new fake task will be sent
+ * to the client every 5s.
+ */
+ void startGeneratingFakeTask(const std::string& clientId);
+
+ /**
+ * stops generating fake tasks.
+ */
+ void stopGeneratingFakeTask();
+
+ /**
+ * Returns whether we need to wakeup the target device to send remote tasks.
+ */
+ bool isWakeupRequired();
+
+ /**
+ * Returns whether we have an active connection with the target device.
+ */
+ bool isRemoteTaskConnectionAlive();
+
+ /**
+ * Injects a fake task with taskData to be sent to the specific client.
+ */
+ void injectTask(const std::string& taskData, const std::string& clientId);
+
+ /**
+ * Wakes up the target device.
+ *
+ * This must be implemented by child class and contains device specific logic. E.g. this might
+ * be sending QEMU commands for the emulator device.
+ */
+ virtual void wakeupApplicationProcessor() = 0;
+
+ /**
+ * Cleans up a scheduled task info.
+ */
+ void cleanupScheduledTaskLocked(const std::string& clientId, const std::string& scheduleId)
+ REQUIRES(mLock);
+
private:
- // This is a thread for communicating with remote wakeup server (via network) and receive tasks
- // from it.
- std::thread mThread;
+ friend class TaskScheduleMsgHandler;
+
+ struct ScheduleInfo {
+ std::unique_ptr<GrpcScheduleInfo> grpcScheduleInfo;
+ // This is a unique ID to represent this schedule. Each repeated tasks will have different
+ // task ID but will have the same scheduleMsgId so that we can use to unschedule. This has
+ // to be an int so we cannot use the scheduleId provided by the client.
+ int scheduleMsgId;
+ int64_t periodicInSeconds;
+ int32_t currentCount;
+ int32_t totalCount;
+ };
+
+ std::atomic<int> mScheduleMsgCounter = 0;
+ // This is a looper for scheduling tasks to be executed in the future.
+ android::sp<Looper> mLooper;
+ android::sp<TaskScheduleMsgHandler> mTaskScheduleMsgHandler;
+ // This is a thread for generating fake tasks.
+ std::thread mFakeTaskThread;
+ // This is a thread for the looper.
+ std::thread mLooperThread;
// A variable to notify server is stopping.
- std::condition_variable mServerStoppedCv;
+ std::condition_variable mTaskLoopStoppedCv;
// Whether wakeup AP is required for executing tasks.
std::atomic<bool> mWakeupRequired = true;
+ // Whether we currently have an active long-live connection to deliver remote tasks.
+ std::atomic<bool> mRemoteTaskConnectionAlive = false;
std::mutex mLock;
- bool mServerStopped GUARDED_BY(mLock);
+ bool mGeneratingFakeTask GUARDED_BY(mLock);
+ std::atomic<bool> mServerStopped;
+ std::unordered_map<std::string, std::unordered_map<std::string, ScheduleInfo>>
+ mInfoByScheduleIdByClientId GUARDED_BY(mLock);
// Thread-safe. For test impl only.
FakeTaskGenerator mFakeTaskGenerator;
- // Thread-sfae.
- TaskQueue mTaskQueue;
+ // Thread-safe.
+ std::unique_ptr<TaskQueue> mTaskQueue;
- void fakeTaskGenerateLoop();
-
- void wakeupApplicationProcessor();
+ void fakeTaskGenerateLoop(const std::string& clientId);
+ void injectTaskResponse(const GetRemoteTasksResponse& response);
+ bool getScheduleInfoLocked(int scheduleMsgId, ScheduleInfo** outScheduleInfoPtr)
+ REQUIRES(mLock);
+ void handleAddTask(int scheduleMsgId);
+ void loop();
};
} // namespace remoteaccess
diff --git a/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp b/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp
index 7dcd31e..1db991c 100644
--- a/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp
+++ b/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp
@@ -16,8 +16,6 @@
#include "TestWakeupClientServiceImpl.h"
-#include "ApPowerControl.h"
-
#include <android-base/stringprintf.h>
#include <inttypes.h>
#include <utils/Looper.h>
@@ -39,17 +37,24 @@
using ::grpc::ServerWriter;
using ::grpc::Status;
-constexpr int kTaskIntervalInMs = 5'000;
-constexpr int64_t KTaskTimeoutInMs = 20'000;
+constexpr int64_t kTaskIntervalInMs = 5'000;
+constexpr int64_t kTaskTimeoutInMs = 20'000;
+
+int64_t msToNs(int64_t ms) {
+ return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::milliseconds(ms))
+ .count();
+}
+
+int64_t sToNs(int64_t s) {
+ return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::seconds(s)).count();
+}
} // namespace
-GetRemoteTasksResponse FakeTaskGenerator::generateTask() {
- int clientId = mCurrentClientId++;
+GetRemoteTasksResponse FakeTaskGenerator::generateTask(const std::string& clientId) {
GetRemoteTasksResponse response;
- response.set_data(std::string(reinterpret_cast<const char*>(DATA), sizeof(DATA)));
- std::string clientIdStr = StringPrintf("%d", clientId);
- response.set_clientid(clientIdStr);
+ response.set_data(reinterpret_cast<const char*>(DATA), sizeof(DATA));
+ response.set_clientid(clientId);
return response;
}
@@ -60,26 +65,9 @@
mTaskQueue->handleTaskTimeout();
}
-TaskQueue::TaskQueue() {
+TaskQueue::TaskQueue(android::sp<Looper> looper) {
mTaskTimeoutMessageHandler = android::sp<TaskTimeoutMessageHandler>::make(this);
- mLooper = Looper::prepare(/*opts=*/0);
- mCheckTaskTimeoutThread = std::thread([this] { checkForTestTimeoutLoop(); });
-}
-
-TaskQueue::~TaskQueue() {
- {
- std::lock_guard<std::mutex> lockGuard(mLock);
- mStopped = true;
- }
- while (true) {
- // Remove all pending timeout handlers from queue.
- if (!maybePopOne().has_value()) {
- break;
- }
- }
- if (mCheckTaskTimeoutThread.joinable()) {
- mCheckTaskTimeoutThread.join();
- }
+ mLooper = looper;
}
std::optional<GetRemoteTasksResponse> TaskQueue::maybePopOne() {
@@ -105,16 +93,12 @@
.taskData = task,
});
android::Message message(taskId);
- mLooper->sendMessageDelayed(KTaskTimeoutInMs * 1000, mTaskTimeoutMessageHandler, message);
+ mLooper->sendMessageDelayed(msToNs(kTaskTimeoutInMs), mTaskTimeoutMessageHandler, message);
mTasksNotEmptyCv.notify_all();
}
void TaskQueue::waitForTask() {
std::unique_lock<std::mutex> lock(mLock);
- waitForTaskWithLock(lock);
-}
-
-void TaskQueue::waitForTaskWithLock(std::unique_lock<std::mutex>& lock) {
mTasksNotEmptyCv.wait(lock, [this] {
ScopedLockAssertion lockAssertion(mLock);
return mTasks.size() > 0 || mStopped;
@@ -122,9 +106,11 @@
}
void TaskQueue::stopWait() {
- std::lock_guard<std::mutex> lockGuard(mLock);
mStopped = true;
- mTasksNotEmptyCv.notify_all();
+ {
+ std::lock_guard<std::mutex> lockGuard(mLock);
+ mTasksNotEmptyCv.notify_all();
+ }
}
bool TaskQueue::isEmpty() {
@@ -132,21 +118,6 @@
return mTasks.size() == 0 || mStopped;
}
-void TaskQueue::checkForTestTimeoutLoop() {
- Looper::setForThread(mLooper);
-
- while (true) {
- {
- std::unique_lock<std::mutex> lock(mLock);
- if (mStopped) {
- return;
- }
- }
-
- mLooper->pollAll(/*timeoutMillis=*/-1);
- }
-}
-
void TaskQueue::handleTaskTimeout() {
// We know which task timed-out from the taskId in the message. However, there is no easy way
// to remove a specific task with the task ID from the priority_queue, so we just check from
@@ -155,48 +126,106 @@
int64_t now = uptimeMillis();
while (mTasks.size() > 0) {
const TaskInfo& taskInfo = mTasks.top();
- if (taskInfo.timestampInMs + KTaskTimeoutInMs > now) {
+ if (taskInfo.timestampInMs + kTaskTimeoutInMs > now) {
break;
}
// In real implementation, this should report task failure to remote wakeup server.
- printf("Task for client ID: %s timed-out, added at %" PRId64 " ms, now %" PRId64 " ms",
+ printf("Task for client ID: %s timed-out, added at %" PRId64 " ms, now %" PRId64 " ms\n",
taskInfo.taskData.clientid().c_str(), taskInfo.timestampInMs, now);
mTasks.pop();
}
}
TestWakeupClientServiceImpl::TestWakeupClientServiceImpl() {
- mThread = std::thread([this] { fakeTaskGenerateLoop(); });
+ mTaskScheduleMsgHandler = android::sp<TaskScheduleMsgHandler>::make(this);
+ mLooper = android::sp<Looper>::make(/*opts=*/0);
+ mLooperThread = std::thread([this] { loop(); });
+ mTaskQueue = std::make_unique<TaskQueue>(mLooper);
}
TestWakeupClientServiceImpl::~TestWakeupClientServiceImpl() {
- {
- std::lock_guard<std::mutex> lockGuard(mLock);
- mServerStopped = true;
- mServerStoppedCv.notify_all();
+ if (mServerStopped) {
+ return;
}
- mTaskQueue.stopWait();
- if (mThread.joinable()) {
- mThread.join();
+ stopServer();
+}
+
+void TestWakeupClientServiceImpl::stopServer() {
+ mTaskQueue->stopWait();
+ stopGeneratingFakeTask();
+ // Set the flag so that the loop thread will exit.
+ mServerStopped = true;
+ mLooper->wake();
+ if (mLooperThread.joinable()) {
+ mLooperThread.join();
}
}
-void TestWakeupClientServiceImpl::fakeTaskGenerateLoop() {
+void TestWakeupClientServiceImpl::loop() {
+ Looper::setForThread(mLooper);
+
+ while (true) {
+ mLooper->pollAll(/*timeoutMillis=*/-1);
+ if (mServerStopped) {
+ return;
+ }
+ }
+}
+
+void TestWakeupClientServiceImpl::injectTask(const std::string& taskData,
+ const std::string& clientId) {
+ GetRemoteTasksResponse response;
+ response.set_data(taskData);
+ response.set_clientid(clientId);
+ injectTaskResponse(response);
+}
+
+void TestWakeupClientServiceImpl::injectTaskResponse(const GetRemoteTasksResponse& response) {
+ printf("Receive a new task\n");
+ mTaskQueue->add(response);
+ if (mWakeupRequired) {
+ wakeupApplicationProcessor();
+ }
+}
+
+void TestWakeupClientServiceImpl::startGeneratingFakeTask(const std::string& clientId) {
+ std::lock_guard<std::mutex> lockGuard(mLock);
+ if (mGeneratingFakeTask) {
+ printf("Fake task is already being generated\n");
+ return;
+ }
+ mGeneratingFakeTask = true;
+ mFakeTaskThread = std::thread([this, clientId] { fakeTaskGenerateLoop(clientId); });
+ printf("Started generating fake tasks\n");
+}
+
+void TestWakeupClientServiceImpl::stopGeneratingFakeTask() {
+ {
+ std::lock_guard<std::mutex> lockGuard(mLock);
+ if (!mGeneratingFakeTask) {
+ printf("Fake task is not being generated, do nothing\n");
+ return;
+ }
+ mTaskLoopStoppedCv.notify_all();
+ mGeneratingFakeTask = false;
+ }
+ if (mFakeTaskThread.joinable()) {
+ mFakeTaskThread.join();
+ }
+ printf("Stopped generating fake tasks\n");
+}
+
+void TestWakeupClientServiceImpl::fakeTaskGenerateLoop(const std::string& clientId) {
// In actual implementation, this should communicate with the remote server and receives tasks
// from it. Here we simulate receiving one remote task every {kTaskIntervalInMs}ms.
while (true) {
- mTaskQueue.add(mFakeTaskGenerator.generateTask());
- printf("Received a new task\n");
- if (mWakeupRequired) {
- wakeupApplicationProcessor();
- }
-
- printf("Sleeping for %d seconds until next task\n", kTaskIntervalInMs);
+ injectTaskResponse(mFakeTaskGenerator.generateTask(clientId));
+ printf("Sleeping for %" PRId64 " seconds until next task\n", kTaskIntervalInMs);
std::unique_lock lk(mLock);
- if (mServerStoppedCv.wait_for(lk, std::chrono::milliseconds(kTaskIntervalInMs), [this] {
+ if (mTaskLoopStoppedCv.wait_for(lk, std::chrono::milliseconds(kTaskIntervalInMs), [this] {
ScopedLockAssertion lockAssertion(mLock);
- return mServerStopped;
+ return !mGeneratingFakeTask;
})) {
// If the stopped flag is set, we are quitting, exit the loop.
return;
@@ -208,11 +237,18 @@
const GetRemoteTasksRequest* request,
ServerWriter<GetRemoteTasksResponse>* writer) {
printf("GetRemoteTasks called\n");
+ mRemoteTaskConnectionAlive = true;
while (true) {
- mTaskQueue.waitForTask();
+ mTaskQueue->waitForTask();
+
+ if (mServerStopped) {
+ // Server stopped, exit the loop.
+ printf("Server stopped exit loop\n");
+ break;
+ }
while (true) {
- auto maybeTask = mTaskQueue.maybePopOne();
+ auto maybeTask = mTaskQueue->maybePopOne();
if (!maybeTask.has_value()) {
// No task left, loop again and wait for another task(s).
break;
@@ -225,29 +261,238 @@
printf("Failed to deliver remote task to remote access HAL\n");
// The task failed to be sent, add it back to the queue. The order might change, but
// it is okay.
- mTaskQueue.add(response);
+ mTaskQueue->add(response);
+ mRemoteTaskConnectionAlive = false;
return Status::CANCELLED;
}
}
}
- return Status::OK;
+ // Server stopped, exit the loop.
+ return Status::CANCELLED;
}
Status TestWakeupClientServiceImpl::NotifyWakeupRequired(ServerContext* context,
const NotifyWakeupRequiredRequest* request,
NotifyWakeupRequiredResponse* response) {
- if (request->iswakeuprequired() && !mWakeupRequired && !mTaskQueue.isEmpty()) {
+ printf("NotifyWakeupRequired called\n");
+ if (request->iswakeuprequired() && !mWakeupRequired && !mTaskQueue->isEmpty()) {
// If wakeup is now required and previously not required, this means we have finished
// shutting down the device. If there are still pending tasks, try waking up AP again
// to finish executing those tasks.
wakeupApplicationProcessor();
}
mWakeupRequired = request->iswakeuprequired();
+ if (mWakeupRequired) {
+ // We won't know the connection is down unless we try to send a task over. If wakeup is
+ // required, the connection is very likely already down.
+ mRemoteTaskConnectionAlive = false;
+ }
return Status::OK;
}
-void TestWakeupClientServiceImpl::wakeupApplicationProcessor() {
- wakeupAp();
+void TestWakeupClientServiceImpl::cleanupScheduledTaskLocked(const std::string& clientId,
+ const std::string& scheduleId) {
+ mInfoByScheduleIdByClientId[clientId].erase(scheduleId);
+ if (mInfoByScheduleIdByClientId[clientId].size() == 0) {
+ mInfoByScheduleIdByClientId.erase(clientId);
+ }
+}
+
+TaskScheduleMsgHandler::TaskScheduleMsgHandler(TestWakeupClientServiceImpl* impl) : mImpl(impl) {}
+
+void TaskScheduleMsgHandler::handleMessage(const android::Message& message) {
+ mImpl->handleAddTask(message.what);
+}
+
+Status TestWakeupClientServiceImpl::ScheduleTask(ServerContext* context,
+ const ScheduleTaskRequest* request,
+ ScheduleTaskResponse* response) {
+ std::lock_guard<std::mutex> lockGuard(mLock);
+
+ const GrpcScheduleInfo& grpcScheduleInfo = request->scheduleinfo();
+ const std::string& scheduleId = grpcScheduleInfo.scheduleid();
+ const std::string& clientId = grpcScheduleInfo.clientid();
+ response->set_errorcode(ErrorCode::OK);
+
+ if (mInfoByScheduleIdByClientId.find(clientId) != mInfoByScheduleIdByClientId.end() &&
+ mInfoByScheduleIdByClientId[clientId].find(scheduleId) !=
+ mInfoByScheduleIdByClientId[clientId].end()) {
+ printf("Duplicate schedule Id: %s for client Id: %s\n", scheduleId.c_str(),
+ clientId.c_str());
+ response->set_errorcode(ErrorCode::INVALID_ARG);
+ return Status::OK;
+ }
+
+ int64_t startTimeInEpochSeconds = grpcScheduleInfo.starttimeinepochseconds();
+ int64_t periodicInSeconds = grpcScheduleInfo.periodicinseconds();
+ int32_t count = grpcScheduleInfo.count();
+
+ int scheduleMsgId = mScheduleMsgCounter++;
+ mInfoByScheduleIdByClientId[clientId][scheduleId] = {
+ .grpcScheduleInfo = std::make_unique<GrpcScheduleInfo>(grpcScheduleInfo),
+ .scheduleMsgId = scheduleMsgId,
+ .periodicInSeconds = periodicInSeconds,
+ .currentCount = 0,
+ .totalCount = count,
+ };
+
+ int64_t delayInSeconds =
+ startTimeInEpochSeconds - std::chrono::duration_cast<std::chrono::seconds>(
+ std::chrono::system_clock::now().time_since_epoch())
+ .count();
+ if (delayInSeconds < 0) {
+ delayInSeconds = 0;
+ }
+
+ printf("ScheduleTask called with client Id: %s, schedule Id: %s, delay: %" PRId64 " s\n",
+ clientId.c_str(), scheduleId.c_str(), delayInSeconds);
+
+ mLooper->sendMessageDelayed(sToNs(delayInSeconds), mTaskScheduleMsgHandler,
+ android::Message(scheduleMsgId));
+
+ return Status::OK;
+}
+
+bool TestWakeupClientServiceImpl::getScheduleInfoLocked(int scheduleMsgId,
+ ScheduleInfo** outScheduleInfoPtr) {
+ for (auto& [_, infoByScheduleId] : mInfoByScheduleIdByClientId) {
+ for (auto& [_, scheduleInfo] : infoByScheduleId) {
+ if (scheduleInfo.scheduleMsgId == scheduleMsgId) {
+ *outScheduleInfoPtr = &scheduleInfo;
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+void TestWakeupClientServiceImpl::handleAddTask(int scheduleMsgId) {
+ std::lock_guard<std::mutex> lockGuard(mLock);
+
+ ScheduleInfo* scheduleInfoPtr;
+ bool found = getScheduleInfoLocked(scheduleMsgId, &scheduleInfoPtr);
+ if (!found) {
+ printf("The schedule msg Id: %d is not found\n", scheduleMsgId);
+ return;
+ }
+
+ const GrpcScheduleInfo& grpcScheduleInfo = *scheduleInfoPtr->grpcScheduleInfo;
+ const std::string scheduleId = grpcScheduleInfo.scheduleid();
+ const std::string clientId = grpcScheduleInfo.clientid();
+
+ GetRemoteTasksResponse injectResponse;
+ injectResponse.set_data(grpcScheduleInfo.data().data(), grpcScheduleInfo.data().size());
+ injectResponse.set_clientid(clientId);
+ injectTaskResponse(injectResponse);
+ scheduleInfoPtr->currentCount++;
+
+ printf("Sending scheduled tasks for scheduleId: %s, clientId: %s, taskCount: %d\n",
+ scheduleId.c_str(), clientId.c_str(), scheduleInfoPtr->currentCount);
+
+ if (scheduleInfoPtr->totalCount != 0 &&
+ scheduleInfoPtr->currentCount == scheduleInfoPtr->totalCount) {
+ // This schedule is finished.
+ cleanupScheduledTaskLocked(clientId, scheduleId);
+ return;
+ }
+
+ // Schedule the task for the next period.
+ mLooper->sendMessageDelayed(sToNs(scheduleInfoPtr->periodicInSeconds), mTaskScheduleMsgHandler,
+ android::Message(scheduleMsgId));
+}
+
+Status TestWakeupClientServiceImpl::UnscheduleTask(ServerContext* context,
+ const UnscheduleTaskRequest* request,
+ UnscheduleTaskResponse* response) {
+ std::lock_guard<std::mutex> lockGuard(mLock);
+
+ const std::string& clientId = request->clientid();
+ const std::string& scheduleId = request->scheduleid();
+ printf("UnscheduleTask called with client Id: %s, schedule Id: %s\n", clientId.c_str(),
+ scheduleId.c_str());
+
+ if (mInfoByScheduleIdByClientId.find(clientId) == mInfoByScheduleIdByClientId.end() ||
+ mInfoByScheduleIdByClientId[clientId].find(scheduleId) ==
+ mInfoByScheduleIdByClientId[clientId].end()) {
+ printf("UnscheduleTask: no task associated with clientId: %s, scheduleId: %s\n",
+ clientId.c_str(), scheduleId.c_str());
+ return Status::OK;
+ }
+
+ mLooper->removeMessages(mTaskScheduleMsgHandler,
+ mInfoByScheduleIdByClientId[clientId][scheduleId].scheduleMsgId);
+ cleanupScheduledTaskLocked(clientId, scheduleId);
+ return Status::OK;
+}
+
+Status TestWakeupClientServiceImpl::UnscheduleAllTasks(ServerContext* context,
+ const UnscheduleAllTasksRequest* request,
+ UnscheduleAllTasksResponse* response) {
+ std::lock_guard<std::mutex> lockGuard(mLock);
+
+ const std::string& clientId = request->clientid();
+ printf("UnscheduleAllTasks called with client Id: %s\n", clientId.c_str());
+ if (mInfoByScheduleIdByClientId.find(clientId) == mInfoByScheduleIdByClientId.end()) {
+ printf("UnscheduleTask: no task associated with clientId: %s\n", clientId.c_str());
+ return Status::OK;
+ }
+ const auto& infoByScheduleId = mInfoByScheduleIdByClientId[clientId];
+ std::vector<int> scheduleMsgIds;
+ for (const auto& [_, scheduleInfo] : infoByScheduleId) {
+ mLooper->removeMessages(mTaskScheduleMsgHandler, /*what=*/scheduleInfo.scheduleMsgId);
+ }
+
+ mInfoByScheduleIdByClientId.erase(clientId);
+ return Status::OK;
+}
+
+Status TestWakeupClientServiceImpl::IsTaskScheduled(ServerContext* context,
+ const IsTaskScheduledRequest* request,
+ IsTaskScheduledResponse* response) {
+ std::lock_guard<std::mutex> lockGuard(mLock);
+
+ const std::string& clientId = request->clientid();
+ const std::string& scheduleId = request->scheduleid();
+ printf("IsTaskScheduled called with client Id: %s, scheduleId: %s\n", clientId.c_str(),
+ scheduleId.c_str());
+
+ if (mInfoByScheduleIdByClientId.find(clientId) == mInfoByScheduleIdByClientId.end()) {
+ response->set_istaskscheduled(false);
+ return Status::OK;
+ }
+ if (mInfoByScheduleIdByClientId[clientId].find(scheduleId) ==
+ mInfoByScheduleIdByClientId[clientId].end()) {
+ response->set_istaskscheduled(false);
+ return Status::OK;
+ }
+ response->set_istaskscheduled(true);
+ return Status::OK;
+}
+
+Status TestWakeupClientServiceImpl::GetAllScheduledTasks(ServerContext* context,
+ const GetAllScheduledTasksRequest* request,
+ GetAllScheduledTasksResponse* response) {
+ const std::string& clientId = request->clientid();
+ printf("GetAllScheduledTasks called with client Id: %s\n", clientId.c_str());
+ response->clear_allscheduledtasks();
+ {
+ std::unique_lock lk(mLock);
+ if (mInfoByScheduleIdByClientId.find(clientId) == mInfoByScheduleIdByClientId.end()) {
+ return Status::OK;
+ }
+ for (const auto& [_, scheduleInfo] : mInfoByScheduleIdByClientId[clientId]) {
+ (*response->add_allscheduledtasks()) = *scheduleInfo.grpcScheduleInfo;
+ }
+ }
+ return Status::OK;
+}
+
+bool TestWakeupClientServiceImpl::isWakeupRequired() {
+ return mWakeupRequired;
+}
+
+bool TestWakeupClientServiceImpl::isRemoteTaskConnectionAlive() {
+ return mRemoteTaskConnectionAlive;
}
} // namespace remoteaccess
diff --git a/automotive/remoteaccess/test_grpc_server/impl/src/main.cpp b/automotive/remoteaccess/test_grpc_server/impl/src/main.cpp
index d3f519c..5443ad9 100644
--- a/automotive/remoteaccess/test_grpc_server/impl/src/main.cpp
+++ b/automotive/remoteaccess/test_grpc_server/impl/src/main.cpp
@@ -14,7 +14,17 @@
* limitations under the License.
*/
+#include <signal.h>
+#include <stdio.h>
+#include <sys/wait.h>
+#include <iostream>
+#include <sstream>
#include <string>
+#include <thread>
+
+#ifndef HOST
+#include "ApPowerControl.h"
+#endif // #ifndef HOST
#include "TestWakeupClientServiceImpl.h"
@@ -28,10 +38,18 @@
using ::grpc::ServerBuilder;
using ::grpc::ServerWriter;
-void RunServer(const std::string& serviceAddr) {
- std::shared_ptr<TestWakeupClientServiceImpl> service =
- std::make_unique<TestWakeupClientServiceImpl>();
+constexpr int SHUTDOWN_REQUEST = 289410889;
+constexpr int VEHICLE_IN_USE = 287313738;
+const char* COMMAND_RUN_EMU = "source ~/.aae-toolbox/bin/bashrc && aae emulator run";
+const char* COMMAND_SET_VHAL_PROP =
+ "adb -s emulator-5554 wait-for-device && adb -s emulator-5554 root "
+ "&& sleep 1 && adb -s emulator-5554 wait-for-device && adb -s emulator-5554 shell "
+ "dumpsys android.hardware.automotive.vehicle.IVehicle/default --set %d -i %d";
+pid_t emuPid = 0;
+
+void RunServer(const std::string& serviceAddr,
+ std::shared_ptr<TestWakeupClientServiceImpl> service) {
ServerBuilder builder;
builder.AddListeningPort(serviceAddr, grpc::InsecureServerCredentials());
builder.RegisterService(service.get());
@@ -40,11 +58,228 @@
server->Wait();
}
+pid_t runCommand(const char* bashCommand) {
+ pid_t pid = fork();
+ if (pid == 0) {
+ // In child process. Put it into a separate process group so we can kill it.
+ setpgid(0, 0);
+ execl("/bin/bash", "bash", "-c", bashCommand, /*terminateArg=*/nullptr);
+ exit(0);
+ } else {
+ return pid;
+ }
+}
+
+void updateEmuStatus() {
+ if (emuPid == 0) {
+ return;
+ }
+ pid_t pid = waitpid(emuPid, nullptr, WNOHANG);
+ if (pid == emuPid) {
+ // Emu process already exited. If Emu process is still running, pid will be 0.
+ emuPid = 0;
+ }
+}
+
+bool powerOnEmu() {
+ updateEmuStatus();
+ if (emuPid != 0) {
+ printf("The emulator is already running\n");
+ return false;
+ }
+ emuPid = runCommand(COMMAND_RUN_EMU);
+ printf("Emulator started in process: %d\n", emuPid);
+ return true;
+}
+
+bool powerOn() {
+#ifdef HOST
+ return powerOnEmu();
+#else
+ printf("power on is only supported on host\n");
+ return false;
+#endif
+}
+
+const char* getSetPropCommand(int propId, int value) {
+ int size = snprintf(nullptr, 0, COMMAND_SET_VHAL_PROP, propId, value);
+ char* command = new char[size + 1];
+ snprintf(command, size + 1, COMMAND_SET_VHAL_PROP, propId, value);
+ return command;
+}
+
+const char* getSetPropCommand(int propId) {
+ return getSetPropCommand(propId, /*value=*/1);
+}
+
+void powerOffEmu() {
+ updateEmuStatus();
+ if (emuPid == 0) {
+ printf("The emulator is not running\n");
+ return;
+ }
+ const char* command = getSetPropCommand(SHUTDOWN_REQUEST);
+ runCommand(command);
+ delete[] command;
+ waitpid(emuPid, nullptr, /*options=*/0);
+ emuPid = 0;
+}
+
+void powerOff() {
+#ifdef HOST
+ powerOffEmu();
+#else
+ printf("power off is only supported on host\n");
+#endif
+}
+
+void setVehicleInUse(bool vehicleInUse) {
+#ifdef HOST
+ printf("Set vehicleInUse to %d\n", vehicleInUse);
+ int value = 0;
+ if (vehicleInUse) {
+ value = 1;
+ }
+ const char* command = getSetPropCommand(VEHICLE_IN_USE, value);
+ runCommand(command);
+ delete[] command;
+#else
+ printf("set vehicleInUse is only supported on host\n");
+#endif
+}
+
+void help() {
+ std::cout << "Remote Access Host Test Utility" << std::endl
+ << "help:\t"
+ << "Print out this help info" << std::endl
+ << "genFakeTask start [clientID]:\t"
+ << "Start generating a fake task every 5s" << std::endl
+ << "genFakeTask stop:\t"
+ << "Stop the fake task generation" << std::endl
+ << "status:\t"
+ << "Print current status" << std::endl
+ << "power on:\t"
+ << "Power on the emulator, simulate user enters vehicle while AP is off"
+ << " (only supported on host)" << std::endl
+ << "power off:\t"
+ << "Power off the emulator, simulate user leaves vehicle"
+ << " (only supported on host)" << std::endl
+ << "inject task [clientID] [taskData]:\t"
+ << "Inject a remote task" << std::endl
+ << "set vehicleInUse:\t"
+ << "Set vehicle in use, simulate user enter vehicle while boot up for remote task "
+ << "(only supported on host)" << std::endl;
+}
+
+void parseCommand(const std::string& userInput,
+ std::shared_ptr<TestWakeupClientServiceImpl> service) {
+ if (userInput == "") {
+ // ignore empty line.
+ } else if (userInput == "help") {
+ help();
+ } else if (userInput.rfind("genFakeTask start", 0) == 0) {
+ std::string clientId;
+ std::stringstream ss;
+ ss << userInput;
+ int i = 0;
+ while (std::getline(ss, clientId, ' ')) {
+ i++;
+ if (i == 3) {
+ break;
+ }
+ }
+ if (i != 3) {
+ printf("Missing clientId, see 'help'\n");
+ return;
+ }
+ service->startGeneratingFakeTask(clientId);
+ } else if (userInput == "genFakeTask stop") {
+ service->stopGeneratingFakeTask();
+ } else if (userInput == "status") {
+ printf("isWakeupRequired: %B, isRemoteTaskConnectionAlive: %B\n",
+ service->isWakeupRequired(), service->isRemoteTaskConnectionAlive());
+ } else if (userInput == "power on") {
+ powerOn();
+ } else if (userInput == "power off") {
+ powerOff();
+ } else if (userInput.rfind("inject task", 0) == 0) {
+ std::stringstream ss;
+ ss << userInput;
+ std::string data;
+ std::string taskData;
+ std::string clientId;
+ int i = 0;
+ while (std::getline(ss, data, ' ')) {
+ i++;
+ if (i == 3) {
+ clientId = data;
+ }
+ if (i == 4) {
+ taskData = data;
+ }
+ }
+ if (taskData == "" || clientId == "") {
+ printf("Missing taskData or clientId, see 'help'\n");
+ return;
+ }
+ service->injectTask(taskData, clientId);
+ printf("Remote task with client ID: %s, data: %s injected\n", clientId.c_str(),
+ taskData.c_str());
+ } else if (userInput == "set vehicleInUse") {
+ setVehicleInUse(true);
+ } else {
+ printf("Unknown command, see 'help'\n");
+ }
+}
+
+void saHandler(int signum) {
+ if (emuPid != 0) {
+ kill(-emuPid, signum);
+ waitpid(emuPid, nullptr, /*options=*/0);
+ // Sleep for 1 seconds to allow emulator to print out logs.
+ sleep(1);
+ }
+ exit(-1);
+}
+
+class MyTestWakeupClientServiceImpl final : public TestWakeupClientServiceImpl {
+ public:
+ void wakeupApplicationProcessor() override {
+#ifdef HOST
+ if (powerOnEmu()) {
+ // If we wake up AP to execute remote task, vehicle in use should be false.
+ setVehicleInUse(false);
+ }
+#else
+ wakeupAp();
+#endif
+ };
+};
+
int main(int argc, char** argv) {
std::string serviceAddr = GRPC_SERVICE_ADDRESS;
if (argc > 1) {
serviceAddr = argv[1];
}
- RunServer(serviceAddr);
+ // Let the server thread run, we will force kill the server when we exit the program.
+ std::shared_ptr<TestWakeupClientServiceImpl> service =
+ std::make_shared<MyTestWakeupClientServiceImpl>();
+ std::thread serverThread([serviceAddr, service] { RunServer(serviceAddr, service); });
+
+ // Register the signal handler for SIGTERM and SIGINT so that we can stop the emulator before
+ // exit.
+ struct sigaction sa = {};
+ sigemptyset(&sa.sa_mask);
+ sa.sa_handler = saHandler;
+ sigaction(SIGTERM, &sa, nullptr);
+ sigaction(SIGINT, &sa, nullptr);
+
+ // Start processing the user inputs.
+ std::string userInput;
+ while (true) {
+ std::cout << ">>> ";
+ std::getline(std::cin, userInput);
+ parseCommand(userInput, service);
+ }
return 0;
}
diff --git a/automotive/remoteaccess/test_grpc_server/impl/test/TestWakeupClientServiceImplUnitTest.cpp b/automotive/remoteaccess/test_grpc_server/impl/test/TestWakeupClientServiceImplUnitTest.cpp
new file mode 100644
index 0000000..960020d
--- /dev/null
+++ b/automotive/remoteaccess/test_grpc_server/impl/test/TestWakeupClientServiceImplUnitTest.cpp
@@ -0,0 +1,339 @@
+/*
+ * 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 "TestWakeupClientServiceImpl.h"
+
+#include <grpcpp/channel.h>
+#include <grpcpp/create_channel.h>
+#include <grpcpp/security/credentials.h>
+#include <grpcpp/security/server_credentials.h>
+#include <grpcpp/server.h>
+#include <grpcpp/server_builder.h>
+#include <gtest/gtest.h>
+#include <chrono>
+
+namespace android::hardware::automotive::remoteaccess::test {
+
+using ::android::base::ScopedLockAssertion;
+
+using ::grpc::Channel;
+using ::grpc::ClientContext;
+using ::grpc::Server;
+using ::grpc::ServerBuilder;
+using ::grpc::Status;
+
+const std::string kTestClientId = "test client id";
+const std::string kTestScheduleId = "test schedule id";
+const std::vector<uint8_t> kTestData = {0xde, 0xad, 0xbe, 0xef};
+constexpr int32_t kTestCount = 1234;
+constexpr int64_t kTestStartTimeInEpochSeconds = 2345;
+constexpr int64_t kTestPeriodicInSeconds = 123;
+const std::string kTestGrpcAddr = "localhost:50051";
+
+class MyTestWakeupClientServiceImpl final : public TestWakeupClientServiceImpl {
+ public:
+ void wakeupApplicationProcessor() override {
+ // Do nothing.
+ }
+};
+
+class TestWakeupClientServiceImplUnitTest : public ::testing::Test {
+ public:
+ virtual void SetUp() override {
+ mServerThread = std::thread([this] {
+ {
+ std::unique_lock<std::mutex> lock(mLock);
+ mService = std::make_unique<MyTestWakeupClientServiceImpl>();
+ ServerBuilder builder;
+ builder.AddListeningPort(kTestGrpcAddr, grpc::InsecureServerCredentials());
+ builder.RegisterService(mService.get());
+ mServer = builder.BuildAndStart();
+ mServerStartCv.notify_one();
+ }
+ mServer->Wait();
+ });
+ {
+ std::unique_lock<std::mutex> lock(mLock);
+ mServerStartCv.wait(lock, [this] {
+ ScopedLockAssertion lockAssertion(mLock);
+ return mServer != nullptr;
+ });
+ }
+ mChannel = grpc::CreateChannel(kTestGrpcAddr, grpc::InsecureChannelCredentials());
+ mStub = WakeupClient::NewStub(mChannel);
+ }
+
+ virtual void TearDown() override {
+ printf("Start server shutdown\n");
+ mService->stopServer();
+ mServer->Shutdown();
+ printf("Server shutdown complete\n");
+ mServerThread.join();
+ printf("Server thread exits\n");
+ mServer.reset();
+ mService.reset();
+ printf("Server and service classes reset\n");
+ }
+
+ WakeupClient::Stub* getStub() { return mStub.get(); }
+
+ size_t waitForRemoteTasks(size_t count) {
+ ClientContext context = {};
+ GetRemoteTasksResponse response;
+ auto reader = mStub->GetRemoteTasks(&context, GetRemoteTasksRequest{});
+ size_t got = 0;
+ while (reader->Read(&response)) {
+ got++;
+ mRemoteTaskResponses.push_back(response);
+ if (got == count) {
+ break;
+ }
+ }
+ // If there is more messages to be read in the reader, cancel them all so that we can
+ // finish.
+ context.TryCancel();
+ reader->Finish();
+ return got;
+ }
+
+ std::vector<GetRemoteTasksResponse> getRemoteTaskResponses() { return mRemoteTaskResponses; }
+
+ Status scheduleTask(int32_t count, int64_t startTimeInEpochSeconds, int64_t periodicInSeconds) {
+ return scheduleTask(kTestScheduleId, count, startTimeInEpochSeconds, periodicInSeconds);
+ }
+
+ Status scheduleTask(const std::string& scheduleId, int32_t count,
+ int64_t startTimeInEpochSeconds, int64_t periodicInSeconds) {
+ ClientContext context;
+ ScheduleTaskRequest request;
+ ScheduleTaskResponse response;
+ int64_t now = std::chrono::duration_cast<std::chrono::seconds>(
+ std::chrono::system_clock::now().time_since_epoch())
+ .count();
+ request.mutable_scheduleinfo()->set_clientid(kTestClientId);
+ request.mutable_scheduleinfo()->set_scheduleid(scheduleId);
+ request.mutable_scheduleinfo()->set_data(kTestData.data(), kTestData.size());
+ request.mutable_scheduleinfo()->set_count(count);
+ request.mutable_scheduleinfo()->set_starttimeinepochseconds(startTimeInEpochSeconds);
+ request.mutable_scheduleinfo()->set_periodicinseconds(periodicInSeconds);
+
+ return getStub()->ScheduleTask(&context, request, &response);
+ }
+
+ int64_t getNow() {
+ return std::chrono::duration_cast<std::chrono::seconds>(
+ std::chrono::system_clock::now().time_since_epoch())
+ .count();
+ }
+
+ private:
+ std::condition_variable mServerStartCv;
+ std::mutex mLock;
+ std::thread mServerThread;
+ std::unique_ptr<MyTestWakeupClientServiceImpl> mService;
+ std::unique_ptr<Server> mServer;
+ std::shared_ptr<Channel> mChannel;
+ std::unique_ptr<WakeupClient::Stub> mStub;
+ std::vector<GetRemoteTasksResponse> mRemoteTaskResponses;
+};
+
+TEST_F(TestWakeupClientServiceImplUnitTest, TestScheduleTask) {
+ ClientContext context = {};
+ ScheduleTaskRequest request = {};
+ ScheduleTaskResponse response = {};
+
+ request.mutable_scheduleinfo()->set_clientid(kTestClientId);
+ request.mutable_scheduleinfo()->set_scheduleid(kTestScheduleId);
+ request.mutable_scheduleinfo()->set_data(kTestData.data(), kTestData.size());
+ request.mutable_scheduleinfo()->set_count(2);
+ // Schedule the task to be executed 1s later.
+ request.mutable_scheduleinfo()->set_starttimeinepochseconds(getNow() + 1);
+ request.mutable_scheduleinfo()->set_periodicinseconds(1);
+
+ Status status = getStub()->ScheduleTask(&context, request, &response);
+
+ ASSERT_TRUE(status.ok());
+ ASSERT_EQ(response.errorcode(), ErrorCode::OK);
+
+ size_t gotTaskCount = waitForRemoteTasks(/*count=*/2);
+
+ EXPECT_EQ(gotTaskCount, 2);
+ auto responses = getRemoteTaskResponses();
+ for (const auto& response : responses) {
+ EXPECT_EQ(response.clientid(), kTestClientId);
+ EXPECT_EQ(response.data(), std::string(kTestData.begin(), kTestData.end()));
+ }
+}
+
+TEST_F(TestWakeupClientServiceImplUnitTest, TestScheduleTask_conflictScheduleId) {
+ Status status = scheduleTask(/*count=*/2, /*startTimeInEpochSeconds=*/getNow() + 1,
+ /*periodicInSeconds=*/1);
+
+ ASSERT_TRUE(status.ok());
+
+ // Schedule the same task again.
+ ClientContext context = {};
+ ScheduleTaskRequest request = {};
+ ScheduleTaskResponse response = {};
+
+ request.mutable_scheduleinfo()->set_clientid(kTestClientId);
+ request.mutable_scheduleinfo()->set_scheduleid(kTestScheduleId);
+ request.mutable_scheduleinfo()->set_data(kTestData.data(), kTestData.size());
+ request.mutable_scheduleinfo()->set_count(2);
+ request.mutable_scheduleinfo()->set_starttimeinepochseconds(getNow() + 1);
+ request.mutable_scheduleinfo()->set_periodicinseconds(1);
+
+ status = getStub()->ScheduleTask(&context, request, &response);
+
+ ASSERT_TRUE(status.ok());
+ ASSERT_EQ(response.errorcode(), ErrorCode::INVALID_ARG);
+}
+
+TEST_F(TestWakeupClientServiceImplUnitTest, TestUnscheduleTask) {
+ Status status = scheduleTask(/*count=*/2, /*startTimeInEpochSeconds=*/getNow() + 1,
+ /*periodicInSeconds=*/1);
+
+ ASSERT_TRUE(status.ok());
+
+ ClientContext context;
+ UnscheduleTaskRequest request;
+ UnscheduleTaskResponse response;
+ request.set_clientid(kTestClientId);
+ request.set_scheduleid(kTestScheduleId);
+ status = getStub()->UnscheduleTask(&context, request, &response);
+
+ ASSERT_TRUE(status.ok());
+
+ sleep(2);
+
+ // There should be no remote tasks received after 2s because the task was unscheduled.
+ EXPECT_EQ(getRemoteTaskResponses().size(), 0);
+}
+
+TEST_F(TestWakeupClientServiceImplUnitTest, TestIsTaskScheduled) {
+ int64_t startTimeInEpochSeconds = getNow() + 1;
+ int64_t periodicInSeconds = 1234;
+
+ Status status = scheduleTask(/*count=*/2, startTimeInEpochSeconds, periodicInSeconds);
+
+ ASSERT_TRUE(status.ok());
+
+ ClientContext context;
+ IsTaskScheduledRequest request;
+ IsTaskScheduledResponse response;
+ request.set_clientid(kTestClientId);
+ request.set_scheduleid(kTestScheduleId);
+ status = getStub()->IsTaskScheduled(&context, request, &response);
+
+ ASSERT_TRUE(status.ok());
+ EXPECT_TRUE(response.istaskscheduled());
+
+ ClientContext context2;
+ IsTaskScheduledRequest request2;
+ IsTaskScheduledResponse response2;
+ request.set_clientid(kTestClientId);
+ request.set_scheduleid("invalid id");
+ status = getStub()->IsTaskScheduled(&context2, request2, &response2);
+
+ ASSERT_TRUE(status.ok());
+ EXPECT_FALSE(response2.istaskscheduled());
+}
+
+TEST_F(TestWakeupClientServiceImplUnitTest, TestUnscheduleAllTasks) {
+ std::string scheduleId1 = "scheduleId1";
+ std::string scheduleId2 = "scheduleId2";
+ int64_t time1 = getNow();
+ int64_t time2 = getNow() + 1;
+ int64_t periodicInSeconds1 = 1;
+ int64_t periodicInSeconds2 = 1;
+ int32_t count1 = 2;
+ int64_t count2 = 5;
+
+ Status status = scheduleTask(scheduleId1, count1, time1, periodicInSeconds1);
+ ASSERT_TRUE(status.ok());
+ status = scheduleTask(scheduleId2, count2, time2, periodicInSeconds2);
+ ASSERT_TRUE(status.ok());
+
+ ClientContext context;
+ UnscheduleAllTasksRequest request;
+ UnscheduleAllTasksResponse response;
+ request.set_clientid(kTestClientId);
+ status = getStub()->UnscheduleAllTasks(&context, request, &response);
+ ASSERT_TRUE(status.ok());
+
+ sleep(2);
+
+ // There should be no remote tasks received after 2s because the tasks were unscheduled.
+ EXPECT_EQ(getRemoteTaskResponses().size(), 0);
+}
+
+TEST_F(TestWakeupClientServiceImplUnitTest, TestGetAllScheduledTasks) {
+ std::string scheduleId1 = "scheduleId1";
+ std::string scheduleId2 = "scheduleId2";
+ int64_t time1 = getNow();
+ int64_t time2 = getNow() + 1;
+ int64_t periodicInSeconds1 = 1;
+ int64_t periodicInSeconds2 = 1;
+ int32_t count1 = 2;
+ int64_t count2 = 5;
+
+ Status status = scheduleTask(scheduleId1, count1, time1, periodicInSeconds1);
+ ASSERT_TRUE(status.ok());
+ status = scheduleTask(scheduleId2, count2, time2, periodicInSeconds2);
+ ASSERT_TRUE(status.ok());
+
+ ClientContext context;
+ GetAllScheduledTasksRequest request;
+ GetAllScheduledTasksResponse response;
+ request.set_clientid("invalid client Id");
+ status = getStub()->GetAllScheduledTasks(&context, request, &response);
+
+ ASSERT_TRUE(status.ok());
+ EXPECT_EQ(response.allscheduledtasks_size(), 0);
+
+ ClientContext context2;
+ GetAllScheduledTasksRequest request2;
+ GetAllScheduledTasksResponse response2;
+ request2.set_clientid(kTestClientId);
+ status = getStub()->GetAllScheduledTasks(&context2, request2, &response2);
+
+ ASSERT_TRUE(status.ok());
+ ASSERT_EQ(response2.allscheduledtasks_size(), 2);
+ for (int i = 0; i < 2; i++) {
+ EXPECT_EQ(response2.allscheduledtasks(i).clientid(), kTestClientId);
+ if (response2.allscheduledtasks(i).scheduleid() == scheduleId1) {
+ EXPECT_EQ(response2.allscheduledtasks(i).data(),
+ std::string(kTestData.begin(), kTestData.end()));
+ EXPECT_EQ(response2.allscheduledtasks(i).count(), count1);
+ EXPECT_EQ(response2.allscheduledtasks(i).starttimeinepochseconds(), time1);
+ EXPECT_EQ(response2.allscheduledtasks(i).periodicinseconds(), periodicInSeconds1);
+ } else {
+ EXPECT_EQ(response2.allscheduledtasks(i).scheduleid(), scheduleId2);
+ EXPECT_EQ(response2.allscheduledtasks(i).data(),
+ std::string(kTestData.begin(), kTestData.end()));
+ EXPECT_EQ(response2.allscheduledtasks(i).count(), count2);
+ EXPECT_EQ(response2.allscheduledtasks(i).starttimeinepochseconds(), time2);
+ EXPECT_EQ(response2.allscheduledtasks(i).periodicinseconds(), periodicInSeconds2);
+ }
+ }
+}
+
+} // namespace android::hardware::automotive::remoteaccess::test
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/automotive/remoteaccess/test_grpc_server/lib/Android.bp b/automotive/remoteaccess/test_grpc_server/lib/Android.bp
index 7e95f53..8391018 100644
--- a/automotive/remoteaccess/test_grpc_server/lib/Android.bp
+++ b/automotive/remoteaccess/test_grpc_server/lib/Android.bp
@@ -26,7 +26,7 @@
cc_library_shared {
name: "ApPowerControlLib",
vendor: true,
- srcs: ["*.cpp"],
+ srcs: ["ApPowerControl.cpp"],
local_include_dirs: ["."],
export_include_dirs: ["."],
}
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/automotive/remoteaccess/test_grpc_server/lib/ApPowerControlHost.cpp
similarity index 66%
copy from automotive/vehicle/aidl/impl/utils/test/Android.bp
copy to automotive/remoteaccess/test_grpc_server/lib/ApPowerControlHost.cpp
index ad9954f..a475b00 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/automotive/remoteaccess/test_grpc_server/lib/ApPowerControlHost.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -14,13 +14,10 @@
* limitations under the License.
*/
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
+#include "ApPowerControl.h"
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
+#include <cstdio>
+
+void wakeupAp() {
+ printf("Waking up application processor...\n");
}
diff --git a/automotive/vehicle/2.0/default/TEST_MAPPING b/automotive/vehicle/2.0/default/TEST_MAPPING
index bb58700..63ea3d5 100644
--- a/automotive/vehicle/2.0/default/TEST_MAPPING
+++ b/automotive/vehicle/2.0/default/TEST_MAPPING
@@ -2,7 +2,9 @@
"presubmit": [
{
"name": "android.hardware.automotive.vehicle@2.0-manager-unit-tests"
- },
+ }
+ ],
+ "postsubmit": [
{
"name": "android.hardware.automotive.vehicle@2.0-default-impl-unit-tests"
}
diff --git a/automotive/vehicle/2.0/default/common/include/vhal_v2_0/RecurrentTimer.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/RecurrentTimer.h
index 0ed8742..0f5987e 100644
--- a/automotive/vehicle/2.0/default/common/include/vhal_v2_0/RecurrentTimer.h
+++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/RecurrentTimer.h
@@ -122,21 +122,29 @@
}
std::unique_lock<std::mutex> g(mLock);
+ // mStopRequested might be set to true after we enter the loop. Must check inside
+ // the lock to make sure the value will not change before we start the wait.
+ if (mStopRequested) {
+ return;
+ }
mCond.wait_until(g, nextEventTime); // nextEventTime can be nanoseconds::max()
}
}
void stop() {
- mStopRequested = true;
{
std::lock_guard<std::mutex> g(mLock);
mCookieToEventsMap.clear();
+ // Even though this is atomic, this must be set inside the lock to make sure we will
+ // not change this after we check mStopRequested, but before we start the wait.
+ mStopRequested = true;
}
mCond.notify_one();
if (mTimerThread.joinable()) {
mTimerThread.join();
}
}
+
private:
mutable std::mutex mLock;
std::thread mTimerThread;
diff --git a/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehiclePropertyStore.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehiclePropertyStore.h
index 6a02cf3..abbcd35 100644
--- a/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehiclePropertyStore.h
+++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehiclePropertyStore.h
@@ -70,6 +70,16 @@
* example wasn't registered. */
bool writeValue(const VehiclePropValue& propValue, bool updateStatus);
+ /*
+ * Stores provided value. Returns true if value was written returns false if config for
+ * example wasn't registered.
+ *
+ * The property value's timestamp will be set to the current ElapsedRealTimeNano.
+ */
+ bool writeValueWithCurrentTimestamp(VehiclePropValue* propValuePtr, bool updateStatus);
+
+ std::unique_ptr<VehiclePropValue> refreshTimestamp(int32_t propId, int32_t areaId);
+
void removeValue(const VehiclePropValue& propValue);
void removeValuesForProperty(int32_t propId);
@@ -94,6 +104,8 @@
std::unordered_map<int32_t /* VehicleProperty */, RecordConfig> mConfigs;
PropertyMap mPropertyValues; // Sorted map of RecordId : VehiclePropValue.
+
+ bool writeValueLocked(const VehiclePropValue& propValue, bool updateStatus);
};
} // namespace V2_0
diff --git a/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp b/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp
index 6087bfa..c12904e 100644
--- a/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp
+++ b/automotive/vehicle/2.0/default/common/src/VehiclePropertyStore.cpp
@@ -15,6 +15,7 @@
*/
#define LOG_TAG "VehiclePropertyStore"
#include <log/log.h>
+#include <utils/SystemClock.h>
#include <common/include/vhal_v2_0/VehicleUtils.h>
#include "VehiclePropertyStore.h"
@@ -41,9 +42,7 @@
mConfigs.insert({ config.prop, RecordConfig { config, tokenFunc } });
}
-bool VehiclePropertyStore::writeValue(const VehiclePropValue& propValue,
- bool updateStatus) {
- MuxGuard g(mLock);
+bool VehiclePropertyStore::writeValueLocked(const VehiclePropValue& propValue, bool updateStatus) {
if (!mConfigs.count(propValue.prop)) return false;
RecordId recId = getRecordIdLocked(propValue);
@@ -68,6 +67,36 @@
return true;
}
+bool VehiclePropertyStore::writeValue(const VehiclePropValue& propValue, bool updateStatus) {
+ MuxGuard g(mLock);
+
+ return writeValueLocked(propValue, updateStatus);
+}
+
+bool VehiclePropertyStore::writeValueWithCurrentTimestamp(VehiclePropValue* propValuePtr,
+ bool updateStatus) {
+ MuxGuard g(mLock);
+
+ propValuePtr->timestamp = elapsedRealtimeNano();
+ return writeValueLocked(*propValuePtr, updateStatus);
+}
+
+std::unique_ptr<VehiclePropValue> VehiclePropertyStore::refreshTimestamp(int32_t propId,
+ int32_t areaId) {
+ MuxGuard g(mLock);
+ RecordId recId = getRecordIdLocked(VehiclePropValue{
+ .prop = propId,
+ .areaId = areaId,
+ });
+ auto it = mPropertyValues.find(recId);
+ if (it == mPropertyValues.end()) {
+ return nullptr;
+ }
+
+ it->second.timestamp = elapsedRealtimeNano();
+ return std::make_unique<VehiclePropValue>(it->second);
+}
+
void VehiclePropertyStore::removeValue(const VehiclePropValue& propValue) {
MuxGuard g(mLock);
RecordId recId = getRecordIdLocked(propValue);
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/BackportedPropertyHelper.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/BackportedPropertyHelper.h
new file mode 100644
index 0000000..78ae940
--- /dev/null
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/BackportedPropertyHelper.h
@@ -0,0 +1,106 @@
+/*
+ * 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 contains backported system property definitions and backported enums.
+
+#pragma once
+
+namespace android {
+namespace hardware {
+namespace automotive {
+namespace vehicle {
+namespace V2_0 {
+namespace backportedproperty {
+
+/**
+ * Characterization of inputs used for computing location.
+ *
+ * This property must indicate what (if any) data and sensor inputs are considered by the system
+ * when computing the vehicle's location that is shared with Android through the GNSS HAL.
+ *
+ * The value must return a collection of bit flags. The bit flags are defined in
+ * LocationCharacterization. The value must also include exactly one of DEAD_RECKONED or
+ * RAW_GNSS_ONLY among its collection of bit flags.
+ *
+ * When this property is not supported, it is assumed that no additional sensor inputs are fused
+ * into the GNSS updates provided through the GNSS HAL. That is unless otherwise specified
+ * through the GNSS HAL interfaces.
+ *
+ * @change_mode VehiclePropertyChangeMode.STATIC
+ * @access VehiclePropertyAccess.READ
+ */
+constexpr int32_t LOCATION_CHARACTERIZATION = 0x31400C10;
+
+/**
+ * Used by LOCATION_CHARACTERIZATION to enumerate the supported bit flags.
+ *
+ * These flags are used to indicate to what transformations are performed on the
+ * GNSS data before the location data is sent, so that location processing
+ * algorithms can take into account prior fusion.
+ *
+ * This enum can be extended in future releases to include additional bit flags.
+ */
+enum class LocationCharacterization : int32_t {
+ /**
+ * Prior location samples have been used to refine the raw GNSS data (e.g. a
+ * Kalman Filter).
+ */
+ PRIOR_LOCATIONS = 0x1,
+ /**
+ * Gyroscope data has been used to refine the raw GNSS data.
+ */
+ GYROSCOPE_FUSION = 0x2,
+ /**
+ * Accelerometer data has been used to refine the raw GNSS data.
+ */
+ ACCELEROMETER_FUSION = 0x4,
+ /**
+ * Compass data has been used to refine the raw GNSS data.
+ */
+ COMPASS_FUSION = 0x8,
+ /**
+ * Wheel speed has been used to refine the raw GNSS data.
+ */
+ WHEEL_SPEED_FUSION = 0x10,
+ /**
+ * Steering angle has been used to refine the raw GNSS data.
+ */
+ STEERING_ANGLE_FUSION = 0x20,
+ /**
+ * Car speed has been used to refine the raw GNSS data.
+ */
+ CAR_SPEED_FUSION = 0x40,
+ /**
+ * Some effort is made to dead-reckon location. In particular, this means that
+ * relative changes in location have meaning when no GNSS satellite is
+ * available.
+ */
+ DEAD_RECKONED = 0x80,
+ /**
+ * Location is based on GNSS satellite signals without sufficient fusion of
+ * other sensors for complete dead reckoning. This flag should be set when
+ * relative changes to location cannot be relied on when no GNSS satellite is
+ * available.
+ */
+ RAW_GNSS_ONLY = 0x100,
+};
+
+} // namespace backportedproperty
+} // namespace V2_0
+} // namespace vehicle
+} // namespace automotive
+} // namespace hardware
+} // namespace android
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
index cfa3b0c..4846bfb 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
@@ -17,6 +17,7 @@
#ifndef android_hardware_automotive_vehicle_V2_0_impl_DefaultConfig_H_
#define android_hardware_automotive_vehicle_V2_0_impl_DefaultConfig_H_
+#include "BackportedPropertyHelper.h"
#include "PropertyUtils.h"
#include <map>
@@ -29,6 +30,9 @@
namespace impl {
+using ::android::hardware::automotive::vehicle::V2_0::backportedproperty::LOCATION_CHARACTERIZATION;
+using ::android::hardware::automotive::vehicle::V2_0::backportedproperty::LocationCharacterization;
+
struct ConfigDeclaration {
VehiclePropConfig config;
@@ -938,7 +942,10 @@
(int)VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE,
VENDOR_EXTENSION_FLOAT_PROPERTY,
(int)VehicleVendorPermission::PERMISSION_DEFAULT,
- (int)VehicleVendorPermission::PERMISSION_DEFAULT},
+ (int)VehicleVendorPermission::PERMISSION_DEFAULT,
+ LOCATION_CHARACTERIZATION,
+ (int)VehicleVendorPermission::PERMISSION_GET_VENDOR_CATEGORY_INFO,
+ (int)VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE},
},
.initialValue = {.int32Values = {1}}},
@@ -1131,6 +1138,15 @@
// GsrComplianceRequirementType::GSR_COMPLIANCE_REQUIRED_V1
.initialValue = {.int32Values = {1}},
},
+ {
+ .config =
+ {
+ .prop = LOCATION_CHARACTERIZATION,
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::STATIC,
+ },
+ .initialValue = {.int32Values = {toInt(LocationCharacterization::RAW_GNSS_ONLY)}},
+ },
#ifdef ENABLE_VENDOR_CLUSTER_PROPERTY_FOR_TESTING
// Vendor propetry for E2E ClusterHomeService testing.
{
@@ -1195,29 +1211,131 @@
},
// All supported property IDs. This list is checked by
// DefaultConfigSupportedPropertyIds_test.
- .initialValue =
- {.int32Values =
- {291504388, 289472773, 291504390, 289472775, 289407240, 289407241,
- 289472780, 286261505, 286261506, 289407235, 289472779, 291504647,
- 289408517, 356518832, 356516106, 291504644, 291504649, 291504656,
- 291504901, 291504903, 287310600, 291504905, 287310602, 287310603,
- 291504908, 291504904, 392168201, 392168202, 289408514, 289408001,
- 287310850, 287310851, 287310853, 289408513, 289475088, 289475104,
- 289475120, 354419984, 320865540, 320865556, 354419975, 354419976,
- 354419986, 354419973, 354419974, 354419978, 354419977, 356517120,
- 356517121, 356582673, 356517139, 289408269, 356517131, 358614275,
- 291570965, 291505923, 289408270, 289408512, 287310855, 289408000,
- 289408008, 289408009, 289407747, 291504900, 568332561, 371198722,
- 373295872, 320867268, 322964416, 290521862, 287310858, 287310859,
- 289475072, 289475073, 289409539, 299896064, 299896065, 299896066,
- 299896067, 289410560, 289410561, 289410562, 289410563, 289410576,
- 289410577, 289410578, 289410579, 289476368, 299895808, 639631617,
- 627048706, 591397123, 554696964, 289410873, 289410874, 287313669,
- 299896583, 299896584, 299896585, 299896586, 299896587, 286265121,
- 286265122, 286265123, 290457094, 290459441, 299896626, 290459443,
- 289410868, 289476405, 299896630, 289410871, 292556600, 557853201,
- 559950353, 555756049, 554707473, 289410887, 557846324, 557911861,
- 568332086, 557846327, 560992056, 289476424}},
+ .initialValue = {.int32Values = {291504388,
+ 289472773,
+ 291504390,
+ 289472775,
+ 289407240,
+ 289407241,
+ 289472780,
+ 286261505,
+ 286261506,
+ 289407235,
+ 289472779,
+ 291504647,
+ 289408517,
+ 356518832,
+ 356516106,
+ 291504644,
+ 291504649,
+ 291504656,
+ 291504901,
+ 291504903,
+ 287310600,
+ 291504905,
+ 287310602,
+ 287310603,
+ 291504908,
+ 291504904,
+ 392168201,
+ 392168202,
+ 289408514,
+ 289408001,
+ 287310850,
+ 287310851,
+ 287310853,
+ 289408513,
+ 289475088,
+ 289475104,
+ 289475120,
+ 354419984,
+ 320865540,
+ 320865556,
+ 354419975,
+ 354419976,
+ 354419986,
+ 354419973,
+ 354419974,
+ 354419978,
+ 354419977,
+ 356517120,
+ 356517121,
+ 356582673,
+ 356517139,
+ 289408269,
+ 356517131,
+ 358614275,
+ 291570965,
+ 291505923,
+ 289408270,
+ 289408512,
+ 287310855,
+ 289408000,
+ 289408008,
+ 289408009,
+ 289407747,
+ 291504900,
+ 568332561,
+ 371198722,
+ 373295872,
+ 320867268,
+ 322964416,
+ 290521862,
+ 287310858,
+ 287310859,
+ 289475072,
+ 289475073,
+ 289409539,
+ 299896064,
+ 299896065,
+ 299896066,
+ 299896067,
+ 289410560,
+ 289410561,
+ 289410562,
+ 289410563,
+ 289410576,
+ 289410577,
+ 289410578,
+ 289410579,
+ 289476368,
+ 299895808,
+ 639631617,
+ 627048706,
+ 591397123,
+ 554696964,
+ 289410873,
+ 289410874,
+ 287313669,
+ 299896583,
+ 299896584,
+ 299896585,
+ 299896586,
+ 299896587,
+ 286265121,
+ 286265122,
+ 286265123,
+ 290457094,
+ 290459441,
+ 299896626,
+ 290459443,
+ 289410868,
+ 289476405,
+ 299896630,
+ 289410871,
+ 292556600,
+ 557853201,
+ 559950353,
+ 555756049,
+ 554707473,
+ 289410887,
+ 557846324,
+ 557911861,
+ 568332086,
+ 557846327,
+ 560992056,
+ 289476424,
+ LOCATION_CHARACTERIZATION}},
},
#endif // ENABLE_GET_PROP_CONFIGS_BY_MULTIPLE_REQUESTS
};
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp
index 318e9dd..b56a190 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp
@@ -57,12 +57,6 @@
return nullptr;
}
-VehicleHal::VehiclePropValuePtr addTimestamp(VehicleHal::VehiclePropValuePtr v) {
- if (v.get()) {
- v->timestamp = elapsedRealtimeNano();
- }
- return v;
-}
} // namespace
VehicleHal::VehiclePropValuePtr DefaultVehicleHal::createVhalHeartBeatProp() {
@@ -102,7 +96,7 @@
*outStatus = StatusCode::INTERNAL_ERROR;
}
}
- return addTimestamp(std::move(v));
+ return v;
}
VehicleHal::VehiclePropValuePtr DefaultVehicleHal::get(const VehiclePropValue& requestedPropValue,
@@ -118,13 +112,13 @@
if (propId == OBD2_FREEZE_FRAME) {
v = getValuePool()->obtainComplex();
*outStatus = fillObd2FreezeFrame(mPropStore, requestedPropValue, v.get());
- return addTimestamp(std::move(v));
+ return v;
}
if (propId == OBD2_FREEZE_FRAME_INFO) {
v = getValuePool()->obtainComplex();
*outStatus = fillObd2DtcInfo(mPropStore, v.get());
- return addTimestamp(std::move(v));
+ return v;
}
auto internalPropValue = mPropStore->readValueOrNull(requestedPropValue);
@@ -139,7 +133,7 @@
} else {
*outStatus = StatusCode::TRY_AGAIN;
}
- return addTimestamp(std::move(v));
+ return v;
}
std::vector<VehiclePropConfig> DefaultVehicleHal::listProperties() {
@@ -486,26 +480,42 @@
void DefaultVehicleHal::onContinuousPropertyTimer(const std::vector<int32_t>& properties) {
auto& pool = *getValuePool();
-
for (int32_t property : properties) {
- VehiclePropValuePtr v;
+ std::vector<VehiclePropValuePtr> events;
if (isContinuousProperty(property)) {
- auto internalPropValue = mPropStore->readValueOrNull(property);
- if (internalPropValue != nullptr) {
- v = pool.obtain(*internalPropValue);
+ const VehiclePropConfig* config = mPropStore->getConfigOrNull(property);
+ std::vector<int32_t> areaIds;
+ if (isGlobalProp(property)) {
+ areaIds.push_back(0);
+ } else {
+ for (auto& c : config->areaConfigs) {
+ areaIds.push_back(c.areaId);
+ }
+ }
+
+ for (int areaId : areaIds) {
+ auto v = pool.obtain(*mPropStore->refreshTimestamp(property, areaId));
+ if (v.get()) {
+ events.push_back(std::move(v));
+ }
}
} else if (property == static_cast<int32_t>(VehicleProperty::VHAL_HEARTBEAT)) {
// VHAL_HEARTBEAT is not a continuous value, but it needs to be updated periodically.
// So, the update is done through onContinuousPropertyTimer.
- v = doInternalHealthCheck();
+ auto v = doInternalHealthCheck();
+ if (!v.get()) {
+ // Internal health check failed.
+ continue;
+ }
+ mPropStore->writeValueWithCurrentTimestamp(v.get(), /*updateStatus=*/true);
+ events.push_back(std::move(v));
} else {
ALOGE("Unexpected onContinuousPropertyTimer for property: 0x%x", property);
continue;
}
- if (v.get()) {
- v->timestamp = elapsedRealtimeNano();
- doHalEvent(std::move(v));
+ for (VehiclePropValuePtr& event : events) {
+ doHalEvent(std::move(event));
}
}
}
@@ -556,7 +566,7 @@
void DefaultVehicleHal::onPropertyValue(const VehiclePropValue& value, bool updateStatus) {
VehiclePropValuePtr updatedPropValue = getValuePool()->obtain(value);
- if (mPropStore->writeValue(*updatedPropValue, updateStatus)) {
+ if (mPropStore->writeValueWithCurrentTimestamp(updatedPropValue.get(), updateStatus)) {
doHalEvent(std::move(updatedPropValue));
}
}
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp
index edd4484..c876836 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/tests/DefaultVhalImpl_test.cpp
@@ -81,8 +81,13 @@
using ::android::hardware::automotive::vehicle::V2_0::impl::OBD2_FREEZE_FRAME_CLEAR;
using ::android::hardware::automotive::vehicle::V2_0::impl::OBD2_FREEZE_FRAME_INFO;
using ::android::hardware::automotive::vehicle::V2_0::impl::OBD2_LIVE_FRAME;
+using ::android::hardware::automotive::vehicle::V2_0::impl::WHEEL_FRONT_LEFT;
+using ::android::hardware::automotive::vehicle::V2_0::impl::WHEEL_FRONT_RIGHT;
+using ::android::hardware::automotive::vehicle::V2_0::impl::WHEEL_REAR_LEFT;
+using ::android::hardware::automotive::vehicle::V2_0::impl::WHEEL_REAR_RIGHT;
using ::testing::HasSubstr;
+using ::testing::UnorderedElementsAre;
using VehiclePropValuePtr = recyclable_ptr<VehiclePropValue>;
@@ -152,7 +157,7 @@
TEST_F(DefaultVhalImplTest, testListProperties) {
std::vector<VehiclePropConfig> configs = mHal->listProperties();
- EXPECT_EQ((size_t)124, configs.size());
+ EXPECT_EQ((size_t)125, configs.size());
}
TEST_F(DefaultVhalImplTest, testGetDefaultPropertyFloat) {
@@ -346,6 +351,38 @@
EXPECT_EQ(1.0f, lastEvent->value.floatValues[0]);
}
+TEST_F(DefaultVhalImplTest, testSubscribeContinuous_withMultipleAreaIds) {
+ // Clear existing events.
+ mEventQueue.flush();
+ int propId = toInt(VehicleProperty::TIRE_PRESSURE);
+
+ auto status = mHal->subscribe(propId, 1);
+
+ ASSERT_EQ(StatusCode::OK, status);
+
+ std::vector<VehiclePropValuePtr> receivedEvents;
+ // Wait for 2 updates, each for 4 area IDs.
+ waitForEvents(&receivedEvents, 4 * 2);
+
+ std::vector<int> areasForUpdate1;
+ std::vector<int> areasForUpdate2;
+
+ for (size_t i = 0; i < receivedEvents.size(); i++) {
+ ASSERT_EQ(receivedEvents[i]->prop, propId);
+
+ if (i < 4) {
+ areasForUpdate1.push_back(receivedEvents[i]->areaId);
+ } else {
+ areasForUpdate2.push_back(receivedEvents[i]->areaId);
+ }
+ }
+
+ ASSERT_THAT(areasForUpdate1, UnorderedElementsAre(WHEEL_FRONT_LEFT, WHEEL_FRONT_RIGHT,
+ WHEEL_REAR_LEFT, WHEEL_REAR_RIGHT));
+ ASSERT_THAT(areasForUpdate2, UnorderedElementsAre(WHEEL_FRONT_LEFT, WHEEL_FRONT_RIGHT,
+ WHEEL_REAR_LEFT, WHEEL_REAR_RIGHT));
+}
+
TEST_F(DefaultVhalImplTest, testSubscribeInvalidProp) {
EXPECT_EQ(StatusCode::INVALID_ARG, mHal->subscribe(toInt(VehicleProperty::INFO_MAKE), 10));
}
@@ -1318,7 +1355,6 @@
ASSERT_EQ((size_t)1, events.size());
ASSERT_EQ((size_t)1, events[0]->value.int32Values.size());
EXPECT_EQ(2022, events[0]->value.int32Values[0]);
- EXPECT_EQ(1000, events[0]->timestamp);
VehiclePropValue value;
StatusCode status;
@@ -1352,7 +1388,6 @@
ASSERT_EQ((size_t)1, events.size());
EXPECT_EQ(0, events[0]->value.int32Values[0]);
EXPECT_EQ(DOOR_1_LEFT, events[0]->areaId);
- EXPECT_EQ(1000, events[0]->timestamp);
VehiclePropValue value;
StatusCode status;
@@ -1391,7 +1426,6 @@
ASSERT_EQ((size_t)1, events.size());
ASSERT_EQ((size_t)1, events[0]->value.floatValues.size());
EXPECT_EQ(10.5, events[0]->value.floatValues[0]);
- EXPECT_EQ(1000, events[0]->timestamp);
VehiclePropValue value;
StatusCode status;
diff --git a/automotive/vehicle/Android.bp b/automotive/vehicle/Android.bp
index c0d71d7..3549519 100644
--- a/automotive/vehicle/Android.bp
+++ b/automotive/vehicle/Android.bp
@@ -21,7 +21,7 @@
cc_defaults {
name: "VehicleHalInterfaceDefaults",
static_libs: [
- "android.hardware.automotive.vehicle-V2-ndk",
- "android.hardware.automotive.vehicle.property-V2-ndk",
+ "android.hardware.automotive.vehicle-V3-ndk",
+ "android.hardware.automotive.vehicle.property-V3-ndk",
],
}
diff --git a/automotive/vehicle/TEST_MAPPING b/automotive/vehicle/TEST_MAPPING
index da8416c..e1a90cb 100644
--- a/automotive/vehicle/TEST_MAPPING
+++ b/automotive/vehicle/TEST_MAPPING
@@ -43,6 +43,17 @@
"auto-presubmit": [
{
"name": "VtsHalAutomotiveVehicle_TargetTest"
+ },
+ {
+ "name": "CarServiceUnitTest",
+ "options" : [
+ {
+ "include-filter": "com.android.car.hal.fakevhal.FakeVehicleStubUnitTest"
+ }
+ ]
+ },
+ {
+ "name": "VehicleHalProtoMessageConverterTest"
}
]
}
diff --git a/automotive/vehicle/aidl/Android.bp b/automotive/vehicle/aidl/Android.bp
index 7405d4c..5ca1fc8 100644
--- a/automotive/vehicle/aidl/Android.bp
+++ b/automotive/vehicle/aidl/Android.bp
@@ -27,7 +27,7 @@
srcs: [
"android/hardware/automotive/vehicle/*.aidl",
],
- frozen: true,
+ frozen: false,
stability: "vintf",
backend: {
cpp: {
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/.hash b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/.hash
index b04a6b5..aae94d1 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/.hash
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/.hash
@@ -1 +1,2 @@
a741c2814ba6e9852e106bc26e820d741f66ebb8
+2e101035a8abf667295ca2106bebb8850b9bdc9c
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueRequest.aidl
index d88cd8b..15a2024 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueRequest.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueRequest.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable GetValueRequest {
long requestId;
android.hardware.automotive.vehicle.VehiclePropValue prop;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueResult.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueResult.aidl
index 25f3575..a8e0ac8 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueResult.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/GetValueResult.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable GetValueResult {
long requestId;
android.hardware.automotive.vehicle.StatusCode status = android.hardware.automotive.vehicle.StatusCode.OK;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/RawPropValues.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/RawPropValues.aidl
index e7b0a13..80e81b2 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/RawPropValues.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/RawPropValues.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable RawPropValues {
int[] int32Values = {};
float[] floatValues;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueRequest.aidl
index 6a65307..9b392f5 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueRequest.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueRequest.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable SetValueRequest {
long requestId;
android.hardware.automotive.vehicle.VehiclePropValue value;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueResult.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueResult.aidl
index ec5fabb..57aa11f 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueResult.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SetValueResult.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable SetValueResult {
long requestId;
android.hardware.automotive.vehicle.StatusCode status = android.hardware.automotive.vehicle.StatusCode.OK;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SubscribeOptions.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SubscribeOptions.aidl
index 91e7c14..1f89a01 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SubscribeOptions.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/SubscribeOptions.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable SubscribeOptions {
int propId;
int[] areaIds;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl
index 6960894..c8887d9 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable VehicleAreaConfig {
int areaId;
int minInt32Value;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropConfig.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropConfig.aidl
index 8602d2d..32dac44 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropConfig.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropConfig.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable VehiclePropConfig {
int prop;
android.hardware.automotive.vehicle.VehiclePropertyAccess access = android.hardware.automotive.vehicle.VehiclePropertyAccess.NONE;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropError.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropError.aidl
index 9835295..9d49f1d 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropError.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropError.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable VehiclePropError {
int propId;
int areaId;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropValue.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropValue.aidl
index c87379f..f9feff5 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropValue.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/2/android/hardware/automotive/vehicle/VehiclePropValue.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable VehiclePropValue {
long timestamp;
int areaId;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueRequest.aidl
index d88cd8b..15a2024 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueRequest.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueRequest.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable GetValueRequest {
long requestId;
android.hardware.automotive.vehicle.VehiclePropValue prop;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueResult.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueResult.aidl
index 25f3575..a8e0ac8 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueResult.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/GetValueResult.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable GetValueResult {
long requestId;
android.hardware.automotive.vehicle.StatusCode status = android.hardware.automotive.vehicle.StatusCode.OK;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RawPropValues.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RawPropValues.aidl
index e7b0a13..80e81b2 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RawPropValues.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/RawPropValues.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable RawPropValues {
int[] int32Values = {};
float[] floatValues;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueRequest.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueRequest.aidl
index 6a65307..9b392f5 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueRequest.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueRequest.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable SetValueRequest {
long requestId;
android.hardware.automotive.vehicle.VehiclePropValue value;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueResult.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueResult.aidl
index ec5fabb..57aa11f 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueResult.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SetValueResult.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable SetValueResult {
long requestId;
android.hardware.automotive.vehicle.StatusCode status = android.hardware.automotive.vehicle.StatusCode.OK;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SubscribeOptions.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SubscribeOptions.aidl
index 91e7c14..3e19ede 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SubscribeOptions.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/SubscribeOptions.aidl
@@ -32,9 +32,11 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable SubscribeOptions {
int propId;
int[] areaIds;
float sampleRate;
+ float resolution = 0.0f;
+ boolean enableVariableUpdateRate;
}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl
index 6960894..eb3028e 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable VehicleAreaConfig {
int areaId;
int minInt32Value;
@@ -42,4 +42,6 @@
float minFloatValue;
float maxFloatValue;
@nullable long[] supportedEnumValues;
+ android.hardware.automotive.vehicle.VehiclePropertyAccess access = android.hardware.automotive.vehicle.VehiclePropertyAccess.NONE;
+ boolean supportVariableUpdateRate;
}
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropConfig.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropConfig.aidl
index 8602d2d..32dac44 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropConfig.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropConfig.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable VehiclePropConfig {
int prop;
android.hardware.automotive.vehicle.VehiclePropertyAccess access = android.hardware.automotive.vehicle.VehiclePropertyAccess.NONE;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropError.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropError.aidl
index 9835295..9d49f1d 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropError.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropError.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable VehiclePropError {
int propId;
int areaId;
diff --git a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropValue.aidl b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropValue.aidl
index c87379f..f9feff5 100644
--- a/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropValue.aidl
+++ b/automotive/vehicle/aidl/aidl_api/android.hardware.automotive.vehicle/current/android/hardware/automotive/vehicle/VehiclePropValue.aidl
@@ -32,7 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.automotive.vehicle;
-@JavaDerive(equals=true, toString=true) @VintfStability
+@JavaDerive(equals=true, toString=true) @RustDerive(Clone=true) @VintfStability
parcelable VehiclePropValue {
long timestamp;
int areaId;
diff --git a/automotive/vehicle/aidl/aidl_test/Android.bp b/automotive/vehicle/aidl/aidl_test/Android.bp
index c6d8bce..2dc9ee1 100644
--- a/automotive/vehicle/aidl/aidl_test/Android.bp
+++ b/automotive/vehicle/aidl/aidl_test/Android.bp
@@ -52,8 +52,8 @@
":IVehicleGeneratedJavaFiles",
],
static_libs: [
- "android.hardware.automotive.vehicle-V2-java",
- "android.hardware.automotive.vehicle.property-V2-java",
+ "android.hardware.automotive.vehicle-V3-java",
+ "android.hardware.automotive.vehicle.property-V3-java",
"androidx.test.runner",
"truth",
],
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueRequest.aidl
index e5b3929..1989b3e 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueRequest.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueRequest.aidl
@@ -20,6 +20,7 @@
@VintfStability
@JavaDerive(equals=true, toString=true)
+@RustDerive(Clone=true)
parcelable GetValueRequest {
// A unique request ID. For every client, the request ID must start with 1
// and monotonically increase for every SetValueRequest. If it hits
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResult.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResult.aidl
index 24c5757..208c882 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResult.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/GetValueResult.aidl
@@ -21,6 +21,7 @@
@VintfStability
@JavaDerive(equals=true, toString=true)
+@RustDerive(Clone=true)
parcelable GetValueResult {
// The ID for the request this response is for.
long requestId;
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RawPropValues.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RawPropValues.aidl
index 28ccc1d..032882d 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RawPropValues.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/RawPropValues.aidl
@@ -18,6 +18,7 @@
@VintfStability
@JavaDerive(equals=true, toString=true)
+@RustDerive(Clone=true)
parcelable RawPropValues {
/**
* This is used for properties of types VehiclePropertyType#INT32,
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequest.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequest.aidl
index 625f901..c8d413d 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequest.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueRequest.aidl
@@ -20,6 +20,7 @@
@VintfStability
@JavaDerive(equals=true, toString=true)
+@RustDerive(Clone=true)
parcelable SetValueRequest {
// A unique request ID. For every client, the request ID must start with 1
// and monotonically increase for every SetValueRequest. If it hits
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResult.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResult.aidl
index b3feeaa..673f812 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResult.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SetValueResult.aidl
@@ -20,6 +20,7 @@
@VintfStability
@JavaDerive(equals=true, toString=true)
+@RustDerive(Clone=true)
parcelable SetValueResult {
// The ID for the request this response is for.
long requestId;
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl
index e68f7e3..e572e31 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl
@@ -21,6 +21,7 @@
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
+@RustDerive(Clone=true)
parcelable SubscribeOptions {
/** Property to subscribe */
int propId;
@@ -39,4 +40,29 @@
* This value indicates how many updates per second client wants to receive.
*/
float sampleRate;
+
+ /**
+ * Requested resolution of property updates.
+ *
+ * This value indicates the resolution at which continuous property updates should be sent to
+ * the platform. For example, if resolution is 0.01, the subscribed property value should be
+ * rounded to two decimal places. If the incoming resolution value is not an integer multiple of
+ * 10, VHAL should return a StatusCode::INVALID_ARG.
+ */
+ float resolution = 0.0f;
+
+ /**
+ * Whether to enable variable update rate.
+ *
+ * This only applies for continuous property. If variable update rate is
+ * enabled, for each given areaId, if VHAL supports variable update rate for
+ * the [propId, areaId], VHAL must ignore duplicate property value events
+ * and only sends changed value events (a.k.a treat continuous as an
+ * on-change property).
+ *
+ * If VHAL does not support variable update rate for the [propId, areaId],
+ * indicated by 'supportVariableUpdateRate' in 'VehicleAreaConfig', or if
+ * this property is not a continuous property, this option must be ignored.
+ */
+ boolean enableVariableUpdateRate;
}
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl
index 20c046d..5a93f30 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehicleAreaConfig.aidl
@@ -16,8 +16,11 @@
package android.hardware.automotive.vehicle;
+import android.hardware.automotive.vehicle.VehiclePropertyAccess;
+
@VintfStability
@JavaDerive(equals=true, toString=true)
+@RustDerive(Clone=true)
parcelable VehicleAreaConfig {
/**
* Area id is always 0 for VehicleArea#GLOBAL properties.
@@ -47,4 +50,55 @@
* assumed all @data_enum values are supported unless specified through another mechanism.
*/
@nullable long[] supportedEnumValues;
+
+ /**
+ * Defines if the area ID for this property is READ, WRITE or READ_WRITE. This only applies if
+ * the property is defined in the framework as a READ_WRITE property. Access (if set) should be
+ * equal to, or a superset of, the VehiclePropConfig.access of the property.
+ *
+ * For example, if a property is defined as READ_WRITE, but the OEM wants to specify certain
+ * area Ids as READ-only, the corresponding areaIds should have an access set to READ, while the
+ * others must be set to READ_WRITE. We do not support setting specific area Ids to WRITE-only
+ * when the property is READ-WRITE.
+ *
+ * Exclusively one of VehiclePropConfig and the VehicleAreaConfigs should be specified for a
+ * single property. If VehiclePropConfig.access is populated, none of the
+ * VehicleAreaConfig.access values should be populated. If VehicleAreaConfig.access values are
+ * populated, VehiclePropConfig.access must not be populated.
+ *
+ * VehicleAreaConfigs should not be partially populated with access. If the OEM wants to specify
+ * access for one area Id, all other configs should be populated with their access levels as
+ * well.
+ */
+ VehiclePropertyAccess access = VehiclePropertyAccess.NONE;
+
+ /**
+ * Whether variable update rate is supported.
+ *
+ * This applies for continuous property only.
+ *
+ * It is HIGHLY RECOMMENDED to support variable update rate for all non-heartbeat continuous
+ * properties for better performance unless the property is large.
+ *
+ * If variable update rate is supported and 'enableVariableUpdateRate' is true in subscribe
+ * options, VHAL must only sends property update event when the property's value changes
+ * (a.k.a treat continuous as an on-change property).
+ *
+ * E.g. if the client is subscribing at 5hz at time 0. If the property's value is 0 initially
+ * and becomes 1 after 1 second.
+
+ * If variable update rate is not enabled, VHAL clients will receive 5 property change events
+ * with value 0 and 5 events with value 1 after 2 seconds.
+ *
+ * If variable update rate is enabled, VHAL clients will receive 1 property change event
+ * with value 1 at time 1s. VHAL may/may not send a property event for the initial value (e.g.
+ * a property change event with value 0 at time 0s). VHAL client must not rely on the first
+ * property event, and must use getValues to fetch the initial value. In fact, car service is
+ * using getValues to fetch the initial value, convert it to a property event and deliver to
+ * car service clients.
+ *
+ * NOTE: If this is true, car service may cache the property update event for filtering purpose,
+ * so this should be false if the property is large (e.g. a byte array of 1k in size).
+ */
+ boolean supportVariableUpdateRate;
}
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl
index 61b9369..14cb39a 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropConfig.aidl
@@ -22,12 +22,17 @@
@VintfStability
@JavaDerive(equals=true, toString=true)
+@RustDerive(Clone=true)
parcelable VehiclePropConfig {
/** Property identifier */
int prop;
/**
* Defines if the property is read or write or both.
+ *
+ * If populating VehicleAreaConfig.access fields for this property, this field should not be
+ * populated. If the OEM decides to populate this field, none of the VehicleAreaConfig.access
+ * fields should be populated.
*/
VehiclePropertyAccess access = VehiclePropertyAccess.NONE;
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropError.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropError.aidl
index 2c31c72..7c38b91 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropError.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropError.aidl
@@ -20,6 +20,7 @@
@VintfStability
@JavaDerive(equals=true, toString=true)
+@RustDerive(Clone=true)
parcelable VehiclePropError {
// Property ID.
int propId;
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValue.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValue.aidl
index 289f270..c78c635 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValue.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/VehiclePropValue.aidl
@@ -26,6 +26,7 @@
*/
@VintfStability
@JavaDerive(equals=true, toString=true)
+@RustDerive(Clone=true)
parcelable VehiclePropValue {
/** Time is elapsed nanoseconds since boot */
long timestamp;
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/automotive/vehicle/aidl/emu_metadata/Android.bp
similarity index 74%
rename from automotive/vehicle/aidl/impl/utils/test/Android.bp
rename to automotive/vehicle/aidl/emu_metadata/Android.bp
index ad9954f..64f895f 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/automotive/vehicle/aidl/emu_metadata/Android.bp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright (C) 2024 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.
@@ -18,9 +18,9 @@
default_applicable_licenses: ["Android-Apache-2.0"],
}
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
+filegroup {
+ name: "android.hardware.automotive.vehicle-types-meta",
+ srcs: [
+ "android.hardware.automotive.vehicle-types-meta.json",
+ ],
}
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
index 6d856a8..235bf43 100644
--- 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
@@ -1,4603 +1,2856 @@
[
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehicleOilLevel",
- "values": [
- {
- "name": "CRITICALLY_LOW",
- "value": 0
- },
- {
- "name": "LOW",
- "value": 1
- },
- {
- "name": "NORMAL",
- "value": 2
- },
- {
- "name": "HIGH",
- "value": 3
- },
- {
- "name": "ERROR",
- "value": 4
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "LocationCharacterization",
- "values": [
- {
- "name": "PRIOR_LOCATIONS",
- "value": 1
- },
- {
- "name": "GYROSCOPE_FUSION",
- "value": 2
- },
- {
- "name": "ACCELEROMETER_FUSION",
- "value": 4
- },
- {
- "name": "COMPASS_FUSION",
- "value": 8
- },
- {
- "name": "WHEEL_SPEED_FUSION",
- "value": 16
- },
- {
- "name": "STEERING_ANGLE_FUSION",
- "value": 32
- },
- {
- "name": "CAR_SPEED_FUSION",
- "value": 64
- },
- {
- "name": "DEAD_RECKONED",
- "value": 128
- },
- {
- "name": "RAW_GNSS_ONLY",
- "value": 256
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehicleDisplay",
- "values": [
- {
- "name": "MAIN",
- "value": 0
- },
- {
- "name": "INSTRUMENT_CLUSTER",
- "value": 1
- },
- {
- "name": "HUD",
- "value": 2
- },
- {
- "name": "INPUT",
- "value": 3
- },
- {
- "name": "AUXILIARY",
- "value": 4
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "CruiseControlState",
- "values": [
- {
- "name": "OTHER",
- "value": 0
- },
- {
- "name": "ENABLED",
- "value": 1
- },
- {
- "name": "ACTIVATED",
- "value": 2
- },
- {
- "name": "USER_OVERRIDE",
- "value": 3
- },
- {
- "name": "SUSPENDED",
- "value": 4
- },
- {
- "name": "FORCED_DEACTIVATION_WARNING",
- "value": 5
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "HandsOnDetectionWarning",
- "values": [
- {
- "name": "OTHER",
- "value": 0
- },
- {
- "name": "NO_WARNING",
- "value": 1
- },
- {
- "name": "WARNING",
- "value": 2
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehicleLightSwitch",
- "values": [
- {
- "name": "OFF",
- "value": 0
- },
- {
- "name": "ON",
- "value": 1
- },
- {
- "name": "DAYTIME_RUNNING",
- "value": 2
- },
- {
- "name": "AUTOMATIC",
- "value": 256
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "Obd2IgnitionMonitorKind",
- "values": [
- {
- "name": "SPARK",
- "value": 0
- },
- {
- "name": "COMPRESSION",
- "value": 1
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehicleHwMotionButtonStateFlag",
- "values": [
- {
- "name": "BUTTON_PRIMARY",
- "value": 1
- },
- {
- "name": "BUTTON_SECONDARY",
- "value": 2
- },
- {
- "name": "BUTTON_TERTIARY",
- "value": 4
- },
- {
- "name": "BUTTON_BACK",
- "value": 8
- },
- {
- "name": "BUTTON_FORWARD",
- "value": 16
- },
- {
- "name": "BUTTON_STYLUS_PRIMARY",
- "value": 32
- },
- {
- "name": "BUTTON_STYLUS_SECONDARY",
- "value": 64
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehicleApPowerBootupReason",
- "values": [
- {
- "name": "USER_POWER_ON",
- "value": 0
- },
- {
- "name": "SYSTEM_USER_DETECTION",
- "value": 1
- },
- {
- "name": "SYSTEM_REMOTE_ACCESS",
- "value": 2
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "EmergencyLaneKeepAssistState",
- "values": [
- {
- "name": "OTHER",
- "value": 0
- },
- {
- "name": "ENABLED",
- "value": 1
- },
- {
- "name": "WARNING_LEFT",
- "value": 2
- },
- {
- "name": "WARNING_RIGHT",
- "value": 3
- },
- {
- "name": "ACTIVATED_STEER_LEFT",
- "value": 4
- },
- {
- "name": "ACTIVATED_STEER_RIGHT",
- "value": 5
- },
- {
- "name": "USER_OVERRIDE",
- "value": 6
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "HandsOnDetectionDriverState",
- "values": [
- {
- "name": "OTHER",
- "value": 0
- },
- {
- "name": "HANDS_ON",
- "value": 1
- },
- {
- "name": "HANDS_OFF",
- "value": 2
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "CruiseControlCommand",
- "values": [
- {
- "name": "ACTIVATE",
- "value": 1
- },
- {
- "name": "SUSPEND",
- "value": 2
- },
- {
- "name": "INCREASE_TARGET_SPEED",
- "value": 3
- },
- {
- "name": "DECREASE_TARGET_SPEED",
- "value": 4
- },
- {
- "name": "INCREASE_TARGET_TIME_GAP",
- "value": 5
- },
- {
- "name": "DECREASE_TARGET_TIME_GAP",
- "value": 6
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "WindshieldWipersSwitch",
- "values": [
- {
- "name": "OTHER",
- "value": 0
- },
- {
- "name": "OFF",
- "value": 1
- },
- {
- "name": "MIST",
- "value": 2
- },
- {
- "name": "INTERMITTENT_LEVEL_1",
- "value": 3
- },
- {
- "name": "INTERMITTENT_LEVEL_2",
- "value": 4
- },
- {
- "name": "INTERMITTENT_LEVEL_3",
- "value": 5
- },
- {
- "name": "INTERMITTENT_LEVEL_4",
- "value": 6
- },
- {
- "name": "INTERMITTENT_LEVEL_5",
- "value": 7
- },
- {
- "name": "CONTINUOUS_LEVEL_1",
- "value": 8
- },
- {
- "name": "CONTINUOUS_LEVEL_2",
- "value": 9
- },
- {
- "name": "CONTINUOUS_LEVEL_3",
- "value": 10
- },
- {
- "name": "CONTINUOUS_LEVEL_4",
- "value": 11
- },
- {
- "name": "CONTINUOUS_LEVEL_5",
- "value": 12
- },
- {
- "name": "AUTO",
- "value": 13
- },
- {
- "name": "SERVICE",
- "value": 14
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehicleHwMotionToolType",
- "values": [
- {
- "name": "TOOL_TYPE_UNKNOWN",
- "value": 0
- },
- {
- "name": "TOOL_TYPE_FINGER",
- "value": 1
- },
- {
- "name": "TOOL_TYPE_STYLUS",
- "value": 2
- },
- {
- "name": "TOOL_TYPE_MOUSE",
- "value": 3
- },
- {
- "name": "TOOL_TYPE_ERASER",
- "value": 4
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "SwitchUserStatus",
- "values": [
- {
- "name": "SUCCESS",
- "value": 1
- },
- {
- "name": "FAILURE",
- "value": 2
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "EvsServiceType",
- "values": [
- {
- "name": "REARVIEW",
- "value": 0
- },
- {
- "name": "SURROUNDVIEW",
- "value": 1
- },
- {
- "name": "FRONTVIEW",
- "value": 2
- },
- {
- "name": "LEFTVIEW",
- "value": 3
- },
- {
- "name": "RIGHTVIEW",
- "value": 4
- },
- {
- "name": "DRIVERVIEW",
- "value": 5
- },
- {
- "name": "FRONTPASSENGERSVIEW",
- "value": 6
- },
- {
- "name": "REARPASSENGERSVIEW",
- "value": 7
- },
- {
- "name": "USER_DEFINED",
- "value": 1000
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "ErrorState",
- "values": [
- {
- "name": "OTHER_ERROR_STATE",
- "value": -1
- },
- {
- "name": "NOT_AVAILABLE_DISABLED",
- "value": -2
- },
- {
- "name": "NOT_AVAILABLE_SPEED_LOW",
- "value": -3
- },
- {
- "name": "NOT_AVAILABLE_SPEED_HIGH",
- "value": -4
- },
- {
- "name": "NOT_AVAILABLE_POOR_VISIBILITY",
- "value": -5
- },
- {
- "name": "NOT_AVAILABLE_SAFETY",
- "value": -6
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "EvsServiceRequestIndex",
- "values": [
- {
- "name": "TYPE",
- "value": 0
- },
- {
- "name": "STATE",
- "value": 1
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "LaneDepartureWarningState",
- "values": [
- {
- "name": "OTHER",
- "value": 0
- },
- {
- "name": "NO_WARNING",
- "value": 1
- },
- {
- "name": "WARNING_LEFT",
- "value": 2
- },
- {
- "name": "WARNING_RIGHT",
- "value": 3
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "Obd2SparkIgnitionMonitors",
- "values": []
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "CreateUserStatus",
- "values": [
- {
- "name": "SUCCESS",
- "value": 1
- },
- {
- "name": "FAILURE",
- "value": 2
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehiclePropertyGroup",
- "values": [
- {
- "name": "SYSTEM",
- "value": 268435456
- },
- {
- "name": "VENDOR",
- "value": 536870912
- },
- {
- "name": "MASK",
- "value": 4026531840
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VmsOfferingMessageIntegerValuesIndex",
- "values": [
- {
- "name": "MESSAGE_TYPE",
- "value": 0
- },
- {
- "name": "PUBLISHER_ID",
- "value": 1
- },
- {
- "name": "NUMBER_OF_OFFERS",
- "value": 2
- },
- {
- "name": "OFFERING_START",
- "value": 3
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VmsBaseMessageIntegerValuesIndex",
- "values": [
- {
- "name": "MESSAGE_TYPE",
- "value": 0
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "Obd2CompressionIgnitionMonitors",
- "values": []
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "LaneKeepAssistState",
- "values": [
- {
- "name": "OTHER",
- "value": 0
- },
- {
- "name": "ENABLED",
- "value": 1
- },
- {
- "name": "ACTIVATED_STEER_LEFT",
- "value": 2
- },
- {
- "name": "ACTIVATED_STEER_RIGHT",
- "value": 3
- },
- {
- "name": "USER_OVERRIDE",
- "value": 4
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehicleHwMotionInputAction",
- "values": [
- {
- "name": "ACTION_DOWN",
- "value": 0
- },
- {
- "name": "ACTION_UP",
- "value": 1
- },
- {
- "name": "ACTION_MOVE",
- "value": 2
- },
- {
- "name": "ACTION_CANCEL",
- "value": 3
- },
- {
- "name": "ACTION_OUTSIDE",
- "value": 4
- },
- {
- "name": "ACTION_POINTER_DOWN",
- "value": 5
- },
- {
- "name": "ACTION_POINTER_UP",
- "value": 6
- },
- {
- "name": "ACTION_HOVER_MOVE",
- "value": 7
- },
- {
- "name": "ACTION_SCROLL",
- "value": 8
- },
- {
- "name": "ACTION_HOVER_ENTER",
- "value": 9
- },
- {
- "name": "ACTION_HOVER_EXIT",
- "value": 10
- },
- {
- "name": "ACTION_BUTTON_PRESS",
- "value": 11
- },
- {
- "name": "ACTION_BUTTON_RELEASE",
- "value": 12
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehicleApPowerStateConfigFlag",
- "values": [
- {
- "name": "ENABLE_DEEP_SLEEP_FLAG",
- "value": 1
- },
- {
- "name": "CONFIG_SUPPORT_TIMER_POWER_ON_FLAG",
- "value": 2
- },
- {
- "name": "ENABLE_HIBERNATION_FLAG",
- "value": 4
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VmsPublisherInformationIntegerValuesIndex",
- "values": [
- {
- "name": "MESSAGE_TYPE",
- "value": 0
- },
- {
- "name": "PUBLISHER_ID",
- "value": 1
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehicleApPowerStateReq",
- "values": [
- {
- "name": "ON",
- "value": 0
- },
- {
- "name": "SHUTDOWN_PREPARE",
- "value": 1
- },
- {
- "name": "CANCEL_SHUTDOWN",
- "value": 2
- },
- {
- "name": "FINISHED",
- "value": 3
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "WindshieldWipersState",
- "values": [
- {
- "name": "OTHER",
- "value": 0
- },
- {
- "name": "OFF",
- "value": 1
- },
- {
- "name": "ON",
- "value": 2
- },
- {
- "name": "SERVICE",
- "value": 3
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "LaneCenteringAssistState",
- "values": [
- {
- "name": "OTHER",
- "value": 0
- },
- {
- "name": "ENABLED",
- "value": 1
- },
- {
- "name": "ACTIVATION_REQUESTED",
- "value": 2
- },
- {
- "name": "ACTIVATED",
- "value": 3
- },
- {
- "name": "USER_OVERRIDE",
- "value": 4
- },
- {
- "name": "FORCED_DEACTIVATION_WARNING",
- "value": 5
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "Obd2CommonIgnitionMonitors",
- "values": []
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehicleHwMotionInputSource",
- "values": [
- {
- "name": "SOURCE_UNKNOWN",
- "value": 0
- },
- {
- "name": "SOURCE_KEYBOARD",
- "value": 1
- },
- {
- "name": "SOURCE_DPAD",
- "value": 2
- },
- {
- "name": "SOURCE_GAMEPAD",
- "value": 3
- },
- {
- "name": "SOURCE_TOUCHSCREEN",
- "value": 4
- },
- {
- "name": "SOURCE_MOUSE",
- "value": 5
- },
- {
- "name": "SOURCE_STYLUS",
- "value": 6
- },
- {
- "name": "SOURCE_BLUETOOTH_STYLUS",
- "value": 7
- },
- {
- "name": "SOURCE_TRACKBALL",
- "value": 8
- },
- {
- "name": "SOURCE_MOUSE_RELATIVE",
- "value": 9
- },
- {
- "name": "SOURCE_TOUCHPAD",
- "value": 10
- },
- {
- "name": "SOURCE_TOUCH_NAVIGATION",
- "value": 11
- },
- {
- "name": "SOURCE_ROTARY_ENCODER",
- "value": 12
- },
- {
- "name": "SOURCE_JOYSTICK",
- "value": 13
- },
- {
- "name": "SOURCE_HDMI",
- "value": 14
- },
- {
- "name": "SOURCE_SENSOR",
- "value": 15
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "ForwardCollisionWarningState",
- "values": [
- {
- "name": "OTHER",
- "value": 0
- },
- {
- "name": "NO_WARNING",
- "value": 1
- },
- {
- "name": "WARNING",
- "value": 2
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "InitialUserInfoResponseAction",
- "values": [
- {
- "name": "DEFAULT",
- "value": 0
- },
- {
- "name": "SWITCH",
- "value": 1
- },
- {
- "name": "CREATE",
- "value": 2
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "CruiseControlType",
- "values": [
- {
- "name": "OTHER",
- "value": 0
- },
- {
- "name": "STANDARD",
- "value": 1
- },
- {
- "name": "ADAPTIVE",
- "value": 2
- },
- {
- "name": "PREDICTIVE",
- "value": 3
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "GsrComplianceRequirementType",
- "values": [
- {
- "name": "GSR_COMPLIANCE_NOT_REQUIRED",
- "value": 0
- },
- {
- "name": "GSR_COMPLIANCE_REQUIRED_V1",
- "value": 1
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehicleLightState",
- "values": [
- {
- "name": "OFF",
- "value": 0
- },
- {
- "name": "ON",
- "value": 1
- },
- {
- "name": "DAYTIME_RUNNING",
- "value": 2
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VmsMessageWithLayerIntegerValuesIndex",
- "values": [
- {
- "name": "MESSAGE_TYPE",
- "value": 0
- },
- {
- "name": "LAYER_TYPE",
- "value": 1
- },
- {
- "name": "LAYER_SUBTYPE",
- "value": 2
- },
- {
- "name": "LAYER_VERSION",
- "value": 3
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "EvRegenerativeBrakingState",
- "values": [
- {
- "name": "UNKNOWN",
- "value": 0
- },
- {
- "name": "DISABLED",
- "value": 1
- },
- {
- "name": "PARTIALLY_ENABLED",
- "value": 2
- },
- {
- "name": "FULLY_ENABLED",
- "value": 3
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehicleApPowerStateReqIndex",
- "values": [
- {
- "name": "STATE",
- "value": 0
- },
- {
- "name": "ADDITIONAL",
- "value": 1
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "RotaryInputType",
- "values": [
- {
- "name": "ROTARY_INPUT_TYPE_SYSTEM_NAVIGATION",
- "value": 0
- },
- {
- "name": "ROTARY_INPUT_TYPE_AUDIO_VOLUME",
- "value": 1
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehicleSeatOccupancyState",
- "values": [
- {
- "name": "UNKNOWN",
- "value": 0
- },
- {
- "name": "VACANT",
- "value": 1
- },
- {
- "name": "OCCUPIED",
- "value": 2
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "EvStoppingMode",
- "values": [
- {
- "name": "OTHER",
- "value": 0
- },
- {
- "name": "CREEP",
- "value": 1
- },
- {
- "name": "ROLL",
- "value": 2
- },
- {
- "name": "HOLD",
- "value": 3
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "AutomaticEmergencyBrakingState",
- "values": [
- {
- "name": "OTHER",
- "value": 0
- },
- {
- "name": "ENABLED",
- "value": 1
- },
- {
- "name": "ACTIVATED",
- "value": 2
- },
- {
- "name": "USER_OVERRIDE",
- "value": 3
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehicleAreaMirror",
- "values": [
- {
- "name": "DRIVER_LEFT",
- "value": 1
- },
- {
- "name": "DRIVER_RIGHT",
- "value": 2
- },
- {
- "name": "DRIVER_CENTER",
- "value": 4
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "TrailerState",
- "values": [
- {
- "name": "UNKNOWN",
- "value": 0
- },
- {
- "name": "NOT_PRESENT",
- "value": 1
- },
- {
- "name": "PRESENT",
- "value": 2
- },
- {
- "name": "ERROR",
- "value": 3
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "EvsServiceState",
- "values": [
- {
- "name": "OFF",
- "value": 0
- },
- {
- "name": "ON",
- "value": 1
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehicleHwKeyInputAction",
- "values": [
- {
- "name": "ACTION_DOWN",
- "value": 0
- },
- {
- "name": "ACTION_UP",
- "value": 1
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "BlindSpotWarningState",
- "values": [
- {
- "name": "OTHER",
- "value": 0
- },
- {
- "name": "NO_WARNING",
- "value": 1
- },
- {
- "name": "WARNING",
- "value": 2
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VmsStartSessionMessageIntegerValuesIndex",
- "values": [
- {
- "name": "MESSAGE_TYPE",
- "value": 0
- },
- {
- "name": "SERVICE_ID",
- "value": 1
- },
- {
- "name": "CLIENT_ID",
- "value": 2
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "VehicleTurnSignal",
- "values": [
- {
- "name": "NONE",
- "value": 0
- },
- {
- "name": "RIGHT",
- "value": 1
- },
- {
- "name": "LEFT",
- "value": 2
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "ElectronicTollCollectionCardType",
- "values": [
- {
- "name": "UNKNOWN",
- "value": 0
- },
- {
- "name": "JP_ELECTRONIC_TOLL_COLLECTION_CARD",
- "value": 1
- },
- {
- "name": "JP_ELECTRONIC_TOLL_COLLECTION_CARD_V2",
- "value": 2
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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": "Nominal battery capacity for EV or hybrid vehicle",
- "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": "Battery level for EV or hybrid vehicle",
- "value": 291504905,
- "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
- "access": "VehiclePropertyAccess:READ",
- "unit": "VehicleUnit:WH"
- },
- {
- "name": "Current battery capacity for EV or hybrid vehicle",
- "value": 291504909,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "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": "Represents feature for engine idle automatic stop.",
- "value": 287310624,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "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": "Regenerative braking level of a electronic vehicle",
- "value": 289408012,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "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": "Represents property for the current stopping mode of the vehicle.",
- "value": 289408013,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE",
- "data_enum": "EvStoppingMode"
- },
- {
- "name": "HVAC Properties",
- "value": 356517120,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "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",
- "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": "Property to represent brightness of the display.",
- "value": 289409539,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "Property to represent brightness of the displays which are controlled separately.",
- "value": 289475076,
- "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_KEY_INPUT_V2",
- "value": 367004177,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ",
- "config_flags": ""
- },
- {
- "name": "HW_MOTION_INPUT",
- "value": 367004178,
- "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": "Door child lock feature enabled",
- "value": 371198723,
- "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": "Represents property for Mirror Auto Fold feature.",
- "value": 337644358,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "Represents property for Mirror Auto Tilt feature.",
- "value": 337644359,
- "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": "SEAT_HEADREST_HEIGHT_POS",
- "value": 289409941,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "Headrest height position",
- "value": 356518820,
- "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": "Represents property for the seat footwell lights state.",
- "value": 356518811,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ",
- "data_enum": "VehicleLightState"
- },
- {
- "name": "Represents property for the seat footwell lights switch.",
- "value": 356518812,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE",
- "data_enum": "VehicleLightSwitch"
- },
- {
- "name": "Represents property for Seat easy access feature.",
- "value": 354421661,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "SEAT_AIRBAG_ENABLED",
- "value": 354421662,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "SEAT_CUSHION_SIDE_SUPPORT_POS",
- "value": 356518815,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "Represents property for movement direction and speed of seat cushion side support.",
- "value": 356518816,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "SEAT_LUMBAR_VERTICAL_POS",
- "value": 356518817,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "Represents property for vertical movement direction and speed of seat lumbar support.",
- "value": 356518818,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "SEAT_WALK_IN_POS",
- "value": 356518819,
- "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": "WINDSHIELD_WIPERS_PERIOD",
- "value": 322964421,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ",
- "unit": "VehicleUnit:MILLI_SECS"
- },
- {
- "name": "Windshield wipers state.",
- "value": 322964422,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ",
- "data_enum": "WindshieldWipersState"
- },
- {
- "name": "Windshield wipers switch.",
- "value": 322964423,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE",
- "data_enum": "WindshieldWipersSwitch"
- },
- {
- "name": "Steering wheel depth position",
- "value": 289410016,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "Steering wheel depth movement",
- "value": 289410017,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "Steering wheel height position",
- "value": 289410018,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "Steering wheel height movement",
- "value": 289410019,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "Steering wheel theft lock feature enabled",
- "value": 287312868,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "Steering wheel locked",
- "value": 287312869,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "Steering wheel easy access feature enabled",
- "value": 287312870,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "Property that represents the current position of the glove box door.",
- "value": 356518896,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "Lock or unlock the glove box.",
- "value": 354421745,
- "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": "Characterization of inputs used for computing location.",
- "value": 289410064,
- "change_mode": "VehiclePropertyChangeMode:STATIC",
- "access": "VehiclePropertyAccess:READ"
- },
- {
- "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": "Steering wheel lights state",
- "value": 289410828,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ",
- "data_enum": "VehicleLightState"
- },
- {
- "name": "Steering wheel lights switch",
- "value": 289410829,
- "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": "GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT",
- "value": 289410887,
- "change_mode": "VehiclePropertyChangeMode:STATIC",
- "access": "VehiclePropertyAccess:READ",
- "data_enum": "GsrComplianceRequirementType"
- },
- {
- "name": "SUPPORTED_PROPERTY_IDS",
- "value": 289476424,
- "change_mode": "VehiclePropertyChangeMode:STATIC",
- "access": "VehiclePropertyAccess:READ"
- },
- {
- "name": "Request the head unit to be shutdown.",
- "value": 289410889,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:WRITE",
- "data_enum": "VehicleApPowerStateShutdownParam"
- },
- {
- "name": "Whether the vehicle is currently in use.",
- "value": 287313738,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "Start of ADAS Properties",
- "value": 287313920,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "AUTOMATIC_EMERGENCY_BRAKING_STATE",
- "value": 289411073,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ",
- "data_enum": "ErrorState"
- },
- {
- "name": "FORWARD_COLLISION_WARNING_ENABLED",
- "value": 287313922,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "FORWARD_COLLISION_WARNING_STATE",
- "value": 289411075,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ",
- "data_enum": "ErrorState"
- },
- {
- "name": "BLIND_SPOT_WARNING_ENABLED",
- "value": 287313924,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "BLIND_SPOT_WARNING_STATE",
- "value": 339742725,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ",
- "data_enum": "ErrorState"
- },
- {
- "name": "LANE_DEPARTURE_WARNING_ENABLED",
- "value": 287313926,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "LANE_DEPARTURE_WARNING_STATE",
- "value": 289411079,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ",
- "data_enum": "ErrorState"
- },
- {
- "name": "LANE_KEEP_ASSIST_ENABLED",
- "value": 287313928,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "LANE_KEEP_ASSIST_STATE",
- "value": 289411081,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ",
- "data_enum": "ErrorState"
- },
- {
- "name": "LANE_CENTERING_ASSIST_ENABLED",
- "value": 287313930,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "LANE_CENTERING_ASSIST_COMMAND",
- "value": 289411083,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:WRITE",
- "data_enum": "LaneCenteringAssistCommand"
- },
- {
- "name": "LANE_CENTERING_ASSIST_STATE",
- "value": 289411084,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ",
- "data_enum": "ErrorState"
- },
- {
- "name": "EMERGENCY_LANE_KEEP_ASSIST_ENABLED",
- "value": 287313933
- },
- {
- "name": "EMERGENCY_LANE_KEEP_ASSIST_STATE",
- "value": 289411086,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ",
- "data_enum": "ErrorState"
- },
- {
- "name": "CRUISE_CONTROL_ENABLED",
- "value": 287313935,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "CRUISE_CONTROL_TYPE",
- "value": 289411088,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE",
- "data_enum": "ErrorState"
- },
- {
- "name": "CRUISE_CONTROL_STATE",
- "value": 289411089,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ",
- "data_enum": "ErrorState"
- },
- {
- "name": "CRUISE_CONTROL_COMMAND",
- "value": 289411090,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:WRITE",
- "data_enum": "CruiseControlCommand"
- },
- {
- "name": "CRUISE_CONTROL_TARGET_SPEED",
- "value": 291508243,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ",
- "unit": "VehicleUnit:METER_PER_SEC"
- },
- {
- "name": "ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP",
- "value": 289411092,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE",
- "unit": "VehicleUnit:MILLI_SECS"
- },
- {
- "name": "ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE",
- "value": 289411093,
- "change_mode": "VehiclePropertyChangeMode:CONTINUOUS",
- "access": "VehiclePropertyAccess:READ",
- "unit": "VehicleUnit:MILLIMETER"
- },
- {
- "name": "HANDS_ON_DETECTION_ENABLED",
- "value": 287313942,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ_WRITE"
- },
- {
- "name": "HANDS_ON_DETECTION_DRIVER_STATE",
- "value": 289411095,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ",
- "data_enum": "ErrorState"
- },
- {
- "name": "HANDS_ON_DETECTION_WARNING",
- "value": 289411096,
- "change_mode": "VehiclePropertyChangeMode:ON_CHANGE",
- "access": "VehiclePropertyAccess:READ",
- "data_enum": "ErrorState"
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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": "MILLI_SECS",
- "value": 81
- },
- {
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "LaneCenteringAssistCommand",
- "values": [
- {
- "name": "ACTIVATE",
- "value": 1
- },
- {
- "name": "DEACTIVATE",
- "value": 2
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "name": "ProcessTerminationReason",
- "values": [
- {
- "name": "NOT_RESPONDING",
- "value": 1
- },
- {
- "name": "IO_OVERUSE",
- "value": 2
- },
- {
- "name": "MEMORY_OVERUSE",
- "value": 3
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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
- }
- ]
- },
- {
- "package": "android.hardware.automotive.vehicle",
- "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": "VehicleProperty",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "VIN of vehicle",
+ "value": 286261504
+ },
+ {
+ "name": "Manufacturer of vehicle",
+ "value": 286261505
+ },
+ {
+ "name": "Model of vehicle",
+ "value": 286261506
+ },
+ {
+ "name": "Model year of vehicle.",
+ "value": 289407235
+ },
+ {
+ "name": "INFO_FUEL_CAPACITY",
+ "value": 291504388
+ },
+ {
+ "name": "INFO_FUEL_TYPE",
+ "value": 289472773,
+ "data_enums": [
+ "FuelType"
+ ],
+ "data_enum": "FuelType"
+ },
+ {
+ "name": "INFO_EV_BATTERY_CAPACITY",
+ "value": 291504390
+ },
+ {
+ "name": "INFO_EV_CONNECTOR_TYPE",
+ "value": 289472775,
+ "data_enums": [
+ "EvConnectorType"
+ ],
+ "data_enum": "EvConnectorType"
+ },
+ {
+ "name": "Fuel door location",
+ "value": 289407240,
+ "data_enums": [
+ "PortLocationType"
+ ],
+ "data_enum": "PortLocationType"
+ },
+ {
+ "name": "EV port location",
+ "value": 289407241,
+ "data_enums": [
+ "PortLocationType"
+ ],
+ "data_enum": "PortLocationType"
+ },
+ {
+ "name": "INFO_DRIVER_SEAT",
+ "value": 356516106,
+ "data_enums": [
+ "VehicleAreaSeat"
+ ],
+ "data_enum": "VehicleAreaSeat"
+ },
+ {
+ "name": "INFO_EXTERIOR_DIMENSIONS",
+ "value": 289472779
+ },
+ {
+ "name": "Multiple EV port locations",
+ "value": 289472780,
+ "data_enums": [
+ "PortLocationType"
+ ],
+ "data_enum": "PortLocationType"
+ },
+ {
+ "name": "PERF_ODOMETER",
+ "value": 291504644
+ },
+ {
+ "name": "Speed of the vehicle",
+ "value": 291504647
+ },
+ {
+ "name": "PERF_VEHICLE_SPEED_DISPLAY",
+ "value": 291504648
+ },
+ {
+ "name": "PERF_STEERING_ANGLE",
+ "value": 291504649
+ },
+ {
+ "name": "PERF_REAR_STEERING_ANGLE",
+ "value": 291504656
+ },
+ {
+ "name": "Temperature of engine coolant",
+ "value": 291504897
+ },
+ {
+ "name": "Engine oil level",
+ "value": 289407747,
+ "data_enums": [
+ "VehicleOilLevel"
+ ],
+ "data_enum": "VehicleOilLevel"
+ },
+ {
+ "name": "Temperature of engine oil",
+ "value": 291504900
+ },
+ {
+ "name": "Engine rpm",
+ "value": 291504901
+ },
+ {
+ "name": "Reports wheel ticks",
+ "value": 290521862
+ },
+ {
+ "name": "FUEL_LEVEL",
+ "value": 291504903
+ },
+ {
+ "name": "Fuel door open",
+ "value": 287310600
+ },
+ {
+ "name": "EV_BATTERY_LEVEL",
+ "value": 291504905
+ },
+ {
+ "name": "EV_CURRENT_BATTERY_CAPACITY",
+ "value": 291504909
+ },
+ {
+ "name": "EV charge port open",
+ "value": 287310602
+ },
+ {
+ "name": "EV charge port connected",
+ "value": 287310603
+ },
+ {
+ "name": "EV_BATTERY_INSTANTANEOUS_CHARGE_RATE",
+ "value": 291504908
+ },
+ {
+ "name": "Range remaining",
+ "value": 291504904
+ },
+ {
+ "name": "EV battery average temperature",
+ "value": 291504910
+ },
+ {
+ "name": "Tire pressure",
+ "value": 392168201
+ },
+ {
+ "name": "Critically low tire pressure",
+ "value": 392168202
+ },
+ {
+ "name": "ENGINE_IDLE_AUTO_STOP_ENABLED",
+ "value": 287310624
+ },
+ {
+ "name": "Impact detected.",
+ "value": 289407792,
+ "data_enums": [
+ "ImpactSensorLocation"
+ ],
+ "data_enum": "ImpactSensorLocation"
+ },
+ {
+ "name": "Currently selected gear",
+ "value": 289408000,
+ "data_enums": [
+ "VehicleGear"
+ ],
+ "data_enum": "VehicleGear"
+ },
+ {
+ "name": "CURRENT_GEAR",
+ "value": 289408001,
+ "data_enums": [
+ "VehicleGear"
+ ],
+ "data_enum": "VehicleGear"
+ },
+ {
+ "name": "Parking brake state.",
+ "value": 287310850
+ },
+ {
+ "name": "Auto-apply parking brake.",
+ "value": 287310851
+ },
+ {
+ "name": "EV_BRAKE_REGENERATION_LEVEL",
+ "value": 289408012
+ },
+ {
+ "name": "Warning for fuel low level.",
+ "value": 287310853
+ },
+ {
+ "name": "Night mode",
+ "value": 287310855
+ },
+ {
+ "name": "TURN_SIGNAL_STATE",
+ "value": 289408008,
+ "data_enums": [
+ "VehicleTurnSignal"
+ ],
+ "data_enum": "VehicleTurnSignal"
+ },
+ {
+ "name": "Represents ignition state",
+ "value": 289408009,
+ "data_enums": [
+ "VehicleIgnitionState"
+ ],
+ "data_enum": "VehicleIgnitionState"
+ },
+ {
+ "name": "ABS is active",
+ "value": 287310858
+ },
+ {
+ "name": "Traction Control is active",
+ "value": 287310859
+ },
+ {
+ "name": "EV_STOPPING_MODE",
+ "value": 289408013,
+ "data_enums": [
+ "EvStoppingMode"
+ ],
+ "data_enum": "EvStoppingMode"
+ },
+ {
+ "name": "ELECTRONIC_STABILITY_CONTROL_ENABLED",
+ "value": 287310862
+ },
+ {
+ "name": "ELECTRONIC_STABILITY_CONTROL_STATE",
+ "value": 289408015,
+ "data_enums": [
+ "ElectronicStabilityControlState",
+ "ErrorState"
+ ],
+ "data_enum": "ElectronicStabilityControlState"
+ },
+ {
+ "name": "Fan speed setting",
+ "value": 356517120
+ },
+ {
+ "name": "Fan direction setting",
+ "value": 356517121,
+ "data_enums": [
+ "VehicleHvacFanDirection"
+ ],
+ "data_enum": "VehicleHvacFanDirection"
+ },
+ {
+ "name": "HVAC current temperature.",
+ "value": 358614274
+ },
+ {
+ "name": "HVAC, target temperature set.",
+ "value": 358614275
+ },
+ {
+ "name": "HVAC_DEFROSTER",
+ "value": 320865540
+ },
+ {
+ "name": "HVAC_AC_ON",
+ "value": 354419973
+ },
+ {
+ "name": "On\/off max AC",
+ "value": 354419974
+ },
+ {
+ "name": "On\/off max defrost",
+ "value": 354419975
+ },
+ {
+ "name": "Recirculation on\/off",
+ "value": 354419976
+ },
+ {
+ "name": "HVAC_DUAL_ON",
+ "value": 354419977
+ },
+ {
+ "name": "HVAC_AUTO_ON",
+ "value": 354419978
+ },
+ {
+ "name": "Seat heating\/cooling",
+ "value": 356517131
+ },
+ {
+ "name": "Side Mirror Heat",
+ "value": 339739916
+ },
+ {
+ "name": "Steering Wheel Heating\/Cooling",
+ "value": 289408269
+ },
+ {
+ "name": "Temperature units for display",
+ "value": 289408270,
+ "data_enums": [
+ "VehicleUnit"
+ ],
+ "data_enum": "VehicleUnit"
+ },
+ {
+ "name": "Actual fan speed",
+ "value": 356517135
+ },
+ {
+ "name": "HVAC_POWER_ON",
+ "value": 354419984
+ },
+ {
+ "name": "Fan Positions Available",
+ "value": 356582673,
+ "data_enums": [
+ "VehicleHvacFanDirection"
+ ],
+ "data_enum": "VehicleHvacFanDirection"
+ },
+ {
+ "name": "Automatic recirculation on\/off",
+ "value": 354419986
+ },
+ {
+ "name": "Seat ventilation",
+ "value": 356517139
+ },
+ {
+ "name": "Electric defrosters' status",
+ "value": 320865556
+ },
+ {
+ "name": "HVAC_TEMPERATURE_VALUE_SUGGESTION",
+ "value": 291570965
+ },
+ {
+ "name": "Distance units for display",
+ "value": 289408512,
+ "data_enums": [
+ "VehicleUnit"
+ ],
+ "data_enum": "VehicleUnit"
+ },
+ {
+ "name": "Fuel volume units for display",
+ "value": 289408513,
+ "data_enums": [
+ "VehicleUnit"
+ ],
+ "data_enum": "VehicleUnit"
+ },
+ {
+ "name": "TIRE_PRESSURE_DISPLAY_UNITS",
+ "value": 289408514,
+ "data_enums": [
+ "VehicleUnit"
+ ],
+ "data_enum": "VehicleUnit"
+ },
+ {
+ "name": "EV battery units for display",
+ "value": 289408515,
+ "data_enums": [
+ "VehicleUnit"
+ ],
+ "data_enum": "VehicleUnit"
+ },
+ {
+ "name": "FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME",
+ "value": 287311364
+ },
+ {
+ "name": "Speed units for display",
+ "value": 289408517
+ },
+ {
+ "name": "EXTERNAL_CAR_TIME",
+ "value": 290457096
+ },
+ {
+ "name": "ANDROID_EPOCH_TIME",
+ "value": 290457094
+ },
+ {
+ "name": "STORAGE_ENCRYPTION_BINDING_SEED",
+ "value": 292554247
+ },
+ {
+ "name": "Outside temperature",
+ "value": 291505923
+ },
+ {
+ "name": "AP_POWER_STATE_REQ",
+ "value": 289475072
+ },
+ {
+ "name": "AP_POWER_STATE_REPORT",
+ "value": 289475073
+ },
+ {
+ "name": "AP_POWER_BOOTUP_REASON",
+ "value": 289409538
+ },
+ {
+ "name": "DISPLAY_BRIGHTNESS",
+ "value": 289409539
+ },
+ {
+ "name": "PER_DISPLAY_BRIGHTNESS",
+ "value": 289475076
+ },
+ {
+ "name": "Valet mode enabled",
+ "value": 287312389
+ },
+ {
+ "name": "HW_KEY_INPUT",
+ "value": 289475088
+ },
+ {
+ "name": "HW_KEY_INPUT_V2",
+ "value": 367004177
+ },
+ {
+ "name": "HW_MOTION_INPUT",
+ "value": 367004178
+ },
+ {
+ "name": "HW_ROTARY_INPUT",
+ "value": 289475104,
+ "data_enums": [
+ "RotaryInputType"
+ ],
+ "data_enum": "RotaryInputType"
+ },
+ {
+ "name": "HW_CUSTOM_INPUT",
+ "value": 289475120,
+ "data_enums": [
+ "CustomInputType"
+ ],
+ "data_enum": "CustomInputType"
+ },
+ {
+ "name": "Door position",
+ "value": 373295872
+ },
+ {
+ "name": "Door move",
+ "value": 373295873
+ },
+ {
+ "name": "Door lock",
+ "value": 371198722
+ },
+ {
+ "name": "DOOR_CHILD_LOCK_ENABLED",
+ "value": 371198723
+ },
+ {
+ "name": "Mirror Z Position",
+ "value": 339741504
+ },
+ {
+ "name": "Mirror Z Move",
+ "value": 339741505
+ },
+ {
+ "name": "Mirror Y Position",
+ "value": 339741506
+ },
+ {
+ "name": "Mirror Y Move",
+ "value": 339741507
+ },
+ {
+ "name": "Mirror Lock",
+ "value": 287312708
+ },
+ {
+ "name": "Mirror Fold",
+ "value": 287312709
+ },
+ {
+ "name": "MIRROR_AUTO_FOLD_ENABLED",
+ "value": 337644358
+ },
+ {
+ "name": "MIRROR_AUTO_TILT_ENABLED",
+ "value": 337644359
+ },
+ {
+ "name": "Seat memory select",
+ "value": 356518784
+ },
+ {
+ "name": "Seat memory set",
+ "value": 356518785
+ },
+ {
+ "name": "Seatbelt buckled",
+ "value": 354421634
+ },
+ {
+ "name": "Seatbelt height position",
+ "value": 356518787
+ },
+ {
+ "name": "Seatbelt height move",
+ "value": 356518788
+ },
+ {
+ "name": "Seat fore\/aft position",
+ "value": 356518789
+ },
+ {
+ "name": "Seat fore\/aft move",
+ "value": 356518790
+ },
+ {
+ "name": "Seat backrest angle 1 position",
+ "value": 356518791
+ },
+ {
+ "name": "Seat backrest angle 1 move",
+ "value": 356518792
+ },
+ {
+ "name": "Seat backrest angle 2 position",
+ "value": 356518793
+ },
+ {
+ "name": "Seat backrest angle 2 move",
+ "value": 356518794
+ },
+ {
+ "name": "Seat height position",
+ "value": 356518795
+ },
+ {
+ "name": "Seat height move",
+ "value": 356518796
+ },
+ {
+ "name": "Seat depth position",
+ "value": 356518797
+ },
+ {
+ "name": "Seat depth move",
+ "value": 356518798
+ },
+ {
+ "name": "Seat tilt position",
+ "value": 356518799
+ },
+ {
+ "name": "Seat tilt move",
+ "value": 356518800
+ },
+ {
+ "name": "Lumber fore\/aft position",
+ "value": 356518801
+ },
+ {
+ "name": "Lumbar fore\/aft move",
+ "value": 356518802
+ },
+ {
+ "name": "Lumbar side support position",
+ "value": 356518803
+ },
+ {
+ "name": "Lumbar side support move",
+ "value": 356518804
+ },
+ {
+ "name": "SEAT_HEADREST_HEIGHT_POS",
+ "value": 289409941
+ },
+ {
+ "name": "Headrest height position",
+ "value": 356518820
+ },
+ {
+ "name": "Headrest height move",
+ "value": 356518806
+ },
+ {
+ "name": "Headrest angle position",
+ "value": 356518807
+ },
+ {
+ "name": "Headrest angle move",
+ "value": 356518808
+ },
+ {
+ "name": "Headrest fore\/aft position",
+ "value": 356518809
+ },
+ {
+ "name": "Headrest fore\/aft move",
+ "value": 356518810
+ },
+ {
+ "name": "SEAT_FOOTWELL_LIGHTS_STATE",
+ "value": 356518811,
+ "data_enums": [
+ "VehicleLightState"
+ ],
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "SEAT_FOOTWELL_LIGHTS_SWITCH",
+ "value": 356518812,
+ "data_enums": [
+ "VehicleLightSwitch"
+ ],
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "SEAT_EASY_ACCESS_ENABLED",
+ "value": 354421661
+ },
+ {
+ "name": "SEAT_AIRBAG_ENABLED",
+ "value": 354421662
+ },
+ {
+ "name": "Seat airbags deployed",
+ "value": 356518821,
+ "data_enums": [
+ "VehicleAirbagLocation"
+ ],
+ "data_enum": "VehicleAirbagLocation"
+ },
+ {
+ "name": "SEAT_CUSHION_SIDE_SUPPORT_POS",
+ "value": 356518815
+ },
+ {
+ "name": "SEAT_CUSHION_SIDE_SUPPORT_MOVE",
+ "value": 356518816
+ },
+ {
+ "name": "SEAT_LUMBAR_VERTICAL_POS",
+ "value": 356518817
+ },
+ {
+ "name": "SEAT_LUMBAR_VERTICAL_MOVE",
+ "value": 356518818
+ },
+ {
+ "name": "SEAT_WALK_IN_POS",
+ "value": 356518819
+ },
+ {
+ "name": "SEAT_BELT_PRETENSIONER_DEPLOYED",
+ "value": 354421670
+ },
+ {
+ "name": "Seat Occupancy",
+ "value": 356518832,
+ "data_enums": [
+ "VehicleSeatOccupancyState"
+ ],
+ "data_enum": "VehicleSeatOccupancyState"
+ },
+ {
+ "name": "Window Position",
+ "value": 322964416
+ },
+ {
+ "name": "Window Move",
+ "value": 322964417
+ },
+ {
+ "name": "Window Lock",
+ "value": 320867268
+ },
+ {
+ "name": "WINDSHIELD_WIPERS_PERIOD",
+ "value": 322964421
+ },
+ {
+ "name": "Windshield wipers state.",
+ "value": 322964422,
+ "data_enums": [
+ "WindshieldWipersState"
+ ],
+ "data_enum": "WindshieldWipersState"
+ },
+ {
+ "name": "Windshield wipers switch.",
+ "value": 322964423,
+ "data_enums": [
+ "WindshieldWipersSwitch"
+ ],
+ "data_enum": "WindshieldWipersSwitch"
+ },
+ {
+ "name": "Steering wheel depth position",
+ "value": 289410016
+ },
+ {
+ "name": "Steering wheel depth movement",
+ "value": 289410017
+ },
+ {
+ "name": "Steering wheel height position",
+ "value": 289410018
+ },
+ {
+ "name": "Steering wheel height movement",
+ "value": 289410019
+ },
+ {
+ "name": "STEERING_WHEEL_THEFT_LOCK_ENABLED",
+ "value": 287312868
+ },
+ {
+ "name": "Steering wheel locked",
+ "value": 287312869
+ },
+ {
+ "name": "STEERING_WHEEL_EASY_ACCESS_ENABLED",
+ "value": 287312870
+ },
+ {
+ "name": "GLOVE_BOX_DOOR_POS",
+ "value": 356518896
+ },
+ {
+ "name": "Lock or unlock the glove box.",
+ "value": 354421745
+ },
+ {
+ "name": "VEHICLE_MAP_SERVICE",
+ "value": 299895808
+ },
+ {
+ "name": "LOCATION_CHARACTERIZATION",
+ "value": 289410064
+ },
+ {
+ "name": "ULTRASONICS_SENSOR_POSITION",
+ "value": 406916128
+ },
+ {
+ "name": "ULTRASONICS_SENSOR_ORIENTATION",
+ "value": 406916129
+ },
+ {
+ "name": "ULTRASONICS_SENSOR_FIELD_OF_VIEW",
+ "value": 406916130
+ },
+ {
+ "name": "ULTRASONICS_SENSOR_DETECTION_RANGE",
+ "value": 406916131
+ },
+ {
+ "name": "ULTRASONICS_SENSOR_SUPPORTED_RANGES",
+ "value": 406916132
+ },
+ {
+ "name": "OBD2 Live Sensor Data",
+ "value": 299896064
+ },
+ {
+ "name": "OBD2 Freeze Frame Sensor Data",
+ "value": 299896065
+ },
+ {
+ "name": "OBD2 Freeze Frame Information",
+ "value": 299896066
+ },
+ {
+ "name": "OBD2 Freeze Frame Clear",
+ "value": 299896067
+ },
+ {
+ "name": "Headlights State",
+ "value": 289410560,
+ "data_enums": [
+ "VehicleLightState"
+ ],
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "High beam lights state",
+ "value": 289410561,
+ "data_enums": [
+ "VehicleLightState"
+ ],
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "Fog light state",
+ "value": 289410562,
+ "data_enums": [
+ "VehicleLightState"
+ ],
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "Hazard light status",
+ "value": 289410563,
+ "data_enums": [
+ "VehicleLightState"
+ ],
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "Headlight switch",
+ "value": 289410576,
+ "data_enums": [
+ "VehicleLightSwitch"
+ ],
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "High beam light switch",
+ "value": 289410577,
+ "data_enums": [
+ "VehicleLightSwitch"
+ ],
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "Fog light switch",
+ "value": 289410578,
+ "data_enums": [
+ "VehicleLightSwitch"
+ ],
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "Hazard light switch",
+ "value": 289410579,
+ "data_enums": [
+ "VehicleLightSwitch"
+ ],
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "Cabin lights",
+ "value": 289410817,
+ "data_enums": [
+ "VehicleLightState"
+ ],
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "Cabin lights switch",
+ "value": 289410818,
+ "data_enums": [
+ "VehicleLightSwitch"
+ ],
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "Reading lights",
+ "value": 356519683,
+ "data_enums": [
+ "VehicleLightState"
+ ],
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "Reading lights switch",
+ "value": 356519684,
+ "data_enums": [
+ "VehicleLightSwitch"
+ ],
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "Steering wheel lights state",
+ "value": 289410828,
+ "data_enums": [
+ "VehicleLightState"
+ ],
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "Steering wheel lights switch",
+ "value": 289410829,
+ "data_enums": [
+ "VehicleLightSwitch"
+ ],
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "SUPPORT_CUSTOMIZE_VENDOR_PERMISSION",
+ "value": 287313669
+ },
+ {
+ "name": "DISABLED_OPTIONAL_FEATURES",
+ "value": 286265094
+ },
+ {
+ "name": "INITIAL_USER_INFO",
+ "value": 299896583
+ },
+ {
+ "name": "SWITCH_USER",
+ "value": 299896584
+ },
+ {
+ "name": "CREATE_USER",
+ "value": 299896585
+ },
+ {
+ "name": "REMOVE_USER",
+ "value": 299896586
+ },
+ {
+ "name": "USER_IDENTIFICATION_ASSOCIATION",
+ "value": 299896587
+ },
+ {
+ "name": "Enable\/request an EVS service.",
+ "value": 289476368
+ },
+ {
+ "name": "POWER_POLICY_REQ",
+ "value": 286265121
+ },
+ {
+ "name": "POWER_POLICY_GROUP_REQ",
+ "value": 286265122
+ },
+ {
+ "name": "CURRENT_POWER_POLICY",
+ "value": 286265123
+ },
+ {
+ "name": "WATCHDOG_ALIVE",
+ "value": 290459441
+ },
+ {
+ "name": "WATCHDOG_TERMINATED_PROCESS",
+ "value": 299896626
+ },
+ {
+ "name": "VHAL_HEARTBEAT",
+ "value": 290459443
+ },
+ {
+ "name": "CLUSTER_SWITCH_UI",
+ "value": 289410868
+ },
+ {
+ "name": "CLUSTER_DISPLAY_STATE",
+ "value": 289476405
+ },
+ {
+ "name": "CLUSTER_REPORT_STATE",
+ "value": 299896630
+ },
+ {
+ "name": "CLUSTER_REQUEST_DISPLAY",
+ "value": 289410871
+ },
+ {
+ "name": "CLUSTER_NAVIGATION_STATE",
+ "value": 292556600
+ },
+ {
+ "name": "ELECTRONIC_TOLL_COLLECTION_CARD_TYPE",
+ "value": 289410873,
+ "data_enums": [
+ "ElectronicTollCollectionCardType"
+ ],
+ "data_enum": "ElectronicTollCollectionCardType"
+ },
+ {
+ "name": "ELECTRONIC_TOLL_COLLECTION_CARD_STATUS",
+ "value": 289410874,
+ "data_enums": [
+ "ElectronicTollCollectionCardStatus"
+ ],
+ "data_enum": "ElectronicTollCollectionCardStatus"
+ },
+ {
+ "name": "Front fog lights state",
+ "value": 289410875,
+ "data_enums": [
+ "VehicleLightState"
+ ],
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "Front fog lights switch",
+ "value": 289410876,
+ "data_enums": [
+ "VehicleLightSwitch"
+ ],
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "Rear fog lights state",
+ "value": 289410877,
+ "data_enums": [
+ "VehicleLightState"
+ ],
+ "data_enum": "VehicleLightState"
+ },
+ {
+ "name": "Rear fog lights switch",
+ "value": 289410878,
+ "data_enums": [
+ "VehicleLightSwitch"
+ ],
+ "data_enum": "VehicleLightSwitch"
+ },
+ {
+ "name": "EV_CHARGE_CURRENT_DRAW_LIMIT",
+ "value": 291508031
+ },
+ {
+ "name": "EV_CHARGE_PERCENT_LIMIT",
+ "value": 291508032
+ },
+ {
+ "name": "Charging state of the car",
+ "value": 289410881,
+ "data_enums": [
+ "EvChargeState"
+ ],
+ "data_enum": "EvChargeState"
+ },
+ {
+ "name": "EV_CHARGE_SWITCH",
+ "value": 287313730
+ },
+ {
+ "name": "EV_CHARGE_TIME_REMAINING",
+ "value": 289410883
+ },
+ {
+ "name": "EV_REGENERATIVE_BRAKING_STATE",
+ "value": 289410884,
+ "data_enums": [
+ "EvRegenerativeBrakingState"
+ ],
+ "data_enum": "EvRegenerativeBrakingState"
+ },
+ {
+ "name": "TRAILER_PRESENT",
+ "value": 289410885,
+ "data_enums": [
+ "TrailerState"
+ ],
+ "data_enum": "TrailerState"
+ },
+ {
+ "name": "Vehicle’s curb weight",
+ "value": 289410886
+ },
+ {
+ "name": "GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT",
+ "value": 289410887,
+ "data_enums": [
+ "GsrComplianceRequirementType"
+ ],
+ "data_enum": "GsrComplianceRequirementType"
+ },
+ {
+ "name": "SUPPORTED_PROPERTY_IDS",
+ "value": 289476424
+ },
+ {
+ "name": "SHUTDOWN_REQUEST",
+ "value": 289410889,
+ "data_enums": [
+ "VehicleApPowerStateShutdownParam"
+ ],
+ "data_enum": "VehicleApPowerStateShutdownParam"
+ },
+ {
+ "name": "VEHICLE_IN_USE",
+ "value": 287313738
+ },
+ {
+ "name": "CLUSTER_HEARTBEAT",
+ "value": 299896651
+ },
+ {
+ "name": "VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL",
+ "value": 289410892,
+ "data_enums": [
+ "VehicleAutonomousState"
+ ],
+ "data_enum": "VehicleAutonomousState"
+ },
+ {
+ "name": "AUTOMATIC_EMERGENCY_BRAKING_ENABLED",
+ "value": 287313920
+ },
+ {
+ "name": "AUTOMATIC_EMERGENCY_BRAKING_STATE",
+ "value": 289411073,
+ "data_enums": [
+ "AutomaticEmergencyBrakingState",
+ "ErrorState"
+ ],
+ "data_enum": "AutomaticEmergencyBrakingState"
+ },
+ {
+ "name": "FORWARD_COLLISION_WARNING_ENABLED",
+ "value": 287313922
+ },
+ {
+ "name": "FORWARD_COLLISION_WARNING_STATE",
+ "value": 289411075,
+ "data_enums": [
+ "ForwardCollisionWarningState",
+ "ErrorState"
+ ],
+ "data_enum": "ForwardCollisionWarningState"
+ },
+ {
+ "name": "BLIND_SPOT_WARNING_ENABLED",
+ "value": 287313924
+ },
+ {
+ "name": "BLIND_SPOT_WARNING_STATE",
+ "value": 339742725,
+ "data_enums": [
+ "BlindSpotWarningState",
+ "ErrorState"
+ ],
+ "data_enum": "BlindSpotWarningState"
+ },
+ {
+ "name": "LANE_DEPARTURE_WARNING_ENABLED",
+ "value": 287313926
+ },
+ {
+ "name": "LANE_DEPARTURE_WARNING_STATE",
+ "value": 289411079,
+ "data_enums": [
+ "LaneDepartureWarningState",
+ "ErrorState"
+ ],
+ "data_enum": "LaneDepartureWarningState"
+ },
+ {
+ "name": "LANE_KEEP_ASSIST_ENABLED",
+ "value": 287313928
+ },
+ {
+ "name": "Lane Keep Assist (LKA) state.",
+ "value": 289411081,
+ "data_enums": [
+ "LaneKeepAssistState",
+ "ErrorState"
+ ],
+ "data_enum": "LaneKeepAssistState"
+ },
+ {
+ "name": "LANE_CENTERING_ASSIST_ENABLED",
+ "value": 287313930
+ },
+ {
+ "name": "LANE_CENTERING_ASSIST_COMMAND",
+ "value": 289411083,
+ "data_enums": [
+ "LaneCenteringAssistCommand"
+ ],
+ "data_enum": "LaneCenteringAssistCommand"
+ },
+ {
+ "name": "LANE_CENTERING_ASSIST_STATE",
+ "value": 289411084,
+ "data_enums": [
+ "LaneCenteringAssistState",
+ "ErrorState"
+ ],
+ "data_enum": "LaneCenteringAssistState"
+ },
+ {
+ "name": "EMERGENCY_LANE_KEEP_ASSIST_ENABLED",
+ "value": 287313933
+ },
+ {
+ "name": "EMERGENCY_LANE_KEEP_ASSIST_STATE",
+ "value": 289411086,
+ "data_enums": [
+ "EmergencyLaneKeepAssistState",
+ "ErrorState"
+ ],
+ "data_enum": "EmergencyLaneKeepAssistState"
+ },
+ {
+ "name": "CRUISE_CONTROL_ENABLED",
+ "value": 287313935
+ },
+ {
+ "name": "CRUISE_CONTROL_TYPE",
+ "value": 289411088,
+ "data_enums": [
+ "CruiseControlType",
+ "ErrorState"
+ ],
+ "data_enum": "CruiseControlType"
+ },
+ {
+ "name": "CRUISE_CONTROL_STATE",
+ "value": 289411089,
+ "data_enums": [
+ "CruiseControlState",
+ "ErrorState"
+ ],
+ "data_enum": "CruiseControlState"
+ },
+ {
+ "name": "CRUISE_CONTROL_COMMAND",
+ "value": 289411090,
+ "data_enums": [
+ "CruiseControlCommand"
+ ],
+ "data_enum": "CruiseControlCommand"
+ },
+ {
+ "name": "CRUISE_CONTROL_TARGET_SPEED",
+ "value": 291508243
+ },
+ {
+ "name": "ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP",
+ "value": 289411092
+ },
+ {
+ "name": "ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE",
+ "value": 289411093
+ },
+ {
+ "name": "HANDS_ON_DETECTION_ENABLED",
+ "value": 287313942
+ },
+ {
+ "name": "HANDS_ON_DETECTION_DRIVER_STATE",
+ "value": 289411095,
+ "data_enums": [
+ "HandsOnDetectionDriverState",
+ "ErrorState"
+ ],
+ "data_enum": "HandsOnDetectionDriverState"
+ },
+ {
+ "name": "HANDS_ON_DETECTION_WARNING",
+ "value": 289411096,
+ "data_enums": [
+ "HandsOnDetectionWarning",
+ "ErrorState"
+ ],
+ "data_enum": "HandsOnDetectionWarning"
+ },
+ {
+ "name": "DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED",
+ "value": 287313945
+ },
+ {
+ "name": "DRIVER_DROWSINESS_ATTENTION_STATE",
+ "value": 289411098,
+ "data_enums": [
+ "DriverDrowsinessAttentionState",
+ "ErrorState"
+ ],
+ "data_enum": "DriverDrowsinessAttentionState"
+ },
+ {
+ "name": "DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED",
+ "value": 287313947
+ },
+ {
+ "name": "DRIVER_DROWSINESS_ATTENTION_WARNING",
+ "value": 289411100,
+ "data_enums": [
+ "DriverDrowsinessAttentionWarning",
+ "ErrorState"
+ ],
+ "data_enum": "DriverDrowsinessAttentionWarning"
+ },
+ {
+ "name": "DRIVER_DISTRACTION_SYSTEM_ENABLED",
+ "value": 287313949
+ },
+ {
+ "name": "Driver distraction state.",
+ "value": 289411102,
+ "data_enums": [
+ "DriverDistractionState",
+ "ErrorState"
+ ],
+ "data_enum": "DriverDistractionState"
+ },
+ {
+ "name": "DRIVER_DISTRACTION_WARNING_ENABLED",
+ "value": 287313951
+ },
+ {
+ "name": "Driver distraction warning.",
+ "value": 289411104,
+ "data_enums": [
+ "DriverDistractionWarning",
+ "ErrorState"
+ ],
+ "data_enum": "DriverDistractionWarning"
+ },
+ {
+ "name": "LOW_SPEED_COLLISION_WARNING_ENABLED",
+ "value": 287313953
+ },
+ {
+ "name": "LOW_SPEED_COLLISION_WARNING_STATE",
+ "value": 289411106,
+ "data_enums": [
+ "LowSpeedCollisionWarningState",
+ "ErrorState"
+ ],
+ "data_enum": "LowSpeedCollisionWarningState"
+ },
+ {
+ "name": "CROSS_TRAFFIC_MONITORING_ENABLED",
+ "value": 287313955
+ },
+ {
+ "name": "CROSS_TRAFFIC_MONITORING_WARNING_STATE",
+ "value": 289411108,
+ "data_enums": [
+ "CrossTrafficMonitoringWarningState",
+ "ErrorState"
+ ],
+ "data_enum": "CrossTrafficMonitoringWarningState"
+ }
+ ]
+ },
+ {
+ "name": "LaneDepartureWarningState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "NO_WARNING",
+ "value": 1
+ },
+ {
+ "name": "WARNING_LEFT",
+ "value": 2
+ },
+ {
+ "name": "WARNING_RIGHT",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "HandsOnDetectionWarning",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "NO_WARNING",
+ "value": 1
+ },
+ {
+ "name": "WARNING",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "DriverDistractionState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "NOT_DISTRACTED",
+ "value": 1
+ },
+ {
+ "name": "DISTRACTED",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "VehicleTurnSignal",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "NONE",
+ "value": 0
+ },
+ {
+ "name": "RIGHT",
+ "value": 1
+ },
+ {
+ "name": "LEFT",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "RotaryInputType",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "ROTARY_INPUT_TYPE_SYSTEM_NAVIGATION",
+ "value": 0
+ },
+ {
+ "name": "ROTARY_INPUT_TYPE_AUDIO_VOLUME",
+ "value": 1
+ }
+ ]
+ },
+ {
+ "name": "EvStoppingMode",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "CREEP",
+ "value": 1
+ },
+ {
+ "name": "ROLL",
+ "value": 2
+ },
+ {
+ "name": "HOLD",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "VehicleLightState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OFF",
+ "value": 0
+ },
+ {
+ "name": "ON",
+ "value": 1
+ },
+ {
+ "name": "DAYTIME_RUNNING",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "FuelType",
+ "package": "android.hardware.automotive.vehicle",
+ "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": "VehicleIgnitionState",
+ "package": "android.hardware.automotive.vehicle",
+ "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": "EvConnectorType",
+ "package": "android.hardware.automotive.vehicle",
+ "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": "TrailerState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "NOT_PRESENT",
+ "value": 1
+ },
+ {
+ "name": "PRESENT",
+ "value": 2
+ },
+ {
+ "name": "ERROR",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "DriverDrowsinessAttentionState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "KSS_RATING_1_EXTREMELY_ALERT",
+ "value": 1
+ },
+ {
+ "name": "KSS_RATING_2_VERY_ALERT",
+ "value": 2
+ },
+ {
+ "name": "KSS_RATING_3_ALERT",
+ "value": 3
+ },
+ {
+ "name": "KSS_RATING_4_RATHER_ALERT",
+ "value": 4
+ },
+ {
+ "name": "KSS_RATING_5_NEITHER_ALERT_NOR_SLEEPY",
+ "value": 5
+ },
+ {
+ "name": "KSS_RATING_6_SOME_SLEEPINESS",
+ "value": 6
+ },
+ {
+ "name": "KSS_RATING_7_SLEEPY_NO_EFFORT",
+ "value": 7
+ },
+ {
+ "name": "KSS_RATING_8_SLEEPY_SOME_EFFORT",
+ "value": 8
+ },
+ {
+ "name": "KSS_RATING_9_VERY_SLEEPY",
+ "value": 9
+ }
+ ]
+ },
+ {
+ "name": "DriverDistractionWarning",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "NO_WARNING",
+ "value": 1
+ },
+ {
+ "name": "WARNING",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "VehicleAreaSeat",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "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": "VehicleLightSwitch",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OFF",
+ "value": 0
+ },
+ {
+ "name": "ON",
+ "value": 1
+ },
+ {
+ "name": "DAYTIME_RUNNING",
+ "value": 2
+ },
+ {
+ "name": "AUTOMATIC",
+ "value": 256
+ }
+ ]
+ },
+ {
+ "name": "WindshieldWipersSwitch",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "OFF",
+ "value": 1
+ },
+ {
+ "name": "MIST",
+ "value": 2
+ },
+ {
+ "name": "INTERMITTENT_LEVEL_1",
+ "value": 3
+ },
+ {
+ "name": "INTERMITTENT_LEVEL_2",
+ "value": 4
+ },
+ {
+ "name": "INTERMITTENT_LEVEL_3",
+ "value": 5
+ },
+ {
+ "name": "INTERMITTENT_LEVEL_4",
+ "value": 6
+ },
+ {
+ "name": "INTERMITTENT_LEVEL_5",
+ "value": 7
+ },
+ {
+ "name": "CONTINUOUS_LEVEL_1",
+ "value": 8
+ },
+ {
+ "name": "CONTINUOUS_LEVEL_2",
+ "value": 9
+ },
+ {
+ "name": "CONTINUOUS_LEVEL_3",
+ "value": 10
+ },
+ {
+ "name": "CONTINUOUS_LEVEL_4",
+ "value": 11
+ },
+ {
+ "name": "CONTINUOUS_LEVEL_5",
+ "value": 12
+ },
+ {
+ "name": "AUTO",
+ "value": 13
+ },
+ {
+ "name": "SERVICE",
+ "value": 14
+ }
+ ]
+ },
+ {
+ "name": "CrossTrafficMonitoringWarningState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "NO_WARNING",
+ "value": 1
+ },
+ {
+ "name": "WARNING_FRONT_LEFT",
+ "value": 2
+ },
+ {
+ "name": "WARNING_FRONT_RIGHT",
+ "value": 3
+ },
+ {
+ "name": "WARNING_FRONT_BOTH",
+ "value": 4
+ },
+ {
+ "name": "WARNING_REAR_LEFT",
+ "value": 5
+ },
+ {
+ "name": "WARNING_REAR_RIGHT",
+ "value": 6
+ },
+ {
+ "name": "WARNING_REAR_BOTH",
+ "value": 7
+ }
+ ]
+ },
+ {
+ "name": "LaneCenteringAssistCommand",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "ACTIVATE",
+ "value": 1
+ },
+ {
+ "name": "DEACTIVATE",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "VehicleSeatOccupancyState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "VACANT",
+ "value": 1
+ },
+ {
+ "name": "OCCUPIED",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "ErrorState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER_ERROR_STATE",
+ "value": -1
+ },
+ {
+ "name": "NOT_AVAILABLE_DISABLED",
+ "value": -2
+ },
+ {
+ "name": "NOT_AVAILABLE_SPEED_LOW",
+ "value": -3
+ },
+ {
+ "name": "NOT_AVAILABLE_SPEED_HIGH",
+ "value": -4
+ },
+ {
+ "name": "NOT_AVAILABLE_POOR_VISIBILITY",
+ "value": -5
+ },
+ {
+ "name": "NOT_AVAILABLE_SAFETY",
+ "value": -6
+ }
+ ]
+ },
+ {
+ "name": "BlindSpotWarningState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "NO_WARNING",
+ "value": 1
+ },
+ {
+ "name": "WARNING",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "WindshieldWipersState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "OFF",
+ "value": 1
+ },
+ {
+ "name": "ON",
+ "value": 2
+ },
+ {
+ "name": "SERVICE",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "VehicleAirbagLocation",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 1
+ },
+ {
+ "name": "FRONT",
+ "value": 2
+ },
+ {
+ "name": "KNEE",
+ "value": 4
+ },
+ {
+ "name": "LEFT_SIDE",
+ "value": 8
+ },
+ {
+ "name": "RIGHT_SIDE",
+ "value": 16
+ },
+ {
+ "name": "CURTAIN",
+ "value": 32
+ }
+ ]
+ },
+ {
+ "name": "DriverDrowsinessAttentionWarning",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "NO_WARNING",
+ "value": 1
+ },
+ {
+ "name": "WARNING",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "VehicleOilLevel",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "CRITICALLY_LOW",
+ "value": 0
+ },
+ {
+ "name": "LOW",
+ "value": 1
+ },
+ {
+ "name": "NORMAL",
+ "value": 2
+ },
+ {
+ "name": "HIGH",
+ "value": 3
+ },
+ {
+ "name": "ERROR",
+ "value": 4
+ }
+ ]
+ },
+ {
+ "name": "ForwardCollisionWarningState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "NO_WARNING",
+ "value": 1
+ },
+ {
+ "name": "WARNING",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "VehicleUnit",
+ "package": "android.hardware.automotive.vehicle",
+ "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": "MILLI_SECS",
+ "value": 81
+ },
+ {
+ "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": "VehicleHvacFanDirection",
+ "package": "android.hardware.automotive.vehicle",
+ "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": "LowSpeedCollisionWarningState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "NO_WARNING",
+ "value": 1
+ },
+ {
+ "name": "WARNING",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "CruiseControlCommand",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "ACTIVATE",
+ "value": 1
+ },
+ {
+ "name": "SUSPEND",
+ "value": 2
+ },
+ {
+ "name": "INCREASE_TARGET_SPEED",
+ "value": 3
+ },
+ {
+ "name": "DECREASE_TARGET_SPEED",
+ "value": 4
+ },
+ {
+ "name": "INCREASE_TARGET_TIME_GAP",
+ "value": 5
+ },
+ {
+ "name": "DECREASE_TARGET_TIME_GAP",
+ "value": 6
+ }
+ ]
+ },
+ {
+ "name": "ElectronicStabilityControlState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "ENABLED",
+ "value": 1
+ },
+ {
+ "name": "ACTIVATED",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "EvRegenerativeBrakingState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "DISABLED",
+ "value": 1
+ },
+ {
+ "name": "PARTIALLY_ENABLED",
+ "value": 2
+ },
+ {
+ "name": "FULLY_ENABLED",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "LaneCenteringAssistState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "ENABLED",
+ "value": 1
+ },
+ {
+ "name": "ACTIVATION_REQUESTED",
+ "value": 2
+ },
+ {
+ "name": "ACTIVATED",
+ "value": 3
+ },
+ {
+ "name": "USER_OVERRIDE",
+ "value": 4
+ },
+ {
+ "name": "FORCED_DEACTIVATION_WARNING",
+ "value": 5
+ }
+ ]
+ },
+ {
+ "name": "VehicleGear",
+ "package": "android.hardware.automotive.vehicle",
+ "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": "ElectronicTollCollectionCardType",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "JP_ELECTRONIC_TOLL_COLLECTION_CARD",
+ "value": 1
+ },
+ {
+ "name": "JP_ELECTRONIC_TOLL_COLLECTION_CARD_V2",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "VehicleApPowerStateShutdownParam",
+ "package": "android.hardware.automotive.vehicle",
+ "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": "EMERGENCY_SHUTDOWN",
+ "value": 7
+ }
+ ]
+ },
+ {
+ "name": "AutomaticEmergencyBrakingState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "ENABLED",
+ "value": 1
+ },
+ {
+ "name": "ACTIVATED",
+ "value": 2
+ },
+ {
+ "name": "USER_OVERRIDE",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "ImpactSensorLocation",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 1
+ },
+ {
+ "name": "FRONT",
+ "value": 2
+ },
+ {
+ "name": "FRONT_LEFT_DOOR_SIDE",
+ "value": 4
+ },
+ {
+ "name": "FRONT_RIGHT_DOOR_SIDE",
+ "value": 8
+ },
+ {
+ "name": "REAR_LEFT_DOOR_SIDE",
+ "value": 16
+ },
+ {
+ "name": "REAR_RIGHT_DOOR_SIDE",
+ "value": 32
+ },
+ {
+ "name": "REAR",
+ "value": 64
+ }
+ ]
+ },
+ {
+ "name": "CruiseControlType",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "STANDARD",
+ "value": 1
+ },
+ {
+ "name": "ADAPTIVE",
+ "value": 2
+ },
+ {
+ "name": "PREDICTIVE",
+ "value": 3
+ }
+ ]
+ },
+ {
+ "name": "LaneKeepAssistState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "ENABLED",
+ "value": 1
+ },
+ {
+ "name": "ACTIVATED_STEER_LEFT",
+ "value": 2
+ },
+ {
+ "name": "ACTIVATED_STEER_RIGHT",
+ "value": 3
+ },
+ {
+ "name": "USER_OVERRIDE",
+ "value": 4
+ }
+ ]
+ },
+ {
+ "name": "CustomInputType",
+ "package": "android.hardware.automotive.vehicle",
+ "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": "ElectronicTollCollectionCardStatus",
+ "package": "android.hardware.automotive.vehicle",
+ "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": "HandsOnDetectionDriverState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "HANDS_ON",
+ "value": 1
+ },
+ {
+ "name": "HANDS_OFF",
+ "value": 2
+ }
+ ]
+ },
+ {
+ "name": "EmergencyLaneKeepAssistState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "ENABLED",
+ "value": 1
+ },
+ {
+ "name": "WARNING_LEFT",
+ "value": 2
+ },
+ {
+ "name": "WARNING_RIGHT",
+ "value": 3
+ },
+ {
+ "name": "ACTIVATED_STEER_LEFT",
+ "value": 4
+ },
+ {
+ "name": "ACTIVATED_STEER_RIGHT",
+ "value": 5
+ },
+ {
+ "name": "USER_OVERRIDE",
+ "value": 6
+ }
+ ]
+ },
+ {
+ "name": "VehicleAutonomousState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "LEVEL_0",
+ "value": 0
+ },
+ {
+ "name": "LEVEL_1",
+ "value": 1
+ },
+ {
+ "name": "LEVEL_2",
+ "value": 2
+ },
+ {
+ "name": "LEVEL_3",
+ "value": 3
+ },
+ {
+ "name": "LEVEL_4",
+ "value": 4
+ },
+ {
+ "name": "LEVEL_5",
+ "value": 5
+ }
+ ]
+ },
+ {
+ "name": "EvChargeState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "UNKNOWN",
+ "value": 0
+ },
+ {
+ "name": "CHARGING",
+ "value": 1
+ },
+ {
+ "name": "FULLY_CHARGED",
+ "value": 2
+ },
+ {
+ "name": "NOT_CHARGING",
+ "value": 3
+ },
+ {
+ "name": "ERROR",
+ "value": 4
+ }
+ ]
+ },
+ {
+ "name": "GsrComplianceRequirementType",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "GSR_COMPLIANCE_NOT_REQUIRED",
+ "value": 0
+ },
+ {
+ "name": "GSR_COMPLIANCE_REQUIRED_V1",
+ "value": 1
+ }
+ ]
+ },
+ {
+ "name": "PortLocationType",
+ "package": "android.hardware.automotive.vehicle",
+ "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": "CruiseControlState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "ENABLED",
+ "value": 1
+ },
+ {
+ "name": "ACTIVATED",
+ "value": 2
+ },
+ {
+ "name": "USER_OVERRIDE",
+ "value": 3
+ },
+ {
+ "name": "SUSPENDED",
+ "value": 4
+ },
+ {
+ "name": "FORCED_DEACTIVATION_WARNING",
+ "value": 5
+ }
+ ]
+ }
]
\ 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
deleted file mode 100755
index 5706571..0000000
--- a/automotive/vehicle/aidl/emu_metadata/generate_emulator_metadata.py
+++ /dev/null
@@ -1,136 +0,0 @@
-#!/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_PACKAGE = re.compile(r"\npackage\s([\.a-z0-9]*);")
-RE_IMPORT = re.compile(r"\nimport\s([\.a-zA-Z0-9]*);")
-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-Za-z]+)")
-
-
-class JEnum:
- def __init__(self, package, name):
- self.package = package
- self.name = name
- self.values = []
-
-class Enum:
- def __init__(self, package, name, text, imports):
- self.text = text
- self.parsed = False
- self.imports = imports
- self.jenum = JEnum(package, name)
-
- def parse(self, enums):
- if self.parsed:
- return
- for dep in self.imports:
- enums[dep].parse(enums)
- print("Parsing " + self.jenum.name)
- matches = RE_COMMENT.findall(self.text)
- defaultValue = 0
- for match in matches:
- value = dict()
- value['name'] = match[1]
- value['value'] = self.calculateValue(match[2], defaultValue, enums)
- defaultValue = value['value'] + 1
- if self.jenum.name == "VehicleProperty":
- block_comment = match[0]
- self.parseBlockComment(value, block_comment)
- self.jenum.values.append(value)
- self.parsed = True
- self.text = None
-
- def get_value(self, value_name):
- for value in self.jenum.values:
- if value['name'] == value_name:
- return value['value']
- raise Exception("Cannot decode value: " + self.jenum.package + " : " + value_name)
-
- def calculateValue(self, expression, default_value, enums):
- 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:
- if '.' in number:
- package, val_name = number.split('.')
- for dep in self.imports:
- if package in dep:
- result += enums[dep].get_value(val_name)
- else:
- 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].replace(".", ":")
-
-class Converter:
- # Only addition is supported for now, but that covers all existing properties except
- # OBD diagnostics, which use bitwise shifts
- def convert(self, input):
- text = Path(input).read_text()
- matches = RE_ENUM.findall(text)
- package = RE_PACKAGE.findall(text)[0]
- imports = RE_IMPORT.findall(text)
- enums = []
- for match in matches:
- enum = Enum(package, match[0], match[1], imports)
- enums.append(enum)
- return enums
-
-
-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]
- enums_dict = dict()
- for file in os.listdir(aidl_path):
- enums = Converter().convert(os.path.join(aidl_path, file))
- for enum in enums:
- enums_dict[enum.jenum.package + "." + enum.jenum.name] = enum
-
- result = []
- for enum_name, enum in enums_dict.items():
- enum.parse(enums_dict)
- result.append(enum.jenum.__dict__)
-
- json_result = json.dumps(result, default=None, indent=2)
- with open(out_path, 'w') as f:
- f.write(json_result)
-
-
-if __name__ == "__main__":
- main()
diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h
index d0c6e83..e7d4464 100644
--- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h
+++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 The Android Open Source Project
+ * 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.
@@ -68,9 +68,11 @@
{VehicleProperty::EV_CHARGE_PORT_CONNECTED, VehiclePropertyAccess::READ},
{VehicleProperty::EV_BATTERY_INSTANTANEOUS_CHARGE_RATE, VehiclePropertyAccess::READ},
{VehicleProperty::RANGE_REMAINING, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::EV_BATTERY_AVERAGE_TEMPERATURE, VehiclePropertyAccess::READ},
{VehicleProperty::TIRE_PRESSURE, VehiclePropertyAccess::READ},
{VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE, VehiclePropertyAccess::READ},
{VehicleProperty::ENGINE_IDLE_AUTO_STOP_ENABLED, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::IMPACT_DETECTED, VehiclePropertyAccess::READ},
{VehicleProperty::GEAR_SELECTION, VehiclePropertyAccess::READ},
{VehicleProperty::CURRENT_GEAR, VehiclePropertyAccess::READ},
{VehicleProperty::PARKING_BRAKE_ON, VehiclePropertyAccess::READ},
@@ -83,6 +85,8 @@
{VehicleProperty::ABS_ACTIVE, VehiclePropertyAccess::READ},
{VehicleProperty::TRACTION_CONTROL_ACTIVE, VehiclePropertyAccess::READ},
{VehicleProperty::EV_STOPPING_MODE, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE, VehiclePropertyAccess::READ},
{VehicleProperty::HVAC_FAN_SPEED, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::HVAC_FAN_DIRECTION, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::HVAC_TEMPERATURE_CURRENT, VehiclePropertyAccess::READ},
@@ -120,6 +124,7 @@
{VehicleProperty::AP_POWER_BOOTUP_REASON, VehiclePropertyAccess::READ},
{VehicleProperty::DISPLAY_BRIGHTNESS, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::PER_DISPLAY_BRIGHTNESS, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::VALET_MODE_ENABLED, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::HW_KEY_INPUT, VehiclePropertyAccess::READ},
{VehicleProperty::HW_KEY_INPUT_V2, VehiclePropertyAccess::READ},
{VehicleProperty::HW_MOTION_INPUT, VehiclePropertyAccess::READ},
@@ -169,11 +174,13 @@
{VehicleProperty::SEAT_FOOTWELL_LIGHTS_SWITCH, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::SEAT_EASY_ACCESS_ENABLED, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::SEAT_AIRBAG_ENABLED, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::SEAT_AIRBAGS_DEPLOYED, VehiclePropertyAccess::READ},
{VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_MOVE, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::SEAT_LUMBAR_VERTICAL_MOVE, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::SEAT_WALK_IN_POS, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::SEAT_BELT_PRETENSIONER_DEPLOYED, VehiclePropertyAccess::READ},
{VehicleProperty::SEAT_OCCUPANCY, VehiclePropertyAccess::READ},
{VehicleProperty::WINDOW_POS, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::WINDOW_MOVE, VehiclePropertyAccess::READ_WRITE},
@@ -192,6 +199,11 @@
{VehicleProperty::GLOVE_BOX_LOCKED, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::VEHICLE_MAP_SERVICE, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyAccess::READ},
+ {VehicleProperty::ULTRASONICS_SENSOR_POSITION, VehiclePropertyAccess::READ},
+ {VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyAccess::READ},
+ {VehicleProperty::ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyAccess::READ},
+ {VehicleProperty::ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyAccess::READ},
+ {VehicleProperty::ULTRASONICS_SENSOR_SUPPORTED_RANGES, VehiclePropertyAccess::READ},
{VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyAccess::READ},
{VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyAccess::READ},
{VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess::READ},
@@ -247,6 +259,8 @@
{VehicleProperty::SUPPORTED_PROPERTY_IDS, VehiclePropertyAccess::READ},
{VehicleProperty::SHUTDOWN_REQUEST, VehiclePropertyAccess::WRITE},
{VehicleProperty::VEHICLE_IN_USE, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::CLUSTER_HEARTBEAT, VehiclePropertyAccess::WRITE},
+ {VehicleProperty::VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, VehiclePropertyAccess::READ},
{VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess::READ},
{VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE},
@@ -272,6 +286,18 @@
{VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::HANDS_ON_DETECTION_DRIVER_STATE, VehiclePropertyAccess::READ},
{VehicleProperty::HANDS_ON_DETECTION_WARNING, VehiclePropertyAccess::READ},
+ {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyAccess::READ},
+ {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyAccess::READ},
+ {VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::DRIVER_DISTRACTION_STATE, VehiclePropertyAccess::READ},
+ {VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::DRIVER_DISTRACTION_WARNING, VehiclePropertyAccess::READ},
+ {VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyAccess::READ},
+ {VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE, VehiclePropertyAccess::READ},
};
} // namespace vehicle
diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h
index 48532c9..3a46a92 100644
--- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h
+++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 The Android Open Source Project
+ * 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.
@@ -68,9 +68,11 @@
{VehicleProperty::EV_CHARGE_PORT_CONNECTED, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::EV_BATTERY_INSTANTANEOUS_CHARGE_RATE, VehiclePropertyChangeMode::CONTINUOUS},
{VehicleProperty::RANGE_REMAINING, VehiclePropertyChangeMode::CONTINUOUS},
+ {VehicleProperty::EV_BATTERY_AVERAGE_TEMPERATURE, VehiclePropertyChangeMode::CONTINUOUS},
{VehicleProperty::TIRE_PRESSURE, VehiclePropertyChangeMode::CONTINUOUS},
{VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE, VehiclePropertyChangeMode::STATIC},
{VehicleProperty::ENGINE_IDLE_AUTO_STOP_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::IMPACT_DETECTED, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::GEAR_SELECTION, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::CURRENT_GEAR, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::PARKING_BRAKE_ON, VehiclePropertyChangeMode::ON_CHANGE},
@@ -83,6 +85,8 @@
{VehicleProperty::ABS_ACTIVE, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::TRACTION_CONTROL_ACTIVE, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::EV_STOPPING_MODE, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::HVAC_FAN_SPEED, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::HVAC_FAN_DIRECTION, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::HVAC_TEMPERATURE_CURRENT, VehiclePropertyChangeMode::ON_CHANGE},
@@ -120,6 +124,7 @@
{VehicleProperty::AP_POWER_BOOTUP_REASON, VehiclePropertyChangeMode::STATIC},
{VehicleProperty::DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::PER_DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::VALET_MODE_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::HW_KEY_INPUT, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::HW_KEY_INPUT_V2, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::HW_MOTION_INPUT, VehiclePropertyChangeMode::ON_CHANGE},
@@ -169,11 +174,13 @@
{VehicleProperty::SEAT_FOOTWELL_LIGHTS_SWITCH, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::SEAT_EASY_ACCESS_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::SEAT_AIRBAG_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::SEAT_AIRBAGS_DEPLOYED, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_MOVE, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::SEAT_LUMBAR_VERTICAL_MOVE, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::SEAT_WALK_IN_POS, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::SEAT_BELT_PRETENSIONER_DEPLOYED, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::SEAT_OCCUPANCY, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::WINDOW_POS, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::WINDOW_MOVE, VehiclePropertyChangeMode::ON_CHANGE},
@@ -192,6 +199,11 @@
{VehicleProperty::GLOVE_BOX_LOCKED, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::VEHICLE_MAP_SERVICE, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::LOCATION_CHARACTERIZATION, VehiclePropertyChangeMode::STATIC},
+ {VehicleProperty::ULTRASONICS_SENSOR_POSITION, VehiclePropertyChangeMode::STATIC},
+ {VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyChangeMode::STATIC},
+ {VehicleProperty::ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyChangeMode::STATIC},
+ {VehicleProperty::ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyChangeMode::STATIC},
+ {VehicleProperty::ULTRASONICS_SENSOR_SUPPORTED_RANGES, VehiclePropertyChangeMode::STATIC},
{VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyChangeMode::ON_CHANGE},
@@ -247,6 +259,8 @@
{VehicleProperty::SUPPORTED_PROPERTY_IDS, VehiclePropertyChangeMode::STATIC},
{VehicleProperty::SHUTDOWN_REQUEST, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::VEHICLE_IN_USE, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::CLUSTER_HEARTBEAT, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
@@ -272,6 +286,18 @@
{VehicleProperty::HANDS_ON_DETECTION_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::HANDS_ON_DETECTION_DRIVER_STATE, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::HANDS_ON_DETECTION_WARNING, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::DRIVER_DISTRACTION_STATE, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::DRIVER_DISTRACTION_WARNING, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE, VehiclePropertyChangeMode::ON_CHANGE},
};
} // namespace vehicle
diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java
index 758670d..7b5412f 100644
--- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 The Android Open Source Project
+ * 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.
@@ -60,9 +60,11 @@
Map.entry(VehicleProperty.EV_CHARGE_PORT_CONNECTED, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.EV_BATTERY_INSTANTANEOUS_CHARGE_RATE, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.RANGE_REMAINING, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.EV_BATTERY_AVERAGE_TEMPERATURE, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.TIRE_PRESSURE, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.CRITICALLY_LOW_TIRE_PRESSURE, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.ENGINE_IDLE_AUTO_STOP_ENABLED, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.IMPACT_DETECTED, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.GEAR_SELECTION, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.CURRENT_GEAR, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.PARKING_BRAKE_ON, VehiclePropertyAccess.READ),
@@ -75,6 +77,8 @@
Map.entry(VehicleProperty.ABS_ACTIVE, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.TRACTION_CONTROL_ACTIVE, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.EV_STOPPING_MODE, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.ELECTRONIC_STABILITY_CONTROL_ENABLED, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.ELECTRONIC_STABILITY_CONTROL_STATE, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.HVAC_FAN_SPEED, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.HVAC_FAN_DIRECTION, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.HVAC_TEMPERATURE_CURRENT, VehiclePropertyAccess.READ),
@@ -112,6 +116,7 @@
Map.entry(VehicleProperty.AP_POWER_BOOTUP_REASON, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.DISPLAY_BRIGHTNESS, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.PER_DISPLAY_BRIGHTNESS, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.VALET_MODE_ENABLED, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.HW_KEY_INPUT, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.HW_KEY_INPUT_V2, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.HW_MOTION_INPUT, VehiclePropertyAccess.READ),
@@ -161,11 +166,13 @@
Map.entry(VehicleProperty.SEAT_FOOTWELL_LIGHTS_SWITCH, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.SEAT_EASY_ACCESS_ENABLED, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.SEAT_AIRBAG_ENABLED, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.SEAT_AIRBAGS_DEPLOYED, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.SEAT_CUSHION_SIDE_SUPPORT_MOVE, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.SEAT_LUMBAR_VERTICAL_MOVE, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.SEAT_WALK_IN_POS, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.SEAT_BELT_PRETENSIONER_DEPLOYED, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.SEAT_OCCUPANCY, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.WINDOW_POS, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.WINDOW_MOVE, VehiclePropertyAccess.READ_WRITE),
@@ -184,6 +191,11 @@
Map.entry(VehicleProperty.GLOVE_BOX_LOCKED, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.VEHICLE_MAP_SERVICE, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.LOCATION_CHARACTERIZATION, VehiclePropertyAccess.READ),
+ Map.entry(VehicleProperty.ULTRASONICS_SENSOR_POSITION, VehiclePropertyAccess.READ),
+ Map.entry(VehicleProperty.ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyAccess.READ),
+ Map.entry(VehicleProperty.ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyAccess.READ),
+ Map.entry(VehicleProperty.ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyAccess.READ),
+ Map.entry(VehicleProperty.ULTRASONICS_SENSOR_SUPPORTED_RANGES, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess.READ),
@@ -239,6 +251,8 @@
Map.entry(VehicleProperty.SUPPORTED_PROPERTY_IDS, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.SHUTDOWN_REQUEST, VehiclePropertyAccess.WRITE),
Map.entry(VehicleProperty.VEHICLE_IN_USE, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.CLUSTER_HEARTBEAT, VehiclePropertyAccess.WRITE),
+ Map.entry(VehicleProperty.VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE),
@@ -263,7 +277,19 @@
Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.HANDS_ON_DETECTION_ENABLED, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.HANDS_ON_DETECTION_DRIVER_STATE, VehiclePropertyAccess.READ),
- Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, VehiclePropertyAccess.READ)
+ Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, VehiclePropertyAccess.READ),
+ Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyAccess.READ),
+ Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyAccess.READ),
+ Map.entry(VehicleProperty.DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, VehiclePropertyAccess.READ),
+ Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, VehiclePropertyAccess.READ),
+ Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyAccess.READ),
+ Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_WARNING_STATE, VehiclePropertyAccess.READ)
);
}
diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java
index 29069f8..4fe45ef 100644
--- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 The Android Open Source Project
+ * 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.
@@ -60,9 +60,11 @@
Map.entry(VehicleProperty.EV_CHARGE_PORT_CONNECTED, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.EV_BATTERY_INSTANTANEOUS_CHARGE_RATE, VehiclePropertyChangeMode.CONTINUOUS),
Map.entry(VehicleProperty.RANGE_REMAINING, VehiclePropertyChangeMode.CONTINUOUS),
+ Map.entry(VehicleProperty.EV_BATTERY_AVERAGE_TEMPERATURE, VehiclePropertyChangeMode.CONTINUOUS),
Map.entry(VehicleProperty.TIRE_PRESSURE, VehiclePropertyChangeMode.CONTINUOUS),
Map.entry(VehicleProperty.CRITICALLY_LOW_TIRE_PRESSURE, VehiclePropertyChangeMode.STATIC),
Map.entry(VehicleProperty.ENGINE_IDLE_AUTO_STOP_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.IMPACT_DETECTED, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.GEAR_SELECTION, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.CURRENT_GEAR, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.PARKING_BRAKE_ON, VehiclePropertyChangeMode.ON_CHANGE),
@@ -75,6 +77,8 @@
Map.entry(VehicleProperty.ABS_ACTIVE, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.TRACTION_CONTROL_ACTIVE, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.EV_STOPPING_MODE, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.ELECTRONIC_STABILITY_CONTROL_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.ELECTRONIC_STABILITY_CONTROL_STATE, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.HVAC_FAN_SPEED, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.HVAC_FAN_DIRECTION, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.HVAC_TEMPERATURE_CURRENT, VehiclePropertyChangeMode.ON_CHANGE),
@@ -112,6 +116,7 @@
Map.entry(VehicleProperty.AP_POWER_BOOTUP_REASON, VehiclePropertyChangeMode.STATIC),
Map.entry(VehicleProperty.DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.PER_DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.VALET_MODE_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.HW_KEY_INPUT, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.HW_KEY_INPUT_V2, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.HW_MOTION_INPUT, VehiclePropertyChangeMode.ON_CHANGE),
@@ -161,11 +166,13 @@
Map.entry(VehicleProperty.SEAT_FOOTWELL_LIGHTS_SWITCH, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.SEAT_EASY_ACCESS_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.SEAT_AIRBAG_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.SEAT_AIRBAGS_DEPLOYED, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.SEAT_CUSHION_SIDE_SUPPORT_POS, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.SEAT_CUSHION_SIDE_SUPPORT_MOVE, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.SEAT_LUMBAR_VERTICAL_POS, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.SEAT_LUMBAR_VERTICAL_MOVE, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.SEAT_WALK_IN_POS, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.SEAT_BELT_PRETENSIONER_DEPLOYED, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.SEAT_OCCUPANCY, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.WINDOW_POS, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.WINDOW_MOVE, VehiclePropertyChangeMode.ON_CHANGE),
@@ -184,6 +191,11 @@
Map.entry(VehicleProperty.GLOVE_BOX_LOCKED, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.VEHICLE_MAP_SERVICE, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.LOCATION_CHARACTERIZATION, VehiclePropertyChangeMode.STATIC),
+ Map.entry(VehicleProperty.ULTRASONICS_SENSOR_POSITION, VehiclePropertyChangeMode.STATIC),
+ Map.entry(VehicleProperty.ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyChangeMode.STATIC),
+ Map.entry(VehicleProperty.ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyChangeMode.STATIC),
+ Map.entry(VehicleProperty.ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyChangeMode.STATIC),
+ Map.entry(VehicleProperty.ULTRASONICS_SENSOR_SUPPORTED_RANGES, VehiclePropertyChangeMode.STATIC),
Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, VehiclePropertyChangeMode.ON_CHANGE),
@@ -239,6 +251,8 @@
Map.entry(VehicleProperty.SUPPORTED_PROPERTY_IDS, VehiclePropertyChangeMode.STATIC),
Map.entry(VehicleProperty.SHUTDOWN_REQUEST, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.VEHICLE_IN_USE, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.CLUSTER_HEARTBEAT, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
@@ -263,7 +277,19 @@
Map.entry(VehicleProperty.ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE, VehiclePropertyChangeMode.CONTINUOUS),
Map.entry(VehicleProperty.HANDS_ON_DETECTION_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.HANDS_ON_DETECTION_DRIVER_STATE, VehiclePropertyChangeMode.ON_CHANGE),
- Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE)
+ Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.DRIVER_DISTRACTION_SYSTEM_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE)
);
}
diff --git a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java
new file mode 100644
index 0000000..b4f24a6
--- /dev/null
+++ b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java
@@ -0,0 +1,109 @@
+/*
+ * 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.
+ */
+
+/**
+ * DO NOT EDIT MANUALLY!!!
+ *
+ * Generated by tools/generate_annotation_enums.py.
+ */
+
+// clang-format off
+
+package android.hardware.automotive.vehicle;
+
+import java.util.List;
+import java.util.Map;
+
+public final class EnumForVehicleProperty {
+
+ public static final Map<Integer, List<Class<?>>> values = Map.ofEntries(
+ Map.entry(VehicleProperty.INFO_FUEL_TYPE, List.of(FuelType.class)),
+ Map.entry(VehicleProperty.INFO_EV_CONNECTOR_TYPE, List.of(EvConnectorType.class)),
+ Map.entry(VehicleProperty.INFO_FUEL_DOOR_LOCATION, List.of(PortLocationType.class)),
+ Map.entry(VehicleProperty.INFO_EV_PORT_LOCATION, List.of(PortLocationType.class)),
+ Map.entry(VehicleProperty.INFO_DRIVER_SEAT, List.of(VehicleAreaSeat.class)),
+ Map.entry(VehicleProperty.INFO_MULTI_EV_PORT_LOCATIONS, List.of(PortLocationType.class)),
+ Map.entry(VehicleProperty.ENGINE_OIL_LEVEL, List.of(VehicleOilLevel.class)),
+ Map.entry(VehicleProperty.IMPACT_DETECTED, List.of(ImpactSensorLocation.class)),
+ Map.entry(VehicleProperty.GEAR_SELECTION, List.of(VehicleGear.class)),
+ Map.entry(VehicleProperty.CURRENT_GEAR, List.of(VehicleGear.class)),
+ Map.entry(VehicleProperty.TURN_SIGNAL_STATE, List.of(VehicleTurnSignal.class)),
+ Map.entry(VehicleProperty.IGNITION_STATE, List.of(VehicleIgnitionState.class)),
+ Map.entry(VehicleProperty.EV_STOPPING_MODE, List.of(EvStoppingMode.class)),
+ Map.entry(VehicleProperty.ELECTRONIC_STABILITY_CONTROL_STATE, List.of(ElectronicStabilityControlState.class, ErrorState.class)),
+ Map.entry(VehicleProperty.HVAC_FAN_DIRECTION, List.of(VehicleHvacFanDirection.class)),
+ Map.entry(VehicleProperty.HVAC_TEMPERATURE_DISPLAY_UNITS, List.of(VehicleUnit.class)),
+ Map.entry(VehicleProperty.HVAC_FAN_DIRECTION_AVAILABLE, List.of(VehicleHvacFanDirection.class)),
+ Map.entry(VehicleProperty.DISTANCE_DISPLAY_UNITS, List.of(VehicleUnit.class)),
+ Map.entry(VehicleProperty.FUEL_VOLUME_DISPLAY_UNITS, List.of(VehicleUnit.class)),
+ Map.entry(VehicleProperty.TIRE_PRESSURE_DISPLAY_UNITS, List.of(VehicleUnit.class)),
+ Map.entry(VehicleProperty.EV_BATTERY_DISPLAY_UNITS, List.of(VehicleUnit.class)),
+ Map.entry(VehicleProperty.HW_ROTARY_INPUT, List.of(RotaryInputType.class)),
+ Map.entry(VehicleProperty.HW_CUSTOM_INPUT, List.of(CustomInputType.class)),
+ Map.entry(VehicleProperty.SEAT_FOOTWELL_LIGHTS_STATE, List.of(VehicleLightState.class)),
+ Map.entry(VehicleProperty.SEAT_FOOTWELL_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)),
+ Map.entry(VehicleProperty.SEAT_AIRBAGS_DEPLOYED, List.of(VehicleAirbagLocation.class)),
+ Map.entry(VehicleProperty.SEAT_OCCUPANCY, List.of(VehicleSeatOccupancyState.class)),
+ Map.entry(VehicleProperty.WINDSHIELD_WIPERS_STATE, List.of(WindshieldWipersState.class)),
+ Map.entry(VehicleProperty.WINDSHIELD_WIPERS_SWITCH, List.of(WindshieldWipersSwitch.class)),
+ Map.entry(VehicleProperty.HEADLIGHTS_STATE, List.of(VehicleLightState.class)),
+ Map.entry(VehicleProperty.HIGH_BEAM_LIGHTS_STATE, List.of(VehicleLightState.class)),
+ Map.entry(VehicleProperty.FOG_LIGHTS_STATE, List.of(VehicleLightState.class)),
+ Map.entry(VehicleProperty.HAZARD_LIGHTS_STATE, List.of(VehicleLightState.class)),
+ Map.entry(VehicleProperty.HEADLIGHTS_SWITCH, List.of(VehicleLightSwitch.class)),
+ Map.entry(VehicleProperty.HIGH_BEAM_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)),
+ Map.entry(VehicleProperty.FOG_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)),
+ Map.entry(VehicleProperty.HAZARD_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)),
+ Map.entry(VehicleProperty.CABIN_LIGHTS_STATE, List.of(VehicleLightState.class)),
+ Map.entry(VehicleProperty.CABIN_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)),
+ Map.entry(VehicleProperty.READING_LIGHTS_STATE, List.of(VehicleLightState.class)),
+ Map.entry(VehicleProperty.READING_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)),
+ Map.entry(VehicleProperty.STEERING_WHEEL_LIGHTS_STATE, List.of(VehicleLightState.class)),
+ Map.entry(VehicleProperty.STEERING_WHEEL_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)),
+ Map.entry(VehicleProperty.ELECTRONIC_TOLL_COLLECTION_CARD_TYPE, List.of(ElectronicTollCollectionCardType.class)),
+ Map.entry(VehicleProperty.ELECTRONIC_TOLL_COLLECTION_CARD_STATUS, List.of(ElectronicTollCollectionCardStatus.class)),
+ Map.entry(VehicleProperty.FRONT_FOG_LIGHTS_STATE, List.of(VehicleLightState.class)),
+ Map.entry(VehicleProperty.FRONT_FOG_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)),
+ Map.entry(VehicleProperty.REAR_FOG_LIGHTS_STATE, List.of(VehicleLightState.class)),
+ Map.entry(VehicleProperty.REAR_FOG_LIGHTS_SWITCH, List.of(VehicleLightSwitch.class)),
+ Map.entry(VehicleProperty.EV_CHARGE_STATE, List.of(EvChargeState.class)),
+ Map.entry(VehicleProperty.EV_REGENERATIVE_BRAKING_STATE, List.of(EvRegenerativeBrakingState.class)),
+ Map.entry(VehicleProperty.TRAILER_PRESENT, List.of(TrailerState.class)),
+ Map.entry(VehicleProperty.GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT, List.of(GsrComplianceRequirementType.class)),
+ Map.entry(VehicleProperty.SHUTDOWN_REQUEST, List.of(VehicleApPowerStateShutdownParam.class)),
+ Map.entry(VehicleProperty.VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, List.of(VehicleAutonomousState.class)),
+ Map.entry(VehicleProperty.AUTOMATIC_EMERGENCY_BRAKING_STATE, List.of(AutomaticEmergencyBrakingState.class, ErrorState.class)),
+ Map.entry(VehicleProperty.FORWARD_COLLISION_WARNING_STATE, List.of(ForwardCollisionWarningState.class, ErrorState.class)),
+ Map.entry(VehicleProperty.BLIND_SPOT_WARNING_STATE, List.of(BlindSpotWarningState.class, ErrorState.class)),
+ Map.entry(VehicleProperty.LANE_DEPARTURE_WARNING_STATE, List.of(LaneDepartureWarningState.class, ErrorState.class)),
+ Map.entry(VehicleProperty.LANE_KEEP_ASSIST_STATE, List.of(LaneKeepAssistState.class, ErrorState.class)),
+ Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_COMMAND, List.of(LaneCenteringAssistCommand.class)),
+ Map.entry(VehicleProperty.LANE_CENTERING_ASSIST_STATE, List.of(LaneCenteringAssistState.class, ErrorState.class)),
+ Map.entry(VehicleProperty.EMERGENCY_LANE_KEEP_ASSIST_STATE, List.of(EmergencyLaneKeepAssistState.class, ErrorState.class)),
+ Map.entry(VehicleProperty.CRUISE_CONTROL_TYPE, List.of(CruiseControlType.class, ErrorState.class)),
+ Map.entry(VehicleProperty.CRUISE_CONTROL_STATE, List.of(CruiseControlState.class, ErrorState.class)),
+ Map.entry(VehicleProperty.CRUISE_CONTROL_COMMAND, List.of(CruiseControlCommand.class)),
+ Map.entry(VehicleProperty.HANDS_ON_DETECTION_DRIVER_STATE, List.of(HandsOnDetectionDriverState.class, ErrorState.class)),
+ Map.entry(VehicleProperty.HANDS_ON_DETECTION_WARNING, List.of(HandsOnDetectionWarning.class, ErrorState.class)),
+ Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_STATE, List.of(DriverDrowsinessAttentionState.class, ErrorState.class)),
+ Map.entry(VehicleProperty.DRIVER_DROWSINESS_ATTENTION_WARNING, List.of(DriverDrowsinessAttentionWarning.class, ErrorState.class)),
+ Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, List.of(DriverDistractionState.class, ErrorState.class)),
+ Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, List.of(DriverDistractionWarning.class, ErrorState.class)),
+ Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, List.of(LowSpeedCollisionWarningState.class, ErrorState.class)),
+ Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_WARNING_STATE, List.of(CrossTrafficMonitoringWarningState.class, ErrorState.class))
+ );
+
+}
diff --git a/automotive/vehicle/aidl/impl/README.md b/automotive/vehicle/aidl/impl/README.md
index 121ffd1..2cd3a3e 100644
--- a/automotive/vehicle/aidl/impl/README.md
+++ b/automotive/vehicle/aidl/impl/README.md
@@ -46,7 +46,7 @@
use this library, along with their own implementation for `IVehicleHardware`
interface.
-Also defines a binary `android.hardware.automotive.vehicle@V1-default-service`
+Also defines a binary `android.hardware.automotive.vehicle@V3-default-service`
which is the reference VHAL implementation. It implements `IVehicle.aidl`
interface. It uses `DefaultVehicleHal`, along with `FakeVehicleHardware`
(in fake_impl). It simulates the vehicle bus interaction by using an
diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/Android.bp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/Android.bp
index 6984d5e..75a3541 100644
--- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/Android.bp
+++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/Android.bp
@@ -35,14 +35,17 @@
cc_library {
name: "VehicleHalJsonConfigLoaderEnableTestProperties",
vendor: true,
- srcs: ["src/*.cpp"],
+ srcs: [
+ "src/*.cpp",
+ ":VhalTestVendorProperties",
+ ],
local_include_dirs: ["include"],
export_include_dirs: ["include"],
defaults: ["VehicleHalDefaults"],
static_libs: ["VehicleHalUtils"],
header_libs: [
- "VehicleHalTestUtilHeaders",
"IVehicleGeneratedHeaders",
+ "libbinder_headers",
],
cflags: ["-DENABLE_VEHICLE_HAL_TEST_PROPERTIES"],
shared_libs: ["libjsoncpp"],
diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
index 0a1f904..146da69 100644
--- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
+++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
@@ -21,7 +21,7 @@
#include <PropertyUtils.h>
#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES
-#include <TestPropertyUtils.h>
+#include <android/hardware/automotive/vehicle/TestVendorProperty.h>
#endif // ENABLE_VEHICLE_HAL_TEST_PROPERTIES
#include <android-base/strings.h>
@@ -38,9 +38,15 @@
using ::aidl::android::hardware::automotive::vehicle::AutomaticEmergencyBrakingState;
using ::aidl::android::hardware::automotive::vehicle::BlindSpotWarningState;
using ::aidl::android::hardware::automotive::vehicle::ChangeModeForVehicleProperty;
+using ::aidl::android::hardware::automotive::vehicle::CrossTrafficMonitoringWarningState;
using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand;
using ::aidl::android::hardware::automotive::vehicle::CruiseControlState;
using ::aidl::android::hardware::automotive::vehicle::CruiseControlType;
+using ::aidl::android::hardware::automotive::vehicle::DriverDistractionState;
+using ::aidl::android::hardware::automotive::vehicle::DriverDistractionWarning;
+using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionState;
+using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionWarning;
+using ::aidl::android::hardware::automotive::vehicle::ElectronicStabilityControlState;
using ::aidl::android::hardware::automotive::vehicle::EmergencyLaneKeepAssistState;
using ::aidl::android::hardware::automotive::vehicle::ErrorState;
using ::aidl::android::hardware::automotive::vehicle::EvConnectorType;
@@ -51,17 +57,21 @@
using ::aidl::android::hardware::automotive::vehicle::GsrComplianceRequirementType;
using ::aidl::android::hardware::automotive::vehicle::HandsOnDetectionDriverState;
using ::aidl::android::hardware::automotive::vehicle::HandsOnDetectionWarning;
+using ::aidl::android::hardware::automotive::vehicle::ImpactSensorLocation;
using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistCommand;
using ::aidl::android::hardware::automotive::vehicle::LaneCenteringAssistState;
using ::aidl::android::hardware::automotive::vehicle::LaneDepartureWarningState;
using ::aidl::android::hardware::automotive::vehicle::LaneKeepAssistState;
using ::aidl::android::hardware::automotive::vehicle::LocationCharacterization;
+using ::aidl::android::hardware::automotive::vehicle::LowSpeedCollisionWarningState;
using ::aidl::android::hardware::automotive::vehicle::RawPropValues;
+using ::aidl::android::hardware::automotive::vehicle::VehicleAirbagLocation;
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport;
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq;
using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig;
using ::aidl::android::hardware::automotive::vehicle::VehicleAreaMirror;
using ::aidl::android::hardware::automotive::vehicle::VehicleAreaWindow;
+using ::aidl::android::hardware::automotive::vehicle::VehicleAutonomousState;
using ::aidl::android::hardware::automotive::vehicle::VehicleGear;
using ::aidl::android::hardware::automotive::vehicle::VehicleHvacFanDirection;
using ::aidl::android::hardware::automotive::vehicle::VehicleIgnitionState;
@@ -91,10 +101,6 @@
{"HVAC_ALL", HVAC_ALL},
{"HVAC_LEFT", HVAC_LEFT},
{"HVAC_RIGHT", HVAC_RIGHT},
- {"VENDOR_EXTENSION_INT_PROPERTY", VENDOR_EXTENSION_INT_PROPERTY},
- {"VENDOR_EXTENSION_BOOLEAN_PROPERTY", VENDOR_EXTENSION_BOOLEAN_PROPERTY},
- {"VENDOR_EXTENSION_STRING_PROPERTY", VENDOR_EXTENSION_STRING_PROPERTY},
- {"VENDOR_EXTENSION_FLOAT_PROPERTY", VENDOR_EXTENSION_FLOAT_PROPERTY},
{"WINDOW_1_LEFT", WINDOW_1_LEFT},
{"WINDOW_1_RIGHT", WINDOW_1_RIGHT},
{"WINDOW_2_LEFT", WINDOW_2_LEFT},
@@ -133,24 +139,9 @@
{"EV_STOPPING_MODE_HOLD", EV_STOPPING_MODE_HOLD},
{"MIRROR_DRIVER_LEFT_RIGHT",
toInt(VehicleAreaMirror::DRIVER_LEFT) | toInt(VehicleAreaMirror::DRIVER_RIGHT)},
-#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES
- // Following are test properties:
- {"ECHO_REVERSE_BYTES", ECHO_REVERSE_BYTES},
- {"VENDOR_PROPERTY_ID", VENDOR_PROPERTY_ID},
- {"kMixedTypePropertyForTest", kMixedTypePropertyForTest},
- {"VENDOR_CLUSTER_NAVIGATION_STATE", VENDOR_CLUSTER_NAVIGATION_STATE},
- {"VENDOR_CLUSTER_REQUEST_DISPLAY", VENDOR_CLUSTER_REQUEST_DISPLAY},
- {"VENDOR_CLUSTER_SWITCH_UI", VENDOR_CLUSTER_SWITCH_UI},
- {"VENDOR_CLUSTER_DISPLAY_STATE", VENDOR_CLUSTER_DISPLAY_STATE},
- {"VENDOR_CLUSTER_REPORT_STATE", VENDOR_CLUSTER_REPORT_STATE},
- {"PLACEHOLDER_PROPERTY_INT", PLACEHOLDER_PROPERTY_INT},
- {"PLACEHOLDER_PROPERTY_FLOAT", PLACEHOLDER_PROPERTY_FLOAT},
- {"PLACEHOLDER_PROPERTY_BOOLEAN", PLACEHOLDER_PROPERTY_BOOLEAN},
- {"PLACEHOLDER_PROPERTY_STRING", PLACEHOLDER_PROPERTY_STRING}
-#endif // ENABLE_VEHICLE_HAL_TEST_PROPERTIES
};
-// A class to parse constant values for type T.
+// A class to parse constant values for type T where T is defined as an enum in NDK AIDL backend.
template <class T>
class ConstantParser final : public ConstantParserInterface {
public:
@@ -181,6 +172,33 @@
std::unordered_map<std::string, int> mValueByName;
};
+#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES
+// A class to parse constant values for type T where T is defined as an enum in CPP AIDL backend.
+template <class T>
+class CppConstantParser final : public ConstantParserInterface {
+ public:
+ CppConstantParser() {
+ for (const T& v : android::enum_range<T>()) {
+ std::string name = android::hardware::automotive::vehicle::toString(v);
+ mValueByName[name] = toInt(v);
+ }
+ }
+
+ ~CppConstantParser() = default;
+
+ Result<int> parseValue(const std::string& name) const override {
+ auto it = mValueByName.find(name);
+ if (it == mValueByName.end()) {
+ return Error() << "Constant name: " << name << " is not defined";
+ }
+ return it->second;
+ }
+
+ private:
+ std::unordered_map<std::string, int> mValueByName;
+};
+#endif
+
// A class to parse constant values defined in CONSTANTS_BY_NAME map.
class LocalVariableParser final : public ConstantParserInterface {
public:
@@ -232,6 +250,12 @@
std::make_unique<ConstantParser<WindshieldWipersState>>();
mConstantParsersByType["WindshieldWipersSwitch"] =
std::make_unique<ConstantParser<WindshieldWipersSwitch>>();
+ mConstantParsersByType["VehicleAutonomousState"] =
+ std::make_unique<ConstantParser<VehicleAutonomousState>>();
+ mConstantParsersByType["VehicleAirbagLocation"] =
+ std::make_unique<ConstantParser<VehicleAirbagLocation>>();
+ mConstantParsersByType["ImpactSensorLocation"] =
+ std::make_unique<ConstantParser<ImpactSensorLocation>>();
mConstantParsersByType["EmergencyLaneKeepAssistState"] =
std::make_unique<ConstantParser<EmergencyLaneKeepAssistState>>();
mConstantParsersByType["CruiseControlType"] =
@@ -244,6 +268,14 @@
std::make_unique<ConstantParser<HandsOnDetectionDriverState>>();
mConstantParsersByType["HandsOnDetectionWarning"] =
std::make_unique<ConstantParser<HandsOnDetectionWarning>>();
+ mConstantParsersByType["DriverDrowsinessAttentionState"] =
+ std::make_unique<ConstantParser<DriverDrowsinessAttentionState>>();
+ mConstantParsersByType["DriverDrowsinessAttentionWarning"] =
+ std::make_unique<ConstantParser<DriverDrowsinessAttentionWarning>>();
+ mConstantParsersByType["DriverDistractionState"] =
+ std::make_unique<ConstantParser<DriverDistractionState>>();
+ mConstantParsersByType["DriverDistractionWarning"] =
+ std::make_unique<ConstantParser<DriverDistractionWarning>>();
mConstantParsersByType["ErrorState"] = std::make_unique<ConstantParser<ErrorState>>();
mConstantParsersByType["AutomaticEmergencyBrakingState"] =
std::make_unique<ConstantParser<AutomaticEmergencyBrakingState>>();
@@ -259,7 +291,27 @@
std::make_unique<ConstantParser<LaneCenteringAssistCommand>>();
mConstantParsersByType["LaneCenteringAssistState"] =
std::make_unique<ConstantParser<LaneCenteringAssistState>>();
+ mConstantParsersByType["LowSpeedCollisionWarningState"] =
+ std::make_unique<ConstantParser<LowSpeedCollisionWarningState>>();
+ mConstantParsersByType["ElectronicStabilityControlState"] =
+ std::make_unique<ConstantParser<ElectronicStabilityControlState>>();
+ mConstantParsersByType["CrossTrafficMonitoringWarningState"] =
+ std::make_unique<ConstantParser<CrossTrafficMonitoringWarningState>>();
mConstantParsersByType["Constants"] = std::make_unique<LocalVariableParser>();
+#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES
+ mConstantParsersByType["TestVendorProperty"] =
+ std::make_unique<CppConstantParser<TestVendorProperty>>();
+#endif // ENABLE_VEHICLE_HAL_TEST_PROPERTIES
+}
+
+template <>
+Result<bool> JsonValueParser::convertValueToType<bool>(const std::string& fieldName,
+ const Json::Value& value) {
+ if (!value.isBool()) {
+ return Error() << "The value: " << value << " for field: " << fieldName
+ << " is not in correct type, expect bool";
+ }
+ return value.asBool();
}
template <>
@@ -519,6 +571,12 @@
tryParseJsonValueToVariable(jsonAreaConfig, "maxFloatValue", /*optional=*/true,
&areaConfig.maxFloatValue, errors);
+ // By default we support variable update rate for all properties except it is explicitly
+ // disabled.
+ areaConfig.supportVariableUpdateRate = true;
+ tryParseJsonValueToVariable(jsonAreaConfig, "supportVariableUpdateRate", /*optional=*/true,
+ &areaConfig.supportVariableUpdateRate, errors);
+
std::vector<int64_t> supportedEnumValues;
tryParseJsonArrayToVariable(jsonAreaConfig, "supportedEnumValues", /*optional=*/true,
&supportedEnumValues, errors);
@@ -573,6 +631,16 @@
if (errors->size() != initialErrorCount) {
return std::nullopt;
}
+
+ // If there is no area config, by default we allow variable update rate, so we have to add
+ // a global area config.
+ if (configDecl.config.areaConfigs.size() == 0) {
+ VehicleAreaConfig areaConfig = {
+ .areaId = 0,
+ .supportVariableUpdateRate = true,
+ };
+ configDecl.config.areaConfigs.push_back(std::move(areaConfig));
+ }
return configDecl;
}
diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json
index 5503de2..665c10e 100644
--- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json
+++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json
@@ -1328,6 +1328,75 @@
]
},
{
+ "property": "VehicleProperty::SEAT_AIRBAGS_DEPLOYED",
+ "defaultValue": {
+ "int32Values": [
+ 0
+ ]
+ },
+ "areas": [
+ {
+ "areaId": "Constants::SEAT_1_LEFT",
+ "supportedEnumValues": [
+ "VehicleAirbagLocation::FRONT",
+ "VehicleAirbagLocation::KNEE",
+ "VehicleAirbagLocation::LEFT_SIDE",
+ "VehicleAirbagLocation::RIGHT_SIDE",
+ "VehicleAirbagLocation::CURTAIN"
+ ]
+ },
+ {
+ "areaId": "Constants::SEAT_1_RIGHT",
+ "supportedEnumValues": [
+ "VehicleAirbagLocation::FRONT",
+ "VehicleAirbagLocation::KNEE",
+ "VehicleAirbagLocation::LEFT_SIDE",
+ "VehicleAirbagLocation::RIGHT_SIDE",
+ "VehicleAirbagLocation::CURTAIN"
+ ]
+ },
+ {
+ "areaId": "Constants::SEAT_2_LEFT",
+ "supportedEnumValues": [
+ "VehicleAirbagLocation::FRONT",
+ "VehicleAirbagLocation::CURTAIN"
+ ]
+ },
+ {
+ "areaId": "Constants::SEAT_2_RIGHT",
+ "supportedEnumValues": [
+ "VehicleAirbagLocation::FRONT",
+ "VehicleAirbagLocation::CURTAIN"
+ ]
+ }
+ ]
+ },
+ {
+ "property": "VehicleProperty::SEAT_BELT_PRETENSIONER_DEPLOYED",
+ "defaultValue": {
+ "int32Values": [
+ 0
+ ]
+ },
+ "areas": [
+ {
+ "areaId": "Constants::SEAT_1_LEFT"
+ },
+ {
+ "areaId": "Constants::SEAT_1_RIGHT"
+ },
+ {
+ "areaId": "Constants::SEAT_2_LEFT"
+ },
+ {
+ "areaId": "Constants::SEAT_2_RIGHT"
+ },
+ {
+ "areaId": "Constants::SEAT_2_CENTER"
+ }
+ ]
+ },
+ {
"property": "VehicleProperty::SEAT_OCCUPANCY",
"defaultValue": {
"int32Values": [
@@ -1560,6 +1629,16 @@
"minSampleRate": 1.0
},
{
+ "property": "VehicleProperty::EV_BATTERY_AVERAGE_TEMPERATURE",
+ "defaultValue": {
+ "floatValues": [
+ 25.0
+ ]
+ },
+ "maxSampleRate": 2.0,
+ "minSampleRate": 1.0
+ },
+ {
"property": "VehicleProperty::TIRE_PRESSURE",
"defaultValue": {
"floatValues": [
@@ -1899,8 +1978,16 @@
}
],
"configArray": [
+ "VehicleProperty::HVAC_ACTUAL_FAN_SPEED_RPM",
+ "VehicleProperty::HVAC_AC_ON",
+ "VehicleProperty::HVAC_AUTO_ON",
+ "VehicleProperty::HVAC_AUTO_RECIRC_ON",
+ "VehicleProperty::HVAC_FAN_DIRECTION",
"VehicleProperty::HVAC_FAN_SPEED",
- "VehicleProperty::HVAC_FAN_DIRECTION"
+ "VehicleProperty::HVAC_MAX_AC_ON",
+ "VehicleProperty::HVAC_RECIRC_ON",
+ "VehicleProperty::HVAC_TEMPERATURE_CURRENT",
+ "VehicleProperty::HVAC_TEMPERATURE_SET"
]
},
{
@@ -2360,9 +2447,9 @@
160,
280,
5,
- 600,
- 840,
- 10
+ 608,
+ 824,
+ 9
]
},
{
@@ -2372,7 +2459,7 @@
66.19999694824219,
"VehicleUnit::FAHRENHEIT",
19.0,
- 66.0
+ 66.2
]
}
},
@@ -2495,6 +2582,27 @@
}
},
{
+ "property": "VehicleProperty::IMPACT_DETECTED",
+ "defaultValue": {
+ "int32Values": [
+ 0
+ ]
+ },
+ "areas": [
+ {
+ "areaId": 0,
+ "supportedEnumValues": [
+ "ImpactSensorLocation::FRONT",
+ "ImpactSensorLocation::FRONT_LEFT_DOOR_SIDE",
+ "ImpactSensorLocation::FRONT_RIGHT_DOOR_SIDE",
+ "ImpactSensorLocation::REAR_LEFT_DOOR_SIDE",
+ "ImpactSensorLocation::REAR_RIGHT_DOOR_SIDE",
+ "ImpactSensorLocation::REAR"
+ ]
+ }
+ ]
+ },
+ {
"property": "VehicleProperty::DOOR_LOCK",
"areas": [
{
@@ -3103,6 +3211,14 @@
]
},
{
+ "property": "VehicleProperty::VALET_MODE_ENABLED",
+ "defaultValue": {
+ "int32Values": [
+ 0
+ ]
+ }
+ },
+ {
"property": "VehicleProperty::OBD2_LIVE_FRAME",
"configArray": [
0,
@@ -3387,7 +3503,7 @@
"property": "VehicleProperty::CRUISE_CONTROL_TYPE",
"defaultValue": {
"int32Values": [
- "CruiseControlType::STANDARD"
+ "CruiseControlType::ADAPTIVE"
]
},
"areas": [
@@ -3538,6 +3654,117 @@
]
},
{
+ "property": "VehicleProperty::DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED",
+ "defaultValue": {
+ "int32Values": [
+ 1
+ ]
+ }
+ },
+ {
+ "property": "VehicleProperty::DRIVER_DROWSINESS_ATTENTION_STATE",
+ "defaultValue": {
+ "int32Values": [
+ "DriverDrowsinessAttentionState::KSS_RATING_3_ALERT"
+ ]
+ },
+ "areas": [
+ {
+ "areaId": 0,
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "DriverDrowsinessAttentionState::KSS_RATING_1_EXTREMELY_ALERT",
+ "DriverDrowsinessAttentionState::KSS_RATING_2_VERY_ALERT",
+ "DriverDrowsinessAttentionState::KSS_RATING_3_ALERT",
+ "DriverDrowsinessAttentionState::KSS_RATING_4_RATHER_ALERT",
+ "DriverDrowsinessAttentionState::KSS_RATING_5_NEITHER_ALERT_NOR_SLEEPY",
+ "DriverDrowsinessAttentionState::KSS_RATING_6_SOME_SLEEPINESS",
+ "DriverDrowsinessAttentionState::KSS_RATING_7_SLEEPY_NO_EFFORT",
+ "DriverDrowsinessAttentionState::KSS_RATING_8_SLEEPY_SOME_EFFORT",
+ "DriverDrowsinessAttentionState::KSS_RATING_9_VERY_SLEEPY"
+ ]
+ }
+ ]
+ },
+ {
+ "property": "VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED",
+ "defaultValue": {
+ "int32Values": [
+ 1
+ ]
+ }
+ },
+ {
+ "property": "VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING",
+ "defaultValue": {
+ "int32Values": [
+ "DriverDrowsinessAttentionWarning::NO_WARNING"
+ ]
+ },
+ "areas": [
+ {
+ "areaId": 0,
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "DriverDrowsinessAttentionWarning::NO_WARNING",
+ "DriverDrowsinessAttentionWarning::WARNING"
+ ]
+ }
+ ]
+ },
+ {
+ "property": "VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED",
+ "defaultValue": {
+ "int32Values": [
+ 1
+ ]
+ }
+ },
+ {
+ "property": "VehicleProperty::DRIVER_DISTRACTION_STATE",
+ "defaultValue": {
+ "int32Values": [
+ "DriverDistractionState::NOT_DISTRACTED"
+ ]
+ },
+ "areas": [
+ {
+ "areaId": 0,
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "DriverDistractionState::NOT_DISTRACTED",
+ "DriverDistractionState::DISTRACTED"
+ ]
+ }
+ ]
+ },
+ {
+ "property": "VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED",
+ "defaultValue": {
+ "int32Values": [
+ 1
+ ]
+ }
+ },
+ {
+ "property": "VehicleProperty::DRIVER_DISTRACTION_WARNING",
+ "defaultValue": {
+ "int32Values": [
+ "DriverDistractionWarning::NO_WARNING"
+ ]
+ },
+ "areas": [
+ {
+ "areaId": 0,
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "DriverDistractionWarning::NO_WARNING",
+ "DriverDistractionWarning::WARNING"
+ ]
+ }
+ ]
+ },
+ {
"property": "VehicleProperty::INITIAL_USER_INFO"
},
{
@@ -3571,7 +3798,13 @@
"property": "VehicleProperty::WATCHDOG_TERMINATED_PROCESS"
},
{
- "property": "VehicleProperty::VHAL_HEARTBEAT"
+ "property": "VehicleProperty::VHAL_HEARTBEAT",
+ "areas": [
+ {
+ "areaId": 0,
+ "supportVariableUpdateRate": false
+ }
+ ]
},
{
"property": "VehicleProperty::CLUSTER_SWITCH_UI",
@@ -3621,6 +3854,27 @@
"property": "VehicleProperty::CLUSTER_NAVIGATION_STATE"
},
{
+ "property": "VehicleProperty::CLUSTER_HEARTBEAT",
+ "configArray": [
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ 2,
+ 0,
+ 0,
+ 16
+ ],
+ "areas": [
+ {
+ "areaId": 0,
+ "supportVariableUpdateRate": false
+ }
+ ],
+ "comment": "configArray specifies it consists of int64[2] and byte[16]."
+ },
+ {
"property": "VehicleProperty::GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT",
"defaultValue": {
"int32Values": [
@@ -3629,6 +3883,25 @@
}
},
{
+ "property": "VehicleProperty::SHUTDOWN_REQUEST"
+ },
+ {
+ "property": "VehicleProperty::VEHICLE_IN_USE",
+ "defaultValue": {
+ "int32Values": [
+ 1
+ ]
+ }
+ },
+ {
+ "property": "VehicleProperty::VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL",
+ "defaultValue": {
+ "int32Values": [
+ "VehicleAutonomousState::LEVEL_0"
+ ]
+ }
+ },
+ {
"property": "VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED",
"defaultValue": {
"int32Values": [
@@ -3826,6 +4099,98 @@
]
}
]
+ },
+ {
+ "property": "VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED",
+ "defaultValue": {
+ "int32Values": [
+ 1
+ ]
+ }
+ },
+ {
+ "property": "VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE",
+ "defaultValue": {
+ "int32Values": [
+ "LowSpeedCollisionWarningState::NO_WARNING"
+ ]
+ },
+ "areas": [
+ {
+ "areaId": 0,
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "LowSpeedCollisionWarningState::NO_WARNING",
+ "LowSpeedCollisionWarningState::WARNING"
+ ]
+ }
+ ]
+ },
+ {
+ "property": "VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED",
+ "defaultValue": {
+ "int32Values": [
+ 1
+ ]
+ }
+ },
+ {
+ "property": "VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE",
+ "defaultValue": {
+ "int32Values": [
+ "ElectronicStabilityControlState::ENABLED"
+ ]
+ },
+ "areas": [
+ {
+ "areaId": 0,
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_SPEED_LOW",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "ElectronicStabilityControlState::ENABLED",
+ "ElectronicStabilityControlState::ACTIVATED"
+ ]
+ }
+ ]
+ },
+ {
+ "property": "VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED",
+ "defaultValue": {
+ "int32Values": [
+ 1
+ ]
+ }
+ },
+ {
+ "property": "VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE",
+ "defaultValue": {
+ "int32Values": [
+ "CrossTrafficMonitoringWarningState::NO_WARNING"
+ ]
+ },
+ "areas": [
+ {
+ "areaId": 0,
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "CrossTrafficMonitoringWarningState::NO_WARNING",
+ "CrossTrafficMonitoringWarningState::WARNING_FRONT_LEFT",
+ "CrossTrafficMonitoringWarningState::WARNING_FRONT_RIGHT",
+ "CrossTrafficMonitoringWarningState::WARNING_FRONT_BOTH",
+ "CrossTrafficMonitoringWarningState::WARNING_REAR_LEFT",
+ "CrossTrafficMonitoringWarningState::WARNING_REAR_RIGHT",
+ "CrossTrafficMonitoringWarningState::WARNING_REAR_BOTH"
+ ]
+ }
+ ]
}
]
}
diff --git a/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json b/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json
index fd4b002..73e4d44 100644
--- a/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json
+++ b/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json
@@ -1,7 +1,7 @@
{
"properties": [
{
- "property": "Constants::kMixedTypePropertyForTest",
+ "property": "TestVendorProperty::MIXED_TYPE_PROPERTY_FOR_TEST",
"defaultValue": {
"floatValues": [
4.5
@@ -28,7 +28,7 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::VENDOR_EXTENSION_BOOLEAN_PROPERTY",
+ "property": "TestVendorProperty::VENDOR_EXTENSION_BOOLEAN_PROPERTY",
"areas": [
{
"defaultValue": {
@@ -67,7 +67,7 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::VENDOR_EXTENSION_FLOAT_PROPERTY",
+ "property": "TestVendorProperty::VENDOR_EXTENSION_FLOAT_PROPERTY",
"areas": [
{
"defaultValue": {
@@ -94,7 +94,7 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::VENDOR_EXTENSION_INT_PROPERTY",
+ "property": "TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY",
"areas": [
{
"defaultValue": {
@@ -131,7 +131,7 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::VENDOR_EXTENSION_STRING_PROPERTY",
+ "property": "TestVendorProperty::VENDOR_EXTENSION_STRING_PROPERTY",
"defaultValue": {
"stringValue": "Vendor String Property"
},
@@ -139,7 +139,7 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::PLACEHOLDER_PROPERTY_INT",
+ "property": "TestVendorProperty::PLACEHOLDER_PROPERTY_INT",
"defaultValue": {
"int32Values": [
0
@@ -149,7 +149,7 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::PLACEHOLDER_PROPERTY_FLOAT",
+ "property": "TestVendorProperty::PLACEHOLDER_PROPERTY_FLOAT",
"defaultValue": {
"floatValues": [
0.0
@@ -159,7 +159,7 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::PLACEHOLDER_PROPERTY_BOOLEAN",
+ "property": "TestVendorProperty::PLACEHOLDER_PROPERTY_BOOLEAN",
"defaultValue": {
"int32Values": [
0
@@ -169,7 +169,7 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::PLACEHOLDER_PROPERTY_STRING",
+ "property": "TestVendorProperty::PLACEHOLDER_PROPERTY_STRING",
"defaultValue": {
"stringValue": "Test"
},
@@ -177,12 +177,12 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::ECHO_REVERSE_BYTES",
+ "property": "TestVendorProperty::ECHO_REVERSE_BYTES",
"access": "VehiclePropertyAccess::READ_WRITE",
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::VENDOR_PROPERTY_ID",
+ "property": "TestVendorProperty::VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING",
"access": "VehiclePropertyAccess::READ_WRITE",
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
@@ -194,13 +194,13 @@
]
},
"configArray": [
- "Constants::kMixedTypePropertyForTest",
+ "TestVendorProperty::MIXED_TYPE_PROPERTY_FOR_TEST",
"VehicleVendorPermission::PERMISSION_GET_VENDOR_CATEGORY_INFO",
"VehicleVendorPermission::PERMISSION_SET_VENDOR_CATEGORY_INFO",
- "Constants::VENDOR_EXTENSION_INT_PROPERTY",
+ "TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY",
"VehicleVendorPermission::PERMISSION_GET_VENDOR_CATEGORY_SEAT",
"VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE",
- "Constants::VENDOR_EXTENSION_FLOAT_PROPERTY",
+ "TestVendorProperty::VENDOR_EXTENSION_FLOAT_PROPERTY",
"VehicleVendorPermission::PERMISSION_DEFAULT",
"VehicleVendorPermission::PERMISSION_DEFAULT"
]
diff --git a/automotive/vehicle/aidl/impl/default_config/config/VendorClusterTestProperties.json b/automotive/vehicle/aidl/impl/default_config/config/VendorClusterTestProperties.json
index 3a1a783..8c2bc93 100644
--- a/automotive/vehicle/aidl/impl/default_config/config/VendorClusterTestProperties.json
+++ b/automotive/vehicle/aidl/impl/default_config/config/VendorClusterTestProperties.json
@@ -1,17 +1,17 @@
{
"properties": [
{
- "property": "Constants::VENDOR_CLUSTER_SWITCH_UI",
+ "property": "TestVendorProperty::VENDOR_CLUSTER_SWITCH_UI",
"access": "VehiclePropertyAccess::WRITE",
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::VENDOR_CLUSTER_DISPLAY_STATE",
+ "property": "TestVendorProperty::VENDOR_CLUSTER_DISPLAY_STATE",
"access": "VehiclePropertyAccess::WRITE",
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::VENDOR_CLUSTER_REPORT_STATE",
+ "property": "TestVendorProperty::VENDOR_CLUSTER_REPORT_STATE",
"defaultValue": {
"int32Values": [
0,
@@ -44,7 +44,7 @@
"Value means 0 /* Off */, -1, -1, -1, -1 /* Bounds */, -1, -1, -1, -1 /* Insets */, 0 /* ClusterHome */, -1 /* ClusterNone */"
},
{
- "property": "Constants::VENDOR_CLUSTER_REQUEST_DISPLAY",
+ "property": "TestVendorProperty::VENDOR_CLUSTER_REQUEST_DISPLAY",
"defaultValue": {
"int32Values": [
0
@@ -55,7 +55,7 @@
"comment": "0 means ClusterHome"
},
{
- "property": "Constants::VENDOR_CLUSTER_NAVIGATION_STATE",
+ "property": "TestVendorProperty::VENDOR_CLUSTER_NAVIGATION_STATE",
"access": "VehiclePropertyAccess::READ",
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
}
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp
index 4c17cde..e75f648 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp
@@ -21,7 +21,10 @@
cc_library {
name: "FakeVehicleHardware",
vendor: true,
- srcs: ["src/*.cpp"],
+ srcs: [
+ "src/*.cpp",
+ ":VhalTestVendorProperties",
+ ],
local_include_dirs: ["include"],
export_include_dirs: ["include"],
cflags: ["-DENABLE_VEHICLE_HAL_TEST_PROPERTIES"],
@@ -35,7 +38,7 @@
name: "FakeVehicleHardwareDefaults",
header_libs: [
"IVehicleHardware",
- "VehicleHalTestUtilHeaders",
+ "libbinder_headers",
],
export_header_lib_headers: ["IVehicleHardware"],
static_libs: [
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h
index af1bb1d..8cd92b3 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h
@@ -36,6 +36,7 @@
#include <memory>
#include <mutex>
#include <unordered_map>
+#include <unordered_set>
#include <vector>
namespace android {
@@ -90,9 +91,13 @@
void registerOnPropertySetErrorEvent(
std::unique_ptr<const PropertySetErrorCallback> callback) override;
- // Update the sample rate for the [propId, areaId] pair.
- aidl::android::hardware::automotive::vehicle::StatusCode updateSampleRate(
- int32_t propId, int32_t areaId, float sampleRate) override;
+ // Subscribe to a new [propId, areaId] or change the update rate.
+ aidl::android::hardware::automotive::vehicle::StatusCode subscribe(
+ aidl::android::hardware::automotive::vehicle::SubscribeOptions options) override;
+
+ // Unsubscribe to a [propId, areaId].
+ aidl::android::hardware::automotive::vehicle::StatusCode unsubscribe(int32_t propId,
+ int32_t areaId) override;
protected:
// mValuePool is also used in mServerSidePropStore.
@@ -137,6 +142,16 @@
void handleRequestsOnce();
};
+ struct RefreshInfo {
+ VehiclePropertyStore::EventMode eventMode;
+ int64_t intervalInNanos;
+ };
+
+ struct ActionForInterval {
+ std::unordered_set<PropIdAreaId, PropIdAreaIdHash> propIdAreaIdsToRefresh;
+ std::shared_ptr<RecurrentTimer::Callback> recurrentAction;
+ };
+
const std::unique_ptr<obd2frame::FakeObd2Frame> mFakeObd2Frame;
const std::unique_ptr<FakeUserHal> mFakeUserHal;
// RecurrentTimer is thread-safe.
@@ -149,10 +164,12 @@
std::unique_ptr<const PropertySetErrorCallback> mOnPropertySetErrorCallback;
std::mutex mLock;
- std::unordered_map<PropIdAreaId, std::shared_ptr<RecurrentTimer::Callback>, PropIdAreaIdHash>
- mRecurrentActions GUARDED_BY(mLock);
+ std::unordered_map<PropIdAreaId, RefreshInfo, PropIdAreaIdHash> mRefreshInfoByPropIdAreaId
+ GUARDED_BY(mLock);
+ std::unordered_map<int64_t, ActionForInterval> mActionByIntervalInNanos GUARDED_BY(mLock);
std::unordered_map<PropIdAreaId, VehiclePropValuePool::RecyclableType, PropIdAreaIdHash>
mSavedProps GUARDED_BY(mLock);
+ std::unordered_set<PropIdAreaId, PropIdAreaIdHash> mSubOnChangePropIdAreaIds GUARDED_BY(mLock);
// PendingRequestHandler is thread-safe.
mutable PendingRequestHandler<GetValuesCallback,
aidl::android::hardware::automotive::vehicle::GetValueRequest>
@@ -161,6 +178,9 @@
aidl::android::hardware::automotive::vehicle::SetValueRequest>
mPendingSetValueRequests;
+ // Set of HVAC properties dependent on HVAC_POWER_ON
+ std::unordered_set<int32_t> hvacPowerDependentProps;
+
const bool mForceOverride;
bool mAddExtraTestVendorConfigs;
@@ -172,7 +192,12 @@
void storePropInitialValue(const ConfigDeclaration& config);
// The callback that would be called when a vehicle property value change happens.
void onValueChangeCallback(
- const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value)
+ EXCLUDES(mLock);
+ // The callback that would be called when multiple vehicle property value changes happen.
+ void onValuesChangeCallback(
+ std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropValue> values)
+ EXCLUDES(mLock);
// Load the config files in format '*.json' from the directory and parse the config files
// into a map from property ID to ConfigDeclarations.
void loadPropConfigsFromDir(const std::string& dirPath,
@@ -192,11 +217,14 @@
VhalResult<void> maybeSetSpecialValue(
const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value,
bool* isSpecialValue);
+ VhalResult<bool> isCruiseControlTypeStandard() const;
ValueResultType maybeGetSpecialValue(
const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value,
bool* isSpecialValue) const;
VhalResult<void> setApPowerStateReport(
const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
+ VhalResult<void> setApPowerStateReqShutdown(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value);
VehiclePropValuePool::RecyclableType createApPowerStateReq(
aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq state);
VehiclePropValuePool::RecyclableType createAdasStateReq(int32_t propertyId, int32_t areaId,
@@ -209,6 +237,9 @@
const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const;
bool isHvacPropAndHvacNotAvailable(int32_t propId, int32_t areaId) const;
VhalResult<void> isAdasPropertyAvailable(int32_t adasStatePropertyId) const;
+ VhalResult<void> synchronizeHvacTemp(int32_t hvacDualOnAreaId,
+ std::optional<float> newTempC) const;
+ std::optional<int32_t> getSyncedAreaIdIfHvacDualOn(int32_t hvacTemperatureSetAreaId) const;
std::unordered_map<int32_t, ConfigDeclaration> loadConfigDeclarations();
@@ -250,11 +281,21 @@
const aidl::android::hardware::automotive::vehicle::SetValueRequest& request);
std::string genFakeDataCommand(const std::vector<std::string>& options);
- void sendHvacPropertiesCurrentValues(int32_t areaId);
+ void sendHvacPropertiesCurrentValues(int32_t areaId, int32_t hvacPowerOnVal);
void sendAdasPropertiesState(int32_t propertyId, int32_t state);
void generateVendorConfigs(
std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropConfig>&) const;
+ aidl::android::hardware::automotive::vehicle::StatusCode subscribePropIdAreaIdLocked(
+ int32_t propId, int32_t areaId, float sampleRateHz, bool enableVariableUpdateRate,
+ const aidl::android::hardware::automotive::vehicle::VehiclePropConfig&
+ vehiclePropConfig) REQUIRES(mLock);
+
+ void registerRefreshLocked(PropIdAreaId propIdAreaId, VehiclePropertyStore::EventMode eventMode,
+ float sampleRateHz) REQUIRES(mLock);
+ void unregisterRefreshLocked(PropIdAreaId propIdAreaId) REQUIRES(mLock);
+ void refreshTimeStampForInterval(int64_t intervalInNanos) EXCLUDES(mLock);
+
static aidl::android::hardware::automotive::vehicle::VehiclePropValue createHwInputKeyProp(
aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction action,
int32_t keyCode, int32_t targetDisplay);
@@ -268,6 +309,10 @@
static std::string genFakeDataHelp();
static std::string parseErrMsg(std::string fieldName, std::string value, std::string type);
+ static bool isVariableUpdateRateSupported(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropConfig&
+ vehiclePropConfig,
+ int32_t areaId);
};
} // namespace fake
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
index 250a226..dced624 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
@@ -24,7 +24,6 @@
#include <JsonFakeValueGenerator.h>
#include <LinearFakeValueGenerator.h>
#include <PropertyUtils.h>
-#include <TestPropertyUtils.h>
#include <VehicleHalTypes.h>
#include <VehicleUtils.h>
@@ -32,6 +31,7 @@
#include <android-base/parsedouble.h>
#include <android-base/properties.h>
#include <android-base/strings.h>
+#include <android/hardware/automotive/vehicle/TestVendorProperty.h>
#include <utils/Log.h>
#include <utils/SystemClock.h>
#include <utils/Trace.h>
@@ -51,6 +51,12 @@
namespace {
+using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand;
+using ::aidl::android::hardware::automotive::vehicle::CruiseControlType;
+using ::aidl::android::hardware::automotive::vehicle::DriverDistractionState;
+using ::aidl::android::hardware::automotive::vehicle::DriverDistractionWarning;
+using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionState;
+using ::aidl::android::hardware::automotive::vehicle::DriverDrowsinessAttentionWarning;
using ::aidl::android::hardware::automotive::vehicle::ErrorState;
using ::aidl::android::hardware::automotive::vehicle::GetValueRequest;
using ::aidl::android::hardware::automotive::vehicle::GetValueResult;
@@ -58,12 +64,16 @@
using ::aidl::android::hardware::automotive::vehicle::SetValueRequest;
using ::aidl::android::hardware::automotive::vehicle::SetValueResult;
using ::aidl::android::hardware::automotive::vehicle::StatusCode;
+using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions;
+using ::aidl::android::hardware::automotive::vehicle::toString;
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport;
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq;
+using ::aidl::android::hardware::automotive::vehicle::VehicleArea;
using ::aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig;
using ::aidl::android::hardware::automotive::vehicle::VehicleProperty;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess;
+using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyChangeMode;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType;
@@ -84,14 +94,12 @@
// getPropertiesAsync, and setPropertiesAsync.
// 0x21403000
constexpr int32_t STARTING_VENDOR_CODE_PROPERTIES_FOR_TEST =
- 0x3000 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::INT32);
+ 0x3000 | toInt(VehiclePropertyGroup::VENDOR) | toInt(VehicleArea::GLOBAL) |
+ toInt(VehiclePropertyType::INT32);
// 0x21405000
constexpr int32_t ENDING_VENDOR_CODE_PROPERTIES_FOR_TEST =
- 0x5000 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::INT32);
+ 0x5000 | toInt(VehiclePropertyGroup::VENDOR) | toInt(VehicleArea::GLOBAL) |
+ toInt(VehiclePropertyType::INT32);
// The directory for default property configuration file.
// For config file format, see impl/default_config/config/README.md.
constexpr char DEFAULT_CONFIG_DIR[] = "/vendor/etc/automotive/vhalconfig/";
@@ -102,7 +110,7 @@
// overwrite the default configs.
constexpr char OVERRIDE_PROPERTY[] = "persist.vendor.vhal_init_value_override";
constexpr char POWER_STATE_REQ_CONFIG_PROPERTY[] = "ro.vendor.fake_vhal.ap_power_state_req.config";
-// The value to be returned if VENDOR_PROPERTY_ID is set as the property
+// The value to be returned if VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING is set as the property
constexpr int VENDOR_ERROR_CODE = 0x00ab0005;
// A list of supported options for "--set" command.
const std::unordered_set<std::string> SET_PROP_OPTIONS = {
@@ -188,6 +196,56 @@
toInt(VehicleProperty::HANDS_ON_DETECTION_WARNING),
},
},
+ // Driver Drowsiness and Attention
+ {
+ toInt(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED),
+ {
+ toInt(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_STATE),
+ },
+ },
+ // Driver Drowsiness and Attention Warning
+ {
+ toInt(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED),
+ {
+ toInt(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING),
+ },
+ },
+ // Driver Distraction
+ {
+ toInt(VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED),
+ {
+ toInt(VehicleProperty::DRIVER_DISTRACTION_STATE),
+ toInt(VehicleProperty::DRIVER_DISTRACTION_WARNING),
+ },
+ },
+ // Driver Distraction Warning
+ {
+ toInt(VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED),
+ {
+ toInt(VehicleProperty::DRIVER_DISTRACTION_WARNING),
+ },
+ },
+ // LSCW
+ {
+ toInt(VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED),
+ {
+ toInt(VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE),
+ },
+ },
+ // ESC
+ {
+ toInt(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED),
+ {
+ toInt(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE),
+ },
+ },
+ // CTMW
+ {
+ toInt(VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED),
+ {
+ toInt(VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE),
+ },
+ },
};
} // namespace
@@ -199,6 +257,11 @@
bool globalProp = isGlobalProp(propId);
size_t numAreas = globalProp ? 1 : vehiclePropConfig.areaConfigs.size();
+ if (propId == toInt(VehicleProperty::HVAC_POWER_ON)) {
+ const auto& configArray = vehiclePropConfig.configArray;
+ hvacPowerDependentProps.insert(configArray.begin(), configArray.end());
+ }
+
for (size_t i = 0; i < numAreas; i++) {
int32_t curArea = globalProp ? 0 : vehiclePropConfig.areaConfigs[i].areaId;
@@ -295,17 +358,18 @@
}
// OBD2_LIVE_FRAME and OBD2_FREEZE_FRAME must be configured in default configs.
- auto maybeObd2LiveFrame = mServerSidePropStore->getConfig(OBD2_LIVE_FRAME);
+ auto maybeObd2LiveFrame = mServerSidePropStore->getPropConfig(OBD2_LIVE_FRAME);
if (maybeObd2LiveFrame.has_value()) {
- mFakeObd2Frame->initObd2LiveFrame(*maybeObd2LiveFrame.value());
+ mFakeObd2Frame->initObd2LiveFrame(maybeObd2LiveFrame.value());
}
- auto maybeObd2FreezeFrame = mServerSidePropStore->getConfig(OBD2_FREEZE_FRAME);
+ auto maybeObd2FreezeFrame = mServerSidePropStore->getPropConfig(OBD2_FREEZE_FRAME);
if (maybeObd2FreezeFrame.has_value()) {
- mFakeObd2Frame->initObd2FreezeFrame(*maybeObd2FreezeFrame.value());
+ mFakeObd2Frame->initObd2FreezeFrame(maybeObd2FreezeFrame.value());
}
- mServerSidePropStore->setOnValueChangeCallback(
- [this](const VehiclePropValue& value) { return onValueChangeCallback(value); });
+ mServerSidePropStore->setOnValuesChangeCallback([this](std::vector<VehiclePropValue> values) {
+ return onValuesChangeCallback(std::move(values));
+ });
}
std::vector<VehiclePropConfig> FakeVehicleHardware::getAllPropertyConfigs() const {
@@ -341,6 +405,25 @@
return req;
}
+VhalResult<void> FakeVehicleHardware::setApPowerStateReqShutdown(const VehiclePropValue& value) {
+ if (value.value.int32Values.size() != 1) {
+ return StatusError(StatusCode::INVALID_ARG)
+ << "Failed to set SHUTDOWN_REQUEST, expect 1 int value: "
+ << "VehicleApPowerStateShutdownParam";
+ }
+ int powerStateShutdownParam = value.value.int32Values[0];
+ auto prop = createApPowerStateReq(VehicleApPowerStateReq::SHUTDOWN_PREPARE);
+ prop->value.int32Values[1] = powerStateShutdownParam;
+ if (auto writeResult = mServerSidePropStore->writeValue(
+ std::move(prop), /*updateStatus=*/true, VehiclePropertyStore::EventMode::ALWAYS);
+ !writeResult.ok()) {
+ return StatusError(getErrorCode(writeResult))
+ << "failed to write AP_POWER_STATE_REQ into property store, error: "
+ << getErrorMsg(writeResult);
+ }
+ return {};
+}
+
VhalResult<void> FakeVehicleHardware::setApPowerStateReport(const VehiclePropValue& value) {
auto updatedValue = mValuePool->obtain(value);
updatedValue->timestamp = elapsedRealtimeNano();
@@ -406,7 +489,7 @@
int increment) {
requestedTemp = std::max(requestedTemp, minTemp);
requestedTemp = std::min(requestedTemp, maxTemp);
- int numIncrements = (requestedTemp - minTemp) / increment;
+ int numIncrements = std::round((requestedTemp - minTemp) / static_cast<float>(increment));
return numIncrements;
}
@@ -444,7 +527,7 @@
VhalResult<void> FakeVehicleHardware::setHvacTemperatureValueSuggestion(
const VehiclePropValue& hvacTemperatureValueSuggestion) {
auto hvacTemperatureSetConfigResult =
- mServerSidePropStore->getConfig(toInt(VehicleProperty::HVAC_TEMPERATURE_SET));
+ mServerSidePropStore->getPropConfig(toInt(VehicleProperty::HVAC_TEMPERATURE_SET));
if (!hvacTemperatureSetConfigResult.ok()) {
return StatusError(getErrorCode(hvacTemperatureSetConfigResult)) << StringPrintf(
@@ -471,7 +554,7 @@
}
auto updatedValue = mValuePool->obtain(hvacTemperatureValueSuggestion);
- const auto& hvacTemperatureSetConfigArray = hvacTemperatureSetConfigResult.value()->configArray;
+ const auto& hvacTemperatureSetConfigArray = hvacTemperatureSetConfigResult.value().configArray;
auto& hvacTemperatureValueSuggestionInput = updatedValue->value.floatValues;
updateHvacTemperatureValueSuggestionInput(hvacTemperatureSetConfigArray,
@@ -491,9 +574,7 @@
}
bool FakeVehicleHardware::isHvacPropAndHvacNotAvailable(int32_t propId, int32_t areaId) const {
- std::unordered_set<int32_t> powerProps(std::begin(HVAC_POWER_PROPERTIES),
- std::end(HVAC_POWER_PROPERTIES));
- if (powerProps.count(propId)) {
+ if (hvacPowerDependentProps.count(propId)) {
auto hvacPowerOnResults =
mServerSidePropStore->readValuesForProperty(toInt(VehicleProperty::HVAC_POWER_ON));
if (!hvacPowerOnResults.ok()) {
@@ -575,6 +656,65 @@
return {};
}
+VhalResult<void> FakeVehicleHardware::synchronizeHvacTemp(int32_t hvacDualOnAreaId,
+ std::optional<float> newTempC) const {
+ auto hvacTemperatureSetResults = mServerSidePropStore->readValuesForProperty(
+ toInt(VehicleProperty::HVAC_TEMPERATURE_SET));
+ if (!hvacTemperatureSetResults.ok()) {
+ return StatusError(StatusCode::NOT_AVAILABLE)
+ << "Failed to get HVAC_TEMPERATURE_SET, error: "
+ << getErrorMsg(hvacTemperatureSetResults);
+ }
+ auto& hvacTemperatureSetValues = hvacTemperatureSetResults.value();
+ std::optional<float> tempCToSynchronize = newTempC;
+ for (size_t i = 0; i < hvacTemperatureSetValues.size(); i++) {
+ int32_t areaId = hvacTemperatureSetValues[i]->areaId;
+ if ((hvacDualOnAreaId & areaId) != areaId) {
+ continue;
+ }
+ if (hvacTemperatureSetValues[i]->status != VehiclePropertyStatus::AVAILABLE) {
+ continue;
+ }
+ // When HVAC_DUAL_ON is initially enabled, synchronize all area IDs
+ // to the temperature of the first area ID, which is the driver's.
+ if (!tempCToSynchronize.has_value()) {
+ tempCToSynchronize = hvacTemperatureSetValues[i]->value.floatValues[0];
+ continue;
+ }
+ auto updatedValue = std::move(hvacTemperatureSetValues[i]);
+ updatedValue->value.floatValues[0] = tempCToSynchronize.value();
+ updatedValue->timestamp = elapsedRealtimeNano();
+ // This will trigger a property change event for the current hvac property value.
+ auto writeResult =
+ mServerSidePropStore->writeValue(std::move(updatedValue), /*updateStatus=*/true,
+ VehiclePropertyStore::EventMode::ALWAYS);
+ if (!writeResult.ok()) {
+ return StatusError(getErrorCode(writeResult))
+ << "Failed to write value into property store, error: "
+ << getErrorMsg(writeResult);
+ }
+ }
+ return {};
+}
+
+std::optional<int32_t> FakeVehicleHardware::getSyncedAreaIdIfHvacDualOn(
+ int32_t hvacTemperatureSetAreaId) const {
+ auto hvacDualOnResults =
+ mServerSidePropStore->readValuesForProperty(toInt(VehicleProperty::HVAC_DUAL_ON));
+ if (!hvacDualOnResults.ok()) {
+ return std::nullopt;
+ }
+ auto& hvacDualOnValues = hvacDualOnResults.value();
+ for (size_t i = 0; i < hvacDualOnValues.size(); i++) {
+ if ((hvacDualOnValues[i]->areaId & hvacTemperatureSetAreaId) == hvacTemperatureSetAreaId &&
+ hvacDualOnValues[i]->value.int32Values.size() == 1 &&
+ hvacDualOnValues[i]->value.int32Values[0] == 1) {
+ return hvacDualOnValues[i]->areaId;
+ }
+ }
+ return std::nullopt;
+}
+
FakeVehicleHardware::ValueResultType FakeVehicleHardware::getUserHalProp(
const VehiclePropValue& value) const {
auto propId = value.prop;
@@ -596,6 +736,18 @@
}
}
+VhalResult<bool> FakeVehicleHardware::isCruiseControlTypeStandard() const {
+ auto isCruiseControlTypeAvailableResult =
+ isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_TYPE));
+ if (!isCruiseControlTypeAvailableResult.ok()) {
+ return isCruiseControlTypeAvailableResult.error();
+ }
+ auto cruiseControlTypeValue =
+ mServerSidePropStore->readValue(toInt(VehicleProperty::CRUISE_CONTROL_TYPE));
+ return cruiseControlTypeValue.value()->value.int32Values[0] ==
+ toInt(CruiseControlType::STANDARD);
+}
+
FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue(
const VehiclePropValue& value, bool* isSpecialValue) const {
*isSpecialValue = false;
@@ -623,6 +775,7 @@
return StatusError(StatusCode::NOT_AVAILABLE_DISABLED) << "hvac not available";
}
+ VhalResult<void> isAdasPropertyAvailableResult;
switch (propId) {
case OBD2_FREEZE_FRAME:
*isSpecialValue = true;
@@ -638,24 +791,41 @@
result.value()->timestamp = elapsedRealtimeNano();
}
return result;
- case ECHO_REVERSE_BYTES:
+ case toInt(TestVendorProperty::ECHO_REVERSE_BYTES):
*isSpecialValue = true;
return getEchoReverseBytes(value);
- case VENDOR_PROPERTY_ID:
+ case toInt(TestVendorProperty::VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING):
*isSpecialValue = true;
return StatusError((StatusCode)VENDOR_ERROR_CODE);
case toInt(VehicleProperty::CRUISE_CONTROL_TARGET_SPEED):
- [[fallthrough]];
- case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP):
- [[fallthrough]];
- case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE): {
- auto isAdasPropertyAvailableResult =
+ isAdasPropertyAvailableResult =
isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_STATE));
if (!isAdasPropertyAvailableResult.ok()) {
*isSpecialValue = true;
return isAdasPropertyAvailableResult.error();
}
return nullptr;
+ case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP):
+ [[fallthrough]];
+ case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE): {
+ isAdasPropertyAvailableResult =
+ isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_STATE));
+ if (!isAdasPropertyAvailableResult.ok()) {
+ *isSpecialValue = true;
+ return isAdasPropertyAvailableResult.error();
+ }
+ auto isCruiseControlTypeStandardResult = isCruiseControlTypeStandard();
+ if (!isCruiseControlTypeStandardResult.ok()) {
+ *isSpecialValue = true;
+ return isCruiseControlTypeStandardResult.error();
+ }
+ if (isCruiseControlTypeStandardResult.value()) {
+ *isSpecialValue = true;
+ return StatusError(StatusCode::NOT_AVAILABLE_DISABLED)
+ << "tried to get target time gap or lead vehicle measured distance value "
+ << "while on a standard CC setting";
+ }
+ return nullptr;
}
default:
// Do nothing.
@@ -681,9 +851,8 @@
return std::move(gotValue);
}
-void FakeVehicleHardware::sendHvacPropertiesCurrentValues(int32_t areaId) {
- for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) {
- int powerPropId = HVAC_POWER_PROPERTIES[i];
+void FakeVehicleHardware::sendHvacPropertiesCurrentValues(int32_t areaId, int32_t hvacPowerOnVal) {
+ for (auto& powerPropId : hvacPowerDependentProps) {
auto powerPropResults = mServerSidePropStore->readValuesForProperty(powerPropId);
if (!powerPropResults.ok()) {
ALOGW("failed to get power prop 0x%x, error: %s", powerPropId,
@@ -694,7 +863,8 @@
for (size_t j = 0; j < powerPropValues.size(); j++) {
auto powerPropValue = std::move(powerPropValues[j]);
if ((powerPropValue->areaId & areaId) == powerPropValue->areaId) {
- powerPropValue->status = VehiclePropertyStatus::AVAILABLE;
+ powerPropValue->status = hvacPowerOnVal ? VehiclePropertyStatus::AVAILABLE
+ : VehiclePropertyStatus::UNAVAILABLE;
powerPropValue->timestamp = elapsedRealtimeNano();
// This will trigger a property change event for the current hvac property value.
mServerSidePropStore->writeValue(std::move(powerPropValue), /*updateStatus=*/true,
@@ -707,15 +877,21 @@
void FakeVehicleHardware::sendAdasPropertiesState(int32_t propertyId, int32_t state) {
auto& adasDependentPropIds = mAdasEnabledPropToAdasPropWithErrorState.find(propertyId)->second;
for (auto dependentPropId : adasDependentPropIds) {
- auto dependentPropConfigResult = mServerSidePropStore->getConfig(dependentPropId);
+ auto dependentPropConfigResult = mServerSidePropStore->getPropConfig(dependentPropId);
if (!dependentPropConfigResult.ok()) {
ALOGW("Failed to get config for ADAS property 0x%x, error: %s", dependentPropId,
getErrorMsg(dependentPropConfigResult).c_str());
continue;
}
auto& dependentPropConfig = dependentPropConfigResult.value();
- for (auto& areaConfig : dependentPropConfig->areaConfigs) {
- auto propValue = createAdasStateReq(dependentPropId, areaConfig.areaId, state);
+ for (auto& areaConfig : dependentPropConfig.areaConfigs) {
+ int32_t hardcoded_state = state;
+ // TODO: restore old/initial values here instead of hardcoded value (b/295542701)
+ if (state == 1 && dependentPropId == toInt(VehicleProperty::CRUISE_CONTROL_TYPE)) {
+ hardcoded_state = toInt(CruiseControlType::ADAPTIVE);
+ }
+ auto propValue =
+ createAdasStateReq(dependentPropId, areaConfig.areaId, hardcoded_state);
// This will trigger a property change event for the current ADAS property value.
mServerSidePropStore->writeValue(std::move(propValue), /*updateStatus=*/true,
VehiclePropertyStore::EventMode::ALWAYS);
@@ -740,13 +916,6 @@
return setUserHalProp(value);
}
- if (propId == toInt(VehicleProperty::HVAC_POWER_ON) && value.value.int32Values.size() == 1 &&
- value.value.int32Values[0] == 1) {
- // If we are turning HVAC power on, send current hvac property values through on change
- // event.
- sendHvacPropertiesCurrentValues(value.areaId);
- }
-
if (isHvacPropAndHvacNotAvailable(propId, value.areaId)) {
*isSpecialValue = true;
return StatusError(StatusCode::NOT_AVAILABLE_DISABLED) << "hvac not available";
@@ -762,10 +931,18 @@
}
}
+ VhalResult<void> isAdasPropertyAvailableResult;
+ VhalResult<bool> isCruiseControlTypeStandardResult;
switch (propId) {
case toInt(VehicleProperty::AP_POWER_STATE_REPORT):
*isSpecialValue = true;
return setApPowerStateReport(value);
+ case toInt(VehicleProperty::SHUTDOWN_REQUEST):
+ // If we receive SHUTDOWN_REQUEST, we should send this to an external component which
+ // should shutdown Android system via sending an AP_POWER_STATE_REQ event. Here we have
+ // no external components to notify, so we just send the event.
+ *isSpecialValue = true;
+ return setApPowerStateReqShutdown(value);
case toInt(VehicleProperty::VEHICLE_MAP_SERVICE):
// Placeholder for future implementation of VMS property in the default hal. For
// now, just returns OK; otherwise, hal clients crash with property not supported.
@@ -774,14 +951,46 @@
case OBD2_FREEZE_FRAME_CLEAR:
*isSpecialValue = true;
return mFakeObd2Frame->clearObd2FreezeFrames(value);
- case VENDOR_PROPERTY_ID:
+ case toInt(TestVendorProperty::VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING):
*isSpecialValue = true;
return StatusError((StatusCode)VENDOR_ERROR_CODE);
+ case toInt(VehicleProperty::HVAC_POWER_ON):
+ if (value.value.int32Values.size() != 1) {
+ *isSpecialValue = true;
+ return StatusError(StatusCode::INVALID_ARG)
+ << "HVAC_POWER_ON requires only one int32 value";
+ }
+ // When changing HVAC power state, send current hvac property values
+ // through on change event.
+ sendHvacPropertiesCurrentValues(value.areaId, value.value.int32Values[0]);
+ return {};
case toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION):
*isSpecialValue = true;
return setHvacTemperatureValueSuggestion(value);
+ case toInt(VehicleProperty::HVAC_TEMPERATURE_SET):
+ if (value.value.floatValues.size() != 1) {
+ *isSpecialValue = true;
+ return StatusError(StatusCode::INVALID_ARG)
+ << "HVAC_DUAL_ON requires only one float value";
+ }
+ if (auto hvacDualOnAreaId = getSyncedAreaIdIfHvacDualOn(value.areaId);
+ hvacDualOnAreaId.has_value()) {
+ *isSpecialValue = true;
+ return synchronizeHvacTemp(hvacDualOnAreaId.value(), value.value.floatValues[0]);
+ }
+ return {};
+ case toInt(VehicleProperty::HVAC_DUAL_ON):
+ if (value.value.int32Values.size() != 1) {
+ *isSpecialValue = true;
+ return StatusError(StatusCode::INVALID_ARG)
+ << "HVAC_DUAL_ON requires only one int32 value";
+ }
+ if (value.value.int32Values[0] == 1) {
+ synchronizeHvacTemp(value.areaId, std::nullopt);
+ }
+ return {};
case toInt(VehicleProperty::LANE_CENTERING_ASSIST_COMMAND): {
- auto isAdasPropertyAvailableResult =
+ isAdasPropertyAvailableResult =
isAdasPropertyAvailable(toInt(VehicleProperty::LANE_CENTERING_ASSIST_STATE));
if (!isAdasPropertyAvailableResult.ok()) {
*isSpecialValue = true;
@@ -789,14 +998,47 @@
return isAdasPropertyAvailableResult;
}
case toInt(VehicleProperty::CRUISE_CONTROL_COMMAND):
- [[fallthrough]];
- case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP): {
- auto isAdasPropertyAvailableResult =
+ isAdasPropertyAvailableResult =
isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_STATE));
if (!isAdasPropertyAvailableResult.ok()) {
*isSpecialValue = true;
+ return isAdasPropertyAvailableResult;
}
- return isAdasPropertyAvailableResult;
+ isCruiseControlTypeStandardResult = isCruiseControlTypeStandard();
+ if (!isCruiseControlTypeStandardResult.ok()) {
+ *isSpecialValue = true;
+ return isCruiseControlTypeStandardResult.error();
+ }
+ if (isCruiseControlTypeStandardResult.value() &&
+ (value.value.int32Values[0] ==
+ toInt(CruiseControlCommand::INCREASE_TARGET_TIME_GAP) ||
+ value.value.int32Values[0] ==
+ toInt(CruiseControlCommand::DECREASE_TARGET_TIME_GAP))) {
+ *isSpecialValue = true;
+ return StatusError(StatusCode::NOT_AVAILABLE_DISABLED)
+ << "tried to use a change target time gap command while on a standard CC "
+ << "setting";
+ }
+ return {};
+ case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP): {
+ isAdasPropertyAvailableResult =
+ isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_STATE));
+ if (!isAdasPropertyAvailableResult.ok()) {
+ *isSpecialValue = true;
+ return isAdasPropertyAvailableResult;
+ }
+ isCruiseControlTypeStandardResult = isCruiseControlTypeStandard();
+ if (!isCruiseControlTypeStandardResult.ok()) {
+ *isSpecialValue = true;
+ return isCruiseControlTypeStandardResult.error();
+ }
+ if (isCruiseControlTypeStandardResult.value()) {
+ *isSpecialValue = true;
+ return StatusError(StatusCode::NOT_AVAILABLE_DISABLED)
+ << "tried to set target time gap or lead vehicle measured distance value "
+ << "while on a standard CC setting";
+ }
+ return {};
}
#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES
@@ -806,9 +1048,9 @@
[[fallthrough]];
case toInt(VehicleProperty::CLUSTER_NAVIGATION_STATE):
[[fallthrough]];
- case VENDOR_CLUSTER_SWITCH_UI:
+ case toInt(TestVendorProperty::VENDOR_CLUSTER_SWITCH_UI):
[[fallthrough]];
- case VENDOR_CLUSTER_DISPLAY_STATE:
+ case toInt(TestVendorProperty::VENDOR_CLUSTER_DISPLAY_STATE):
*isSpecialValue = true;
updatedValue = mValuePool->obtain(getPropType(value.prop));
updatedValue->prop = value.prop & ~toInt(VehiclePropertyGroup::MASK);
@@ -868,10 +1110,11 @@
}
auto updatedValue = mValuePool->obtain(value);
- int64_t timestamp = elapsedRealtimeNano();
- updatedValue->timestamp = timestamp;
- auto writeResult = mServerSidePropStore->writeValue(std::move(updatedValue));
+ auto writeResult = mServerSidePropStore->writeValue(
+ std::move(updatedValue),
+ /*updateStatus=*/false, /*mode=*/VehiclePropertyStore::EventMode::ON_VALUE_CHANGE,
+ /*useCurrentTimestamp=*/true);
if (!writeResult.ok()) {
return StatusError(getErrorCode(writeResult))
<< StringPrintf("failed to write value into property store, error: %s",
@@ -1514,12 +1757,12 @@
continue;
}
int32_t prop = propResult.value();
- auto result = mServerSidePropStore->getConfig(prop);
+ auto result = mServerSidePropStore->getPropConfig(prop);
if (!result.ok()) {
msg += StringPrintf("No property %d\n", prop);
continue;
}
- msg += dumpOnePropertyByConfig(rowNumber++, *result.value());
+ msg += dumpOnePropertyByConfig(rowNumber++, result.value());
}
return msg;
}
@@ -1823,54 +2066,196 @@
mOnPropertySetErrorCallback = std::move(callback);
}
-StatusCode FakeVehicleHardware::updateSampleRate(int32_t propId, int32_t areaId, float sampleRate) {
- // DefaultVehicleHal makes sure that sampleRate must be within minSampleRate and maxSampleRate.
- // For fake implementation, we would write the same value with a new timestamp into propStore
- // at sample rate.
- std::scoped_lock<std::mutex> lockGuard(mLock);
+StatusCode FakeVehicleHardware::subscribe(SubscribeOptions options) {
+ int32_t propId = options.propId;
+ auto configResult = mServerSidePropStore->getPropConfig(propId);
+ if (!configResult.ok()) {
+ ALOGE("subscribe: property: %" PRId32 " is not supported", propId);
+ return StatusCode::INVALID_ARG;
+ }
+
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ for (int areaId : options.areaIds) {
+ if (StatusCode status = subscribePropIdAreaIdLocked(propId, areaId, options.sampleRate,
+ options.enableVariableUpdateRate,
+ configResult.value());
+ status != StatusCode::OK) {
+ return status;
+ }
+ }
+ return StatusCode::OK;
+}
+
+bool FakeVehicleHardware::isVariableUpdateRateSupported(const VehiclePropConfig& vehiclePropConfig,
+ int32_t areaId) {
+ for (size_t i = 0; i < vehiclePropConfig.areaConfigs.size(); i++) {
+ const auto& areaConfig = vehiclePropConfig.areaConfigs[i];
+ if (areaConfig.areaId != areaId) {
+ continue;
+ }
+ if (areaConfig.supportVariableUpdateRate) {
+ return true;
+ }
+ break;
+ }
+ return false;
+}
+
+void FakeVehicleHardware::refreshTimeStampForInterval(int64_t intervalInNanos) {
+ std::unordered_map<PropIdAreaId, VehiclePropertyStore::EventMode, PropIdAreaIdHash>
+ eventModeByPropIdAreaId;
+
+ {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+
+ if (mActionByIntervalInNanos.find(intervalInNanos) == mActionByIntervalInNanos.end()) {
+ ALOGE("No actions scheduled for the interval: %" PRId64 ", ignore the refresh request",
+ intervalInNanos);
+ return;
+ }
+
+ ActionForInterval actionForInterval = mActionByIntervalInNanos[intervalInNanos];
+
+ // Make a copy so that we don't hold the lock while trying to refresh the timestamp.
+ // Refreshing the timestamp will inovke onValueChangeCallback which also requires lock, so
+ // we must not hold lock.
+ for (const PropIdAreaId& propIdAreaId : actionForInterval.propIdAreaIdsToRefresh) {
+ const RefreshInfo& refreshInfo = mRefreshInfoByPropIdAreaId[propIdAreaId];
+ eventModeByPropIdAreaId[propIdAreaId] = refreshInfo.eventMode;
+ }
+ }
+
+ mServerSidePropStore->refreshTimestamps(eventModeByPropIdAreaId);
+}
+
+void FakeVehicleHardware::registerRefreshLocked(PropIdAreaId propIdAreaId,
+ VehiclePropertyStore::EventMode eventMode,
+ float sampleRateHz) {
+ if (mRefreshInfoByPropIdAreaId.find(propIdAreaId) != mRefreshInfoByPropIdAreaId.end()) {
+ unregisterRefreshLocked(propIdAreaId);
+ }
+
+ int64_t intervalInNanos = static_cast<int64_t>(1'000'000'000. / sampleRateHz);
+ RefreshInfo refreshInfo = {
+ .eventMode = eventMode,
+ .intervalInNanos = intervalInNanos,
+ };
+ mRefreshInfoByPropIdAreaId[propIdAreaId] = refreshInfo;
+
+ if (mActionByIntervalInNanos.find(intervalInNanos) != mActionByIntervalInNanos.end()) {
+ // If we have already registered for this interval, then add the action info to the
+ // actions list.
+ mActionByIntervalInNanos[intervalInNanos].propIdAreaIdsToRefresh.insert(propIdAreaId);
+ return;
+ }
+
+ // This is the first action for the interval, register a timer callback for that interval.
+ auto action = std::make_shared<RecurrentTimer::Callback>(
+ [this, intervalInNanos] { refreshTimeStampForInterval(intervalInNanos); });
+ mActionByIntervalInNanos[intervalInNanos] = ActionForInterval{
+ .propIdAreaIdsToRefresh = {propIdAreaId},
+ .recurrentAction = action,
+ };
+ mRecurrentTimer->registerTimerCallback(intervalInNanos, action);
+}
+
+void FakeVehicleHardware::unregisterRefreshLocked(PropIdAreaId propIdAreaId) {
+ if (mRefreshInfoByPropIdAreaId.find(propIdAreaId) == mRefreshInfoByPropIdAreaId.end()) {
+ ALOGW("PropId: %" PRId32 ", areaId: %" PRId32 " was not registered for refresh, ignore",
+ propIdAreaId.propId, propIdAreaId.areaId);
+ return;
+ }
+
+ int64_t intervalInNanos = mRefreshInfoByPropIdAreaId[propIdAreaId].intervalInNanos;
+ auto& actionForInterval = mActionByIntervalInNanos[intervalInNanos];
+ actionForInterval.propIdAreaIdsToRefresh.erase(propIdAreaId);
+ if (actionForInterval.propIdAreaIdsToRefresh.empty()) {
+ mRecurrentTimer->unregisterTimerCallback(actionForInterval.recurrentAction);
+ mActionByIntervalInNanos.erase(intervalInNanos);
+ }
+ mRefreshInfoByPropIdAreaId.erase(propIdAreaId);
+}
+
+StatusCode FakeVehicleHardware::subscribePropIdAreaIdLocked(
+ int32_t propId, int32_t areaId, float sampleRateHz, bool enableVariableUpdateRate,
+ const VehiclePropConfig& vehiclePropConfig) {
PropIdAreaId propIdAreaId{
.propId = propId,
.areaId = areaId,
};
- if (mRecurrentActions.find(propIdAreaId) != mRecurrentActions.end()) {
- mRecurrentTimer->unregisterTimerCallback(mRecurrentActions[propIdAreaId]);
+ switch (vehiclePropConfig.changeMode) {
+ case VehiclePropertyChangeMode::STATIC:
+ ALOGW("subscribe to a static property, do nothing.");
+ return StatusCode::OK;
+ case VehiclePropertyChangeMode::ON_CHANGE:
+ mSubOnChangePropIdAreaIds.insert(std::move(propIdAreaId));
+ return StatusCode::OK;
+ case VehiclePropertyChangeMode::CONTINUOUS:
+ if (sampleRateHz == 0.f) {
+ ALOGE("Must not use sample rate 0 for a continuous property");
+ return StatusCode::INTERNAL_ERROR;
+ }
+ // For continuous properties, we must generate a new onPropertyChange event
+ // periodically according to the sample rate.
+ auto eventMode = VehiclePropertyStore::EventMode::ALWAYS;
+ if (isVariableUpdateRateSupported(vehiclePropConfig, areaId) &&
+ enableVariableUpdateRate) {
+ eventMode = VehiclePropertyStore::EventMode::ON_VALUE_CHANGE;
+ }
+
+ registerRefreshLocked(propIdAreaId, eventMode, sampleRateHz);
+ return StatusCode::OK;
}
- if (sampleRate == 0) {
- return StatusCode::OK;
+}
+
+StatusCode FakeVehicleHardware::unsubscribe(int32_t propId, int32_t areaId) {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ PropIdAreaId propIdAreaId{
+ .propId = propId,
+ .areaId = areaId,
+ };
+ if (mRefreshInfoByPropIdAreaId.find(propIdAreaId) != mRefreshInfoByPropIdAreaId.end()) {
+ unregisterRefreshLocked(propIdAreaId);
}
- int64_t interval = static_cast<int64_t>(1'000'000'000. / sampleRate);
- auto action = std::make_shared<RecurrentTimer::Callback>([this, propId, areaId] {
- // Refresh the property value. In real implementation, this should poll the latest value
- // from vehicle bus. Here, we are just refreshing the existing value with a new timestamp.
- auto result = getValue(VehiclePropValue{
- .areaId = areaId,
- .prop = propId,
- .value = {},
- });
- if (!result.ok()) {
- // Failed to read current value, skip refreshing.
- return;
- }
- result.value()->timestamp = elapsedRealtimeNano();
- // For continuous properties, we must generate a new onPropertyChange event periodically
- // according to the sample rate.
- mServerSidePropStore->writeValue(std::move(result.value()), /*updateStatus=*/true,
- VehiclePropertyStore::EventMode::ALWAYS);
- });
- mRecurrentTimer->registerTimerCallback(interval, action);
- mRecurrentActions[propIdAreaId] = action;
+ mSubOnChangePropIdAreaIds.erase(propIdAreaId);
return StatusCode::OK;
}
void FakeVehicleHardware::onValueChangeCallback(const VehiclePropValue& value) {
- if (mOnPropertyChangeCallback == nullptr) {
- return;
+ ATRACE_CALL();
+ onValuesChangeCallback({value});
+}
+
+void FakeVehicleHardware::onValuesChangeCallback(std::vector<VehiclePropValue> values) {
+ ATRACE_CALL();
+ std::vector<VehiclePropValue> subscribedUpdatedValues;
+
+ {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ if (mOnPropertyChangeCallback == nullptr) {
+ return;
+ }
+
+ for (const auto& value : values) {
+ PropIdAreaId propIdAreaId{
+ .propId = value.prop,
+ .areaId = value.areaId,
+ };
+ if (mRefreshInfoByPropIdAreaId.find(propIdAreaId) == mRefreshInfoByPropIdAreaId.end() &&
+ mSubOnChangePropIdAreaIds.find(propIdAreaId) == mSubOnChangePropIdAreaIds.end()) {
+ if (FAKE_VEHICLEHARDWARE_DEBUG) {
+ ALOGD("The updated property value: %s is not subscribed, ignore",
+ value.toString().c_str());
+ }
+ continue;
+ }
+
+ subscribedUpdatedValues.push_back(value);
+ }
}
- std::vector<VehiclePropValue> updatedValues;
- updatedValues.push_back(value);
- (*mOnPropertyChangeCallback)(std::move(updatedValues));
+ (*mOnPropertyChangeCallback)(std::move(subscribedUpdatedValues));
}
void FakeVehicleHardware::loadPropConfigsFromDir(
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp
index fc33e92..9819f3c 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp
@@ -22,11 +22,14 @@
cc_test {
name: "FakeVehicleHardwareTest",
vendor: true,
- srcs: ["*.cpp"],
+ srcs: [
+ "*.cpp",
+ ":VhalTestVendorProperties",
+ ],
cflags: ["-DENABLE_VEHICLE_HAL_TEST_PROPERTIES"],
header_libs: [
"IVehicleHardware",
- "VehicleHalTestUtilHeaders",
+ "libbinder_headers",
],
static_libs: [
"VehicleHalJsonConfigLoaderEnableTestProperties",
@@ -48,7 +51,9 @@
":FakeVehicleHardwareTestOverrideJson",
":FakeVehicleHardwareTestPropJson",
],
- defaults: ["VehicleHalDefaults"],
+ defaults: [
+ "VehicleHalDefaults",
+ ],
test_suites: ["device-tests"],
}
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
index 8d385dd..6d2efd5 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
@@ -19,7 +19,9 @@
#include <FakeObd2Frame.h>
#include <FakeUserHal.h>
#include <PropertyUtils.h>
-#include <TestPropertyUtils.h>
+
+#include <aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.h>
+#include <android/hardware/automotive/vehicle/TestVendorProperty.h>
#include <android-base/expected.h>
#include <android-base/file.h>
@@ -33,6 +35,7 @@
#include <inttypes.h>
#include <chrono>
#include <condition_variable>
+#include <memory>
#include <unordered_map>
#include <unordered_set>
#include <vector>
@@ -60,6 +63,8 @@
namespace fake {
namespace {
+using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand;
+using ::aidl::android::hardware::automotive::vehicle::CruiseControlType;
using ::aidl::android::hardware::automotive::vehicle::ErrorState;
using ::aidl::android::hardware::automotive::vehicle::GetValueRequest;
using ::aidl::android::hardware::automotive::vehicle::GetValueResult;
@@ -67,13 +72,17 @@
using ::aidl::android::hardware::automotive::vehicle::SetValueRequest;
using ::aidl::android::hardware::automotive::vehicle::SetValueResult;
using ::aidl::android::hardware::automotive::vehicle::StatusCode;
+using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions;
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport;
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq;
+using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateShutdownParam;
using ::aidl::android::hardware::automotive::vehicle::VehicleAreaMirror;
using ::aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig;
using ::aidl::android::hardware::automotive::vehicle::VehicleProperty;
+using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus;
+using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue;
using ::aidl::android::hardware::automotive::vehicle::VehicleUnit;
using ::android::base::expected;
@@ -86,6 +95,7 @@
using ::testing::Eq;
using ::testing::HasSubstr;
using ::testing::IsSubsetOf;
+using ::testing::UnorderedElementsAre;
using ::testing::WhenSortedBy;
using std::chrono::milliseconds;
@@ -104,6 +114,10 @@
return mHardware->loadConfigDeclarations();
}
+ std::unordered_set<int32_t> getHvacPowerDependentProps() {
+ return mHardware->hvacPowerDependentProps;
+ }
+
private:
FakeVehicleHardware* mHardware;
};
@@ -137,6 +151,15 @@
mHardware = std::move(hardware);
}
+ static SubscribeOptions newSubscribeOptions(int32_t propId, int32_t areaId,
+ float sampleRateHz) {
+ SubscribeOptions options;
+ options.areaIds = {areaId};
+ options.propId = propId;
+ options.sampleRate = sampleRateHz;
+ return options;
+ }
+
StatusCode setValues(const std::vector<SetValueRequest>& requests) {
{
std::scoped_lock<std::mutex> lockGuard(mLock);
@@ -324,6 +347,13 @@
return mEventCount[propIdAreaId];
}
+ void subscribe(int32_t propId, int32_t areaId, float sampleRateHz) {
+ ASSERT_EQ(StatusCode::OK,
+ getHardware()->subscribe(newSubscribeOptions(propId, areaId, sampleRateHz)))
+ << "failed to subscribe to propId: " << propId << "areaId: " << areaId
+ << ", sampleRateHz: " << sampleRateHz;
+ }
+
static void addSetValueRequest(std::vector<SetValueRequest>& requests,
std::vector<SetValueResult>& expectedResults, int64_t requestId,
const VehiclePropValue& value, StatusCode expectedStatus) {
@@ -358,24 +388,24 @@
}
std::vector<VehiclePropValue> getTestPropValues() {
- VehiclePropValue fuelCapacity = {
- .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY),
- .value = {.floatValues = {1.0}},
+ VehiclePropValue oilLevel = {
+ .prop = toInt(VehicleProperty::ENGINE_OIL_LEVEL),
+ .value = {.int32Values = {1}},
};
- VehiclePropValue leftTirePressure = {
- .prop = toInt(VehicleProperty::TIRE_PRESSURE),
+ VehiclePropValue leftHvacTemp = {
+ .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_CURRENT),
.value = {.floatValues = {170.0}},
- .areaId = WHEEL_FRONT_LEFT,
+ .areaId = SEAT_1_LEFT,
};
- VehiclePropValue rightTirePressure = {
- .prop = toInt(VehicleProperty::TIRE_PRESSURE),
+ VehiclePropValue rightHvacTemp = {
+ .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_CURRENT),
.value = {.floatValues = {180.0}},
- .areaId = WHEEL_FRONT_RIGHT,
+ .areaId = SEAT_1_RIGHT,
};
- return {fuelCapacity, leftTirePressure, rightTirePressure};
+ return {oilLevel, leftHvacTemp, rightHvacTemp};
}
struct PropValueCmp {
@@ -385,6 +415,25 @@
}
} mPropValueCmp;
+ std::unique_ptr<VehiclePropConfig> getVehiclePropConfig(int32_t propertyId) {
+ auto configs = mHardware->getAllPropertyConfigs();
+ for (auto& config : configs) {
+ if (config.prop == propertyId) {
+ auto ptr = std::make_unique<VehiclePropConfig>();
+ ptr->prop = config.prop;
+ ptr->access = config.access;
+ ptr->changeMode = config.changeMode;
+ ptr->areaConfigs = config.areaConfigs;
+ ptr->configArray = config.configArray;
+ ptr->configString = config.configString;
+ ptr->minSampleRate = config.minSampleRate;
+ ptr->maxSampleRate = config.maxSampleRate;
+ return ptr;
+ }
+ }
+ return std::unique_ptr<VehiclePropConfig>(nullptr);
+ }
+
private:
std::unique_ptr<FakeVehicleHardware> mHardware;
std::shared_ptr<IVehicleHardware::SetValuesCallback> mSetValuesCallback;
@@ -406,6 +455,29 @@
ASSERT_EQ(configs.size(), helper.loadConfigDeclarations().size());
}
+TEST_F(FakeVehicleHardwareTest, testGetAllPropertyConfigs_defaultSupportVUR) {
+ std::vector<VehiclePropConfig> configs = getHardware()->getAllPropertyConfigs();
+
+ for (const auto& config : configs) {
+ bool expectedSupportVUR = true;
+ if (config.prop == toInt(VehicleProperty::VHAL_HEARTBEAT) ||
+ config.prop == toInt(VehicleProperty::CLUSTER_HEARTBEAT)) {
+ expectedSupportVUR = false;
+ }
+ EXPECT_GE(config.areaConfigs.size(), 1u)
+ << "expect at least one area config, including global area config, propId: "
+ << config.prop;
+ if (config.areaConfigs.size() == 0) {
+ continue;
+ }
+ for (const auto& areaConfig : config.areaConfigs) {
+ EXPECT_EQ(areaConfig.supportVariableUpdateRate, expectedSupportVUR)
+ << "unexpected supportVariableUpdateRate for propId: " << config.prop
+ << ", areaId: " << areaConfig.areaId;
+ }
+ }
+}
+
TEST_F(FakeVehicleHardwareTest, testGetDefaultValues) {
std::vector<GetValueRequest> getValueRequests;
std::vector<GetValueResult> expectedGetValueResults;
@@ -424,13 +496,13 @@
continue;
}
- if (propId == ECHO_REVERSE_BYTES) {
+ if (propId == toInt(TestVendorProperty::ECHO_REVERSE_BYTES)) {
// Ignore ECHO_REVERSE_BYTES, it has special logic.
continue;
}
- if (propId == VENDOR_PROPERTY_ID) {
- // Ignore VENDOR_PROPERTY_ID, it has special logic.
+ if (propId == toInt(TestVendorProperty::VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING)) {
+ // Ignore VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING, it has special logic.
continue;
}
@@ -528,17 +600,13 @@
ASSERT_THAT(getSetValueResults(), ContainerEq(expectedResults));
}
-TEST_F(FakeVehicleHardwareTest, testRegisterOnPropertyChangeEvent) {
- // We have already registered this callback in Setup, here we are registering again.
- auto callback = std::make_unique<IVehicleHardware::PropertyChangeCallback>(
- [this](const std::vector<VehiclePropValue>& values) { onPropertyChangeEvent(values); });
- getHardware()->registerOnPropertyChangeEvent(std::move(callback));
-
+TEST_F(FakeVehicleHardwareTest, testSetValues_getUpdateEvents) {
auto testValues = getTestPropValues();
std::vector<SetValueRequest> requests;
std::vector<SetValueResult> expectedResults;
int64_t requestId = 1;
for (auto& value : testValues) {
+ subscribe(value.prop, value.areaId, /*sampleRateHz=*/0);
addSetValueRequest(requests, expectedResults, requestId++, value, StatusCode::OK);
}
int64_t timestamp = elapsedRealtimeNano();
@@ -963,7 +1031,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = VENDOR_CLUSTER_REPORT_STATE,
+ .prop = toInt(TestVendorProperty::
+ VENDOR_CLUSTER_REPORT_STATE),
.value.int32Values = {1},
},
},
@@ -980,7 +1049,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = VENDOR_CLUSTER_REQUEST_DISPLAY,
+ .prop = toInt(TestVendorProperty::
+ VENDOR_CLUSTER_REQUEST_DISPLAY),
.value.int32Values = {1},
},
},
@@ -998,7 +1068,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = VENDOR_CLUSTER_NAVIGATION_STATE,
+ .prop = toInt(TestVendorProperty::
+ VENDOR_CLUSTER_NAVIGATION_STATE),
.value.byteValues = {0x1},
},
},
@@ -1008,7 +1079,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = VENDOR_CLUSTER_SWITCH_UI,
+ .prop = toInt(
+ TestVendorProperty::VENDOR_CLUSTER_SWITCH_UI),
.value.int32Values = {1},
},
},
@@ -1025,7 +1097,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = VENDOR_CLUSTER_DISPLAY_STATE,
+ .prop = toInt(TestVendorProperty::
+ VENDOR_CLUSTER_DISPLAY_STATE),
.value.int32Values = {1, 2},
},
},
@@ -1451,7 +1524,7 @@
},
VehiclePropValue{
.prop = toInt(VehicleProperty::CRUISE_CONTROL_TYPE),
- .value.int32Values = {1},
+ .value.int32Values = {2},
},
VehiclePropValue{
.prop = toInt(VehicleProperty::CRUISE_CONTROL_STATE),
@@ -1519,6 +1592,143 @@
},
},
},
+ SetSpecialValueTestCase{
+ .name = "set_low_speed_collision_warning_enabled_false",
+ .valuesToSet =
+ {
+ VehiclePropValue{
+ .prop = toInt(
+ VehicleProperty::
+ LOW_SPEED_COLLISION_WARNING_ENABLED),
+ .value.int32Values = {0},
+ },
+ },
+ .expectedValuesToGet =
+ {
+ VehiclePropValue{
+ .prop = toInt(
+ VehicleProperty::
+ LOW_SPEED_COLLISION_WARNING_ENABLED),
+ .value.int32Values = {0},
+ },
+ VehiclePropValue{
+ .prop = toInt(
+ VehicleProperty::
+ LOW_SPEED_COLLISION_WARNING_STATE),
+ .value.int32Values = {toInt(
+ ErrorState::NOT_AVAILABLE_DISABLED)},
+ },
+ },
+ },
+ SetSpecialValueTestCase{
+ .name = "set_low_speed_collision_warning_enabled_true",
+ .valuesToSet =
+ {
+ VehiclePropValue{
+ .prop = toInt(
+ VehicleProperty::
+ LOW_SPEED_COLLISION_WARNING_ENABLED),
+ .value.int32Values = {1},
+ },
+ },
+ .expectedValuesToGet =
+ {
+ VehiclePropValue{
+ .prop = toInt(
+ VehicleProperty::
+ LOW_SPEED_COLLISION_WARNING_ENABLED),
+ .value.int32Values = {1},
+ },
+ VehiclePropValue{
+ .prop = toInt(
+ VehicleProperty::
+ LOW_SPEED_COLLISION_WARNING_STATE),
+ .value.int32Values = {1},
+ },
+ },
+ },
+ SetSpecialValueTestCase{
+ .name = "set_electronic_stability_control_enabled_false",
+ .valuesToSet =
+ {
+ VehiclePropValue{
+ .prop = toInt(
+ VehicleProperty::
+ ELECTRONIC_STABILITY_CONTROL_ENABLED),
+ .value.int32Values = {0},
+ },
+ },
+ .expectedValuesToGet =
+ {
+ VehiclePropValue{
+ .prop = toInt(
+ VehicleProperty::
+ ELECTRONIC_STABILITY_CONTROL_ENABLED),
+ .value.int32Values = {0},
+ },
+ VehiclePropValue{
+ .prop = toInt(
+ VehicleProperty::
+ ELECTRONIC_STABILITY_CONTROL_STATE),
+ .value.int32Values = {toInt(
+ ErrorState::NOT_AVAILABLE_DISABLED)},
+ },
+ },
+ },
+ SetSpecialValueTestCase{
+ .name = "set_electronic_stability_control_enabled_true",
+ .valuesToSet =
+ {
+ VehiclePropValue{
+ .prop = toInt(
+ VehicleProperty::
+ ELECTRONIC_STABILITY_CONTROL_ENABLED),
+ .value.int32Values = {1},
+ },
+ },
+ .expectedValuesToGet =
+ {
+ VehiclePropValue{
+ .prop = toInt(
+ VehicleProperty::
+ ELECTRONIC_STABILITY_CONTROL_ENABLED),
+ .value.int32Values = {1},
+ },
+ VehiclePropValue{
+ .prop = toInt(
+ VehicleProperty::
+ ELECTRONIC_STABILITY_CONTROL_STATE),
+ .value.int32Values = {1},
+ },
+ },
+ },
+ SetSpecialValueTestCase{
+ .name = "set_shutdown_request",
+ .valuesToSet =
+ {
+ VehiclePropValue{
+ .prop = toInt(VehicleProperty::SHUTDOWN_REQUEST),
+ .value.int32Values =
+ {
+ toInt(VehicleApPowerStateShutdownParam::
+ SHUTDOWN_ONLY),
+ },
+ },
+ },
+ .expectedValuesToGet =
+ {
+ VehiclePropValue{
+ .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ),
+ .value.int32Values =
+ {
+ toInt(VehicleApPowerStateReq::
+ SHUTDOWN_PREPARE),
+ toInt(VehicleApPowerStateShutdownParam::
+ SHUTDOWN_ONLY),
+ },
+ },
+ },
+ },
};
}
@@ -1561,27 +1771,30 @@
return info.param.name;
});
-TEST_F(FakeVehicleHardwareTest, testSetWaitForVhalAfterCarServiceCrash) {
- int32_t propId = toInt(VehicleProperty::AP_POWER_STATE_REPORT);
+TEST_F(FakeVehicleHardwareTest, testSetWaitForVhal_alwaysTriggerEvents) {
+ int32_t powerReq = toInt(VehicleProperty::AP_POWER_STATE_REQ);
+ subscribe(powerReq, /*areaId*/ 0, /*sampleRateHz*/ 0);
+
+ int32_t powerReport = toInt(VehicleProperty::AP_POWER_STATE_REPORT);
VehiclePropValue request = VehiclePropValue{
- .prop = propId,
+ .prop = powerReport,
.value.int32Values = {toInt(VehicleApPowerStateReport::WAIT_FOR_VHAL)},
};
- ASSERT_EQ(setValue(request), StatusCode::OK) << "failed to set property " << propId;
+ ASSERT_EQ(setValue(request), StatusCode::OK) << "failed to set property " << powerReport;
// Clear existing events.
clearChangedProperties();
// Simulate a Car Service crash, Car Service would restart and send the message again.
- ASSERT_EQ(setValue(request), StatusCode::OK) << "failed to set property " << propId;
+ ASSERT_EQ(setValue(request), StatusCode::OK) << "failed to set property " << powerReport;
std::vector<VehiclePropValue> events = getChangedProperties();
// Even though the state is already ON, we should receive another ON event.
- ASSERT_EQ(events.size(), 1u);
+ ASSERT_EQ(events.size(), 1u) << "failed to receive on-change events AP_POWER_STATE_REQ ON";
// Erase the timestamp for comparison.
events[0].timestamp = 0;
auto expectedValue = VehiclePropValue{
- .prop = toInt(VehicleProperty::AP_POWER_STATE_REQ),
+ .prop = powerReq,
.status = VehiclePropertyStatus::AVAILABLE,
.value.int32Values = {toInt(VehicleApPowerStateReq::ON), 0},
};
@@ -1650,23 +1863,35 @@
}
TEST_F(FakeVehicleHardwareTest, testGetHvacPropNotAvailable) {
- int seatAreaIds[5] = {SEAT_1_LEFT, SEAT_1_RIGHT, SEAT_2_LEFT, SEAT_2_CENTER, SEAT_2_RIGHT};
- for (int areaId : seatAreaIds) {
+ FakeVehicleHardwareTestHelper helper(getHardware());
+ auto hvacPowerOnConfig = std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_POWER_ON)));
+ EXPECT_NE(hvacPowerOnConfig, nullptr);
+ for (auto& hvacPowerOnAreaConfig : hvacPowerOnConfig->areaConfigs) {
+ int hvacPowerAreaId = hvacPowerOnAreaConfig.areaId;
+ // Turn off HVAC_POWER_ON for only 1 area ID
StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = areaId,
+ .areaId = hvacPowerAreaId,
.value.int32Values = {0}});
+ EXPECT_EQ(status, StatusCode::OK);
- ASSERT_EQ(status, StatusCode::OK);
-
- for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) {
- int powerPropId = HVAC_POWER_PROPERTIES[i];
- for (int powerDependentAreaId : seatAreaIds) {
+ for (auto& powerPropId : helper.getHvacPowerDependentProps()) {
+ auto powerPropConfig = std::move(getVehiclePropConfig(powerPropId));
+ EXPECT_NE(powerPropConfig, nullptr);
+ if (powerPropConfig->access == VehiclePropertyAccess::WRITE) {
+ continue;
+ }
+ // Try getting a value at each area ID supported by the power dependent property
+ for (auto& powerPropAreaConfig : powerPropConfig->areaConfigs) {
+ int powerDependentAreaId = powerPropAreaConfig.areaId;
auto getValueResult = getValue(VehiclePropValue{
.prop = powerPropId,
.areaId = powerDependentAreaId,
});
- if (areaId == powerDependentAreaId) {
+ // If the current area ID is contained within the HVAC_POWER_ON area ID
+ // turned off, then getValue should fail and a StatusCode error should be
+ // returned. Otherwise, a value should be returned.
+ if ((hvacPowerAreaId & powerDependentAreaId) == powerDependentAreaId) {
EXPECT_FALSE(getValueResult.ok());
EXPECT_EQ(getValueResult.error(), StatusCode::NOT_AVAILABLE_DISABLED);
} else {
@@ -1679,28 +1904,45 @@
// on this value from any power dependent property values other than those with the same
// areaId.
setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = areaId,
+ .areaId = hvacPowerAreaId,
.value.int32Values = {1}});
}
}
TEST_F(FakeVehicleHardwareTest, testSetHvacPropNotAvailable) {
- int seatAreaIds[5] = {SEAT_1_LEFT, SEAT_1_RIGHT, SEAT_2_LEFT, SEAT_2_CENTER, SEAT_2_RIGHT};
- for (int areaId : seatAreaIds) {
+ FakeVehicleHardwareTestHelper helper(getHardware());
+ auto hvacPowerOnConfig = std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_POWER_ON)));
+ EXPECT_NE(hvacPowerOnConfig, nullptr);
+ for (auto& hvacPowerOnAreaConfig : hvacPowerOnConfig->areaConfigs) {
+ int hvacPowerAreaId = hvacPowerOnAreaConfig.areaId;
+ // Turn off HVAC_POWER_ON for only 1 area ID
StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = areaId,
+ .areaId = hvacPowerAreaId,
.value.int32Values = {0}});
+ EXPECT_EQ(status, StatusCode::OK);
- ASSERT_EQ(status, StatusCode::OK);
+ for (auto& powerPropId : helper.getHvacPowerDependentProps()) {
+ auto powerPropConfig = std::move(getVehiclePropConfig(powerPropId));
+ EXPECT_NE(powerPropConfig, nullptr);
+ if (powerPropConfig->access == VehiclePropertyAccess::READ) {
+ continue;
+ }
+ auto propType = getPropType(powerPropId);
+ // Try setting a value at each area ID supported by the power dependent property
+ for (auto& powerPropAreaConfig : powerPropConfig->areaConfigs) {
+ int powerDependentAreaId = powerPropAreaConfig.areaId;
+ auto val = VehiclePropValue{.prop = powerPropId, .areaId = powerDependentAreaId};
+ if (propType == VehiclePropertyType::FLOAT) {
+ val.value.floatValues.emplace_back(20);
+ } else {
+ val.value.int32Values.emplace_back(1);
+ }
+ status = setValue(val);
- for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) {
- int powerPropId = HVAC_POWER_PROPERTIES[i];
- for (int powerDependentAreaId : seatAreaIds) {
- StatusCode status = setValue(VehiclePropValue{.prop = powerPropId,
- .areaId = powerDependentAreaId,
- .value.int32Values = {1}});
-
- if (areaId == powerDependentAreaId) {
+ // If the current area ID is contained within the HVAC_POWER_ON area ID
+ // turned off, then setValue should fail and a StatusCode error should be
+ // returned. Otherwise, an ok StatusCode should be returned.
+ if ((hvacPowerAreaId & powerDependentAreaId) == powerDependentAreaId) {
EXPECT_EQ(status, StatusCode::NOT_AVAILABLE_DISABLED);
} else {
EXPECT_EQ(status, StatusCode::OK);
@@ -1712,37 +1954,142 @@
// on this value from any power dependent property values other than those with the same
// areaId.
setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = areaId,
+ .areaId = hvacPowerAreaId,
.value.int32Values = {1}});
}
}
TEST_F(FakeVehicleHardwareTest, testHvacPowerOnSendCurrentHvacPropValues) {
- int seatAreaIds[5] = {SEAT_1_LEFT, SEAT_1_RIGHT, SEAT_2_LEFT, SEAT_2_CENTER, SEAT_2_RIGHT};
- for (int areaId : seatAreaIds) {
+ FakeVehicleHardwareTestHelper helper(getHardware());
+ auto hvacPowerOnConfig = std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_POWER_ON)));
+ EXPECT_NE(hvacPowerOnConfig, nullptr);
+ for (auto& hvacPowerOnAreaConfig : hvacPowerOnConfig->areaConfigs) {
+ int hvacPowerAreaId = hvacPowerOnAreaConfig.areaId;
StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = areaId,
+ .areaId = hvacPowerAreaId,
.value.int32Values = {0}});
-
- ASSERT_EQ(status, StatusCode::OK);
-
- clearChangedProperties();
- setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
- .areaId = areaId,
- .value.int32Values = {1}});
-
+ EXPECT_EQ(status, StatusCode::OK);
auto events = getChangedProperties();
- // If we turn HVAC power on, we expect to receive one property event for every HVAC prop
- // areas plus one event for HVAC_POWER_ON.
- std::vector<int32_t> changedPropIds;
- for (size_t i = 0; i < sizeof(HVAC_POWER_PROPERTIES) / sizeof(int32_t); i++) {
- changedPropIds.push_back(HVAC_POWER_PROPERTIES[i]);
- }
- changedPropIds.push_back(toInt(VehicleProperty::HVAC_POWER_ON));
-
for (const auto& event : events) {
- EXPECT_EQ(event.areaId, areaId);
- EXPECT_THAT(event.prop, AnyOfArray(changedPropIds));
+ // Ignore HVAC_POWER_ON event
+ if (event.prop == toInt(VehicleProperty::HVAC_POWER_ON)) {
+ continue;
+ }
+ EXPECT_THAT(event.prop, AnyOfArray(helper.getHvacPowerDependentProps()));
+ EXPECT_EQ((hvacPowerAreaId & event.areaId), hvacPowerAreaId);
+ EXPECT_EQ(event.status, VehiclePropertyStatus::UNAVAILABLE);
+ }
+ clearChangedProperties();
+
+ status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_POWER_ON),
+ .areaId = hvacPowerAreaId,
+ .value.int32Values = {1}});
+ EXPECT_EQ(status, StatusCode::OK);
+ events = getChangedProperties();
+ for (const auto& event : events) {
+ // Ignore HVAC_POWER_ON event
+ if (event.prop == toInt(VehicleProperty::HVAC_POWER_ON)) {
+ continue;
+ }
+ EXPECT_THAT(event.prop, AnyOfArray(helper.getHvacPowerDependentProps()));
+ EXPECT_EQ((hvacPowerAreaId & event.areaId), hvacPowerAreaId);
+ EXPECT_EQ(event.status, VehiclePropertyStatus::AVAILABLE);
+ }
+ clearChangedProperties();
+ }
+}
+
+TEST_F(FakeVehicleHardwareTest, testHvacDualOnSynchronizesTemp) {
+ auto hvacDualOnConfig = std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_DUAL_ON)));
+ auto hvacTemperatureSetConfig =
+ std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_TEMPERATURE_SET)));
+ EXPECT_NE(hvacDualOnConfig, nullptr);
+ EXPECT_NE(hvacTemperatureSetConfig, nullptr);
+ for (auto& hvacTemperatureSetConfig : hvacTemperatureSetConfig->areaConfigs) {
+ int32_t hvacTemperatureSetAreaId = hvacTemperatureSetConfig.areaId;
+ subscribe(toInt(VehicleProperty::HVAC_TEMPERATURE_SET), hvacTemperatureSetAreaId,
+ /*sampleRateHz*/ 0);
+ }
+ for (auto& hvacDualOnConfig : hvacDualOnConfig->areaConfigs) {
+ int32_t hvacDualOnAreaId = hvacDualOnConfig.areaId;
+ subscribe(toInt(VehicleProperty::HVAC_DUAL_ON), hvacDualOnAreaId, /*sampleRateHz*/ 0);
+ StatusCode status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_DUAL_ON),
+ .areaId = hvacDualOnAreaId,
+ .value.int32Values = {1}});
+ EXPECT_EQ(status, StatusCode::OK);
+
+ // Verify there's an event for all HVAC_TEMPERATURE_SET
+ // area IDs covered by the HVAC_DUAL_ON area ID
+ auto events = getChangedProperties();
+ std::unordered_set<float> temperatureValues;
+ for (const auto& event : events) {
+ // Ignore HVAC_DUAL_ON event
+ if (event.prop == toInt(VehicleProperty::HVAC_DUAL_ON)) {
+ continue;
+ }
+ EXPECT_EQ(event.prop, toInt(VehicleProperty::HVAC_TEMPERATURE_SET));
+ EXPECT_EQ((hvacDualOnAreaId & event.areaId), event.areaId);
+ EXPECT_EQ(1u, event.value.floatValues.size());
+ temperatureValues.insert(event.value.floatValues[0]);
+ }
+ // Verify that the temperature value is the same for all events
+ // Ie the temperature in all area IDs are synchronized
+ EXPECT_EQ(1u, temperatureValues.size());
+ clearChangedProperties();
+
+ // Verify when any HVAC_TEMPERATURE_SET area ID is changed all
+ // area IDs covered by the HVAC_DUAL_ON area ID are also changed
+ for (auto& hvacTemperatureSetConfig : hvacTemperatureSetConfig->areaConfigs) {
+ int32_t hvacTemperatureSetAreaId = hvacTemperatureSetConfig.areaId;
+ if ((hvacDualOnAreaId & hvacTemperatureSetAreaId) != hvacTemperatureSetAreaId) {
+ continue;
+ }
+ float expectedValue = 25;
+ status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
+ .areaId = hvacTemperatureSetAreaId,
+ .value.floatValues = {expectedValue}});
+ EXPECT_EQ(status, StatusCode::OK);
+ events = getChangedProperties();
+ for (const auto& event : events) {
+ EXPECT_EQ(event.prop, toInt(VehicleProperty::HVAC_TEMPERATURE_SET));
+ EXPECT_EQ(1u, event.value.floatValues.size());
+ EXPECT_EQ(expectedValue, event.value.floatValues[0]);
+ }
+ clearChangedProperties();
+ }
+
+ status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_DUAL_ON),
+ .areaId = hvacDualOnAreaId,
+ .value.int32Values = {0}});
+ EXPECT_EQ(status, StatusCode::OK);
+
+ // When HVAC_DUAL_ON is disabled, there should be no events created
+ // for HVAC_TEMPERATURE_SET ie no temperature synchronization.
+ events = getChangedProperties();
+ EXPECT_EQ(1u, events.size());
+ EXPECT_EQ(events[0].prop, toInt(VehicleProperty::HVAC_DUAL_ON));
+ EXPECT_EQ(events[0].areaId, hvacDualOnAreaId);
+ clearChangedProperties();
+
+ // Verify when any HVAC_TEMPERATURE_SET area ID is
+ // changed other area IDs do not change.
+ for (auto& hvacTemperatureSetConfig : hvacTemperatureSetConfig->areaConfigs) {
+ int32_t hvacTemperatureSetAreaId = hvacTemperatureSetConfig.areaId;
+ if ((hvacDualOnAreaId & hvacTemperatureSetAreaId) != hvacTemperatureSetAreaId) {
+ continue;
+ }
+ float expectedValue = 24;
+ status = setValue(VehiclePropValue{.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET),
+ .areaId = hvacTemperatureSetAreaId,
+ .value.floatValues = {expectedValue}});
+ EXPECT_EQ(status, StatusCode::OK);
+ events = getChangedProperties();
+ EXPECT_EQ(1u, events.size());
+ EXPECT_EQ(events[0].prop, toInt(VehicleProperty::HVAC_TEMPERATURE_SET));
+ EXPECT_EQ(events[0].areaId, hvacTemperatureSetAreaId);
+ EXPECT_EQ(1u, events[0].value.floatValues.size());
+ EXPECT_EQ(expectedValue, events[0].value.floatValues[0]);
+ clearChangedProperties();
}
}
}
@@ -1804,6 +2151,47 @@
}
}
+TEST_F(FakeVehicleHardwareTest, testGetAccPropertiesOnStandardCc) {
+ std::vector<int32_t> ccTypeDependentProperties = {
+ toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP),
+ toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE),
+ };
+
+ StatusCode status =
+ setValue(VehiclePropValue{.prop = toInt(VehicleProperty::CRUISE_CONTROL_TYPE),
+ .value.int32Values = {toInt(CruiseControlType::STANDARD)}});
+ EXPECT_EQ(status, StatusCode::OK);
+
+ for (int32_t dependentProp : ccTypeDependentProperties) {
+ auto getValueResult = getValue(VehiclePropValue{.prop = dependentProp});
+ EXPECT_FALSE(getValueResult.ok());
+ EXPECT_EQ(getValueResult.error(), StatusCode::NOT_AVAILABLE_DISABLED);
+ }
+}
+
+TEST_F(FakeVehicleHardwareTest, testSetAccPropertiesOnStandardCc) {
+ std::vector<VehiclePropValue> testVehiclePropValues = {
+ VehiclePropValue{
+ .prop = toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP),
+ .value.int32Values = {3}},
+ VehiclePropValue{
+ .prop = toInt(VehicleProperty::CRUISE_CONTROL_COMMAND),
+ .value.int32Values = {toInt(CruiseControlCommand::INCREASE_TARGET_TIME_GAP)}},
+ VehiclePropValue{
+ .prop = toInt(VehicleProperty::CRUISE_CONTROL_COMMAND),
+ .value.int32Values = {toInt(CruiseControlCommand::DECREASE_TARGET_TIME_GAP)}}};
+
+ StatusCode status =
+ setValue(VehiclePropValue{.prop = toInt(VehicleProperty::CRUISE_CONTROL_TYPE),
+ .value.int32Values = {toInt(CruiseControlType::STANDARD)}});
+ EXPECT_EQ(status, StatusCode::OK);
+
+ for (auto value : testVehiclePropValues) {
+ status = setValue(value);
+ EXPECT_EQ(status, StatusCode::NOT_AVAILABLE_DISABLED);
+ }
+}
+
TEST_F(FakeVehicleHardwareTest, testSendAdasPropertiesState) {
std::unordered_map<int32_t, std::vector<int32_t>> adasEnabledPropToAdasPropWithErrorState = {
// AEB
@@ -1871,7 +2259,37 @@
toInt(VehicleProperty::HANDS_ON_DETECTION_WARNING),
},
},
+ // LSCW
+ {
+ toInt(VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED),
+ {
+ toInt(VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE),
+ },
+ },
+ // ESC
+ {
+ toInt(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED),
+ {
+ toInt(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE),
+ },
+ },
};
+
+ // First subscribe to all the properties that we will change.
+ for (auto& enabledToErrorStateProps : adasEnabledPropToAdasPropWithErrorState) {
+ std::unordered_set<int32_t> expectedChangedPropIds(enabledToErrorStateProps.second.begin(),
+ enabledToErrorStateProps.second.end());
+ expectedChangedPropIds.insert(enabledToErrorStateProps.first);
+
+ for (int32_t propId : expectedChangedPropIds) {
+ int32_t areaId = 0;
+ if (propId == toInt(VehicleProperty::BLIND_SPOT_WARNING_STATE)) {
+ areaId = toInt(VehicleAreaMirror::DRIVER_LEFT);
+ }
+ subscribe(propId, areaId, /*sampleRateHz*/ 0);
+ }
+ }
+
for (auto& enabledToErrorStateProps : adasEnabledPropToAdasPropWithErrorState) {
int32_t adasEnabledPropertyId = enabledToErrorStateProps.first;
StatusCode status =
@@ -1952,9 +2370,16 @@
}
TEST_F(FakeVehicleHardwareTest, testSwitchUser) {
+ SubscribeOptions options;
+ int32_t propSwitchUser = toInt(VehicleProperty::SWITCH_USER);
+ options.propId = propSwitchUser;
+ options.areaIds = {0, 1};
+ ASSERT_EQ(StatusCode::OK, getHardware()->subscribe(options))
+ << "failed to subscribe to propId: " << propSwitchUser;
+
// This is the same example as used in User HAL Emulation doc.
VehiclePropValue valueToSet = {
- .prop = toInt(VehicleProperty::SWITCH_USER),
+ .prop = propSwitchUser,
.areaId = 1,
.value.int32Values = {666, 3, 2},
};
@@ -1965,7 +2390,7 @@
// Simulate a request from Android side.
VehiclePropValue switchUserRequest = {
- .prop = toInt(VehicleProperty::SWITCH_USER),
+ .prop = propSwitchUser,
.areaId = 0,
.value.int32Values = {666, 3},
};
@@ -1995,7 +2420,7 @@
events[0].timestamp = 0;
auto expectedValue = VehiclePropValue{
.areaId = 0,
- .prop = toInt(VehicleProperty::SWITCH_USER),
+ .prop = propSwitchUser,
.value.int32Values =
{
// Request ID
@@ -2010,6 +2435,13 @@
}
TEST_F(FakeVehicleHardwareTest, testCreateUser) {
+ SubscribeOptions options;
+ int32_t propCreateUser = toInt(VehicleProperty::CREATE_USER);
+ options.propId = propCreateUser;
+ options.areaIds = {0, 1};
+ ASSERT_EQ(StatusCode::OK, getHardware()->subscribe(options))
+ << "failed to subscribe to propId: " << propCreateUser;
+
// This is the same example as used in User HAL Emulation doc.
VehiclePropValue valueToSet = {
.prop = toInt(VehicleProperty::CREATE_USER),
@@ -2023,7 +2455,7 @@
// Simulate a request from Android side.
VehiclePropValue createUserRequest = {
- .prop = toInt(VehicleProperty::CREATE_USER),
+ .prop = propCreateUser,
.areaId = 0,
.value.int32Values = {666},
};
@@ -2052,7 +2484,7 @@
events[0].timestamp = 0;
auto expectedValue = VehiclePropValue{
.areaId = 0,
- .prop = toInt(VehicleProperty::CREATE_USER),
+ .prop = propCreateUser,
.value.int32Values =
{
// Request ID
@@ -2065,9 +2497,16 @@
}
TEST_F(FakeVehicleHardwareTest, testInitialUserInfo) {
+ SubscribeOptions options;
+ int32_t propInitialUserInfo = toInt(VehicleProperty::INITIAL_USER_INFO);
+ options.propId = propInitialUserInfo;
+ options.areaIds = {0, 1};
+ ASSERT_EQ(StatusCode::OK, getHardware()->subscribe(options))
+ << "failed to subscribe to propId: " << propInitialUserInfo;
+
// This is the same example as used in User HAL Emulation doc.
VehiclePropValue valueToSet = {
- .prop = toInt(VehicleProperty::INITIAL_USER_INFO),
+ .prop = propInitialUserInfo,
.areaId = 1,
.value.int32Values = {666, 1, 11},
};
@@ -2078,7 +2517,7 @@
// Simulate a request from Android side.
VehiclePropValue initialUserInfoRequest = {
- .prop = toInt(VehicleProperty::INITIAL_USER_INFO),
+ .prop = propInitialUserInfo,
.areaId = 0,
.value.int32Values = {3},
};
@@ -2095,7 +2534,7 @@
events[0].timestamp = 0;
auto expectedValue = VehiclePropValue{
.areaId = 0,
- .prop = toInt(VehicleProperty::INITIAL_USER_INFO),
+ .prop = propInitialUserInfo,
.value.int32Values = {3, 1, 11},
};
EXPECT_EQ(events[0], expectedValue);
@@ -2110,7 +2549,7 @@
events[0].timestamp = 0;
expectedValue = VehiclePropValue{
.areaId = 0,
- .prop = toInt(VehicleProperty::INITIAL_USER_INFO),
+ .prop = propInitialUserInfo,
.value.int32Values =
{
// Request ID
@@ -2252,13 +2691,14 @@
}
TEST_F(FakeVehicleHardwareTest, testDumpInjectEvent) {
- int32_t prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED);
+ int32_t prop = toInt(VehicleProperty::ENGINE_OIL_LEVEL);
std::string propIdStr = std::to_string(prop);
+ subscribe(prop, /*areaId*/ 0, /*sampleRateHz*/ 0);
+
int64_t timestamp = elapsedRealtimeNano();
- // Inject an event with float value 123.4 and timestamp.
DumpResult result = getHardware()->dump(
- {"--inject-event", propIdStr, "-f", "123.4", "-t", std::to_string(timestamp)});
+ {"--inject-event", propIdStr, "-i", "1234", "-t", std::to_string(timestamp)});
ASSERT_FALSE(result.callerShouldDumpState);
ASSERT_THAT(result.buffer,
@@ -2269,7 +2709,7 @@
ASSERT_EQ(events.size(), 1u);
auto event = events[0];
ASSERT_EQ(event.timestamp, timestamp);
- ASSERT_EQ(event.value.floatValues, std::vector<float>({123.4}));
+ ASSERT_EQ(event.value.int32Values, std::vector<int32_t>({1234}));
}
TEST_F(FakeVehicleHardwareTest, testDumpInvalidOptions) {
@@ -2612,9 +3052,13 @@
});
TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataLinear) {
- // Start a fake linear data generator for vehicle speed at 0.1s interval.
+ // Start a fake linear data generator for engine oil level at 0.1s interval.
// range: 0 - 100, current value: 30, step: 20.
- std::string propIdString = StringPrintf("%d", toInt(VehicleProperty::PERF_VEHICLE_SPEED));
+ int32_t prop = toInt(VehicleProperty::ENGINE_OIL_LEVEL);
+
+ subscribe(prop, /*areaId*/ 0, /*sampleRateHz*/ 0);
+
+ std::string propIdString = StringPrintf("%d", prop);
std::vector<std::string> options = {"--genfakedata", "--startlinear", propIdString,
/*middleValue=*/"50",
/*currentValue=*/"30",
@@ -2627,15 +3071,14 @@
ASSERT_FALSE(result.callerShouldDumpState);
ASSERT_THAT(result.buffer, HasSubstr("successfully"));
- ASSERT_TRUE(waitForChangedProperties(toInt(VehicleProperty::PERF_VEHICLE_SPEED), 0, /*count=*/5,
- milliseconds(1000)))
+ ASSERT_TRUE(waitForChangedProperties(prop, 0, /*count=*/5, milliseconds(1000)))
<< "not enough events generated for linear data generator";
int32_t value = 30;
auto events = getChangedProperties();
for (size_t i = 0; i < 5; i++) {
- ASSERT_EQ(1u, events[i].value.floatValues.size());
- EXPECT_EQ(static_cast<float>(value), events[i].value.floatValues[0]);
+ ASSERT_EQ(1u, events[i].value.int32Values.size());
+ EXPECT_EQ(value, events[i].value.int32Values[0]);
value = (value + 20) % 100;
}
@@ -2651,7 +3094,7 @@
std::this_thread::sleep_for(std::chrono::milliseconds(200));
// There should be no new events generated.
- EXPECT_EQ(0u, getEventCount(toInt(VehicleProperty::PERF_VEHICLE_SPEED), 0));
+ EXPECT_EQ(0u, getEventCount(prop, 0));
}
std::string getTestFilePath(const char* filename) {
@@ -2660,6 +3103,8 @@
}
TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataJson) {
+ subscribe(toInt(VehicleProperty::GEAR_SELECTION), /*areaId*/ 0, /*sampleRateHz*/ 0);
+
std::vector<std::string> options = {"--genfakedata", "--startjson", "--path",
getTestFilePath("prop.json"), "2"};
@@ -2686,6 +3131,8 @@
}
TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataJsonByContent) {
+ subscribe(toInt(VehicleProperty::GEAR_SELECTION), /*areaId*/ 0, /*sampleRateHz*/ 0);
+
std::vector<std::string> options = {
"--genfakedata", "--startjson", "--content",
"[{\"timestamp\":1000000,\"areaId\":0,\"value\":8,\"prop\":289408000}]", "1"};
@@ -2760,8 +3207,11 @@
}
TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataKeyPress) {
+ int32_t propHwKeyInput = toInt(VehicleProperty::HW_KEY_INPUT);
std::vector<std::string> options = {"--genfakedata", "--keypress", "1", "2"};
+ subscribe(propHwKeyInput, /*areaId*/ 0, /*sampleRateHz*/ 0);
+
DumpResult result = getHardware()->dump(options);
ASSERT_FALSE(result.callerShouldDumpState);
@@ -2769,8 +3219,8 @@
auto events = getChangedProperties();
ASSERT_EQ(2u, events.size());
- EXPECT_EQ(toInt(VehicleProperty::HW_KEY_INPUT), events[0].prop);
- EXPECT_EQ(toInt(VehicleProperty::HW_KEY_INPUT), events[1].prop);
+ EXPECT_EQ(propHwKeyInput, events[0].prop);
+ EXPECT_EQ(propHwKeyInput, events[1].prop);
ASSERT_EQ(3u, events[0].value.int32Values.size());
ASSERT_EQ(3u, events[1].value.int32Values.size());
EXPECT_EQ(toInt(VehicleHwKeyInputAction::ACTION_DOWN), events[0].value.int32Values[0]);
@@ -2782,8 +3232,11 @@
}
TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataKeyInputV2) {
+ int32_t propHwKeyInputV2 = toInt(VehicleProperty::HW_KEY_INPUT_V2);
std::vector<std::string> options = {"--genfakedata", "--keyinputv2", "1", "2", "3", "4", "5"};
+ subscribe(propHwKeyInputV2, /*areaId*/ 1, /*sampleRateHz*/ 0);
+
DumpResult result = getHardware()->dump(options);
ASSERT_FALSE(result.callerShouldDumpState);
@@ -2801,6 +3254,7 @@
}
TEST_F(FakeVehicleHardwareTest, testDebugGenFakeDataMotionInput) {
+ int32_t propHwMotionInput = toInt(VehicleProperty::HW_MOTION_INPUT);
std::vector<std::string> options = {"--genfakedata",
"--motioninput",
"1",
@@ -2823,6 +3277,8 @@
"65.5",
"76.6"};
+ subscribe(propHwMotionInput, /*areaId*/ 1, /*sampleRateHz*/ 0);
+
DumpResult result = getHardware()->dump(options);
ASSERT_FALSE(result.callerShouldDumpState);
@@ -2830,7 +3286,7 @@
auto events = getChangedProperties();
ASSERT_EQ(1u, events.size());
- EXPECT_EQ(toInt(VehicleProperty::HW_MOTION_INPUT), events[0].prop);
+ EXPECT_EQ(propHwMotionInput, events[0].prop);
ASSERT_EQ(9u, events[0].value.int32Values.size());
EXPECT_EQ(2, events[0].value.int32Values[0]);
EXPECT_EQ(3, events[0].value.int32Values[1]);
@@ -2855,7 +3311,7 @@
TEST_F(FakeVehicleHardwareTest, testGetEchoReverseBytes) {
ASSERT_EQ(setValue(VehiclePropValue{
- .prop = ECHO_REVERSE_BYTES,
+ .prop = toInt(TestVendorProperty::ECHO_REVERSE_BYTES),
.value =
{
.byteValues = {0x01, 0x02, 0x03, 0x04},
@@ -2864,30 +3320,34 @@
StatusCode::OK);
auto result = getValue(VehiclePropValue{
- .prop = ECHO_REVERSE_BYTES,
+ .prop = toInt(TestVendorProperty::ECHO_REVERSE_BYTES),
});
ASSERT_TRUE(result.ok()) << "failed to get ECHO_REVERSE_BYTES value: " << getStatus(result);
ASSERT_EQ(result.value().value.byteValues, std::vector<uint8_t>({0x04, 0x03, 0x02, 0x01}));
}
-TEST_F(FakeVehicleHardwareTest, testUpdateSampleRate) {
+TEST_F(FakeVehicleHardwareTest, testSubscribeUnsubscribe_continuous) {
int32_t propSpeed = toInt(VehicleProperty::PERF_VEHICLE_SPEED);
int32_t propSteering = toInt(VehicleProperty::PERF_STEERING_ANGLE);
int32_t areaId = 0;
- getHardware()->updateSampleRate(propSpeed, areaId, 5);
+
+ auto status = getHardware()->subscribe(newSubscribeOptions(propSpeed, areaId, 5));
+ ASSERT_EQ(status, StatusCode::OK) << "failed to subscribe";
ASSERT_TRUE(waitForChangedProperties(propSpeed, areaId, /*count=*/5, milliseconds(1500)))
<< "not enough events generated for speed";
- getHardware()->updateSampleRate(propSteering, areaId, 10);
+ status = getHardware()->subscribe(newSubscribeOptions(propSteering, areaId, 10));
+ ASSERT_EQ(status, StatusCode::OK) << "failed to subscribe";
ASSERT_TRUE(waitForChangedProperties(propSteering, areaId, /*count=*/10, milliseconds(1500)))
<< "not enough events generated for steering";
int64_t timestamp = elapsedRealtimeNano();
// Disable refreshing for propSpeed.
- getHardware()->updateSampleRate(propSpeed, areaId, 0);
+ status = getHardware()->unsubscribe(propSpeed, areaId);
+ ASSERT_EQ(status, StatusCode::OK) << "failed to unsubscribe";
clearChangedProperties();
ASSERT_TRUE(waitForChangedProperties(propSteering, areaId, /*count=*/5, milliseconds(1500)))
@@ -2900,12 +3360,99 @@
}
}
+TEST_F(FakeVehicleHardwareTest, testSubscribe_enableVUR) {
+ int32_t propSpeed = toInt(VehicleProperty::PERF_VEHICLE_SPEED);
+ int32_t areaId = 0;
+ SubscribeOptions options;
+ options.propId = propSpeed;
+ options.areaIds = {areaId};
+ options.enableVariableUpdateRate = true;
+ options.sampleRate = 5;
+ int64_t timestamp = elapsedRealtimeNano();
+
+ auto status = getHardware()->subscribe(options);
+ ASSERT_EQ(status, StatusCode::OK) << "failed to subscribe";
+
+ status = setValue({
+ .prop = propSpeed,
+ .areaId = 0,
+ .value.floatValues = {1.1f},
+ });
+ ASSERT_EQ(status, StatusCode::OK) << "failed to set speed";
+
+ status = setValue({
+ .prop = propSpeed,
+ .areaId = 0,
+ .value.floatValues = {1.2f},
+ });
+ ASSERT_EQ(status, StatusCode::OK) << "failed to set speed";
+
+ ASSERT_TRUE(waitForChangedProperties(propSpeed, areaId, /*count=*/2, milliseconds(100)))
+ << "not enough events generated for speed";
+ auto updatedValues = getChangedProperties();
+ std::unordered_set<float> gotValues;
+ for (auto& value : updatedValues) {
+ EXPECT_GE(value.timestamp, timestamp) << "timestamp must be updated";
+ EXPECT_EQ(value.prop, propSpeed) << "propId must be correct";
+ EXPECT_EQ(value.areaId, areaId) << "areaId must be correct";
+ gotValues.insert(value.value.floatValues[0]);
+ }
+ EXPECT_THAT(gotValues, UnorderedElementsAre(1.1f, 1.2f))
+ << "must only receive property event for changed value";
+}
+
+TEST_F(FakeVehicleHardwareTest, testSubscribeUnusubscribe_onChange) {
+ int32_t propHvac = toInt(VehicleProperty::HVAC_TEMPERATURE_SET);
+ int32_t areaId = SEAT_1_LEFT;
+
+ auto status = getHardware()->subscribe(newSubscribeOptions(propHvac, areaId, 0));
+ ASSERT_EQ(status, StatusCode::OK) << "failed to subscribe";
+
+ status = setValue({
+ .prop = propHvac,
+ .areaId = areaId,
+ .value.floatValues = {20.0f},
+ });
+ ASSERT_EQ(status, StatusCode::OK) << "failed to set hvac value";
+
+ ASSERT_TRUE(waitForChangedProperties(propHvac, areaId, /*count=*/1, milliseconds(100)))
+ << "not enough on change events generated for hvac";
+ clearChangedProperties();
+
+ status = setValue({
+ .prop = propHvac,
+ .areaId = areaId,
+ .value.floatValues = {21.0f},
+ });
+ ASSERT_EQ(status, StatusCode::OK) << "failed to set hvac value";
+
+ ASSERT_TRUE(waitForChangedProperties(propHvac, areaId, /*count=*/1, milliseconds(100)))
+ << "not enough on change events generated for hvac";
+ clearChangedProperties();
+
+ status = getHardware()->unsubscribe(propHvac, areaId);
+ ASSERT_EQ(status, StatusCode::OK);
+
+ status = setValue({
+ .prop = propHvac,
+ .areaId = areaId,
+ .value.floatValues = {22.0f},
+ });
+ ASSERT_EQ(status, StatusCode::OK) << "failed to set hvac value";
+
+ ASSERT_FALSE(waitForChangedProperties(propHvac, areaId, /*count=*/1, milliseconds(100)))
+ << "must not receive on change events if the propId, areaId is unsubscribed";
+}
+
TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) {
float CELSIUS = static_cast<float>(toInt(VehicleUnit::CELSIUS));
float FAHRENHEIT = static_cast<float>(toInt(VehicleUnit::FAHRENHEIT));
+ int32_t propHvacTempValueSuggest = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION);
+
+ subscribe(propHvacTempValueSuggest, HVAC_ALL, /*sampleRateHz*/ 0);
VehiclePropValue floatArraySizeFour = {
- .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {0, CELSIUS, 0, 0},
};
@@ -2913,14 +3460,14 @@
EXPECT_EQ(status, StatusCode::OK);
VehiclePropValue floatArraySizeZero = {
- .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
};
status = setValue(floatArraySizeZero);
EXPECT_EQ(status, StatusCode::INVALID_ARG);
VehiclePropValue floatArraySizeFive = {
- .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {0, CELSIUS, 0, 0, 0},
};
@@ -2928,7 +3475,7 @@
EXPECT_EQ(status, StatusCode::INVALID_ARG);
VehiclePropValue invalidUnit = {
- .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {0, 0, 0, 0},
};
@@ -2938,13 +3485,8 @@
// Config array values from HVAC_TEMPERATURE_SET in DefaultProperties.json
auto configs = getHardware()->getAllPropertyConfigs();
- VehiclePropConfig* hvacTemperatureSetConfig = nullptr;
- for (auto& config : configs) {
- if (config.prop == toInt(VehicleProperty::HVAC_TEMPERATURE_SET)) {
- hvacTemperatureSetConfig = &config;
- break;
- }
- }
+ auto hvacTemperatureSetConfig =
+ std::move(getVehiclePropConfig(toInt(VehicleProperty::HVAC_TEMPERATURE_SET)));
EXPECT_NE(hvacTemperatureSetConfig, nullptr);
auto& hvacTemperatureSetConfigArray = hvacTemperatureSetConfig->configArray;
@@ -2964,9 +3506,7 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {minTempInCelsius, CELSIUS, 0, 0},
},
@@ -2974,9 +3514,7 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {minTempInCelsius, CELSIUS,
minTempInCelsius,
@@ -2989,9 +3527,7 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {minTempInFahrenheit, FAHRENHEIT,
0, 0},
@@ -3000,9 +3536,7 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {minTempInFahrenheit, FAHRENHEIT,
minTempInCelsius,
@@ -3015,9 +3549,7 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {maxTempInCelsius, CELSIUS, 0, 0},
},
@@ -3025,9 +3557,7 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {maxTempInCelsius, CELSIUS,
maxTempInCelsius,
@@ -3040,9 +3570,7 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {maxTempInFahrenheit, FAHRENHEIT,
0, 0},
@@ -3051,9 +3579,7 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {maxTempInFahrenheit, FAHRENHEIT,
maxTempInCelsius,
@@ -3066,9 +3592,7 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {minTempInCelsius - 1, CELSIUS, 0,
0},
@@ -3077,9 +3601,7 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {minTempInCelsius - 1, CELSIUS,
minTempInCelsius,
@@ -3092,9 +3614,7 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {minTempInFahrenheit - 1,
FAHRENHEIT, 0, 0},
@@ -3103,9 +3623,7 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {minTempInFahrenheit - 1,
FAHRENHEIT, minTempInCelsius,
@@ -3118,9 +3636,7 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {maxTempInCelsius + 1, CELSIUS, 0,
0},
@@ -3129,9 +3645,7 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {maxTempInCelsius + 1, CELSIUS,
maxTempInCelsius,
@@ -3144,9 +3658,7 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {maxTempInFahrenheit + 1,
FAHRENHEIT, 0, 0},
@@ -3155,9 +3667,7 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {maxTempInFahrenheit + 1,
FAHRENHEIT, maxTempInCelsius,
@@ -3170,9 +3680,7 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {minTempInCelsius +
incrementInCelsius * 2.5f,
@@ -3182,9 +3690,7 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues =
{minTempInCelsius + incrementInCelsius * 2.5f,
@@ -3200,9 +3706,7 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues = {minTempInFahrenheit +
incrementInFahrenheit *
@@ -3213,9 +3717,7 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = toInt(
- VehicleProperty::
- HVAC_TEMPERATURE_VALUE_SUGGESTION),
+ .prop = propHvacTempValueSuggest,
.areaId = HVAC_ALL,
.value.floatValues =
{minTempInFahrenheit +
diff --git a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp
index 6cbc7e5..1ea0df4 100644
--- a/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp
+++ b/automotive/vehicle/aidl/impl/grpc/utils/proto_message_converter/src/ProtoMessageConverter.cpp
@@ -67,12 +67,19 @@
for (auto& areaConfig : in.areaConfigs) {
auto* protoACfg = out->add_area_configs();
protoACfg->set_area_id(areaConfig.areaId);
+ protoACfg->set_access(static_cast<proto::VehiclePropertyAccess>(toInt(areaConfig.access)));
protoACfg->set_min_int64_value(areaConfig.minInt64Value);
protoACfg->set_max_int64_value(areaConfig.maxInt64Value);
protoACfg->set_min_float_value(areaConfig.minFloatValue);
protoACfg->set_max_float_value(areaConfig.maxFloatValue);
protoACfg->set_min_int32_value(areaConfig.minInt32Value);
protoACfg->set_max_int32_value(areaConfig.maxInt32Value);
+ if (areaConfig.supportedEnumValues.has_value()) {
+ for (auto& supportedEnumValue : areaConfig.supportedEnumValues.value()) {
+ protoACfg->add_supported_enum_values(supportedEnumValue);
+ }
+ }
+ protoACfg->set_support_variable_update_rate(areaConfig.supportVariableUpdateRate);
}
}
@@ -87,15 +94,24 @@
COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, config_array, out, configArray);
auto cast_to_acfg = [](const proto::VehicleAreaConfig& protoAcfg) {
- return aidl_vehicle::VehicleAreaConfig{
+ auto vehicleAreaConfig = aidl_vehicle::VehicleAreaConfig{
.areaId = protoAcfg.area_id(),
+ .access = static_cast<aidl_vehicle::VehiclePropertyAccess>(protoAcfg.access()),
.minInt32Value = protoAcfg.min_int32_value(),
.maxInt32Value = protoAcfg.max_int32_value(),
.minInt64Value = protoAcfg.min_int64_value(),
.maxInt64Value = protoAcfg.max_int64_value(),
.minFloatValue = protoAcfg.min_float_value(),
.maxFloatValue = protoAcfg.max_float_value(),
+ .supportVariableUpdateRate = protoAcfg.support_variable_update_rate(),
};
+ if (protoAcfg.supported_enum_values().size() != 0) {
+ vehicleAreaConfig.supportedEnumValues = std::vector<int64_t>();
+ COPY_PROTOBUF_VEC_TO_VHAL_TYPE(protoAcfg, supported_enum_values, (&vehicleAreaConfig),
+ supportedEnumValues.value());
+ }
+
+ return vehicleAreaConfig;
};
CAST_COPY_PROTOBUF_VEC_TO_VHAL_TYPE(in, area_configs, out, areaConfigs, cast_to_acfg);
}
diff --git a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h
index e53947e..f49d91b 100644
--- a/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h
+++ b/automotive/vehicle/aidl/impl/hardware/include/IVehicleHardware.h
@@ -82,6 +82,117 @@
const std::vector<aidl::android::hardware::automotive::vehicle::GetValueRequest>&
requests) const = 0;
+ // Dump debug information in the server.
+ virtual DumpResult dump(const std::vector<std::string>& options) = 0;
+
+ // Check whether the system is healthy, return {@code StatusCode::OK} for healthy.
+ virtual aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() = 0;
+
+ // Register a callback that would be called when there is a property change event from vehicle.
+ // This function must only be called once during initialization.
+ virtual void registerOnPropertyChangeEvent(
+ std::unique_ptr<const PropertyChangeCallback> callback) = 0;
+
+ // Register a callback that would be called when there is a property set error event from
+ // vehicle. Must only be called once during initialization.
+ virtual void registerOnPropertySetErrorEvent(
+ std::unique_ptr<const PropertySetErrorCallback> callback) = 0;
+
+ // Gets the batching window used by DefaultVehicleHal for property change events.
+ //
+ // In DefaultVehicleHal, all the property change events generated within the batching window
+ // will be delivered through one callback to the VHAL client. This affects the maximum supported
+ // subscription rate. For example, if this returns 10ms, then only one callback for property
+ // change events will be called per 10ms, meaining that the max subscription rate for all
+ // continuous properties would be 100hz.
+ //
+ // A higher batching window means less callbacks to the VHAL client, causing a better
+ // performance. However, it also means a longer average latency for every property change
+ // events.
+ //
+ // 0 means no batching should be enabled in DefaultVehicleHal. In this case, batching can
+ // be optionally implemented in IVehicleHardware layer.
+ virtual std::chrono::nanoseconds getPropertyOnChangeEventBatchingWindow() {
+ // By default batching is disabled.
+ return std::chrono::nanoseconds(0);
+ }
+
+ // A [propId, areaId] is newly subscribed or the subscribe options are changed.
+ //
+ // The subscribe options contain sample rate in Hz or enable/disable variable update rate.
+ //
+ // For continuous properties:
+ //
+ // The sample rate is never 0 and indicates the desired polling rate for this property. The
+ // sample rate is guaranteed to be within supported {@code minSampleRate} and
+ // {@code maxSampleRate} as specified in {@code VehiclePropConfig}.
+ //
+ // If the specified sample rate is not supported, e.g. vehicle bus only supports 5hz and 10hz
+ // polling rate but the sample rate is 8hz, impl must choose the higher polling rate (10hz).
+ //
+ // Whether variable update rate is enabled is specified by {@code enableVariableUpdateRate} in
+ // {@code SubscribeOptions}. If variable update rate is not supported for the
+ // [propId, areaId], impl must ignore this option and always treat it as disabled.
+ //
+ // If variable update rate is disabled/not supported, impl must report all the property events
+ // for this [propId, areaId] through {@code propertyChangeCallback} according to the sample
+ // rate. E.g. a sample rate of 10hz must generate at least 10 property change events per second.
+ //
+ // If variable update rate is enabled AND supported, impl must only report property events
+ // when the [propId, areaId]'s value or status changes (a.k.a same as on-change property).
+ // The sample rate still guides the polling rate, but duplicate property events must be dropped
+ // and not reported via {@code propertyChangeCallback}.
+ //
+ // Async property set error events are not affected by variable update rate and must always
+ // be reported.
+ //
+ // If the impl is always polling at {@code maxSampleRate} for all continuous [propId, areaId]s,
+ // and do not support variable update rate for any [propId, areaId], then this function can be a
+ // no-op.
+ //
+ // For on-change properties:
+ //
+ // The sample rate is always 0 and must be ignored. If the impl is always subscribing to all
+ // on-change properties, then this function can be no-op.
+ //
+ // For all properties:
+ //
+ // It is recommended to only deliver the subscribed property events to DefaultVehicleHal to
+ // improve performance. However, even if unsubscribed property events are delivered, they
+ // will be filtered out by DefaultVehicleHal.
+ //
+ // A subscription from VHAL client might not necessarily trigger this function.
+ // DefaultVehicleHal will aggregate all the subscriptions from all the clients and notify
+ // IVehicleHardware if new subscriptions are required or subscribe options are updated.
+ //
+ // For example:
+ // 1. VHAL initially have no subscriber for speed.
+ // 2. A new subscriber is subscribing speed for 10 times/s, 'subscribe' is called
+ // with sampleRate as 10. The impl is now polling vehicle speed from bus 10 times/s.
+ // 3. A new subscriber is subscribing speed for 5 times/s, because it is less than 10
+ // times/sec, 'subscribe' is not called.
+ // 4. The initial subscriber is removed, 'subscribe' is called with sampleRate as
+ // 5, because now it only needs to report event 5times/sec. The impl can now poll vehicle
+ // speed 5 times/s. If the impl is still polling at 10 times/s, that is okay as long as
+ // the polling rate is larger than 5times/s. DefaultVehicleHal would ignore the additional
+ // events.
+ // 5. The second subscriber is removed, 'unsubscribe' is called.
+ // The impl can optionally disable the polling for vehicle speed.
+ //
+ virtual aidl::android::hardware::automotive::vehicle::StatusCode subscribe(
+ [[maybe_unused]] aidl::android::hardware::automotive::vehicle::SubscribeOptions
+ options) {
+ return aidl::android::hardware::automotive::vehicle::StatusCode::OK;
+ }
+
+ // A [propId, areaId] is unsubscribed. This applies for both continuous or on-change property.
+ virtual aidl::android::hardware::automotive::vehicle::StatusCode unsubscribe(
+ [[maybe_unused]] int32_t propId, [[maybe_unused]] int32_t areaId) {
+ return aidl::android::hardware::automotive::vehicle::StatusCode::OK;
+ }
+
+ // This function is deprecated, subscribe/unsubscribe should be used instead.
+ //
// Update the sampling rate for the specified property and the specified areaId (0 for global
// property) if server supports it. The property must be a continuous property.
// {@code sampleRate} means that for this specific property, the server must generate at least
@@ -91,7 +202,7 @@
// This would be called if sample rate is updated for a subscriber, a new subscriber is added
// or an existing subscriber is removed. For example:
// 1. We have no subscriber for speed.
- // 2. A new subscriber is subscribing speed for 10 times/s, updsateSampleRate would be called
+ // 2. A new subscriber is subscribing speed for 10 times/s, updateSampleRate would be called
// with sampleRate as 10. The impl is now polling vehicle speed from bus 10 times/s.
// 3. A new subscriber is subscribing speed for 5 times/s, because it is less than 10
// times/sec, updateSampleRate would not be called.
@@ -110,22 +221,6 @@
[[maybe_unused]] float sampleRate) {
return aidl::android::hardware::automotive::vehicle::StatusCode::OK;
}
-
- // Dump debug information in the server.
- virtual DumpResult dump(const std::vector<std::string>& options) = 0;
-
- // Check whether the system is healthy, return {@code StatusCode::OK} for healthy.
- virtual aidl::android::hardware::automotive::vehicle::StatusCode checkHealth() = 0;
-
- // Register a callback that would be called when there is a property change event from vehicle.
- // Must only be called once during initialization.
- virtual void registerOnPropertyChangeEvent(
- std::unique_ptr<const PropertyChangeCallback> callback) = 0;
-
- // Register a callback that would be called when there is a property set error event from
- // vehicle. Must only be called once during initialization.
- virtual void registerOnPropertySetErrorEvent(
- std::unique_ptr<const PropertySetErrorCallback> callback) = 0;
};
} // namespace vehicle
diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto
index 63d7933..95e766a 100644
--- a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto
+++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/StatusCode.proto
@@ -38,6 +38,37 @@
/* Something unexpected has happened in Vehicle HAL */
INTERNAL_ERROR = 5;
+
+ /**
+ * For features that are not available because the underlying feature is
+ * disabled.
+ */
+ NOT_AVAILABLE_DISABLED = 6;
+
+ /**
+ * For features that are not available because the vehicle speed is too low.
+ */
+ NOT_AVAILABLE_SPEED_LOW = 7;
+
+ /**
+ * For features that are not available because the vehicle speed is too
+ * high.
+ */
+ NOT_AVAILABLE_SPEED_HIGH = 8;
+
+ /**
+ * For features that are not available because of bad camera or sensor
+ * visibility. Examples might be bird poop blocking the camera or a bumper
+ * cover blocking an ultrasonic sensor.
+ */
+ NOT_AVAILABLE_POOR_VISIBILITY = 9;
+
+ /**
+ * The feature cannot be accessed due to safety reasons. Eg. System could be
+ * in a faulty state, an object or person could be blocking the requested
+ * operation such as closing a trunk door, etc.
+ */
+ NOT_AVAILABLE_SAFETY = 10;
};
message VehicleHalCallStatus {
diff --git a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto
index b5b7e80..7ea8540 100644
--- a/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto
+++ b/automotive/vehicle/aidl/impl/proto/android/hardware/automotive/vehicle/VehicleAreaConfig.proto
@@ -18,6 +18,8 @@
package android.hardware.automotive.vehicle.proto;
+import "android/hardware/automotive/vehicle/VehiclePropertyAccess.proto";
+
/* Must be in sync with VehicleAreaConfig.aidl. */
message VehicleAreaConfig {
/* Area id is ignored for VehiclePropertyGroup:GLOBAL properties. */
@@ -36,4 +38,13 @@
float min_float_value = 6;
float max_float_value = 7;
+
+ /**
+ * If the property has a @data_enum, then it is possible to specify a supported subset of the
+ * @data_enum. If the property has a @data_enum and supported_enum_values is null, then it is
+ * assumed all @data_enum values are supported unless specified through another mechanism.
+ */
+ repeated int64 supported_enum_values = 8;
+ VehiclePropertyAccess access = 9;
+ bool support_variable_update_rate = 10;
};
diff --git a/automotive/vehicle/aidl/impl/utils/README.md b/automotive/vehicle/aidl/impl/utils/README.md
index 87bb7e3..255131d 100644
--- a/automotive/vehicle/aidl/impl/utils/README.md
+++ b/automotive/vehicle/aidl/impl/utils/README.md
@@ -57,6 +57,6 @@
Defines many useful utility functions.
-## test
+## test_vendor_properties
-Defines utility libraries for test only.
+Contains vendor properties used for testing purpose in reference VHAL.
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/ConcurrentQueue.h b/automotive/vehicle/aidl/impl/utils/common/include/ConcurrentQueue.h
index 327c0dc..b636aa3 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/ConcurrentQueue.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/ConcurrentQueue.h
@@ -69,6 +69,19 @@
mCond.notify_one();
}
+ void push(std::vector<T>&& items) {
+ {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ if (!mIsActive) {
+ return;
+ }
+ for (T& item : items) {
+ mQueue.push(std::move(item));
+ }
+ }
+ mCond.notify_one();
+ }
+
// Deactivates the queue, thus no one can push items to it, also notifies all waiting thread.
// The items already in the queue could still be flushed even after the queue is deactivated.
void deactivate() {
@@ -92,6 +105,69 @@
std::queue<T> mQueue GUARDED_BY(mLock);
};
+template <typename T>
+class BatchingConsumer {
+ private:
+ enum class State {
+ INIT = 0,
+ RUNNING = 1,
+ STOP_REQUESTED = 2,
+ STOPPED = 3,
+ };
+
+ public:
+ BatchingConsumer() : mState(State::INIT) {}
+
+ BatchingConsumer(const BatchingConsumer&) = delete;
+ BatchingConsumer& operator=(const BatchingConsumer&) = delete;
+
+ using OnBatchReceivedFunc = std::function<void(std::vector<T> vec)>;
+
+ void run(ConcurrentQueue<T>* queue, std::chrono::nanoseconds batchInterval,
+ const OnBatchReceivedFunc& func) {
+ mQueue = queue;
+ mBatchInterval = batchInterval;
+
+ mWorkerThread = std::thread(&BatchingConsumer<T>::runInternal, this, func);
+ }
+
+ void requestStop() { mState = State::STOP_REQUESTED; }
+
+ void waitStopped() {
+ if (mWorkerThread.joinable()) {
+ mWorkerThread.join();
+ }
+ }
+
+ private:
+ void runInternal(const OnBatchReceivedFunc& onBatchReceived) {
+ if (mState.exchange(State::RUNNING) == State::INIT) {
+ while (State::RUNNING == mState) {
+ mQueue->waitForItems();
+ if (State::STOP_REQUESTED == mState) break;
+
+ std::this_thread::sleep_for(mBatchInterval);
+ if (State::STOP_REQUESTED == mState) break;
+
+ std::vector<T> items = mQueue->flush();
+
+ if (items.size() > 0) {
+ onBatchReceived(std::move(items));
+ }
+ }
+ }
+
+ mState = State::STOPPED;
+ }
+
+ private:
+ std::thread mWorkerThread;
+
+ std::atomic<State> mState;
+ std::chrono::nanoseconds mBatchInterval;
+ ConcurrentQueue<T>* mQueue;
+};
+
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h
index 7275ba3..78b61f7 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h
@@ -77,22 +77,6 @@
constexpr int SEAT_2_LEFT = toInt(propertyutils_impl::VehicleAreaSeat::ROW_2_LEFT);
constexpr int SEAT_2_RIGHT = toInt(propertyutils_impl::VehicleAreaSeat::ROW_2_RIGHT);
constexpr int SEAT_2_CENTER = toInt(propertyutils_impl::VehicleAreaSeat::ROW_2_CENTER);
-constexpr int VENDOR_EXTENSION_BOOLEAN_PROPERTY =
- 0x101 | toInt(propertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(propertyutils_impl::VehiclePropertyType::BOOLEAN) |
- toInt(propertyutils_impl::VehicleArea::DOOR);
-constexpr int VENDOR_EXTENSION_FLOAT_PROPERTY =
- 0x102 | toInt(propertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(propertyutils_impl::VehiclePropertyType::FLOAT) |
- toInt(propertyutils_impl::VehicleArea::SEAT);
-constexpr int VENDOR_EXTENSION_INT_PROPERTY =
- 0x103 | toInt(propertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(propertyutils_impl::VehiclePropertyType::INT32) |
- toInt(propertyutils_impl::VehicleArea::WINDOW);
-constexpr int VENDOR_EXTENSION_STRING_PROPERTY =
- 0x104 | toInt(propertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(propertyutils_impl::VehiclePropertyType::STRING) |
- toInt(propertyutils_impl::VehicleArea::GLOBAL);
constexpr int FUEL_DOOR_REAR_LEFT = toInt(propertyutils_impl::PortLocationType::REAR_LEFT);
constexpr int CHARGE_PORT_FRONT_LEFT = toInt(propertyutils_impl::PortLocationType::FRONT_LEFT);
constexpr int CHARGE_PORT_REAR_LEFT = toInt(propertyutils_impl::PortLocationType::REAR_LEFT);
@@ -114,11 +98,6 @@
constexpr int HVAC_RIGHT = SEAT_1_RIGHT | SEAT_2_RIGHT;
constexpr int HVAC_ALL = HVAC_LEFT | HVAC_RIGHT;
-const int32_t HVAC_POWER_PROPERTIES[] = {
- toInt(propertyutils_impl::VehicleProperty::HVAC_FAN_SPEED),
- toInt(propertyutils_impl::VehicleProperty::HVAC_FAN_DIRECTION),
-};
-
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/RecurrentTimer.h b/automotive/vehicle/aidl/impl/utils/common/include/RecurrentTimer.h
index cd2b727..712359a 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/RecurrentTimer.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/RecurrentTimer.h
@@ -19,6 +19,8 @@
#include <android-base/thread_annotations.h>
+#include <utils/Looper.h>
+#include <atomic>
#include <memory>
#include <mutex>
#include <queue>
@@ -31,6 +33,9 @@
namespace automotive {
namespace vehicle {
+// Forward declaration
+class RecurrentMessageHandler;
+
// A thread-safe recurrent timer.
class RecurrentTimer final {
public:
@@ -43,49 +48,44 @@
// Registers a recurrent callback for a given interval.
// Registering the same callback twice will override the interval provided before.
- void registerTimerCallback(int64_t intervalInNano, std::shared_ptr<Callback> callback);
+ void registerTimerCallback(int64_t intervalInNanos, std::shared_ptr<Callback> callback);
// Unregisters a previously registered recurrent callback.
void unregisterTimerCallback(std::shared_ptr<Callback> callback);
private:
- // friend class for unit testing.
+ friend class RecurrentMessageHandler;
+
+ // For unit test
friend class RecurrentTimerTest;
struct CallbackInfo {
std::shared_ptr<Callback> callback;
- int64_t interval;
- int64_t nextTime;
- // A flag to indicate whether this CallbackInfo is already outdated and should be ignored.
- // The reason we need this flag is because we cannot easily remove an element from a heap.
- bool outdated = false;
-
- static bool cmp(const std::unique_ptr<CallbackInfo>& lhs,
- const std::unique_ptr<CallbackInfo>& rhs);
+ int64_t intervalInNanos;
+ int64_t nextTimeInNanos;
};
+ android::sp<Looper> mLooper;
+ android::sp<RecurrentMessageHandler> mHandler;
+
+ std::atomic<bool> mStopRequested = false;
+ std::atomic<int> mCallbackId = 0;
std::mutex mLock;
std::thread mThread;
- std::condition_variable mCond;
- bool mStopRequested GUARDED_BY(mLock) = false;
- // A map to map each callback to its current active CallbackInfo in the mCallbackQueue.
- std::unordered_map<std::shared_ptr<Callback>, CallbackInfo*> mCallbacks GUARDED_BY(mLock);
- // A min-heap sorted by nextTime. Note that because we cannot remove arbitrary element from the
- // heap, a single Callback can have multiple entries in this queue, all but one should be valid.
- // The rest should be mark as outdated. The valid one is one stored in mCallbacks.
- std::vector<std::unique_ptr<CallbackInfo>> mCallbackQueue GUARDED_BY(mLock);
+ std::unordered_map<std::shared_ptr<Callback>, int> mIdByCallback GUARDED_BY(mLock);
+ std::unordered_map<int, std::unique_ptr<CallbackInfo>> mCallbackInfoById GUARDED_BY(mLock);
- void loop();
+ void handleMessage(const android::Message& message) EXCLUDES(mLock);
+ int getCallbackIdLocked(std::shared_ptr<Callback> callback) REQUIRES(mLock);
+};
- // Mark the callbackInfo as outdated and should be ignored when popped from the heap.
- void markOutdatedLocked(CallbackInfo* callback) REQUIRES(mLock);
- // Remove all outdated callbackInfos from the top of the heap. This function must be called
- // each time we might introduce outdated elements to the top. We must make sure the heap is
- // always valid from the top.
- void removeInvalidCallbackLocked() REQUIRES(mLock);
- // Gets the next calblack to run (must be valid) from the heap, update its nextTime and put
- // it back to the heap.
- std::shared_ptr<Callback> getNextCallbackLocked(int64_t now) REQUIRES(mLock);
+class RecurrentMessageHandler final : public android::MessageHandler {
+ public:
+ RecurrentMessageHandler(RecurrentTimer* timer) { mTimer = timer; }
+ void handleMessage(const android::Message& message) override;
+
+ private:
+ RecurrentTimer* mTimer;
};
} // namespace vehicle
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h
index e6d657d..bbd88da 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h
@@ -19,11 +19,17 @@
#include <aidl/android/hardware/automotive/vehicle/AutomaticEmergencyBrakingState.h>
#include <aidl/android/hardware/automotive/vehicle/BlindSpotWarningState.h>
+#include <aidl/android/hardware/automotive/vehicle/CrossTrafficMonitoringWarningState.h>
#include <aidl/android/hardware/automotive/vehicle/CruiseControlCommand.h>
#include <aidl/android/hardware/automotive/vehicle/CruiseControlState.h>
#include <aidl/android/hardware/automotive/vehicle/CruiseControlType.h>
#include <aidl/android/hardware/automotive/vehicle/DiagnosticFloatSensorIndex.h>
#include <aidl/android/hardware/automotive/vehicle/DiagnosticIntegerSensorIndex.h>
+#include <aidl/android/hardware/automotive/vehicle/DriverDistractionState.h>
+#include <aidl/android/hardware/automotive/vehicle/DriverDistractionWarning.h>
+#include <aidl/android/hardware/automotive/vehicle/DriverDrowsinessAttentionState.h>
+#include <aidl/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.h>
+#include <aidl/android/hardware/automotive/vehicle/ElectronicStabilityControlState.h>
#include <aidl/android/hardware/automotive/vehicle/EmergencyLaneKeepAssistState.h>
#include <aidl/android/hardware/automotive/vehicle/ErrorState.h>
#include <aidl/android/hardware/automotive/vehicle/EvConnectorType.h>
@@ -38,11 +44,13 @@
#include <aidl/android/hardware/automotive/vehicle/GsrComplianceRequirementType.h>
#include <aidl/android/hardware/automotive/vehicle/HandsOnDetectionDriverState.h>
#include <aidl/android/hardware/automotive/vehicle/HandsOnDetectionWarning.h>
+#include <aidl/android/hardware/automotive/vehicle/ImpactSensorLocation.h>
#include <aidl/android/hardware/automotive/vehicle/LaneCenteringAssistCommand.h>
#include <aidl/android/hardware/automotive/vehicle/LaneCenteringAssistState.h>
#include <aidl/android/hardware/automotive/vehicle/LaneDepartureWarningState.h>
#include <aidl/android/hardware/automotive/vehicle/LaneKeepAssistState.h>
#include <aidl/android/hardware/automotive/vehicle/LocationCharacterization.h>
+#include <aidl/android/hardware/automotive/vehicle/LowSpeedCollisionWarningState.h>
#include <aidl/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.h>
#include <aidl/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.h>
#include <aidl/android/hardware/automotive/vehicle/Obd2FuelType.h>
@@ -55,6 +63,7 @@
#include <aidl/android/hardware/automotive/vehicle/SetValueResults.h>
#include <aidl/android/hardware/automotive/vehicle/StatusCode.h>
#include <aidl/android/hardware/automotive/vehicle/SubscribeOptions.h>
+#include <aidl/android/hardware/automotive/vehicle/VehicleAirbagLocation.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReport.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleApPowerStateReq.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleArea.h>
@@ -63,6 +72,7 @@
#include <aidl/android/hardware/automotive/vehicle/VehicleAreaSeat.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleAreaWheel.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleAreaWindow.h>
+#include <aidl/android/hardware/automotive/vehicle/VehicleAutonomousState.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleGear.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleHvacFanDirection.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleIgnitionState.h>
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h
index 3d25cd3..d9599ed 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/VehiclePropertyStore.h
@@ -48,21 +48,21 @@
enum class EventMode : uint8_t {
/**
- * Only invoke OnValueChangeCallback if the new property value (ignoring timestamp) is
- * different than the existing value.
+ * Only invoke OnValueChangeCallback or OnValuesChangeCallback if the new property value
+ * (ignoring timestamp) is different than the existing value.
*
* This should be used for regular cases.
*/
ON_VALUE_CHANGE,
/**
- * Always invoke OnValueChangeCallback.
+ * Always invoke OnValueChangeCallback or OnValuesChangeCallback.
*
* This should be used for the special properties that are used for delivering event, e.g.
* HW_KEY_INPUT.
*/
ALWAYS,
/**
- * Never invoke OnValueChangeCallback.
+ * Never invoke OnValueChangeCallback or OnValuesChangeCalblack.
*
* This should be used for continuous property subscription when the sample rate for the
* subscription is smaller than the refresh rate for the property. E.g., the vehicle speed
@@ -82,6 +82,10 @@
using OnValueChangeCallback = std::function<void(
const aidl::android::hardware::automotive::vehicle::VehiclePropValue&)>;
+ // Callback when one or more property values have been updated or new values added.
+ using OnValuesChangeCallback = std::function<void(
+ std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropValue>)>;
+
// Function that used to calculate unique token for given VehiclePropValue.
using TokenFunction = std::function<int64_t(
const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value)>;
@@ -92,54 +96,83 @@
// used as the key.
void registerProperty(
const aidl::android::hardware::automotive::vehicle::VehiclePropConfig& config,
- TokenFunction tokenFunc = nullptr);
+ TokenFunction tokenFunc = nullptr) EXCLUDES(mLock);
// Stores provided value. Returns error if config wasn't registered. If 'updateStatus' is
// true, the 'status' in 'propValue' would be stored. Otherwise, if this is a new value,
// 'status' would be initialized to {@code VehiclePropertyStatus::AVAILABLE}, if this is to
// override an existing value, the status for the existing value would be used for the
// overridden value.
- // 'EventMode' controls whether the 'OnValueChangeCallback' will be called for this operation.
+ // 'EventMode' controls whether the 'OnValueChangeCallback' or 'OnValuesChangeCallback' will be
+ // called for this operation.
+ // If 'useCurrentTimestamp' is true, the property value will be set to the current timestamp.
VhalResult<void> writeValue(VehiclePropValuePool::RecyclableType propValue,
bool updateStatus = false,
- EventMode mode = EventMode::ON_VALUE_CHANGE);
+ EventMode mode = EventMode::ON_VALUE_CHANGE,
+ bool useCurrentTimestamp = false) EXCLUDES(mLock);
+
+ // Refresh the timestamp for the stored property value for [propId, areaId]. If eventMode is
+ // always, generates the property update event, otherwise, only update the stored timestamp
+ // without generating event. This operation is atomic with other writeValue operations.
+ void refreshTimestamp(int32_t propId, int32_t areaId, EventMode eventMode) EXCLUDES(mLock);
+
+ // Refresh the timestamp for multiple [propId, areaId]s.
+ void refreshTimestamps(
+ std::unordered_map<PropIdAreaId, EventMode, PropIdAreaIdHash> eventModeByPropIdAreaId)
+ EXCLUDES(mLock);
// Remove a given property value from the property store. The 'propValue' would be used to
// generate the key for the value to remove.
void removeValue(
- const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue);
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& propValue)
+ EXCLUDES(mLock);
// Remove all the values for the property.
- void removeValuesForProperty(int32_t propId);
+ void removeValuesForProperty(int32_t propId) EXCLUDES(mLock);
// Read all the stored values.
- std::vector<VehiclePropValuePool::RecyclableType> readAllValues() const;
+ std::vector<VehiclePropValuePool::RecyclableType> readAllValues() const EXCLUDES(mLock);
// Read all the values for the property.
- ValuesResultType readValuesForProperty(int32_t propId) const;
+ ValuesResultType readValuesForProperty(int32_t propId) const EXCLUDES(mLock);
// Read the value for the requested property. Returns {@code StatusCode::NOT_AVAILABLE} if the
// value has not been set yet. Returns {@code StatusCode::INVALID_ARG} if the property is
// not configured.
ValueResultType readValue(
- const aidl::android::hardware::automotive::vehicle::VehiclePropValue& request) const;
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& request) const
+ EXCLUDES(mLock);
// Read the value for the requested property. Returns {@code StatusCode::NOT_AVAILABLE} if the
// value has not been set yet. Returns {@code StatusCode::INVALID_ARG} if the property is
// not configured.
- ValueResultType readValue(int32_t prop, int32_t area = 0, int64_t token = 0) const;
+ ValueResultType readValue(int32_t prop, int32_t area = 0, int64_t token = 0) const
+ EXCLUDES(mLock);
// Get all property configs.
std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropConfig> getAllConfigs()
- const;
+ const EXCLUDES(mLock);
- // Get the property config for the requested property.
+ // Deprecated, use getPropConfig instead. This is unsafe to use if registerProperty overwrites
+ // an existing config.
android::base::Result<const aidl::android::hardware::automotive::vehicle::VehiclePropConfig*,
VhalError>
- getConfig(int32_t propId) const;
+ getConfig(int32_t propId) const EXCLUDES(mLock);
+
+ // Get the property config for the requested property.
+ android::base::Result<aidl::android::hardware::automotive::vehicle::VehiclePropConfig,
+ VhalError>
+ getPropConfig(int32_t propId) const EXCLUDES(mLock);
// Set a callback that would be called when a property value has been updated.
- void setOnValueChangeCallback(const OnValueChangeCallback& callback);
+ void setOnValueChangeCallback(const OnValueChangeCallback& callback) EXCLUDES(mLock);
+
+ // Set a callback that would be called when one or more property values have been updated.
+ // For backward compatibility, this is optional. If this is not set, then multiple property
+ // updates will be delivered through multiple OnValueChangeCallback instead.
+ // It is recommended to set this and batch the property update events for better performance.
+ // If this is set, then OnValueChangeCallback will not be used.
+ void setOnValuesChangeCallback(const OnValuesChangeCallback& callback) EXCLUDES(mLock);
inline std::shared_ptr<VehiclePropValuePool> getValuePool() { return mValuePool; }
@@ -168,6 +201,7 @@
mutable std::mutex mLock;
std::unordered_map<int32_t, Record> mRecordsByPropId GUARDED_BY(mLock);
OnValueChangeCallback mOnValueChangeCallback GUARDED_BY(mLock);
+ OnValuesChangeCallback mOnValuesChangeCallback GUARDED_BY(mLock);
const Record* getRecordLocked(int32_t propId) const;
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h
index c94bad6..546421e 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h
@@ -329,6 +329,11 @@
}
};
+inline std::string propIdToString(int32_t propId) {
+ return toString(
+ static_cast<aidl::android::hardware::automotive::vehicle::VehicleProperty>(propId));
+}
+
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp b/automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp
index c6d3687..8dec695 100644
--- a/automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp
+++ b/automotive/vehicle/aidl/impl/utils/common/src/RecurrentTimer.cpp
@@ -17,6 +17,7 @@
#include "RecurrentTimer.h"
#include <utils/Log.h>
+#include <utils/Looper.h>
#include <utils/SystemClock.h>
#include <inttypes.h>
@@ -27,153 +28,119 @@
namespace automotive {
namespace vehicle {
+namespace {
+
using ::android::base::ScopedLockAssertion;
+constexpr int INVALID_ID = -1;
+
+} // namespace
+
RecurrentTimer::RecurrentTimer() {
- mThread = std::thread(&RecurrentTimer::loop, this);
+ mHandler = sp<RecurrentMessageHandler>::make(this);
+ mLooper = sp<Looper>::make(/*allowNonCallbacks=*/false);
+ mThread = std::thread([this] {
+ Looper::setForThread(mLooper);
+
+ while (!mStopRequested) {
+ mLooper->pollOnce(/*timeoutMillis=*/-1);
+ }
+ });
}
RecurrentTimer::~RecurrentTimer() {
- {
- std::scoped_lock<std::mutex> lockGuard(mLock);
- mStopRequested = true;
- }
- mCond.notify_one();
+ mStopRequested = true;
+ mLooper->removeMessages(mHandler);
+ mLooper->wake();
if (mThread.joinable()) {
mThread.join();
}
}
-void RecurrentTimer::registerTimerCallback(int64_t intervalInNano,
+int RecurrentTimer::getCallbackIdLocked(std::shared_ptr<RecurrentTimer::Callback> callback) {
+ const auto& it = mIdByCallback.find(callback);
+ if (it != mIdByCallback.end()) {
+ return it->second;
+ }
+ return INVALID_ID;
+}
+
+void RecurrentTimer::registerTimerCallback(int64_t intervalInNanos,
std::shared_ptr<RecurrentTimer::Callback> callback) {
{
std::scoped_lock<std::mutex> lockGuard(mLock);
+ int callbackId = getCallbackIdLocked(callback);
+
+ if (callbackId == INVALID_ID) {
+ callbackId = mCallbackId++;
+ mIdByCallback.insert({callback, callbackId});
+ } else {
+ ALOGI("Replacing an existing timer callback with a new interval, current: %" PRId64
+ " ns, new: %" PRId64 " ns",
+ mCallbackInfoById[callbackId]->intervalInNanos, intervalInNanos);
+ mLooper->removeMessages(mHandler, callbackId);
+ }
+
// Aligns the nextTime to multiply of interval.
- int64_t nextTime = ceil(uptimeNanos() / intervalInNano) * intervalInNano;
+ int64_t nextTimeInNanos = ceil(uptimeNanos() / intervalInNanos) * intervalInNanos;
std::unique_ptr<CallbackInfo> info = std::make_unique<CallbackInfo>();
info->callback = callback;
- info->interval = intervalInNano;
- info->nextTime = nextTime;
+ info->intervalInNanos = intervalInNanos;
+ info->nextTimeInNanos = nextTimeInNanos;
+ mCallbackInfoById.insert({callbackId, std::move(info)});
- auto it = mCallbacks.find(callback);
- if (it != mCallbacks.end()) {
- ALOGI("Replacing an existing timer callback with a new interval, current: %" PRId64
- " ns, new: %" PRId64 " ns",
- it->second->interval, intervalInNano);
- markOutdatedLocked(it->second);
- }
- mCallbacks[callback] = info.get();
- mCallbackQueue.push_back(std::move(info));
- // Insert the last element into the heap.
- std::push_heap(mCallbackQueue.begin(), mCallbackQueue.end(), CallbackInfo::cmp);
+ mLooper->sendMessageAtTime(nextTimeInNanos, mHandler, Message(callbackId));
}
- mCond.notify_one();
}
void RecurrentTimer::unregisterTimerCallback(std::shared_ptr<RecurrentTimer::Callback> callback) {
{
std::scoped_lock<std::mutex> lockGuard(mLock);
- auto it = mCallbacks.find(callback);
- if (it == mCallbacks.end()) {
+ int callbackId = getCallbackIdLocked(callback);
+
+ if (callbackId == INVALID_ID) {
ALOGE("No event found to unregister");
return;
}
- markOutdatedLocked(it->second);
- mCallbacks.erase(it);
- }
-
- mCond.notify_one();
-}
-
-void RecurrentTimer::markOutdatedLocked(RecurrentTimer::CallbackInfo* info) {
- info->outdated = true;
- info->callback = nullptr;
- // Make sure the first element is always valid.
- removeInvalidCallbackLocked();
-}
-
-void RecurrentTimer::removeInvalidCallbackLocked() {
- while (mCallbackQueue.size() != 0 && mCallbackQueue[0]->outdated) {
- std::pop_heap(mCallbackQueue.begin(), mCallbackQueue.end(), CallbackInfo::cmp);
- mCallbackQueue.pop_back();
+ mLooper->removeMessages(mHandler, callbackId);
+ mCallbackInfoById.erase(callbackId);
+ mIdByCallback.erase(callback);
}
}
-std::shared_ptr<RecurrentTimer::Callback> RecurrentTimer::getNextCallbackLocked(int64_t now) {
- std::pop_heap(mCallbackQueue.begin(), mCallbackQueue.end(), CallbackInfo::cmp);
- auto& callbackInfo = mCallbackQueue[mCallbackQueue.size() - 1];
- auto nextCallback = callbackInfo->callback;
- // intervalCount is the number of interval we have to advance until we pass now.
- size_t intervalCount = (now - callbackInfo->nextTime) / callbackInfo->interval + 1;
- callbackInfo->nextTime += intervalCount * callbackInfo->interval;
- std::push_heap(mCallbackQueue.begin(), mCallbackQueue.end(), CallbackInfo::cmp);
+void RecurrentTimer::handleMessage(const Message& message) {
+ std::shared_ptr<RecurrentTimer::Callback> callback;
+ {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
- // Make sure the first element is always valid.
- removeInvalidCallbackLocked();
+ int callbackId = message.what;
- return nextCallback;
-}
-
-void RecurrentTimer::loop() {
- std::vector<std::shared_ptr<Callback>> callbacksToRun;
- while (true) {
- {
- std::unique_lock<std::mutex> uniqueLock(mLock);
- ScopedLockAssertion lockAssertion(mLock);
- // Wait until the timer exits or we have at least one recurrent callback.
- mCond.wait(uniqueLock, [this] {
- ScopedLockAssertion lockAssertion(mLock);
- return mStopRequested || mCallbackQueue.size() != 0;
- });
-
- int64_t interval;
- if (mStopRequested) {
- return;
- }
- // The first element is the nearest next event.
- int64_t nextTime = mCallbackQueue[0]->nextTime;
- int64_t now = uptimeNanos();
-
- if (nextTime > now) {
- interval = nextTime - now;
- } else {
- interval = 0;
- }
-
- // Wait for the next event or the timer exits.
- if (mCond.wait_for(uniqueLock, std::chrono::nanoseconds(interval), [this] {
- ScopedLockAssertion lockAssertion(mLock);
- return mStopRequested;
- })) {
- return;
- }
-
- now = uptimeNanos();
- callbacksToRun.clear();
- while (mCallbackQueue.size() > 0) {
- int64_t nextTime = mCallbackQueue[0]->nextTime;
- if (nextTime > now) {
- break;
- }
-
- callbacksToRun.push_back(getNextCallbackLocked(now));
- }
+ auto it = mCallbackInfoById.find(callbackId);
+ if (it == mCallbackInfoById.end()) {
+ ALOGW("The event for callback ID: %d is outdated, ignore", callbackId);
+ return;
}
- // Do not execute the callback while holding the lock.
- for (size_t i = 0; i < callbacksToRun.size(); i++) {
- (*callbacksToRun[i])();
- }
+ CallbackInfo* callbackInfo = it->second.get();
+ callback = callbackInfo->callback;
+ int64_t nowNanos = uptimeNanos();
+ // intervalCount is the number of interval we have to advance until we pass now.
+ size_t intervalCount =
+ (nowNanos - callbackInfo->nextTimeInNanos) / callbackInfo->intervalInNanos + 1;
+ callbackInfo->nextTimeInNanos += intervalCount * callbackInfo->intervalInNanos;
+
+ mLooper->sendMessageAtTime(callbackInfo->nextTimeInNanos, mHandler, Message(callbackId));
}
+
+ (*callback)();
}
-bool RecurrentTimer::CallbackInfo::cmp(const std::unique_ptr<RecurrentTimer::CallbackInfo>& lhs,
- const std::unique_ptr<RecurrentTimer::CallbackInfo>& rhs) {
- return lhs->nextTime > rhs->nextTime;
+void RecurrentMessageHandler::handleMessage(const Message& message) {
+ mTimer->handleMessage(message);
}
} // namespace vehicle
diff --git a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp
index 646dc0e..6a2a695 100644
--- a/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp
+++ b/automotive/vehicle/aidl/impl/utils/common/src/VehiclePropertyStore.cpp
@@ -16,6 +16,7 @@
#define LOG_TAG "VehiclePropertyStore"
#include <utils/Log.h>
+#include <utils/SystemClock.h>
#include "VehiclePropertyStore.h"
@@ -107,56 +108,158 @@
VhalResult<void> VehiclePropertyStore::writeValue(VehiclePropValuePool::RecyclableType propValue,
bool updateStatus,
- VehiclePropertyStore::EventMode eventMode) {
- std::scoped_lock<std::mutex> g(mLock);
-
- int32_t propId = propValue->prop;
-
- VehiclePropertyStore::Record* record = getRecordLocked(propId);
- if (record == nullptr) {
- return StatusError(StatusCode::INVALID_ARG) << "property: " << propId << " not registered";
- }
-
- if (!isGlobalProp(propId) && getAreaConfig(*propValue, record->propConfig) == nullptr) {
- return StatusError(StatusCode::INVALID_ARG)
- << "no config for property: " << propId << " area: " << propValue->areaId;
- }
-
- VehiclePropertyStore::RecordId recId = getRecordIdLocked(*propValue, *record);
+ VehiclePropertyStore::EventMode eventMode,
+ bool useCurrentTimestamp) {
bool valueUpdated = true;
- if (auto it = record->values.find(recId); it != record->values.end()) {
- const VehiclePropValue* valueToUpdate = it->second.get();
- int64_t oldTimestamp = valueToUpdate->timestamp;
- VehiclePropertyStatus oldStatus = valueToUpdate->status;
- // propValue is outdated and drops it.
- if (oldTimestamp > propValue->timestamp) {
- return StatusError(StatusCode::INVALID_ARG)
- << "outdated timestamp: " << propValue->timestamp;
- }
- if (!updateStatus) {
- propValue->status = oldStatus;
+ VehiclePropValue updatedValue;
+ OnValueChangeCallback onValueChangeCallback = nullptr;
+ OnValuesChangeCallback onValuesChangeCallback = nullptr;
+ int32_t propId;
+ int32_t areaId;
+ {
+ std::scoped_lock<std::mutex> g(mLock);
+
+ // Must set timestamp inside the lock to make sure no other writeValue will update the
+ // the timestamp to a newer one while we are writing this value.
+ if (useCurrentTimestamp) {
+ propValue->timestamp = elapsedRealtimeNano();
}
- valueUpdated = (valueToUpdate->value != propValue->value ||
- valueToUpdate->status != propValue->status ||
- valueToUpdate->prop != propValue->prop ||
- valueToUpdate->areaId != propValue->areaId);
- } else if (!updateStatus) {
- propValue->status = VehiclePropertyStatus::AVAILABLE;
+ propId = propValue->prop;
+ areaId = propValue->areaId;
+
+ VehiclePropertyStore::Record* record = getRecordLocked(propId);
+ if (record == nullptr) {
+ return StatusError(StatusCode::INVALID_ARG)
+ << "property: " << propId << " not registered";
+ }
+
+ if (!isGlobalProp(propId) && getAreaConfig(*propValue, record->propConfig) == nullptr) {
+ return StatusError(StatusCode::INVALID_ARG)
+ << "no config for property: " << propId << " area ID: " << propValue->areaId;
+ }
+
+ VehiclePropertyStore::RecordId recId = getRecordIdLocked(*propValue, *record);
+ if (auto it = record->values.find(recId); it != record->values.end()) {
+ const VehiclePropValue* valueToUpdate = it->second.get();
+ int64_t oldTimestampNanos = valueToUpdate->timestamp;
+ VehiclePropertyStatus oldStatus = valueToUpdate->status;
+ // propValue is outdated and drops it.
+ if (oldTimestampNanos > propValue->timestamp) {
+ return StatusError(StatusCode::INVALID_ARG)
+ << "outdated timestampNanos: " << propValue->timestamp;
+ }
+ if (!updateStatus) {
+ propValue->status = oldStatus;
+ }
+
+ valueUpdated = (valueToUpdate->value != propValue->value ||
+ valueToUpdate->status != propValue->status ||
+ valueToUpdate->prop != propValue->prop ||
+ valueToUpdate->areaId != propValue->areaId);
+ } else if (!updateStatus) {
+ propValue->status = VehiclePropertyStatus::AVAILABLE;
+ }
+
+ record->values[recId] = std::move(propValue);
+
+ if (eventMode == EventMode::NEVER) {
+ return {};
+ }
+ updatedValue = *(record->values[recId]);
+
+ onValuesChangeCallback = mOnValuesChangeCallback;
+ onValueChangeCallback = mOnValueChangeCallback;
}
- record->values[recId] = std::move(propValue);
-
- if (eventMode == EventMode::NEVER) {
+ if (onValuesChangeCallback == nullptr && onValueChangeCallback == nullptr) {
+ ALOGW("No callback registered, ignoring property update for propId: %" PRId32
+ ", area ID: %" PRId32,
+ propId, areaId);
return {};
}
- if ((eventMode == EventMode::ALWAYS || valueUpdated) && mOnValueChangeCallback != nullptr) {
- mOnValueChangeCallback(*(record->values[recId]));
+ // Invoke the callback outside the lock to prevent dead-lock.
+ if (eventMode == EventMode::ALWAYS || valueUpdated) {
+ if (onValuesChangeCallback != nullptr) {
+ onValuesChangeCallback({updatedValue});
+ } else {
+ onValueChangeCallback(updatedValue);
+ }
}
return {};
}
+void VehiclePropertyStore::refreshTimestamp(int32_t propId, int32_t areaId, EventMode eventMode) {
+ std::unordered_map<PropIdAreaId, EventMode, PropIdAreaIdHash> eventModeByPropIdAreaId;
+ PropIdAreaId propIdAreaId = {
+ .propId = propId,
+ .areaId = areaId,
+ };
+ eventModeByPropIdAreaId[propIdAreaId] = eventMode;
+ refreshTimestamps(eventModeByPropIdAreaId);
+}
+
+void VehiclePropertyStore::refreshTimestamps(
+ std::unordered_map<PropIdAreaId, EventMode, PropIdAreaIdHash> eventModeByPropIdAreaId) {
+ std::vector<VehiclePropValue> updatedValues;
+ OnValuesChangeCallback onValuesChangeCallback = nullptr;
+ OnValueChangeCallback onValueChangeCallback = nullptr;
+ {
+ std::scoped_lock<std::mutex> g(mLock);
+
+ onValuesChangeCallback = mOnValuesChangeCallback;
+ onValueChangeCallback = mOnValueChangeCallback;
+
+ for (const auto& [propIdAreaId, eventMode] : eventModeByPropIdAreaId) {
+ int32_t propId = propIdAreaId.propId;
+ int32_t areaId = propIdAreaId.areaId;
+ VehiclePropertyStore::Record* record = getRecordLocked(propId);
+ if (record == nullptr) {
+ continue;
+ }
+
+ VehiclePropValue propValue = {
+ .areaId = areaId,
+ .prop = propId,
+ .value = {},
+ };
+
+ VehiclePropertyStore::RecordId recId = getRecordIdLocked(propValue, *record);
+ if (auto it = record->values.find(recId); it != record->values.end()) {
+ it->second->timestamp = elapsedRealtimeNano();
+ if (eventMode == EventMode::ALWAYS) {
+ updatedValues.push_back(*(it->second));
+ }
+ } else {
+ continue;
+ }
+ }
+ }
+
+ // Invoke the callback outside the lock to prevent dead-lock.
+ if (updatedValues.empty()) {
+ return;
+ }
+ if (!onValuesChangeCallback && !onValueChangeCallback) {
+ // If no callback is set, then we don't have to do anything.
+ for (const auto& updateValue : updatedValues) {
+ ALOGW("No callback registered, ignoring property update for propId: %" PRId32
+ ", area ID: %" PRId32,
+ updateValue.prop, updateValue.areaId);
+ }
+ return;
+ }
+ if (onValuesChangeCallback != nullptr) {
+ onValuesChangeCallback(updatedValues);
+ } else {
+ // Fallback to use multiple onValueChangeCallback
+ for (const auto& updateValue : updatedValues) {
+ onValueChangeCallback(updateValue);
+ }
+ }
+}
+
void VehiclePropertyStore::removeValue(const VehiclePropValue& propValue) {
std::scoped_lock<std::mutex> g(mLock);
@@ -263,6 +366,17 @@
return &record->propConfig;
}
+VhalResult<VehiclePropConfig> VehiclePropertyStore::getPropConfig(int32_t propId) const {
+ std::scoped_lock<std::mutex> g(mLock);
+
+ const VehiclePropertyStore::Record* record = getRecordLocked(propId);
+ if (record == nullptr) {
+ return StatusError(StatusCode::INVALID_ARG) << "property: " << propId << " not registered";
+ }
+
+ return record->propConfig;
+}
+
void VehiclePropertyStore::setOnValueChangeCallback(
const VehiclePropertyStore::OnValueChangeCallback& callback) {
std::scoped_lock<std::mutex> g(mLock);
@@ -270,6 +384,13 @@
mOnValueChangeCallback = callback;
}
+void VehiclePropertyStore::setOnValuesChangeCallback(
+ const VehiclePropertyStore::OnValuesChangeCallback& callback) {
+ std::scoped_lock<std::mutex> g(mLock);
+
+ mOnValuesChangeCallback = callback;
+}
+
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp
index 9c2c563..69ec7a2 100644
--- a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp
@@ -28,7 +28,6 @@
"libgtest",
"libgmock",
],
- header_libs: ["VehicleHalTestUtilHeaders"],
defaults: ["VehicleHalDefaults"],
test_suites: ["device-tests"],
}
diff --git a/automotive/vehicle/aidl/impl/utils/common/test/RecurrentTimerTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/RecurrentTimerTest.cpp
index 62046f3..e8ac2a5 100644
--- a/automotive/vehicle/aidl/impl/utils/common/test/RecurrentTimerTest.cpp
+++ b/automotive/vehicle/aidl/impl/utils/common/test/RecurrentTimerTest.cpp
@@ -60,9 +60,14 @@
mCallbacks.clear();
}
- size_t countTimerCallbackQueue(RecurrentTimer* timer) {
+ size_t countCallbackInfoById(RecurrentTimer* timer) {
std::scoped_lock<std::mutex> lockGuard(timer->mLock);
- return timer->mCallbackQueue.size();
+ return timer->mCallbackInfoById.size();
+ }
+
+ size_t countIdByCallback(RecurrentTimer* timer) {
+ std::scoped_lock<std::mutex> lockGuard(timer->mLock);
+ return timer->mIdByCallback.size();
}
private:
@@ -109,6 +114,9 @@
<< "Not enough callbacks called before timeout";
timer.unregisterTimerCallback(action);
+
+ ASSERT_EQ(countCallbackInfoById(&timer), 0u);
+ ASSERT_EQ(countIdByCallback(&timer), 0u);
}
TEST_F(RecurrentTimerTest, testDestroyTimerWithCallback) {
@@ -198,8 +206,8 @@
timer.unregisterTimerCallback(action);
- // Make sure there is no item in the callback queue.
- ASSERT_EQ(countTimerCallbackQueue(&timer), static_cast<size_t>(0));
+ ASSERT_EQ(countCallbackInfoById(&timer), 0u);
+ ASSERT_EQ(countIdByCallback(&timer), 0u);
}
TEST_F(RecurrentTimerTest, testRegisterCallbackMultipleTimesNoDeadLock) {
diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp
index fea5034..6646b7e 100644
--- a/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp
+++ b/automotive/vehicle/aidl/impl/utils/common/test/VehiclePropertyStoreTest.cpp
@@ -20,6 +20,7 @@
#include <VehicleUtils.h>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
+#include <utils/SystemClock.h>
namespace android {
namespace hardware {
@@ -101,16 +102,16 @@
ASSERT_EQ(configs.size(), static_cast<size_t>(2));
}
-TEST_F(VehiclePropertyStoreTest, testGetConfig) {
- VhalResult<const VehiclePropConfig*> result =
- mStore->getConfig(toInt(VehicleProperty::INFO_FUEL_CAPACITY));
+TEST_F(VehiclePropertyStoreTest, testGetPropConfig) {
+ VhalResult<VehiclePropConfig> result =
+ mStore->getPropConfig(toInt(VehicleProperty::INFO_FUEL_CAPACITY));
ASSERT_RESULT_OK(result);
- ASSERT_EQ(*(result.value()), mConfigFuelCapacity);
+ ASSERT_EQ(result.value(), mConfigFuelCapacity);
}
-TEST_F(VehiclePropertyStoreTest, testGetConfigWithInvalidPropId) {
- VhalResult<const VehiclePropConfig*> result = mStore->getConfig(INVALID_PROP_ID);
+TEST_F(VehiclePropertyStoreTest, testGetPropConfigWithInvalidPropId) {
+ VhalResult<VehiclePropConfig> result = mStore->getPropConfig(INVALID_PROP_ID);
EXPECT_FALSE(result.ok()) << "expect error when getting a config for an invalid property ID";
EXPECT_EQ(result.error().code(), StatusCode::INVALID_ARG);
@@ -509,6 +510,151 @@
ASSERT_EQ(updatedValue.prop, INVALID_PROP_ID);
}
+TEST_F(VehiclePropertyStoreTest, testPropertyChangeCallbackUseVehiclePropertyStore_noDeadLock) {
+ VehiclePropValue fuelCapacity = {
+ .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY),
+ .value = {.floatValues = {1.0}},
+ };
+
+ std::vector<VehiclePropConfig> configs;
+
+ mStore->setOnValueChangeCallback(
+ [this, &configs]([[maybe_unused]] const VehiclePropValue& value) {
+ configs = mStore->getAllConfigs();
+ });
+
+ ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(fuelCapacity), /*updateStatus=*/true,
+ VehiclePropertyStore::EventMode::ALWAYS));
+ ASSERT_EQ(configs.size(), static_cast<size_t>(2));
+}
+
+TEST_F(VehiclePropertyStoreTest, testOnValuesChangeCallback) {
+ std::vector<VehiclePropValue> updatedValues;
+ VehiclePropValue fuelCapacity = {
+ .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY),
+ .value = {.floatValues = {1.0}},
+ };
+ ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(fuelCapacity)));
+
+ mStore->setOnValuesChangeCallback(
+ [&updatedValues](std::vector<VehiclePropValue> values) { updatedValues = values; });
+
+ fuelCapacity.value.floatValues[0] = 2.0;
+ fuelCapacity.timestamp = 1;
+
+ ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(fuelCapacity)));
+
+ ASSERT_THAT(updatedValues, ElementsAre(fuelCapacity));
+}
+
+TEST_F(VehiclePropertyStoreTest, testRefreshTimestamp) {
+ std::vector<VehiclePropValue> updatedValues;
+ mStore->setOnValuesChangeCallback(
+ [&updatedValues](std::vector<VehiclePropValue> values) { updatedValues = values; });
+
+ int64_t now = elapsedRealtimeNano();
+ int propId = toInt(VehicleProperty::TIRE_PRESSURE);
+ int areaId = WHEEL_FRONT_LEFT;
+ VehiclePropValue tirePressure = {
+ .prop = propId,
+ .areaId = areaId,
+ .value = {.floatValues = {1.0}},
+ };
+ ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(tirePressure)));
+ updatedValues.clear();
+
+ mStore->refreshTimestamp(propId, areaId, VehiclePropertyStore::EventMode::ALWAYS);
+
+ ASSERT_EQ(updatedValues.size(), 1u);
+ ASSERT_EQ(updatedValues[0].prop, propId);
+ ASSERT_EQ(updatedValues[0].areaId, areaId);
+ ASSERT_EQ(updatedValues[0].value.floatValues[0], 1.0);
+ int64_t timestamp = updatedValues[0].timestamp;
+ ASSERT_GE(timestamp, now);
+
+ auto result = mStore->readValue(tirePressure);
+
+ ASSERT_RESULT_OK(result);
+ ASSERT_EQ((result.value())->timestamp, timestamp);
+}
+
+TEST_F(VehiclePropertyStoreTest, testRefreshTimestamp_eventModeOnValueChange) {
+ std::vector<VehiclePropValue> updatedValues;
+ mStore->setOnValuesChangeCallback(
+ [&updatedValues](std::vector<VehiclePropValue> values) { updatedValues = values; });
+
+ int64_t now = elapsedRealtimeNano();
+ int propId = toInt(VehicleProperty::TIRE_PRESSURE);
+ int areaId = WHEEL_FRONT_LEFT;
+ VehiclePropValue tirePressure = {
+ .prop = propId,
+ .areaId = areaId,
+ .value = {.floatValues = {1.0}},
+ };
+ ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(tirePressure)));
+ updatedValues.clear();
+
+ mStore->refreshTimestamp(propId, areaId, VehiclePropertyStore::EventMode::ON_VALUE_CHANGE);
+
+ ASSERT_EQ(updatedValues.size(), 0u)
+ << "Must generate no property update events if only the timestamp is refreshed";
+
+ auto result = mStore->readValue(tirePressure);
+
+ ASSERT_RESULT_OK(result);
+ ASSERT_GE((result.value())->timestamp, now)
+ << "Even though event mode is on value change, the store timestamp must be updated";
+}
+
+TEST_F(VehiclePropertyStoreTest, testRefreshTimestamps) {
+ std::vector<VehiclePropValue> updatedValues;
+ mStore->setOnValuesChangeCallback(
+ [&updatedValues](std::vector<VehiclePropValue> values) { updatedValues = values; });
+
+ int64_t now = elapsedRealtimeNano();
+ int propId1 = toInt(VehicleProperty::INFO_FUEL_CAPACITY);
+ int areaId1 = 0;
+ VehiclePropValue fuelCapacity = {
+ .prop = propId1,
+ .areaId = areaId1,
+ .value = {.floatValues = {1.0}},
+ };
+ ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(fuelCapacity)));
+
+ int propId2 = toInt(VehicleProperty::TIRE_PRESSURE);
+ int areaId2 = WHEEL_FRONT_LEFT;
+ VehiclePropValue tirePressure = {
+ .prop = propId2,
+ .areaId = areaId2,
+ .value = {.floatValues = {2.0}},
+ };
+ ASSERT_RESULT_OK(mStore->writeValue(mValuePool->obtain(tirePressure)));
+ updatedValues.clear();
+
+ std::unordered_map<PropIdAreaId, VehiclePropertyStore::EventMode, PropIdAreaIdHash>
+ eventModeByPropIdAreaId;
+ eventModeByPropIdAreaId[PropIdAreaId{
+ .propId = propId1,
+ .areaId = areaId1,
+ }] = VehiclePropertyStore::EventMode::ALWAYS;
+ eventModeByPropIdAreaId[PropIdAreaId{
+ .propId = propId2,
+ .areaId = areaId2,
+ }] = VehiclePropertyStore::EventMode::ALWAYS;
+
+ mStore->refreshTimestamps(eventModeByPropIdAreaId);
+
+ ASSERT_EQ(updatedValues.size(), 2u);
+ ASSERT_EQ(updatedValues[0].prop, propId1);
+ ASSERT_EQ(updatedValues[0].areaId, areaId1);
+ ASSERT_EQ(updatedValues[0].value.floatValues[0], 1.0);
+ ASSERT_GE(updatedValues[0].timestamp, now);
+ ASSERT_EQ(updatedValues[1].prop, propId2);
+ ASSERT_EQ(updatedValues[1].areaId, areaId2);
+ ASSERT_EQ(updatedValues[1].value.floatValues[0], 2.0);
+ ASSERT_GE(updatedValues[1].timestamp, now);
+}
+
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp
index 411539b..9abb2a2 100644
--- a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp
+++ b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp
@@ -16,7 +16,6 @@
#include <ConcurrentQueue.h>
#include <PropertyUtils.h>
-#include <TestPropertyUtils.h>
#include <VehicleUtils.h>
#include <gtest/gtest.h>
@@ -56,6 +55,9 @@
constexpr int32_t int64VecProp = toInt(VehicleProperty::WHEEL_TICK);
constexpr int32_t floatProp = toInt(VehicleProperty::ENV_OUTSIDE_TEMPERATURE);
constexpr int32_t floatVecProp = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION);
+constexpr int32_t kMixedTypePropertyForTest = 0x1111 | toInt(VehiclePropertyGroup::VENDOR) |
+ toInt(VehicleArea::GLOBAL) |
+ toInt(VehiclePropertyType::MIXED);
std::vector<InvalidPropValueTestCase> getInvalidPropValuesTestCases() {
return std::vector<InvalidPropValueTestCase>(
diff --git a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h b/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h
deleted file mode 100644
index 1400288..0000000
--- a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef android_hardware_automotive_vehicle_utils_test_include_TestPropertyUtils_H_
-#define android_hardware_automotive_vehicle_utils_test_include_TestPropertyUtils_H_
-
-#include <VehicleHalTypes.h>
-#include <VehicleUtils.h>
-
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace vehicle {
-
-namespace testpropertyutils_impl {
-
-// These names are not part of the API since we only expose ints.
-using ::aidl::android::hardware::automotive::vehicle::VehicleArea;
-using ::aidl::android::hardware::automotive::vehicle::VehicleProperty;
-using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup;
-using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType;
-
-} // namespace testpropertyutils_impl
-
-// Converts the system property to the vendor property.
-// WARNING: This is only for the end-to-end testing, Should NOT include in the user build.
-inline constexpr int32_t toVendor(
- const aidl::android::hardware::automotive::vehicle::VehicleProperty& prop) {
- return (toInt(prop) & ~toInt(testpropertyutils_impl::VehiclePropertyGroup::MASK)) |
- toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR);
-}
-
-// These properties are used for the end-to-end testing of ClusterHomeService.
-constexpr int32_t VENDOR_CLUSTER_SWITCH_UI =
- toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_SWITCH_UI);
-constexpr int32_t VENDOR_CLUSTER_DISPLAY_STATE =
- toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_DISPLAY_STATE);
-constexpr int32_t VENDOR_CLUSTER_REPORT_STATE =
- toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_REPORT_STATE);
-constexpr int32_t VENDOR_CLUSTER_REQUEST_DISPLAY =
- toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_REQUEST_DISPLAY);
-constexpr int32_t VENDOR_CLUSTER_NAVIGATION_STATE =
- toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_NAVIGATION_STATE);
-
-// These properties are placeholder properties for developers to test new features without
-// implementing a real property.
-constexpr int32_t PLACEHOLDER_PROPERTY_INT =
- 0x2a11 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::INT32);
-constexpr int32_t PLACEHOLDER_PROPERTY_FLOAT =
- 0x2a11 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::FLOAT);
-constexpr int32_t PLACEHOLDER_PROPERTY_BOOLEAN =
- 0x2a11 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::BOOLEAN);
-constexpr int32_t PLACEHOLDER_PROPERTY_STRING =
- 0x2a11 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::STRING);
-
-// This property is used for testing LargeParcelable marshalling/unmarhsalling end to end.
-// It acts as an regular property that stores the property value when setting and return the value
-// when getting, except that all the byteValues used in the setValue response would be filled in
-// the reverse order.
-// 0x21702a12
-constexpr int32_t ECHO_REVERSE_BYTES = 0x2a12 |
- toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::BYTES);
-
-// This property is used for testing vendor error codes end to end.
-// 0x21402a13
-constexpr int32_t VENDOR_PROPERTY_ID = 0x2a13 |
- toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::INT32);
-
-// This property is used for test purpose. End to end tests use this property to test set and get
-// method for MIXED type properties.
-constexpr int32_t kMixedTypePropertyForTest =
- 0x1111 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::MIXED);
-} // namespace vehicle
-} // namespace automotive
-} // namespace hardware
-} // namespace android
-
-#endif // android_hardware_automotive_vehicle_utils_test_include_TestPropertyUtils_H_
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/automotive/vehicle/aidl/impl/utils/test_vendor_properties/Android.bp
similarity index 65%
copy from automotive/vehicle/aidl/impl/utils/test/Android.bp
copy to automotive/vehicle/aidl/impl/utils/test_vendor_properties/Android.bp
index ad9954f..f7da7e0 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/utils/test_vendor_properties/Android.bp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -18,9 +18,14 @@
default_applicable_licenses: ["Android-Apache-2.0"],
}
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
+filegroup {
+ name: "VhalTestVendorProperties",
+ srcs: [
+ "**/*.aidl",
+ ],
+ visibility: [
+ "//hardware/interfaces/automotive/vehicle/aidl:__subpackages__",
+ "//packages/services/Car:__subpackages__",
+ "//cts/tests/tests/car_permission_tests",
+ ],
}
diff --git a/automotive/vehicle/aidl/impl/utils/test_vendor_properties/android/hardware/automotive/vehicle/TestVendorProperty.aidl b/automotive/vehicle/aidl/impl/utils/test_vendor_properties/android/hardware/automotive/vehicle/TestVendorProperty.aidl
new file mode 100644
index 0000000..3c877fa
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/utils/test_vendor_properties/android/hardware/automotive/vehicle/TestVendorProperty.aidl
@@ -0,0 +1,145 @@
+/*
+ * 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.
+ */
+
+package android.hardware.automotive.vehicle;
+
+/**
+ * Test vendor properties used in reference VHAL implementation.
+ */
+@Backing(type="int")
+enum TestVendorProperty {
+
+ /**
+ * Vendor version of CLUSTER_SWITCH_UI, used for the end-to-end testing of ClusterHomeService.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.INT32,
+ */
+ VENDOR_CLUSTER_SWITCH_UI = 0x0F34 + 0x20000000 + 0x01000000 + 0x00400000,
+
+ /**
+ * Vendor version of CLUSTER_DISPLAY_STATE, used for the end-to-end testing of
+ * ClusterHomeService.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.INT32_VEC
+ */
+ VENDOR_CLUSTER_DISPLAY_STATE = 0x0F35 + 0x20000000 + 0x01000000 + 0x00410000,
+
+ /**
+ * Vendor version of CLUSTER_REPORT_STATE, used for the end-to-end testing of
+ * ClusterHomeService.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyGroup.MIXED
+ */
+ VENDOR_CLUSTER_REPORT_STATE = 0x0F36 + 0x20000000 + 0x01000000 + 0x00E00000,
+
+ /**
+ * Vendor version of CLUSTER_REQUEST_DISPLAY, used for the end-to-end testing of
+ * ClusterHomeService.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.INT32
+ */
+ VENDOR_CLUSTER_REQUEST_DISPLAY = 0x0F37 + 0x20000000 + 0x01000000 + 0x00400000,
+
+ /**
+ * Vendor version of CLUSTER_NAVIGATION_STATE, used for the end-to-end testing of
+ * ClusterHomeService.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.BYTES
+ */
+ VENDOR_CLUSTER_NAVIGATION_STATE = 0x0F38 + 0x20000000 + 0x01000000 + 0x00700000,
+
+ // These properties are placeholder properties for developers to test new features without
+ // implementing a real property.
+
+ /**
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.INT32
+ */
+ PLACEHOLDER_PROPERTY_INT = 0x2A11 + 0x20000000 + 0x01000000 + 0x00400000,
+
+ /**
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.FLOAT
+ */
+ PLACEHOLDER_PROPERTY_FLOAT = 0x2A11 + 0x20000000 + 0x01000000 + 0x00600000,
+
+ /**
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.BOOLEAN
+ */
+ PLACEHOLDER_PROPERTY_BOOLEAN = 0x2A11 + 0x20000000 + 0x01000000 + 0x00200000,
+
+ /**
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.STRING
+ */
+ PLACEHOLDER_PROPERTY_STRING = 0x2A11 + 0x20000000 + 0x01000000 + 0x00100000,
+
+ /**
+ * This property is used for testing LargeParcelable marshalling/unmarhsalling end to end.
+ * It acts as an regular property that stores the property value when setting and return the
+ * value when getting, except that all the byteValues used in the setValue response would be
+ * filled in the reverse order.
+ *
+ * This is used in {@code VehicleHalLargeParcelableTest}.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.BYTES
+ *
+ * 0x21702a12
+ */
+ ECHO_REVERSE_BYTES = 0x2A12 + 0x20000000 + 0x01000000 + 0x00700000,
+
+ /**
+ * This property is used for testing vendor error codes end to end.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.INT32
+ *
+ * 0x21402a13
+ */
+ VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING = 0x2A13 + 0x20000000 + 0x01000000 + 0x00400000,
+
+ /**
+ * This property is used for test purpose. End to end tests use this property to test set and
+ * get method for MIXED type properties.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyGroup.MIXED
+ */
+ MIXED_TYPE_PROPERTY_FOR_TEST = 0x1111 + 0x20000000 + 0x01000000 + 0x00E00000,
+
+ /**
+ * Property used for {@code CarVendorPropertyCustomPermissionTest}.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.DOOR | VehiclePropertyGroup.BOOLEAN
+ */
+ VENDOR_EXTENSION_BOOLEAN_PROPERTY = 0x0101 + 0x20000000 + 0x06000000 + 0x00200000,
+
+ /**
+ * Property used for {@code CarVendorPropertyCustomPermissionTest}.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.SEAT | VehiclePropertyGroup.FLOAT
+ */
+ VENDOR_EXTENSION_FLOAT_PROPERTY = 0x102 + 0x20000000 + 0x05000000 + 0x00600000,
+
+ /**
+ * Property used for {@code CarVendorPropertyCustomPermissionTest}.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.WINDOW | VehiclePropertyGroup.INT32
+ */
+ VENDOR_EXTENSION_INT_PROPERTY = 0x103 + 0x20000000 + 0x03000000 + 0x00400000,
+
+ /**
+ * Property used for {@code CarVendorPropertyCustomPermissionTest}.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyGroup.STRING
+ */
+ VENDOR_EXTENSION_STRING_PROPERTY = 0x103 + 0x20000000 + 0x01000000 + 0x00100000,
+}
diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp
index 2ea67f8..e263d87 100644
--- a/automotive/vehicle/aidl/impl/vhal/Android.bp
+++ b/automotive/vehicle/aidl/impl/vhal/Android.bp
@@ -20,7 +20,7 @@
}
cc_binary {
- name: "android.hardware.automotive.vehicle@V1-default-service",
+ name: "android.hardware.automotive.vehicle@V3-default-service",
vendor: true,
defaults: [
"FakeVehicleHardwareDefaults",
@@ -56,6 +56,10 @@
"src/ConnectedClient.cpp",
"src/DefaultVehicleHal.cpp",
"src/SubscriptionManager.cpp",
+ // A target to check whether the file
+ // android.hardware.automotive.vehicle-types-meta.json needs update.
+ // The output is just an empty cpp file and not actually used.
+ ":check_generated_enum_metadata_json",
],
static_libs: [
"VehicleHalUtils",
@@ -69,7 +73,7 @@
}
cc_fuzz {
- name: "android.hardware.automotive.vehicle@V1-default-service_fuzzer",
+ name: "android.hardware.automotive.vehicle-default-service_fuzzer",
vendor: true,
defaults: [
"FakeVehicleHardwareDefaults",
diff --git a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h
index b3f4a0f..addc901 100644
--- a/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h
+++ b/automotive/vehicle/aidl/impl/vhal/include/ConnectedClient.h
@@ -99,13 +99,10 @@
std::shared_ptr<const std::function<void(std::vector<ResultType>)>> mResultCallback;
};
-// A class to represent a client that calls {@code IVehicle.subscribe}.
-class SubscriptionClient final : public ConnectedClient {
+class SubscriptionClient {
public:
- SubscriptionClient(std::shared_ptr<PendingRequestPool> requestPool, CallbackType callback);
-
- // Gets the callback to be called when the request for this client has finished.
- std::shared_ptr<const IVehicleHardware::GetValuesCallback> getResultCallback();
+ using CallbackType =
+ std::shared_ptr<aidl::android::hardware::automotive::vehicle::IVehicleCallback>;
// Marshals the updated values into largeParcelable and sends it through {@code onPropertyEvent}
// callback.
@@ -119,21 +116,6 @@
CallbackType callback,
std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropError>&&
vehiclePropErrors);
-
- protected:
- // Gets the callback to be called when the request for this client has timeout.
- std::shared_ptr<const PendingRequestPool::TimeoutCallbackFunc> getTimeoutCallback() override;
-
- private:
- // The following members are only initialized during construction.
- std::shared_ptr<const PendingRequestPool::TimeoutCallbackFunc> mTimeoutCallback;
- std::shared_ptr<const IVehicleHardware::GetValuesCallback> mResultCallback;
- std::shared_ptr<const IVehicleHardware::PropertyChangeCallback> mPropertyChangeCallback;
-
- static void onGetValueResults(
- const void* clientId, CallbackType callback,
- std::shared_ptr<PendingRequestPool> requestPool,
- std::vector<aidl::android::hardware::automotive::vehicle::GetValueResult> results);
};
} // namespace vehicle
diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h
index 74ad7ea..f7a71b4 100644
--- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h
+++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h
@@ -90,39 +90,6 @@
GetSetValuesClient<aidl::android::hardware::automotive::vehicle::SetValueResult,
aidl::android::hardware::automotive::vehicle::SetValueResults>;
- // A thread safe class to maintain an increasing request ID for each subscribe client. This
- // class is safe to pass to async callbacks.
- class SubscribeIdByClient {
- public:
- int64_t getId(const CallbackType& callback);
-
- private:
- std::mutex mLock;
- std::unordered_map<const AIBinder*, int64_t> mIds GUARDED_BY(mLock);
- };
-
- // A thread safe class to store all subscribe clients. This class is safe to pass to async
- // callbacks.
- class SubscriptionClients {
- public:
- SubscriptionClients(std::shared_ptr<PendingRequestPool> pool) : mPendingRequestPool(pool) {}
-
- std::shared_ptr<SubscriptionClient> maybeAddClient(const CallbackType& callback);
-
- std::shared_ptr<SubscriptionClient> getClient(const CallbackType& callback);
-
- void removeClient(const AIBinder* clientId);
-
- size_t countClients();
-
- private:
- std::mutex mLock;
- std::unordered_map<const AIBinder*, std::shared_ptr<SubscriptionClient>> mClients
- GUARDED_BY(mLock);
- // PendingRequestPool is thread-safe.
- std::shared_ptr<PendingRequestPool> mPendingRequestPool;
- };
-
// A wrapper for binder lifecycle operations to enable stubbing for test.
class BinderLifecycleInterface {
public:
@@ -177,6 +144,15 @@
std::shared_ptr<PendingRequestPool> mPendingRequestPool;
// SubscriptionManager is thread-safe.
std::shared_ptr<SubscriptionManager> mSubscriptionManager;
+ // ConcurrentQueue is thread-safe.
+ std::shared_ptr<ConcurrentQueue<aidl::android::hardware::automotive::vehicle::VehiclePropValue>>
+ mBatchedEventQueue;
+ // BatchingConsumer is thread-safe.
+ std::shared_ptr<
+ BatchingConsumer<aidl::android::hardware::automotive::vehicle::VehiclePropValue>>
+ mPropertyChangeEventsBatchingConsumer;
+ // Only set once during initialization.
+ std::chrono::nanoseconds mEventBatchingWindow;
std::mutex mLock;
std::unordered_map<const AIBinder*, std::unique_ptr<OnBinderDiedContext>> mOnBinderDiedContexts
@@ -185,8 +161,6 @@
GUARDED_BY(mLock);
std::unordered_map<const AIBinder*, std::shared_ptr<SetValuesClient>> mSetValuesClients
GUARDED_BY(mLock);
- // SubscriptionClients is thread-safe.
- std::shared_ptr<SubscriptionClients> mSubscriptionClients;
// mBinderLifecycleHandler is only going to be changed in test.
std::unique_ptr<BinderLifecycleInterface> mBinderLifecycleHandler;
@@ -217,6 +191,10 @@
const std::vector<aidl::android::hardware::automotive::vehicle::SubscribeOptions>&
options);
+ VhalResult<void> checkPermissionHelper(
+ const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value,
+ aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess accessToTest) const;
+
VhalResult<void> checkReadPermission(
const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value) const;
@@ -242,6 +220,21 @@
// mBinderEvents.
void onBinderDiedUnlinkedHandler();
+ size_t countSubscribeClients();
+
+ // Handles the property change events in batch.
+ void handleBatchedPropertyEvents(
+ std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropValue>&&
+ batchedEvents);
+
+ // Puts the property change events into a queue so that they can handled in batch.
+ static void batchPropertyChangeEvent(
+ const std::weak_ptr<ConcurrentQueue<
+ aidl::android::hardware::automotive::vehicle::VehiclePropValue>>&
+ batchedEventQueue,
+ std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropValue>&&
+ updatedValues);
+
// Gets or creates a {@code T} object for the client to or from {@code clients}.
template <class T>
static std::shared_ptr<T> getOrCreateClient(
@@ -250,7 +243,7 @@
static void onPropertyChangeEvent(
const std::weak_ptr<SubscriptionManager>& subscriptionManager,
- const std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropValue>&
+ std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropValue>&&
updatedValues);
static void onPropertySetErrorEvent(
diff --git a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h
index 301d56c..5053c96 100644
--- a/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h
+++ b/automotive/vehicle/aidl/impl/vhal/include/SubscriptionManager.h
@@ -36,20 +36,29 @@
namespace automotive {
namespace vehicle {
+// A structure to represent subscription config for one subscription client.
+struct SubConfig {
+ float sampleRateHz;
+ bool enableVur;
+};
+
// A class to represent all the subscription configs for a continuous [propId, areaId].
class ContSubConfigs final {
public:
using ClientIdType = const AIBinder*;
- void addClient(const ClientIdType& clientId, float sampleRateHz);
+ void addClient(const ClientIdType& clientId, float sampleRateHz, bool enableVur);
void removeClient(const ClientIdType& clientId);
float getMaxSampleRateHz() const;
+ bool isVurEnabled() const;
+ bool isVurEnabledForClient(const ClientIdType& clientId);
private:
float mMaxSampleRateHz = 0.;
- std::unordered_map<ClientIdType, float> mSampleRateHzByClient;
+ bool mEnableVur;
+ std::unordered_map<ClientIdType, SubConfig> mConfigByClient;
- void refreshMaxSampleRateHz();
+ void refreshCombinedConfig();
};
// A thread-safe subscription manager that manages all VHAL subscriptions.
@@ -58,6 +67,7 @@
using ClientIdType = const AIBinder*;
using CallbackType =
std::shared_ptr<aidl::android::hardware::automotive::vehicle::IVehicleCallback>;
+ using VehiclePropValue = aidl::android::hardware::automotive::vehicle::VehiclePropValue;
explicit SubscriptionManager(IVehicleHardware* vehicleHardware);
~SubscriptionManager();
@@ -92,12 +102,8 @@
// For a list of updated properties, returns a map that maps clients subscribing to
// the updated properties to a list of updated values. This would only return on-change property
// clients that should be informed for the given updated values.
- std::unordered_map<
- CallbackType,
- std::vector<const aidl::android::hardware::automotive::vehicle::VehiclePropValue*>>
- getSubscribedClients(
- const std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropValue>&
- updatedValues);
+ std::unordered_map<CallbackType, std::vector<VehiclePropValue>> getSubscribedClients(
+ std::vector<VehiclePropValue>&& updatedValues);
// For a list of set property error events, returns a map that maps clients subscribing to the
// properties to a list of errors for each client.
@@ -105,6 +111,9 @@
std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropError>>
getSubscribedClientsForErrorEvents(const std::vector<SetValueErrorEvent>& errorEvents);
+ // Returns the number of subscribed clients.
+ size_t countClients();
+
// Checks whether the sample rate is valid.
static bool checkSampleRateHz(float sampleRateHz);
@@ -114,28 +123,60 @@
IVehicleHardware* mVehicleHardware;
+ struct VehiclePropValueHashPropIdAreaId {
+ inline size_t operator()(const VehiclePropValue& vehiclePropValue) const {
+ size_t res = 0;
+ hashCombine(res, vehiclePropValue.prop);
+ hashCombine(res, vehiclePropValue.areaId);
+ return res;
+ }
+ };
+
+ struct VehiclePropValueEqualPropIdAreaId {
+ inline bool operator()(const VehiclePropValue& left, const VehiclePropValue& right) const {
+ return left.prop == right.prop && left.areaId == right.areaId;
+ }
+ };
+
mutable std::mutex mLock;
std::unordered_map<PropIdAreaId, std::unordered_map<ClientIdType, CallbackType>,
PropIdAreaIdHash>
- mClientsByPropIdArea GUARDED_BY(mLock);
+ mClientsByPropIdAreaId GUARDED_BY(mLock);
std::unordered_map<ClientIdType, std::unordered_set<PropIdAreaId, PropIdAreaIdHash>>
mSubscribedPropsByClient GUARDED_BY(mLock);
std::unordered_map<PropIdAreaId, ContSubConfigs, PropIdAreaIdHash> mContSubConfigsByPropIdArea
GUARDED_BY(mLock);
+ std::unordered_map<CallbackType,
+ std::unordered_set<VehiclePropValue, VehiclePropValueHashPropIdAreaId,
+ VehiclePropValueEqualPropIdAreaId>>
+ mContSubValuesByCallback GUARDED_BY(mLock);
VhalResult<void> addContinuousSubscriberLocked(const ClientIdType& clientId,
const PropIdAreaId& propIdAreaId,
- float sampleRateHz) REQUIRES(mLock);
+ float sampleRateHz, bool enableVur)
+ REQUIRES(mLock);
+ VhalResult<void> addOnChangeSubscriberLocked(const PropIdAreaId& propIdAreaId) REQUIRES(mLock);
+ // Removes the subscription client for the continuous [propId, areaId].
VhalResult<void> removeContinuousSubscriberLocked(const ClientIdType& clientId,
const PropIdAreaId& propIdAreaId)
REQUIRES(mLock);
+ // Removes one subscription client for the on-change [propId, areaId].
+ VhalResult<void> removeOnChangeSubscriberLocked(const PropIdAreaId& propIdAreaId)
+ REQUIRES(mLock);
- VhalResult<void> updateContSubConfigs(const PropIdAreaId& PropIdAreaId,
- const ContSubConfigs& newConfig) REQUIRES(mLock);
+ VhalResult<void> updateContSubConfigsLocked(const PropIdAreaId& PropIdAreaId,
+ const ContSubConfigs& newConfig) REQUIRES(mLock);
+
+ VhalResult<void> unsubscribePropIdAreaIdLocked(SubscriptionManager::ClientIdType clientId,
+ const PropIdAreaId& propIdAreaId)
+ REQUIRES(mLock);
// Checks whether the manager is empty. For testing purpose.
bool isEmpty();
+ bool isValueUpdatedLocked(const CallbackType& callback, const VehiclePropValue& value)
+ REQUIRES(mLock);
+
// Get the interval in nanoseconds accroding to sample rate.
static android::base::Result<int64_t> getIntervalNanos(float sampleRateHz);
};
diff --git a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp
index fb23a25..35b93d2 100644
--- a/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/src/ConnectedClient.cpp
@@ -250,36 +250,6 @@
template class GetSetValuesClient<GetValueResult, GetValueResults>;
template class GetSetValuesClient<SetValueResult, SetValueResults>;
-SubscriptionClient::SubscriptionClient(std::shared_ptr<PendingRequestPool> requestPool,
- std::shared_ptr<IVehicleCallback> callback)
- : ConnectedClient(requestPool, callback) {
- mTimeoutCallback = std::make_shared<const PendingRequestPool::TimeoutCallbackFunc>(
- [](std::unordered_set<int64_t> timeoutIds) {
- for (int64_t id : timeoutIds) {
- ALOGW("subscribe: requests with IDs: %" PRId64
- " has timed-out, not client informed, "
- "possibly one of recurrent requests for this subscription failed",
- id);
- }
- });
- auto requestPoolCopy = mRequestPool;
- const void* clientId = reinterpret_cast<const void*>(this);
- mResultCallback = std::make_shared<const IVehicleHardware::GetValuesCallback>(
- [clientId, callback, requestPoolCopy](std::vector<GetValueResult> results) {
- onGetValueResults(clientId, callback, requestPoolCopy, results);
- });
-}
-
-std::shared_ptr<const std::function<void(std::vector<GetValueResult>)>>
-SubscriptionClient::getResultCallback() {
- return mResultCallback;
-}
-
-std::shared_ptr<const PendingRequestPool::TimeoutCallbackFunc>
-SubscriptionClient::getTimeoutCallback() {
- return mTimeoutCallback;
-}
-
void SubscriptionClient::sendUpdatedValues(std::shared_ptr<IVehicleCallback> callback,
std::vector<VehiclePropValue>&& updatedValues) {
if (updatedValues.empty()) {
@@ -336,43 +306,6 @@
}
}
-void SubscriptionClient::onGetValueResults(const void* clientId,
- std::shared_ptr<IVehicleCallback> callback,
- std::shared_ptr<PendingRequestPool> requestPool,
- std::vector<GetValueResult> results) {
- std::unordered_set<int64_t> requestIds;
- for (const auto& result : results) {
- requestIds.insert(result.requestId);
- }
-
- auto finishedRequests = requestPool->tryFinishRequests(clientId, requestIds);
- std::vector<VehiclePropValue> propValues;
- for (auto& result : results) {
- int64_t requestId = result.requestId;
- if (finishedRequests.find(requestId) == finishedRequests.end()) {
- ALOGE("subscribe[%" PRId64
- "]: no pending request for the result from hardware, "
- "possibly already time-out",
- requestId);
- continue;
- }
- if (result.status != StatusCode::OK) {
- ALOGE("subscribe[%" PRId64
- "]: hardware returns non-ok status for getValues, status: "
- "%d",
- requestId, toInt(result.status));
- continue;
- }
- if (!result.prop.has_value()) {
- ALOGE("subscribe[%" PRId64 "]: no prop value in getValues result", requestId);
- continue;
- }
- propValues.push_back(std::move(result.prop.value()));
- }
-
- sendUpdatedValues(callback, std::move(propValues));
-}
-
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp
index 0d5c070..76d2f31 100644
--- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp
@@ -32,6 +32,7 @@
#include <utils/Trace.h>
#include <inttypes.h>
+#include <chrono>
#include <set>
#include <unordered_set>
@@ -92,39 +93,6 @@
} // namespace
-std::shared_ptr<SubscriptionClient> DefaultVehicleHal::SubscriptionClients::maybeAddClient(
- const CallbackType& callback) {
- std::scoped_lock<std::mutex> lockGuard(mLock);
- return getOrCreateClient(&mClients, callback, mPendingRequestPool);
-}
-
-std::shared_ptr<SubscriptionClient> DefaultVehicleHal::SubscriptionClients::getClient(
- const CallbackType& callback) {
- std::scoped_lock<std::mutex> lockGuard(mLock);
- const AIBinder* clientId = callback->asBinder().get();
- if (mClients.find(clientId) == mClients.end()) {
- return nullptr;
- }
- return mClients[clientId];
-}
-
-int64_t DefaultVehicleHal::SubscribeIdByClient::getId(const CallbackType& callback) {
- std::scoped_lock<std::mutex> lockGuard(mLock);
- // This would be initialized to 0 if callback does not exist in the map.
- int64_t subscribeId = (mIds[callback->asBinder().get()])++;
- return subscribeId;
-}
-
-void DefaultVehicleHal::SubscriptionClients::removeClient(const AIBinder* clientId) {
- std::scoped_lock<std::mutex> lockGuard(mLock);
- mClients.erase(clientId);
-}
-
-size_t DefaultVehicleHal::SubscriptionClients::countClients() {
- std::scoped_lock<std::mutex> lockGuard(mLock);
- return mClients.size();
-}
-
DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr<IVehicleHardware> vehicleHardware)
: mVehicleHardware(std::move(vehicleHardware)),
mPendingRequestPool(std::make_shared<PendingRequestPool>(TIMEOUT_IN_NANO)) {
@@ -132,17 +100,34 @@
return;
}
- mSubscriptionClients = std::make_shared<SubscriptionClients>(mPendingRequestPool);
-
- auto subscribeIdByClient = std::make_shared<SubscribeIdByClient>();
IVehicleHardware* vehicleHardwarePtr = mVehicleHardware.get();
mSubscriptionManager = std::make_shared<SubscriptionManager>(vehicleHardwarePtr);
+ mEventBatchingWindow = mVehicleHardware->getPropertyOnChangeEventBatchingWindow();
+ if (mEventBatchingWindow != std::chrono::nanoseconds(0)) {
+ mBatchedEventQueue = std::make_shared<ConcurrentQueue<VehiclePropValue>>();
+ mPropertyChangeEventsBatchingConsumer =
+ std::make_shared<BatchingConsumer<VehiclePropValue>>();
+ mPropertyChangeEventsBatchingConsumer->run(
+ mBatchedEventQueue.get(), mEventBatchingWindow,
+ [this](std::vector<VehiclePropValue> batchedEvents) {
+ handleBatchedPropertyEvents(std::move(batchedEvents));
+ });
+ }
+ std::weak_ptr<ConcurrentQueue<VehiclePropValue>> batchedEventQueueCopy = mBatchedEventQueue;
+ std::chrono::nanoseconds eventBatchingWindow = mEventBatchingWindow;
std::weak_ptr<SubscriptionManager> subscriptionManagerCopy = mSubscriptionManager;
mVehicleHardware->registerOnPropertyChangeEvent(
std::make_unique<IVehicleHardware::PropertyChangeCallback>(
- [subscriptionManagerCopy](std::vector<VehiclePropValue> updatedValues) {
- onPropertyChangeEvent(subscriptionManagerCopy, updatedValues);
+ [subscriptionManagerCopy, batchedEventQueueCopy,
+ eventBatchingWindow](std::vector<VehiclePropValue> updatedValues) {
+ if (eventBatchingWindow != std::chrono::nanoseconds(0)) {
+ batchPropertyChangeEvent(batchedEventQueueCopy,
+ std::move(updatedValues));
+ } else {
+ onPropertyChangeEvent(subscriptionManagerCopy,
+ std::move(updatedValues));
+ }
}));
mVehicleHardware->registerOnPropertySetErrorEvent(
std::make_unique<IVehicleHardware::PropertySetErrorCallback>(
@@ -175,26 +160,48 @@
// mRecurrentAction uses pointer to mVehicleHardware, so it has to be unregistered before
// mVehicleHardware.
mRecurrentTimer.unregisterTimerCallback(mRecurrentAction);
+
+ if (mBatchedEventQueue) {
+ // mPropertyChangeEventsBatchingConsumer uses mSubscriptionManager and mBatchedEventQueue.
+ mBatchedEventQueue->deactivate();
+ mPropertyChangeEventsBatchingConsumer->requestStop();
+ mPropertyChangeEventsBatchingConsumer->waitStopped();
+ mPropertyChangeEventsBatchingConsumer.reset();
+ mBatchedEventQueue.reset();
+ }
+
// mSubscriptionManager uses pointer to mVehicleHardware, so it has to be destroyed before
// mVehicleHardware.
mSubscriptionManager.reset();
mVehicleHardware.reset();
}
+void DefaultVehicleHal::batchPropertyChangeEvent(
+ const std::weak_ptr<ConcurrentQueue<VehiclePropValue>>& batchedEventQueue,
+ std::vector<VehiclePropValue>&& updatedValues) {
+ auto batchedEventQueueStrong = batchedEventQueue.lock();
+ if (batchedEventQueueStrong == nullptr) {
+ ALOGW("the batched property events queue is destroyed, DefaultVehicleHal is ending");
+ return;
+ }
+ batchedEventQueueStrong->push(std::move(updatedValues));
+}
+
+void DefaultVehicleHal::handleBatchedPropertyEvents(std::vector<VehiclePropValue>&& batchedEvents) {
+ onPropertyChangeEvent(mSubscriptionManager, std::move(batchedEvents));
+}
+
void DefaultVehicleHal::onPropertyChangeEvent(
const std::weak_ptr<SubscriptionManager>& subscriptionManager,
- const std::vector<VehiclePropValue>& updatedValues) {
+ std::vector<VehiclePropValue>&& updatedValues) {
+ ATRACE_CALL();
auto manager = subscriptionManager.lock();
if (manager == nullptr) {
ALOGW("the SubscriptionManager is destroyed, DefaultVehicleHal is ending");
return;
}
- auto updatedValuesByClients = manager->getSubscribedClients(updatedValues);
- for (const auto& [callback, valuePtrs] : updatedValuesByClients) {
- std::vector<VehiclePropValue> values;
- for (const VehiclePropValue* valuePtr : valuePtrs) {
- values.push_back(*valuePtr);
- }
+ auto updatedValuesByClients = manager->getSubscribedClients(std::move(updatedValues));
+ for (auto& [callback, values] : updatedValuesByClients) {
SubscriptionClient::sendUpdatedValues(callback, std::move(values));
}
}
@@ -262,7 +269,6 @@
ALOGD("binder died, client ID: %p", clientId);
mSetValuesClients.erase(clientId);
mGetValuesClients.erase(clientId);
- mSubscriptionClients->removeClient(clientId);
mSubscriptionManager->unsubscribe(clientId);
}
@@ -301,10 +307,6 @@
DefaultVehicleHal::getOrCreateClient<DefaultVehicleHal::SetValuesClient>(
std::unordered_map<const AIBinder*, std::shared_ptr<SetValuesClient>>* clients,
const CallbackType& callback, std::shared_ptr<PendingRequestPool> pendingRequestPool);
-template std::shared_ptr<SubscriptionClient>
-DefaultVehicleHal::getOrCreateClient<SubscriptionClient>(
- std::unordered_map<const AIBinder*, std::shared_ptr<SubscriptionClient>>* clients,
- const CallbackType& callback, std::shared_ptr<PendingRequestPool> pendingRequestPool);
void DefaultVehicleHal::setTimeout(int64_t timeoutInNano) {
mPendingRequestPool = std::make_unique<PendingRequestPool>(timeoutInNano);
@@ -604,6 +606,23 @@
return vectorToStableLargeParcelable(std::move(configs), output);
}
+bool hasRequiredAccess(VehiclePropertyAccess access, VehiclePropertyAccess requiredAccess) {
+ return access == requiredAccess || access == VehiclePropertyAccess::READ_WRITE;
+}
+
+bool areaConfigsHaveRequiredAccess(const std::vector<VehicleAreaConfig>& areaConfigs,
+ VehiclePropertyAccess requiredAccess) {
+ if (areaConfigs.empty()) {
+ return false;
+ }
+ for (VehicleAreaConfig areaConfig : areaConfigs) {
+ if (!hasRequiredAccess(areaConfig.access, requiredAccess)) {
+ return false;
+ }
+ }
+ return true;
+}
+
VhalResult<void> DefaultVehicleHal::checkSubscribeOptions(
const std::vector<SubscribeOptions>& options) {
for (const auto& option : options) {
@@ -613,6 +632,26 @@
<< StringPrintf("no config for property, ID: %" PRId32, propId);
}
const VehiclePropConfig& config = mConfigsByPropId[propId];
+ std::vector<VehicleAreaConfig> areaConfigs;
+ if (option.areaIds.empty()) {
+ areaConfigs = config.areaConfigs;
+ } else {
+ std::unordered_map<int, VehicleAreaConfig> areaConfigByAreaId;
+ for (const VehicleAreaConfig& areaConfig : config.areaConfigs) {
+ areaConfigByAreaId.emplace(areaConfig.areaId, areaConfig);
+ }
+ for (int areaId : option.areaIds) {
+ auto it = areaConfigByAreaId.find(areaId);
+ if (it != areaConfigByAreaId.end()) {
+ areaConfigs.push_back(it->second);
+ } else if (areaId != 0 || !areaConfigByAreaId.empty()) {
+ return StatusError(StatusCode::INVALID_ARG)
+ << StringPrintf("invalid area ID: %" PRId32 " for prop ID: %" PRId32
+ ", not listed in config",
+ areaId, propId);
+ }
+ }
+ }
if (config.changeMode != VehiclePropertyChangeMode::ON_CHANGE &&
config.changeMode != VehiclePropertyChangeMode::CONTINUOUS) {
@@ -620,8 +659,9 @@
<< "only support subscribing to ON_CHANGE or CONTINUOUS property";
}
- if (config.access != VehiclePropertyAccess::READ &&
- config.access != VehiclePropertyAccess::READ_WRITE) {
+ // Either VehiclePropConfig.access or VehicleAreaConfig.access will be specified
+ if (!hasRequiredAccess(config.access, VehiclePropertyAccess::READ) &&
+ !areaConfigsHaveRequiredAccess(areaConfigs, VehiclePropertyAccess::READ)) {
return StatusError(StatusCode::ACCESS_DENIED)
<< StringPrintf("Property %" PRId32 " has no read access", propId);
}
@@ -643,20 +683,6 @@
<< "invalid sample rate: " << sampleRateHz << " HZ";
}
}
-
- if (isGlobalProp(propId)) {
- continue;
- }
-
- // Non-global property.
- for (int32_t areaId : option.areaIds) {
- if (auto areaConfig = getAreaConfig(propId, areaId, config); areaConfig == nullptr) {
- return StatusError(StatusCode::INVALID_ARG)
- << StringPrintf("invalid area ID: %" PRId32 " for prop ID: %" PRId32
- ", not listed in config",
- areaId, propId);
- }
- }
}
return {};
}
@@ -694,7 +720,39 @@
if (config.changeMode == VehiclePropertyChangeMode::CONTINUOUS) {
optionCopy.sampleRate = getDefaultSampleRateHz(
optionCopy.sampleRate, config.minSampleRate, config.maxSampleRate);
- continuousSubscriptions.push_back(std::move(optionCopy));
+ if (!optionCopy.enableVariableUpdateRate) {
+ continuousSubscriptions.push_back(std::move(optionCopy));
+ } else {
+ // If clients enables to VUR, we need to check whether VUR is supported for the
+ // specific [propId, areaId] and overwrite the option to disable if not supported.
+ std::vector<int32_t> areasVurEnabled;
+ std::vector<int32_t> areasVurDisabled;
+ for (int32_t areaId : optionCopy.areaIds) {
+ const VehicleAreaConfig* areaConfig = getAreaConfig(propId, areaId, config);
+ if (areaConfig == nullptr) {
+ areasVurDisabled.push_back(areaId);
+ continue;
+ }
+ if (!areaConfig->supportVariableUpdateRate) {
+ areasVurDisabled.push_back(areaId);
+ continue;
+ }
+ areasVurEnabled.push_back(areaId);
+ }
+ if (!areasVurEnabled.empty()) {
+ SubscribeOptions optionVurEnabled = optionCopy;
+ optionVurEnabled.areaIds = areasVurEnabled;
+ optionVurEnabled.enableVariableUpdateRate = true;
+ continuousSubscriptions.push_back(std::move(optionVurEnabled));
+ }
+
+ if (!areasVurDisabled.empty()) {
+ // We use optionCopy for areas with VUR disabled.
+ optionCopy.areaIds = areasVurDisabled;
+ optionCopy.enableVariableUpdateRate = false;
+ continuousSubscriptions.push_back(std::move(optionCopy));
+ }
+ }
} else {
onChangeSubscriptions.push_back(std::move(optionCopy));
}
@@ -708,9 +766,6 @@
"client died");
}
- // Create a new SubscriptionClient if there isn't an existing one.
- mSubscriptionClients->maybeAddClient(callback);
-
if (!onChangeSubscriptions.empty()) {
auto result = mSubscriptionManager->subscribe(callback, onChangeSubscriptions,
/*isContinuousProperty=*/false);
@@ -746,36 +801,42 @@
return mVehicleHardware.get();
}
-VhalResult<void> DefaultVehicleHal::checkWritePermission(const VehiclePropValue& value) const {
+VhalResult<void> DefaultVehicleHal::checkPermissionHelper(
+ const VehiclePropValue& value, VehiclePropertyAccess accessToTest) const {
+ static const std::unordered_set<VehiclePropertyAccess> validAccesses = {
+ VehiclePropertyAccess::WRITE, VehiclePropertyAccess::READ,
+ VehiclePropertyAccess::READ_WRITE};
+ if (validAccesses.find(accessToTest) == validAccesses.end()) {
+ return StatusError(StatusCode::INVALID_ARG)
+ << "checkPermissionHelper parameter is an invalid access type";
+ }
+
int32_t propId = value.prop;
auto result = getConfig(propId);
if (!result.ok()) {
return StatusError(StatusCode::INVALID_ARG) << getErrorMsg(result);
}
const VehiclePropConfig* config = result.value();
+ const VehicleAreaConfig* areaConfig = getAreaConfig(value, *config);
- if (config->access != VehiclePropertyAccess::WRITE &&
- config->access != VehiclePropertyAccess::READ_WRITE) {
+ if (areaConfig == nullptr && !isGlobalProp(propId)) {
+ return StatusError(StatusCode::INVALID_ARG) << "no config for area ID: " << value.areaId;
+ }
+ if (!hasRequiredAccess(config->access, accessToTest) &&
+ (areaConfig == nullptr || !hasRequiredAccess(areaConfig->access, accessToTest))) {
return StatusError(StatusCode::ACCESS_DENIED)
- << StringPrintf("Property %" PRId32 " has no write access", propId);
+ << StringPrintf("Property %" PRId32 " does not have the following access: %" PRId32,
+ propId, accessToTest);
}
return {};
}
-VhalResult<void> DefaultVehicleHal::checkReadPermission(const VehiclePropValue& value) const {
- int32_t propId = value.prop;
- auto result = getConfig(propId);
- if (!result.ok()) {
- return StatusError(StatusCode::INVALID_ARG) << getErrorMsg(result);
- }
- const VehiclePropConfig* config = result.value();
+VhalResult<void> DefaultVehicleHal::checkWritePermission(const VehiclePropValue& value) const {
+ return checkPermissionHelper(value, VehiclePropertyAccess::WRITE);
+}
- if (config->access != VehiclePropertyAccess::READ &&
- config->access != VehiclePropertyAccess::READ_WRITE) {
- return StatusError(StatusCode::ACCESS_DENIED)
- << StringPrintf("Property %" PRId32 " has no read access", propId);
- }
- return {};
+VhalResult<void> DefaultVehicleHal::checkReadPermission(const VehiclePropValue& value) const {
+ return checkPermissionHelper(value, VehiclePropertyAccess::READ);
}
void DefaultVehicleHal::checkHealth(IVehicleHardware* vehicleHardware,
@@ -786,12 +847,12 @@
return;
}
std::vector<VehiclePropValue> values = {{
- .prop = toInt(VehicleProperty::VHAL_HEARTBEAT),
.areaId = 0,
+ .prop = toInt(VehicleProperty::VHAL_HEARTBEAT),
.status = VehiclePropertyStatus::AVAILABLE,
.value.int64Values = {uptimeMillis()},
}};
- onPropertyChangeEvent(subscriptionManager, values);
+ onPropertyChangeEvent(subscriptionManager, std::move(values));
return;
}
@@ -842,12 +903,15 @@
dprintf(fd, "Containing %zu property configs\n", mConfigsByPropId.size());
dprintf(fd, "Currently have %zu getValues clients\n", mGetValuesClients.size());
dprintf(fd, "Currently have %zu setValues clients\n", mSetValuesClients.size());
- dprintf(fd, "Currently have %zu subscription clients\n",
- mSubscriptionClients->countClients());
+ dprintf(fd, "Currently have %zu subscribe clients\n", countSubscribeClients());
}
return STATUS_OK;
}
+size_t DefaultVehicleHal::countSubscribeClients() {
+ return mSubscriptionManager->countClients();
+}
+
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp
index 1f2690e..29d81a7 100644
--- a/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/src/SubscriptionManager.cpp
@@ -16,6 +16,7 @@
#include "SubscriptionManager.h"
+#include <VehicleUtils.h>
#include <android-base/stringprintf.h>
#include <utils/Log.h>
#include <utils/SystemClock.h>
@@ -29,10 +30,6 @@
namespace {
-constexpr float ONE_SECOND_IN_NANO = 1'000'000'000.;
-
-} // namespace
-
using ::aidl::android::hardware::automotive::vehicle::IVehicleCallback;
using ::aidl::android::hardware::automotive::vehicle::StatusCode;
using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions;
@@ -43,13 +40,28 @@
using ::android::base::StringPrintf;
using ::ndk::ScopedAStatus;
+constexpr float ONE_SECOND_IN_NANOS = 1'000'000'000.;
+
+SubscribeOptions newSubscribeOptions(int32_t propId, int32_t areaId, float sampleRateHz,
+ bool enableVur) {
+ SubscribeOptions subscribedOptions;
+ subscribedOptions.propId = propId;
+ subscribedOptions.areaIds = {areaId};
+ subscribedOptions.sampleRate = sampleRateHz;
+ subscribedOptions.enableVariableUpdateRate = enableVur;
+
+ return subscribedOptions;
+}
+
+} // namespace
+
SubscriptionManager::SubscriptionManager(IVehicleHardware* vehicleHardware)
: mVehicleHardware(vehicleHardware) {}
SubscriptionManager::~SubscriptionManager() {
std::scoped_lock<std::mutex> lockGuard(mLock);
- mClientsByPropIdArea.clear();
+ mClientsByPropIdAreaId.clear();
mSubscribedPropsByClient.clear();
}
@@ -62,45 +74,83 @@
if (sampleRateHz <= 0) {
return Error() << "invalid sample rate, must be a positive number";
}
- if (sampleRateHz <= (ONE_SECOND_IN_NANO / static_cast<float>(INT64_MAX))) {
+ if (sampleRateHz <= (ONE_SECOND_IN_NANOS / static_cast<float>(INT64_MAX))) {
return Error() << "invalid sample rate: " << sampleRateHz << ", too small";
}
- intervalNanos = static_cast<int64_t>(ONE_SECOND_IN_NANO / sampleRateHz);
+ intervalNanos = static_cast<int64_t>(ONE_SECOND_IN_NANOS / sampleRateHz);
return intervalNanos;
}
-void ContSubConfigs::refreshMaxSampleRateHz() {
+void ContSubConfigs::refreshCombinedConfig() {
float maxSampleRateHz = 0.;
+ bool enableVur = true;
// This is not called frequently so a brute-focre is okay. More efficient way exists but this
// is simpler.
- for (const auto& [_, sampleRateHz] : mSampleRateHzByClient) {
- if (sampleRateHz > maxSampleRateHz) {
- maxSampleRateHz = sampleRateHz;
+ for (const auto& [_, subConfig] : mConfigByClient) {
+ if (subConfig.sampleRateHz > maxSampleRateHz) {
+ maxSampleRateHz = subConfig.sampleRateHz;
+ }
+ if (!subConfig.enableVur) {
+ // If one client does not enable variable update rate, we cannot enable variable update
+ // rate in IVehicleHardware.
+ enableVur = false;
}
}
mMaxSampleRateHz = maxSampleRateHz;
+ mEnableVur = enableVur;
}
-void ContSubConfigs::addClient(const ClientIdType& clientId, float sampleRateHz) {
- mSampleRateHzByClient[clientId] = sampleRateHz;
- refreshMaxSampleRateHz();
+void ContSubConfigs::addClient(const ClientIdType& clientId, float sampleRateHz, bool enableVur) {
+ mConfigByClient[clientId] = {
+ .sampleRateHz = sampleRateHz,
+ .enableVur = enableVur,
+ };
+ refreshCombinedConfig();
}
void ContSubConfigs::removeClient(const ClientIdType& clientId) {
- mSampleRateHzByClient.erase(clientId);
- refreshMaxSampleRateHz();
+ mConfigByClient.erase(clientId);
+ refreshCombinedConfig();
}
float ContSubConfigs::getMaxSampleRateHz() const {
return mMaxSampleRateHz;
}
+bool ContSubConfigs::isVurEnabled() const {
+ return mEnableVur;
+}
+
+bool ContSubConfigs::isVurEnabledForClient(const ClientIdType& clientId) {
+ return mConfigByClient[clientId].enableVur;
+}
+
+VhalResult<void> SubscriptionManager::addOnChangeSubscriberLocked(
+ const PropIdAreaId& propIdAreaId) {
+ if (mClientsByPropIdAreaId.find(propIdAreaId) != mClientsByPropIdAreaId.end()) {
+ // This propId, areaId is already subscribed, ignore the request.
+ return {};
+ }
+
+ int32_t propId = propIdAreaId.propId;
+ int32_t areaId = propIdAreaId.areaId;
+ if (auto status = mVehicleHardware->subscribe(
+ newSubscribeOptions(propId, areaId, /*updateRateHz=*/0, /*enableVur*/ false));
+ status != StatusCode::OK) {
+ return StatusError(status)
+ << StringPrintf("failed subscribe for prop: %s, areaId: %" PRId32,
+ propIdToString(propId).c_str(), areaId);
+ }
+ return {};
+}
+
VhalResult<void> SubscriptionManager::addContinuousSubscriberLocked(
- const ClientIdType& clientId, const PropIdAreaId& propIdAreaId, float sampleRateHz) {
+ const ClientIdType& clientId, const PropIdAreaId& propIdAreaId, float sampleRateHz,
+ bool enableVur) {
// Make a copy so that we don't modify 'mContSubConfigsByPropIdArea' on failure cases.
ContSubConfigs newConfig = mContSubConfigsByPropIdArea[propIdAreaId];
- newConfig.addClient(clientId, sampleRateHz);
- return updateContSubConfigs(propIdAreaId, newConfig);
+ newConfig.addClient(clientId, sampleRateHz, enableVur);
+ return updateContSubConfigsLocked(propIdAreaId, newConfig);
}
VhalResult<void> SubscriptionManager::removeContinuousSubscriberLocked(
@@ -108,25 +158,62 @@
// Make a copy so that we don't modify 'mContSubConfigsByPropIdArea' on failure cases.
ContSubConfigs newConfig = mContSubConfigsByPropIdArea[propIdAreaId];
newConfig.removeClient(clientId);
- return updateContSubConfigs(propIdAreaId, newConfig);
+ return updateContSubConfigsLocked(propIdAreaId, newConfig);
}
-VhalResult<void> SubscriptionManager::updateContSubConfigs(const PropIdAreaId& propIdAreaId,
- const ContSubConfigs& newConfig) {
- if (newConfig.getMaxSampleRateHz() ==
- mContSubConfigsByPropIdArea[propIdAreaId].getMaxSampleRateHz()) {
+VhalResult<void> SubscriptionManager::removeOnChangeSubscriberLocked(
+ const PropIdAreaId& propIdAreaId) {
+ if (mClientsByPropIdAreaId[propIdAreaId].size() > 1) {
+ // After unsubscribing this client, there is still client subscribed, so do nothing.
+ return {};
+ }
+
+ int32_t propId = propIdAreaId.propId;
+ int32_t areaId = propIdAreaId.areaId;
+ if (auto status = mVehicleHardware->unsubscribe(propId, areaId); status != StatusCode::OK) {
+ return StatusError(status)
+ << StringPrintf("failed unsubscribe for prop: %s, areaId: %" PRId32,
+ propIdToString(propId).c_str(), areaId);
+ }
+ return {};
+}
+
+VhalResult<void> SubscriptionManager::updateContSubConfigsLocked(const PropIdAreaId& propIdAreaId,
+ const ContSubConfigs& newConfig) {
+ const auto& oldConfig = mContSubConfigsByPropIdArea[propIdAreaId];
+ float newRateHz = newConfig.getMaxSampleRateHz();
+ float oldRateHz = oldConfig.getMaxSampleRateHz();
+ if (newRateHz == oldRateHz && newConfig.isVurEnabled() == oldConfig.isVurEnabled()) {
mContSubConfigsByPropIdArea[propIdAreaId] = newConfig;
return {};
}
- float newRateHz = newConfig.getMaxSampleRateHz();
int32_t propId = propIdAreaId.propId;
int32_t areaId = propIdAreaId.areaId;
- if (auto status = mVehicleHardware->updateSampleRate(propId, areaId, newRateHz);
- status != StatusCode::OK) {
- return StatusError(status) << StringPrintf("failed to update sample rate for prop: %" PRId32
- ", area"
- ": %" PRId32 ", sample rate: %f HZ",
- propId, areaId, newRateHz);
+ if (newRateHz != oldRateHz) {
+ if (auto status = mVehicleHardware->updateSampleRate(propId, areaId, newRateHz);
+ status != StatusCode::OK) {
+ return StatusError(status)
+ << StringPrintf("failed to update sample rate for prop: %s, areaId: %" PRId32
+ ", sample rate: %f HZ",
+ propIdToString(propId).c_str(), areaId, newRateHz);
+ }
+ }
+ if (newRateHz != 0) {
+ if (auto status = mVehicleHardware->subscribe(
+ newSubscribeOptions(propId, areaId, newRateHz, newConfig.isVurEnabled()));
+ status != StatusCode::OK) {
+ return StatusError(status) << StringPrintf(
+ "failed subscribe for prop: %s, areaId"
+ ": %" PRId32 ", sample rate: %f HZ",
+ propIdToString(propId).c_str(), areaId, newRateHz);
+ }
+ } else {
+ if (auto status = mVehicleHardware->unsubscribe(propId, areaId); status != StatusCode::OK) {
+ return StatusError(status) << StringPrintf(
+ "failed unsubscribe for prop: %s, areaId"
+ ": %" PRId32,
+ propIdToString(propId).c_str(), areaId);
+ }
}
mContSubConfigsByPropIdArea[propIdAreaId] = newConfig;
return {};
@@ -163,21 +250,54 @@
.propId = propId,
.areaId = areaId,
};
+ VhalResult<void> result;
if (isContinuousProperty) {
- if (auto result = addContinuousSubscriberLocked(clientId, propIdAreaId,
- option.sampleRate);
- !result.ok()) {
- return result;
- }
+ result = addContinuousSubscriberLocked(clientId, propIdAreaId, option.sampleRate,
+ option.enableVariableUpdateRate);
+ } else {
+ result = addOnChangeSubscriberLocked(propIdAreaId);
+ }
+
+ if (!result.ok()) {
+ return result;
}
mSubscribedPropsByClient[clientId].insert(propIdAreaId);
- mClientsByPropIdArea[propIdAreaId][clientId] = callback;
+ mClientsByPropIdAreaId[propIdAreaId][clientId] = callback;
}
}
return {};
}
+VhalResult<void> SubscriptionManager::unsubscribePropIdAreaIdLocked(
+ SubscriptionManager::ClientIdType clientId, const PropIdAreaId& propIdAreaId) {
+ if (mContSubConfigsByPropIdArea.find(propIdAreaId) != mContSubConfigsByPropIdArea.end()) {
+ // This is a subscribed continuous property.
+ if (auto result = removeContinuousSubscriberLocked(clientId, propIdAreaId); !result.ok()) {
+ return result;
+ }
+ } else {
+ if (mClientsByPropIdAreaId.find(propIdAreaId) == mClientsByPropIdAreaId.end()) {
+ ALOGW("Unsubscribe: The property: %s, areaId: %" PRId32
+ " was not previously subscribed, do nothing",
+ propIdToString(propIdAreaId.propId).c_str(), propIdAreaId.areaId);
+ return {};
+ }
+ // This is an on-change property.
+ if (auto result = removeOnChangeSubscriberLocked(propIdAreaId); !result.ok()) {
+ return result;
+ }
+ }
+
+ auto& clients = mClientsByPropIdAreaId[propIdAreaId];
+ clients.erase(clientId);
+ if (clients.empty()) {
+ mClientsByPropIdAreaId.erase(propIdAreaId);
+ mContSubConfigsByPropIdArea.erase(propIdAreaId);
+ }
+ return {};
+}
+
VhalResult<void> SubscriptionManager::unsubscribe(SubscriptionManager::ClientIdType clientId,
const std::vector<int32_t>& propIds) {
std::scoped_lock<std::mutex> lockGuard(mLock);
@@ -186,39 +306,27 @@
return StatusError(StatusCode::INVALID_ARG)
<< "No property was subscribed for the callback";
}
- std::unordered_set<int32_t> subscribedPropIds;
- for (auto const& propIdAreaId : mSubscribedPropsByClient[clientId]) {
- subscribedPropIds.insert(propIdAreaId.propId);
- }
+ std::vector<PropIdAreaId> propIdAreaIdsToUnsubscribe;
+ std::unordered_set<int32_t> propIdSet;
for (int32_t propId : propIds) {
- if (subscribedPropIds.find(propId) == subscribedPropIds.end()) {
- return StatusError(StatusCode::INVALID_ARG)
- << "property ID: " << propId << " is not subscribed";
+ propIdSet.insert(propId);
+ }
+ auto& subscribedPropIdsAreaIds = mSubscribedPropsByClient[clientId];
+ for (const auto& propIdAreaId : subscribedPropIdsAreaIds) {
+ if (propIdSet.find(propIdAreaId.propId) != propIdSet.end()) {
+ propIdAreaIdsToUnsubscribe.push_back(propIdAreaId);
}
}
- auto& propIdAreaIds = mSubscribedPropsByClient[clientId];
- auto it = propIdAreaIds.begin();
- while (it != propIdAreaIds.end()) {
- int32_t propId = it->propId;
- if (std::find(propIds.begin(), propIds.end(), propId) != propIds.end()) {
- if (auto result = removeContinuousSubscriberLocked(clientId, *it); !result.ok()) {
- return result;
- }
-
- auto& clients = mClientsByPropIdArea[*it];
- clients.erase(clientId);
- if (clients.empty()) {
- mClientsByPropIdArea.erase(*it);
- mContSubConfigsByPropIdArea.erase(*it);
- }
- it = propIdAreaIds.erase(it);
- } else {
- it++;
+ for (const auto& propIdAreaId : propIdAreaIdsToUnsubscribe) {
+ if (auto result = unsubscribePropIdAreaIdLocked(clientId, propIdAreaId); !result.ok()) {
+ return result;
}
+ subscribedPropIdsAreaIds.erase(propIdAreaId);
}
- if (propIdAreaIds.empty()) {
+
+ if (subscribedPropIdsAreaIds.empty()) {
mSubscribedPropsByClient.erase(clientId);
}
return {};
@@ -233,38 +341,68 @@
auto& subscriptions = mSubscribedPropsByClient[clientId];
for (auto const& propIdAreaId : subscriptions) {
- if (auto result = removeContinuousSubscriberLocked(clientId, propIdAreaId); !result.ok()) {
+ if (auto result = unsubscribePropIdAreaIdLocked(clientId, propIdAreaId); !result.ok()) {
return result;
}
-
- auto& clients = mClientsByPropIdArea[propIdAreaId];
- clients.erase(clientId);
- if (clients.empty()) {
- mClientsByPropIdArea.erase(propIdAreaId);
- mContSubConfigsByPropIdArea.erase(propIdAreaId);
- }
}
mSubscribedPropsByClient.erase(clientId);
return {};
}
-std::unordered_map<std::shared_ptr<IVehicleCallback>, std::vector<const VehiclePropValue*>>
-SubscriptionManager::getSubscribedClients(const std::vector<VehiclePropValue>& updatedValues) {
- std::scoped_lock<std::mutex> lockGuard(mLock);
- std::unordered_map<std::shared_ptr<IVehicleCallback>, std::vector<const VehiclePropValue*>>
- clients;
+bool SubscriptionManager::isValueUpdatedLocked(const std::shared_ptr<IVehicleCallback>& callback,
+ const VehiclePropValue& value) {
+ const auto& it = mContSubValuesByCallback[callback].find(value);
+ if (it == mContSubValuesByCallback[callback].end()) {
+ mContSubValuesByCallback[callback].insert(value);
+ return true;
+ }
- for (const auto& value : updatedValues) {
+ if (it->timestamp > value.timestamp) {
+ ALOGE("The updated property value: %s is outdated, ignored", value.toString().c_str());
+ return false;
+ }
+
+ if (it->value == value.value && it->status == value.status) {
+ // Even though the property value is the same, we need to store the new property event to
+ // update the timestamp.
+ mContSubValuesByCallback[callback].insert(value);
+ ALOGD("The updated property value for propId: %" PRId32 ", areaId: %" PRId32
+ " has the "
+ "same value and status, ignored if VUR is enabled",
+ it->prop, it->areaId);
+ return false;
+ }
+
+ mContSubValuesByCallback[callback].insert(value);
+ return true;
+}
+
+std::unordered_map<std::shared_ptr<IVehicleCallback>, std::vector<VehiclePropValue>>
+SubscriptionManager::getSubscribedClients(std::vector<VehiclePropValue>&& updatedValues) {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ std::unordered_map<std::shared_ptr<IVehicleCallback>, std::vector<VehiclePropValue>> clients;
+
+ for (auto& value : updatedValues) {
PropIdAreaId propIdAreaId{
.propId = value.prop,
.areaId = value.areaId,
};
- if (mClientsByPropIdArea.find(propIdAreaId) == mClientsByPropIdArea.end()) {
+ if (mClientsByPropIdAreaId.find(propIdAreaId) == mClientsByPropIdAreaId.end()) {
continue;
}
- for (const auto& [_, client] : mClientsByPropIdArea[propIdAreaId]) {
- clients[client].push_back(&value);
+ for (const auto& [client, callback] : mClientsByPropIdAreaId[propIdAreaId]) {
+ auto& subConfigs = mContSubConfigsByPropIdArea[propIdAreaId];
+ // If client wants VUR (and VUR is supported as checked in DefaultVehicleHal), it is
+ // possible that VUR is not enabled in IVehicleHardware because another client does not
+ // enable VUR. We will implement VUR filtering here for the client that enables it.
+ if (subConfigs.isVurEnabledForClient(client) && !subConfigs.isVurEnabled()) {
+ if (isValueUpdatedLocked(callback, value)) {
+ clients[callback].push_back(value);
+ }
+ } else {
+ clients[callback].push_back(value);
+ }
}
}
return clients;
@@ -281,11 +419,11 @@
.propId = errorEvent.propId,
.areaId = errorEvent.areaId,
};
- if (mClientsByPropIdArea.find(propIdAreaId) == mClientsByPropIdArea.end()) {
+ if (mClientsByPropIdAreaId.find(propIdAreaId) == mClientsByPropIdAreaId.end()) {
continue;
}
- for (const auto& [_, client] : mClientsByPropIdArea[propIdAreaId]) {
+ for (const auto& [_, client] : mClientsByPropIdAreaId[propIdAreaId]) {
clients[client].push_back({
.propId = errorEvent.propId,
.areaId = errorEvent.areaId,
@@ -298,7 +436,12 @@
bool SubscriptionManager::isEmpty() {
std::scoped_lock<std::mutex> lockGuard(mLock);
- return mSubscribedPropsByClient.empty() && mClientsByPropIdArea.empty();
+ return mSubscribedPropsByClient.empty() && mClientsByPropIdAreaId.empty();
+}
+
+size_t SubscriptionManager::countClients() {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ return mSubscribedPropsByClient.size();
}
} // namespace vehicle
diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
index 96b71f0..a63cb84 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
@@ -59,6 +59,7 @@
using ::aidl::android::hardware::automotive::vehicle::SetValueResults;
using ::aidl::android::hardware::automotive::vehicle::StatusCode;
using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions;
+using ::aidl::android::hardware::automotive::vehicle::VehicleAreaConfig;
using ::aidl::android::hardware::automotive::vehicle::VehicleAreaWindow;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfigs;
@@ -98,12 +99,26 @@
constexpr int32_t READ_ONLY_PROP = 10006 + 0x10000000 + 0x01000000 + 0x00400000;
// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
constexpr int32_t WRITE_ONLY_PROP = 10007 + 0x10000000 + 0x01000000 + 0x00400000;
+// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
+constexpr int32_t GLOBAL_CONTINUOUS_PROP_NO_VUR = 10008 + 0x10000000 + 0x01000000 + 0x00400000;
+// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
+constexpr int32_t GLOBAL_NONE_ACCESS_PROP = 10009 + 0x10000000 + 0x01000000 + 0x00400000;
+// VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32
+constexpr int32_t AREA_NONE_ACCESS_PROP = 10010 + 0x10000000 + 0x03000000 + 0x00400000;
int32_t testInt32VecProp(size_t i) {
// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
return static_cast<int32_t>(i) + 0x10000000 + 0x01000000 + 0x00410000;
}
+std::string toString(const std::vector<SubscribeOptions>& options) {
+ std::string optionsStr;
+ for (const auto& option : options) {
+ optionsStr += option.toString() + "\n";
+ }
+ return optionsStr;
+}
+
struct PropConfigCmp {
bool operator()(const VehiclePropConfig& a, const VehiclePropConfig& b) const {
return (a.prop < b.prop);
@@ -165,6 +180,26 @@
.value.int32Values = {0},
},
.expectedStatus = StatusCode::ACCESS_DENIED,
+ },
+ {
+ .name = "none_access",
+ .request =
+ {
+ .prop = GLOBAL_NONE_ACCESS_PROP,
+ .value.int32Values = {0},
+ },
+ .expectedStatus = StatusCode::ACCESS_DENIED,
+ },
+ {
+ .name = "none_area_access",
+ .request =
+ {
+ .prop = AREA_NONE_ACCESS_PROP,
+ .value.int32Values = {0},
+ // Only ROW_1_LEFT is allowed.
+ .areaId = toInt(VehicleAreaWindow::ROW_1_RIGHT),
+ },
+ .expectedStatus = StatusCode::ACCESS_DENIED,
}};
}
@@ -211,17 +246,18 @@
class DefaultVehicleHalTest : public testing::Test {
public:
- void SetUp() override {
- auto hardware = std::make_unique<MockVehicleHardware>();
+ void SetUp() override { init(std::make_unique<MockVehicleHardware>()); }
+
+ void init(std::unique_ptr<MockVehicleHardware> hardware) {
std::vector<VehiclePropConfig> testConfigs;
for (size_t i = 0; i < 10000; i++) {
testConfigs.push_back(VehiclePropConfig{
.prop = testInt32VecProp(i),
- .access = VehiclePropertyAccess::READ_WRITE,
.areaConfigs =
{
{
.areaId = 0,
+ .access = VehiclePropertyAccess::READ_WRITE,
.minInt32Value = 0,
.maxInt32Value = 100,
},
@@ -231,9 +267,9 @@
// A property with area config.
testConfigs.push_back(
VehiclePropConfig{.prop = INT32_WINDOW_PROP,
- .access = VehiclePropertyAccess::READ_WRITE,
.areaConfigs = {{
.areaId = toInt(VehicleAreaWindow::ROW_1_LEFT),
+ .access = VehiclePropertyAccess::READ_WRITE,
.minInt32Value = 0,
.maxInt32Value = 100,
}}});
@@ -244,8 +280,18 @@
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
});
// A global continuous property.
+ testConfigs.push_back(VehiclePropConfig{.prop = GLOBAL_CONTINUOUS_PROP,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
+ .minSampleRate = 0.0,
+ .maxSampleRate = 100.0,
+ .areaConfigs = {{
+ .areaId = 0,
+ .supportVariableUpdateRate = true,
+ }}});
+ // A global continuous property that does not support VUR.
testConfigs.push_back(VehiclePropConfig{
- .prop = GLOBAL_CONTINUOUS_PROP,
+ .prop = GLOBAL_CONTINUOUS_PROP_NO_VUR,
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::CONTINUOUS,
.minSampleRate = 0.0,
@@ -254,18 +300,19 @@
// A per-area on-change property.
testConfigs.push_back(VehiclePropConfig{
.prop = AREA_ON_CHANGE_PROP,
- .access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs =
{
{
.areaId = toInt(VehicleAreaWindow::ROW_1_LEFT),
+ .access = VehiclePropertyAccess::READ_WRITE,
.minInt32Value = 0,
.maxInt32Value = 100,
},
{
.areaId = toInt(VehicleAreaWindow::ROW_1_RIGHT),
+ .access = VehiclePropertyAccess::READ,
.minInt32Value = 0,
.maxInt32Value = 100,
},
@@ -274,7 +321,6 @@
// A per-area continuous property.
testConfigs.push_back(VehiclePropConfig{
.prop = AREA_CONTINUOUS_PROP,
- .access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::CONTINUOUS,
.minSampleRate = 0.0,
.maxSampleRate = 1000.0,
@@ -283,13 +329,17 @@
{
.areaId = toInt(VehicleAreaWindow::ROW_1_LEFT),
+ .access = VehiclePropertyAccess::READ_WRITE,
.minInt32Value = 0,
.maxInt32Value = 100,
+ .supportVariableUpdateRate = true,
},
{
.areaId = toInt(VehicleAreaWindow::ROW_1_RIGHT),
+ .access = VehiclePropertyAccess::READ_WRITE,
.minInt32Value = 0,
.maxInt32Value = 100,
+ .supportVariableUpdateRate = false,
},
},
});
@@ -309,6 +359,37 @@
.minSampleRate = 0.0,
.maxSampleRate = 1000.0,
});
+ // Global access set to NONE
+ testConfigs.push_back(VehiclePropConfig{
+ .prop = GLOBAL_NONE_ACCESS_PROP,
+ .access = VehiclePropertyAccess::NONE,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
+ .minSampleRate = 0.0,
+ .maxSampleRate = 100.0,
+ });
+ // Area access set to NONE
+ testConfigs.push_back(VehiclePropConfig{
+ .prop = AREA_NONE_ACCESS_PROP,
+ .changeMode = VehiclePropertyChangeMode::CONTINUOUS,
+ .minSampleRate = 0.0,
+ .maxSampleRate = 1000.0,
+ .areaConfigs =
+ {
+ {
+
+ .areaId = toInt(VehicleAreaWindow::ROW_1_LEFT),
+ .access = VehiclePropertyAccess::NONE,
+ .minInt32Value = 0,
+ .maxInt32Value = 100,
+ },
+ {
+ .areaId = toInt(VehicleAreaWindow::ROW_1_RIGHT),
+ .access = VehiclePropertyAccess::NONE,
+ .minInt32Value = 0,
+ .maxInt32Value = 100,
+ },
+ },
+ });
// Register the heartbeat event property.
testConfigs.push_back(VehiclePropConfig{
.prop = toInt(VehicleProperty::VHAL_HEARTBEAT),
@@ -350,7 +431,7 @@
size_t countClients() {
std::scoped_lock<std::mutex> lockGuard(mVhal->mLock);
return mVhal->mGetValuesClients.size() + mVhal->mSetValuesClients.size() +
- mVhal->mSubscriptionClients->countClients();
+ mVhal->countSubscribeClients();
}
std::shared_ptr<PendingRequestPool> getPool() { return mVhal->mPendingRequestPool; }
@@ -650,6 +731,21 @@
.prop = WRITE_ONLY_PROP,
},
},
+ {
+ .requestId = 1,
+ .prop =
+ {
+ .prop = GLOBAL_NONE_ACCESS_PROP,
+ },
+ },
+ {
+ .requestId = 2,
+ .prop =
+ {
+ .prop = AREA_NONE_ACCESS_PROP,
+ .areaId = toInt(VehicleAreaWindow::ROW_1_LEFT),
+ },
+ },
},
};
@@ -667,6 +763,14 @@
.requestId = 0,
.status = StatusCode::ACCESS_DENIED,
},
+ {
+ .requestId = 1,
+ .status = StatusCode::ACCESS_DENIED,
+ },
+ {
+ .requestId = 2,
+ .status = StatusCode::ACCESS_DENIED,
+ },
}))
<< "expect to get ACCESS_DENIED status if no read permission";
}
@@ -1293,8 +1397,8 @@
auto maybeResults = getCallback()->nextOnPropertyEventResults();
ASSERT_TRUE(maybeResults.has_value()) << "no results in callback";
- ASSERT_THAT(maybeResults.value().payloads, UnorderedElementsAre(testValue1, testValue2))
- << "results mismatch, expect two on-change events for all updated areas";
+ ASSERT_THAT(maybeResults.value().payloads, UnorderedElementsAre(testValue1))
+ << "results mismatch, expect one on-change events for all updated areas";
ASSERT_FALSE(getCallback()->nextOnPropertyEventResults().has_value())
<< "more results than expected";
}
@@ -1351,6 +1455,62 @@
EXPECT_EQ(countClients(), static_cast<size_t>(1));
}
+TEST_F(DefaultVehicleHalTest, testSubscribeContinuous_propNotSupportVur) {
+ std::vector<SubscribeOptions> options = {
+ {
+ .propId = GLOBAL_CONTINUOUS_PROP,
+ .sampleRate = 20.0,
+ .enableVariableUpdateRate = true,
+ },
+ {
+ .propId = GLOBAL_CONTINUOUS_PROP_NO_VUR,
+ .sampleRate = 30.0,
+ .enableVariableUpdateRate = true,
+ },
+ };
+
+ auto status = getClient()->subscribe(getCallbackClient(), options, 0);
+
+ ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage();
+ auto receivedSubscribeOptions = getHardware()->getSubscribeOptions();
+ ASSERT_THAT(receivedSubscribeOptions, UnorderedElementsAre(
+ SubscribeOptions{
+ .propId = GLOBAL_CONTINUOUS_PROP,
+ .areaIds = {0},
+ .enableVariableUpdateRate = true,
+ .sampleRate = 20.0,
+ },
+ SubscribeOptions{
+ .propId = GLOBAL_CONTINUOUS_PROP_NO_VUR,
+ .areaIds = {0},
+ .enableVariableUpdateRate = false,
+ .sampleRate = 30.0,
+ }))
+ << "received unexpected subscribe options: " << toString(receivedSubscribeOptions);
+}
+
+TEST_F(DefaultVehicleHalTest, testSubscribeContinuous_propSupportVurNotEnabled) {
+ std::vector<SubscribeOptions> options = {
+ {
+ .propId = GLOBAL_CONTINUOUS_PROP,
+ .sampleRate = 20.0,
+ .enableVariableUpdateRate = false,
+ },
+ };
+
+ auto status = getClient()->subscribe(getCallbackClient(), options, 0);
+
+ ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage();
+ auto receivedSubscribeOptions = getHardware()->getSubscribeOptions();
+ ASSERT_THAT(receivedSubscribeOptions, UnorderedElementsAre(SubscribeOptions{
+ .propId = GLOBAL_CONTINUOUS_PROP,
+ .areaIds = {0},
+ .enableVariableUpdateRate = false,
+ .sampleRate = 20.0,
+ }))
+ << "received unexpected subscribe options: " << toString(receivedSubscribeOptions);
+}
+
TEST_F(DefaultVehicleHalTest, testSubscribeAreaContinuous) {
std::vector<SubscribeOptions> options = {
{
@@ -1403,6 +1563,44 @@
ASSERT_GE(rightCount, static_cast<size_t>(5));
}
+TEST_F(DefaultVehicleHalTest, testAreaContinuous_areaNotSupportVur) {
+ std::vector<SubscribeOptions> options = {
+ {
+ .propId = AREA_CONTINUOUS_PROP,
+ .sampleRate = 20.0,
+ .areaIds = {toInt(VehicleAreaWindow::ROW_1_LEFT)},
+ .enableVariableUpdateRate = true,
+ },
+ {
+ .propId = AREA_CONTINUOUS_PROP,
+ .sampleRate = 10.0,
+ .areaIds = {toInt(VehicleAreaWindow::ROW_1_RIGHT)},
+ .enableVariableUpdateRate = true,
+ },
+ };
+
+ auto status = getClient()->subscribe(getCallbackClient(), options, 0);
+
+ ASSERT_TRUE(status.isOk()) << "subscribe failed: " << status.getMessage();
+ auto receivedSubscribeOptions = getHardware()->getSubscribeOptions();
+ ASSERT_THAT(receivedSubscribeOptions,
+ UnorderedElementsAre(
+ SubscribeOptions{
+ .propId = AREA_CONTINUOUS_PROP,
+ .sampleRate = 20.0,
+ .areaIds = {toInt(VehicleAreaWindow::ROW_1_LEFT)},
+ .enableVariableUpdateRate = true,
+ },
+ SubscribeOptions{
+ .propId = AREA_CONTINUOUS_PROP,
+ .sampleRate = 10.0,
+ .areaIds = {toInt(VehicleAreaWindow::ROW_1_RIGHT)},
+ // Area2 actually does not support VUR.
+ .enableVariableUpdateRate = false,
+ }))
+ << "received unexpected subscribe options: " << toString(receivedSubscribeOptions);
+}
+
TEST_F(DefaultVehicleHalTest, testUnsubscribeOnChange) {
std::vector<SubscribeOptions> options = {
{
@@ -1510,6 +1708,27 @@
ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::ACCESS_DENIED));
}
+TEST_F(DefaultVehicleHalTest, testSubscribeGlobalNoneAccess) {
+ std::vector<SubscribeOptions> options = {{
+ .propId = GLOBAL_NONE_ACCESS_PROP,
+ }};
+
+ auto status = getClient()->subscribe(getCallbackClient(), options, 0);
+
+ ASSERT_FALSE(status.isOk()) << "subscribe to a property with NONE global access must fail";
+ ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::ACCESS_DENIED));
+}
+
+TEST_F(DefaultVehicleHalTest, testSubscribeAreaNoneAccess) {
+ std::vector<SubscribeOptions> options = {
+ {.propId = AREA_NONE_ACCESS_PROP, .areaIds = {toInt(VehicleAreaWindow::ROW_1_LEFT)}}};
+
+ auto status = getClient()->subscribe(getCallbackClient(), options, 0);
+
+ ASSERT_FALSE(status.isOk()) << "subscribe to a property with NONE area access must fail";
+ ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::ACCESS_DENIED));
+}
+
TEST_F(DefaultVehicleHalTest, testUnsubscribeFailure) {
auto status = getClient()->unsubscribe(getCallbackClient(),
std::vector<int32_t>({GLOBAL_ON_CHANGE_PROP}));
@@ -1711,6 +1930,92 @@
ASSERT_THAT(vehiclePropErrors.payloads, UnorderedElementsAreArray(expectedResults));
}
+TEST_F(DefaultVehicleHalTest, testBatchOnPropertyChangeEvents) {
+ auto hardware = std::make_unique<MockVehicleHardware>();
+ hardware->setPropertyOnChangeEventBatchingWindow(std::chrono::milliseconds(10));
+ init(std::move(hardware));
+
+ std::vector<SubscribeOptions> options = {
+ {
+ .propId = GLOBAL_ON_CHANGE_PROP,
+ },
+ {
+ .propId = AREA_ON_CHANGE_PROP,
+ // No areaIds means subscribing to all area IDs.
+ .areaIds = {},
+ },
+ };
+
+ getClient()->subscribe(getCallbackClient(), options, 0);
+ VehiclePropValue testValue1 = {
+ .prop = GLOBAL_ON_CHANGE_PROP,
+ .value.int32Values = {0},
+ };
+ SetValueRequest request1 = {
+ .requestId = 1,
+ .value = testValue1,
+ };
+ SetValueResult result1 = {
+ .requestId = 1,
+ .status = StatusCode::OK,
+ };
+ VehiclePropValue testValue2 = {
+ .prop = AREA_ON_CHANGE_PROP,
+ .areaId = toInt(VehicleAreaWindow::ROW_1_LEFT),
+ .value.int32Values = {1},
+ };
+ SetValueRequest request2 = {
+ .requestId = 2,
+ .value = testValue2,
+ };
+ SetValueResult result2 = {
+ .requestId = 2,
+ .status = StatusCode::OK,
+ };
+ VehiclePropValue testValue3 = {
+ .prop = AREA_ON_CHANGE_PROP,
+ .areaId = toInt(VehicleAreaWindow::ROW_1_RIGHT),
+ .value.int32Values = {1},
+ };
+ SetValueRequest request3 = {
+ .requestId = 3,
+ .value = testValue3,
+ };
+ SetValueResult result3 = {
+ .requestId = 3,
+ .status = StatusCode::ACCESS_DENIED,
+ };
+ // Prepare the responses
+ for (int i = 0; i < 2; i++) {
+ getHardware()->addSetValueResponses({result1});
+ getHardware()->addSetValueResponses({result2, result3});
+ }
+
+ // Try to cause two batches, each with three on property change events.
+ // Set GLOBAL_ON_CHANGE_PROP causing one event.
+ // Set AREA_ON_CHANGE_PROP with two areas causing two events.
+ for (int i = 0; i < 2; i++) {
+ auto status = getClient()->setValues(getCallbackClient(),
+ SetValueRequests{.payloads = {request1}});
+ ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage();
+
+ status = getClient()->setValues(getCallbackClient(),
+ SetValueRequests{.payloads = {request2, request3}});
+ ASSERT_TRUE(status.isOk()) << "setValues failed: " << status.getMessage();
+
+ ASSERT_TRUE(getCallback()->waitForOnPropertyEventResults(/*size=*/1,
+ /*timeoutInNano=*/1'000'000'000))
+ << "not received enough property change events before timeout";
+
+ auto maybeResults = getCallback()->nextOnPropertyEventResults();
+ ASSERT_TRUE(maybeResults.has_value()) << "no results in callback";
+ ASSERT_THAT(maybeResults.value().payloads, UnorderedElementsAre(testValue1, testValue2))
+ << "results mismatch, expect 2 batched on change events";
+ ASSERT_FALSE(getCallback()->nextOnPropertyEventResults().has_value())
+ << "more results than expected";
+ }
+}
+
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp
index 54fede1..c272123 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.cpp
@@ -137,6 +137,14 @@
});
}
+bool MockVehicleCallback::waitForOnPropertyEventResults(size_t size, size_t timeoutInNano) {
+ std::unique_lock lk(mLock);
+ return mCond.wait_for(lk, std::chrono::nanoseconds(timeoutInNano), [this, size] {
+ ScopedLockAssertion lockAssertion(mLock);
+ return mOnPropertyEventResults.size() >= size;
+ });
+}
+
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h
index 1545eae..672ff4f 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h
+++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleCallback.h
@@ -69,6 +69,7 @@
size_t countOnPropertyEventResults();
bool waitForSetValueResults(size_t size, size_t timeoutInNano);
bool waitForGetValueResults(size_t size, size_t timeoutInNano);
+ bool waitForOnPropertyEventResults(size_t size, size_t timeoutInNano);
private:
std::mutex mLock;
diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp
index ba0d33d..db15c89 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.cpp
@@ -29,6 +29,7 @@
using ::aidl::android::hardware::automotive::vehicle::SetValueRequest;
using ::aidl::android::hardware::automotive::vehicle::SetValueResult;
using ::aidl::android::hardware::automotive::vehicle::StatusCode;
+using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue;
@@ -88,7 +89,40 @@
return StatusCode::OK;
}
-StatusCode MockVehicleHardware::updateSampleRate(int32_t propId, int32_t areaId, float sampleRate) {
+StatusCode MockVehicleHardware::subscribe(SubscribeOptions options) {
+ {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ mSubscribeOptions.push_back(options);
+ }
+ for (int32_t areaId : options.areaIds) {
+ if (auto status = subscribePropIdAreaId(options.propId, areaId, options.sampleRate);
+ status != StatusCode::OK) {
+ return status;
+ }
+ }
+ return StatusCode::OK;
+}
+
+std::vector<SubscribeOptions> MockVehicleHardware::getSubscribeOptions() {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ return mSubscribeOptions;
+}
+
+void MockVehicleHardware::clearSubscribeOptions() {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ mSubscribeOptions.clear();
+}
+
+StatusCode MockVehicleHardware::subscribePropIdAreaId(int32_t propId, int32_t areaId,
+ float sampleRateHz) {
+ if (sampleRateHz == 0) {
+ // on-change property.
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ mSubOnChangePropIdAreaIds.insert(std::pair<int32_t, int32_t>(propId, areaId));
+ return StatusCode::OK;
+ }
+
+ // continuous property.
std::shared_ptr<std::function<void()>> action;
{
@@ -97,9 +131,6 @@
// Remove the previous action register for this [propId, areaId].
mRecurrentTimer->unregisterTimerCallback(mRecurrentActions[propId][areaId]);
}
- if (sampleRate == 0) {
- return StatusCode::OK;
- }
// We are sure 'propertyChangeCallback' would be alive because we would unregister timer
// before destroying 'this' which owns mPropertyChangeCallback.
@@ -107,8 +138,8 @@
action = std::make_shared<std::function<void()>>([propertyChangeCallback, propId, areaId] {
std::vector<VehiclePropValue> values = {
{
- .prop = propId,
.areaId = areaId,
+ .prop = propId,
},
};
(*propertyChangeCallback)(values);
@@ -119,11 +150,45 @@
// In mock implementation, we generate a new property change event for this property at sample
// rate.
- int64_t interval = static_cast<int64_t>(1'000'000'000. / sampleRate);
+ int64_t interval = static_cast<int64_t>(1'000'000'000. / sampleRateHz);
mRecurrentTimer->registerTimerCallback(interval, action);
return StatusCode::OK;
}
+StatusCode MockVehicleHardware::unsubscribe(int32_t propId, int32_t areaId) {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ // For on-change property.
+ mSubOnChangePropIdAreaIds.erase(std::make_pair(propId, areaId));
+ // for continuous property.
+ if (mRecurrentActions[propId][areaId] != nullptr) {
+ // Remove the previous action register for this [propId, areaId].
+ mRecurrentTimer->unregisterTimerCallback(mRecurrentActions[propId][areaId]);
+ mRecurrentActions[propId].erase(areaId);
+ if (mRecurrentActions[propId].empty()) {
+ mRecurrentActions.erase(propId);
+ }
+ }
+ return StatusCode::OK;
+}
+
+std::set<std::pair<int32_t, int32_t>> MockVehicleHardware::getSubscribedOnChangePropIdAreaIds() {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ std::set<std::pair<int32_t, int32_t>> propIdAreaIds;
+ propIdAreaIds = mSubOnChangePropIdAreaIds;
+ return propIdAreaIds;
+}
+
+std::set<std::pair<int32_t, int32_t>> MockVehicleHardware::getSubscribedContinuousPropIdAreaIds() {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ std::set<std::pair<int32_t, int32_t>> propIdAreaIds;
+ for (const auto& [propId, actionByAreaId] : mRecurrentActions) {
+ for (const auto& [areaId, _] : actionByAreaId) {
+ propIdAreaIds.insert(std::make_pair(propId, areaId));
+ }
+ }
+ return propIdAreaIds;
+}
+
void MockVehicleHardware::registerOnPropertyChangeEvent(
std::unique_ptr<const PropertyChangeCallback> callback) {
std::scoped_lock<std::mutex> lockGuard(mLock);
@@ -186,6 +251,16 @@
mSleepTime = timeInNano;
}
+void MockVehicleHardware::setPropertyOnChangeEventBatchingWindow(std::chrono::nanoseconds window) {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ mEventBatchingWindow = window;
+}
+
+std::chrono::nanoseconds MockVehicleHardware::getPropertyOnChangeEventBatchingWindow() {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ return mEventBatchingWindow;
+}
+
template <class ResultType>
StatusCode MockVehicleHardware::returnResponse(
std::shared_ptr<const std::function<void(std::vector<ResultType>)>> callback,
diff --git a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h
index 46b30b9..eeca582 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h
+++ b/automotive/vehicle/aidl/impl/vhal/test/MockVehicleHardware.h
@@ -24,10 +24,12 @@
#include <android-base/thread_annotations.h>
#include <atomic>
+#include <chrono>
#include <condition_variable>
#include <list>
#include <memory>
#include <mutex>
+#include <set>
#include <thread>
#include <unordered_map>
#include <vector>
@@ -58,8 +60,11 @@
void registerOnPropertyChangeEvent(
std::unique_ptr<const PropertyChangeCallback> callback) override;
void registerOnPropertySetErrorEvent(std::unique_ptr<const PropertySetErrorCallback>) override;
- aidl::android::hardware::automotive::vehicle::StatusCode updateSampleRate(
- int32_t propId, int32_t areaId, float sampleRate) override;
+ aidl::android::hardware::automotive::vehicle::StatusCode subscribe(
+ aidl::android::hardware::automotive::vehicle::SubscribeOptions options) override;
+ aidl::android::hardware::automotive::vehicle::StatusCode unsubscribe(int32_t propId,
+ int32_t areaId) override;
+ std::chrono::nanoseconds getPropertyOnChangeEventBatchingWindow() override;
// Test functions.
void setPropertyConfigs(
@@ -86,6 +91,13 @@
void setSleepTime(int64_t timeInNano);
void setDumpResult(DumpResult result);
void sendOnPropertySetErrorEvent(const std::vector<SetValueErrorEvent>& errorEvents);
+ void setPropertyOnChangeEventBatchingWindow(std::chrono::nanoseconds window);
+
+ std::set<std::pair<int32_t, int32_t>> getSubscribedOnChangePropIdAreaIds();
+ std::set<std::pair<int32_t, int32_t>> getSubscribedContinuousPropIdAreaIds();
+ std::vector<aidl::android::hardware::automotive::vehicle::SubscribeOptions>
+ getSubscribeOptions();
+ void clearSubscribeOptions();
private:
mutable std::mutex mLock;
@@ -110,6 +122,10 @@
std::shared_ptr<const GetValuesCallback>,
const std::vector<aidl::android::hardware::automotive::vehicle::GetValueRequest>&)>
mGetValueResponder GUARDED_BY(mLock);
+ std::chrono::nanoseconds mEventBatchingWindow GUARDED_BY(mLock) = std::chrono::nanoseconds(0);
+ std::set<std::pair<int32_t, int32_t>> mSubOnChangePropIdAreaIds GUARDED_BY(mLock);
+ std::vector<aidl::android::hardware::automotive::vehicle::SubscribeOptions> mSubscribeOptions
+ GUARDED_BY(mLock);
template <class ResultType>
aidl::android::hardware::automotive::vehicle::StatusCode returnResponse(
@@ -122,6 +138,8 @@
const std::vector<RequestType>& requests,
std::list<std::vector<RequestType>>* storedRequests,
std::list<std::vector<ResultType>>* storedResponses) const REQUIRES(mLock);
+ aidl::android::hardware::automotive::vehicle::StatusCode subscribePropIdAreaId(
+ int32_t propId, int32_t areaId, float sampleRateHz);
DumpResult mDumpResult;
diff --git a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp
index cb8c8d1..aa5f003 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/test/SubscriptionManagerTest.cpp
@@ -43,12 +43,14 @@
using ::aidl::android::hardware::automotive::vehicle::SetValueResults;
using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropErrors;
+using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropValues;
using ::ndk::ScopedAStatus;
using ::ndk::SpAIBinder;
+using ::testing::Contains;
using ::testing::ElementsAre;
-using ::testing::WhenSorted;
+using ::testing::UnorderedElementsAre;
class PropertyCallback final : public BnVehicleCallback {
public:
@@ -114,6 +116,8 @@
void clearEvents() { return getCallback()->clearEvents(); }
+ std::shared_ptr<MockVehicleHardware> getHardware() { return mHardware; }
+
private:
std::unique_ptr<SubscriptionManager> mManager;
std::shared_ptr<PropertyCallback> mCallback;
@@ -132,6 +136,9 @@
auto result = getManager()->subscribe(getCallbackClient(), options, true);
ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message();
+ ASSERT_THAT(getHardware()->getSubscribedContinuousPropIdAreaIds(),
+ UnorderedElementsAre(std::pair<int32_t, int32_t>(0, 0)));
+
std::this_thread::sleep_for(std::chrono::seconds(1));
// Theoretically trigger 10 times, but check for at least 9 times to be stable.
@@ -240,6 +247,8 @@
result = getManager()->unsubscribe(getCallbackClient()->asBinder().get());
ASSERT_TRUE(result.ok()) << "failed to unsubscribe: " << result.error().message();
+ ASSERT_EQ(getHardware()->getSubscribedContinuousPropIdAreaIds().size(), 0u);
+
// Wait for the last events to come.
std::this_thread::sleep_for(std::chrono::milliseconds(100));
@@ -316,7 +325,7 @@
EXPECT_TRUE(getEvents().empty());
}
-TEST_F(SubscriptionManagerTest, testUnsubscribeFailure) {
+TEST_F(SubscriptionManagerTest, testUnsubscribeUnsubscribedPropId) {
std::vector<SubscribeOptions> options = {
{
.propId = 0,
@@ -334,14 +343,21 @@
// Property ID: 2 was not subscribed.
result = getManager()->unsubscribe(getCallbackClient()->asBinder().get(),
std::vector<int32_t>({0, 1, 2}));
- ASSERT_FALSE(result.ok()) << "unsubscribe an unsubscribed property must fail";
+ ASSERT_TRUE(result.ok()) << "unsubscribe an unsubscribed property must do nothing";
- // Since property 0 and property 1 was not unsubscribed successfully, we should be able to
- // unsubscribe them again.
- result = getManager()->unsubscribe(getCallbackClient()->asBinder().get(),
- std::vector<int32_t>({0, 1}));
- ASSERT_TRUE(result.ok()) << "a failed unsubscription must not unsubscribe any properties"
- << result.error().message();
+ std::vector<VehiclePropValue> updatedValues = {
+ {
+ .prop = 0,
+ .areaId = 0,
+ },
+ {
+ .prop = 1,
+ .areaId = 0,
+ },
+ };
+ auto clients = getManager()->getSubscribedClients(std::vector<VehiclePropValue>(updatedValues));
+
+ ASSERT_EQ(clients.size(), 0u) << "all subscribed properties must be unsubscribed";
}
TEST_F(SubscriptionManagerTest, testSubscribeOnchange) {
@@ -370,6 +386,11 @@
ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message();
result = getManager()->subscribe(client2, options2, false);
ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message();
+ ASSERT_THAT(getHardware()->getSubscribedOnChangePropIdAreaIds(),
+ UnorderedElementsAre(std::pair<int32_t, int32_t>(0, 0),
+ std::pair<int32_t, int32_t>(0, 1),
+ std::pair<int32_t, int32_t>(1, 0)));
+ ASSERT_EQ(getHardware()->getSubscribedContinuousPropIdAreaIds().size(), 0u);
std::vector<VehiclePropValue> updatedValues = {
{
@@ -389,11 +410,11 @@
.areaId = 1,
},
};
- auto clients = getManager()->getSubscribedClients(updatedValues);
+ auto clients = getManager()->getSubscribedClients(std::vector<VehiclePropValue>(updatedValues));
ASSERT_THAT(clients[client1],
- WhenSorted(ElementsAre(&updatedValues[0], &updatedValues[1], &updatedValues[2])));
- ASSERT_THAT(clients[client2], ElementsAre(&updatedValues[0]));
+ UnorderedElementsAre(updatedValues[0], updatedValues[1], updatedValues[2]));
+ ASSERT_THAT(clients[client2], ElementsAre(updatedValues[0]));
}
TEST_F(SubscriptionManagerTest, testSubscribeInvalidOption) {
@@ -480,9 +501,11 @@
.areaId = 0,
},
};
- auto clients = getManager()->getSubscribedClients(updatedValues);
+ auto clients = getManager()->getSubscribedClients(std::vector<VehiclePropValue>(updatedValues));
- ASSERT_THAT(clients[getCallbackClient()], ElementsAre(&updatedValues[1]));
+ ASSERT_THAT(clients[getCallbackClient()], ElementsAre(updatedValues[1]));
+ ASSERT_THAT(getHardware()->getSubscribedOnChangePropIdAreaIds(),
+ UnorderedElementsAre(std::pair<int32_t, int32_t>(1, 0)));
}
TEST_F(SubscriptionManagerTest, testCheckSampleRateHzValid) {
@@ -497,6 +520,257 @@
ASSERT_FALSE(SubscriptionManager::checkSampleRateHz(0));
}
+TEST_F(SubscriptionManagerTest, testSubscribe_enableVur) {
+ std::vector<SubscribeOptions> options = {{
+ .propId = 0,
+ .areaIds = {0},
+ .sampleRate = 10.0,
+ .enableVariableUpdateRate = true,
+ }};
+
+ auto result = getManager()->subscribe(getCallbackClient(), options, true);
+ ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message();
+
+ ASSERT_THAT(getHardware()->getSubscribeOptions(), ElementsAre(options[0]));
+}
+
+TEST_F(SubscriptionManagerTest, testSubscribe_VurStateChange) {
+ std::vector<SubscribeOptions> options = {{
+ .propId = 0,
+ .areaIds = {0},
+ .sampleRate = 10.0,
+ .enableVariableUpdateRate = true,
+ }};
+
+ auto result = getManager()->subscribe(getCallbackClient(), options, true);
+ ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message();
+
+ ASSERT_THAT(getHardware()->getSubscribeOptions(), ElementsAre(options[0]));
+
+ getHardware()->clearSubscribeOptions();
+ result = getManager()->subscribe(getCallbackClient(), options, true);
+ ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message();
+
+ ASSERT_TRUE(getHardware()->getSubscribeOptions().empty());
+
+ std::vector<SubscribeOptions> newOptions = {{
+ .propId = 0,
+ .areaIds = {0},
+ .sampleRate = 10.0,
+ .enableVariableUpdateRate = false,
+ }};
+ result = getManager()->subscribe(getCallbackClient(), newOptions, true);
+ ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message();
+
+ ASSERT_THAT(getHardware()->getSubscribeOptions(), ElementsAre(newOptions[0]));
+}
+
+TEST_F(SubscriptionManagerTest, testSubscribe_enableVur_filterUnchangedEvents) {
+ SpAIBinder binder1 = ndk::SharedRefBase::make<PropertyCallback>()->asBinder();
+ std::shared_ptr<IVehicleCallback> client1 = IVehicleCallback::fromBinder(binder1);
+ SpAIBinder binder2 = ndk::SharedRefBase::make<PropertyCallback>()->asBinder();
+ std::shared_ptr<IVehicleCallback> client2 = IVehicleCallback::fromBinder(binder2);
+ SubscribeOptions client1Option = {
+ .propId = 0,
+ .areaIds = {0},
+ .sampleRate = 10.0,
+ .enableVariableUpdateRate = false,
+ };
+ auto result = getManager()->subscribe(client1, {client1Option}, true);
+ ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message();
+
+ ASSERT_THAT(getHardware()->getSubscribeOptions(), UnorderedElementsAre(client1Option));
+
+ getHardware()->clearSubscribeOptions();
+ SubscribeOptions client2Option = {
+ .propId = 0,
+ .areaIds = {0, 1},
+ .sampleRate = 20.0,
+ .enableVariableUpdateRate = true,
+ };
+
+ result = getManager()->subscribe(client2, {client2Option}, true);
+ ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message();
+
+ ASSERT_THAT(getHardware()->getSubscribeOptions(),
+ UnorderedElementsAre(
+ SubscribeOptions{
+ .propId = 0,
+ .areaIds = {0},
+ .sampleRate = 20.0,
+ // This is enabled for client2, but disabled for client1.
+ .enableVariableUpdateRate = false,
+ },
+ SubscribeOptions{
+ .propId = 0,
+ .areaIds = {1},
+ .sampleRate = 20.0,
+ .enableVariableUpdateRate = true,
+ }));
+
+ std::vector<VehiclePropValue> propertyEvents = {{
+ .prop = 0,
+ .areaId = 0,
+ .value = {.int32Values = {0}},
+ .timestamp = 1,
+ },
+ {
+ .prop = 0,
+ .areaId = 1,
+ .value = {.int32Values = {1}},
+ .timestamp = 1,
+ }};
+ auto clients =
+ getManager()->getSubscribedClients(std::vector<VehiclePropValue>(propertyEvents));
+
+ ASSERT_THAT(clients[client1], UnorderedElementsAre(propertyEvents[0]));
+ ASSERT_THAT(clients[client2], UnorderedElementsAre(propertyEvents[0], propertyEvents[1]));
+
+ // If the same property events happen again with a new timestamp.
+ // VUR is disabled for client1, enabled for client2.
+ clients = getManager()->getSubscribedClients({{
+ .prop = 0,
+ .areaId = 0,
+ .value = {.int32Values = {0}},
+ .timestamp = 2,
+ }});
+
+ ASSERT_FALSE(clients.find(client1) == clients.end())
+ << "Must not filter out property events if VUR is not enabled";
+ ASSERT_TRUE(clients.find(client2) == clients.end())
+ << "Must filter out property events if VUR is enabled";
+}
+
+TEST_F(SubscriptionManagerTest, testSubscribe_enableVur_mustNotFilterStatusChange) {
+ SpAIBinder binder1 = ndk::SharedRefBase::make<PropertyCallback>()->asBinder();
+ std::shared_ptr<IVehicleCallback> client1 = IVehicleCallback::fromBinder(binder1);
+ SpAIBinder binder2 = ndk::SharedRefBase::make<PropertyCallback>()->asBinder();
+ std::shared_ptr<IVehicleCallback> client2 = IVehicleCallback::fromBinder(binder2);
+ SubscribeOptions client1Option = {
+ .propId = 0,
+ .areaIds = {0},
+ .sampleRate = 10.0,
+ .enableVariableUpdateRate = false,
+ };
+ auto result = getManager()->subscribe(client1, {client1Option}, true);
+ ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message();
+
+ ASSERT_THAT(getHardware()->getSubscribeOptions(), UnorderedElementsAre(client1Option));
+
+ getHardware()->clearSubscribeOptions();
+ SubscribeOptions client2Option = {
+ .propId = 0,
+ .areaIds = {0, 1},
+ .sampleRate = 20.0,
+ .enableVariableUpdateRate = true,
+ };
+
+ result = getManager()->subscribe(client2, {client2Option}, true);
+ ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message();
+
+ ASSERT_THAT(getHardware()->getSubscribeOptions(),
+ UnorderedElementsAre(
+ SubscribeOptions{
+ .propId = 0,
+ .areaIds = {0},
+ .sampleRate = 20.0,
+ // This is enabled for client2, but disabled for client1.
+ .enableVariableUpdateRate = false,
+ },
+ SubscribeOptions{
+ .propId = 0,
+ .areaIds = {1},
+ .sampleRate = 20.0,
+ .enableVariableUpdateRate = true,
+ }));
+
+ VehiclePropValue propValue1 = {
+ .prop = 0,
+ .areaId = 0,
+ .value = {.int32Values = {0}},
+ .timestamp = 1,
+ };
+ auto clients = getManager()->getSubscribedClients(std::vector<VehiclePropValue>({propValue1}));
+
+ ASSERT_THAT(clients[client1], UnorderedElementsAre(propValue1));
+
+ // A new event with the same value, but different status must not be filtered out.
+ VehiclePropValue propValue2 = {
+ .prop = 0,
+ .areaId = 0,
+ .value = {.int32Values = {0}},
+ .status = VehiclePropertyStatus::UNAVAILABLE,
+ .timestamp = 2,
+ };
+ clients = getManager()->getSubscribedClients({propValue2});
+
+ ASSERT_THAT(clients[client1], UnorderedElementsAre(propValue2))
+ << "Must not filter out property events that has status change";
+}
+
+TEST_F(SubscriptionManagerTest, testSubscribe_enableVur_timestampUpdated_filterOutdatedEvent) {
+ SpAIBinder binder1 = ndk::SharedRefBase::make<PropertyCallback>()->asBinder();
+ std::shared_ptr<IVehicleCallback> client1 = IVehicleCallback::fromBinder(binder1);
+ SpAIBinder binder2 = ndk::SharedRefBase::make<PropertyCallback>()->asBinder();
+ std::shared_ptr<IVehicleCallback> client2 = IVehicleCallback::fromBinder(binder2);
+ std::vector<SubscribeOptions> options = {{
+ .propId = 0,
+ .areaIds = {0},
+ .sampleRate = 10.0,
+ .enableVariableUpdateRate = true,
+ }};
+
+ // client1 subscribe with VUR enabled.
+ auto result = getManager()->subscribe(client1, options, true);
+ ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message();
+
+ // Let client2 subscribe with VUR disabled so that we enabled VUR in DefaultVehicleHal layer.
+ result = getManager()->subscribe(client2,
+ {{
+ .propId = 0,
+ .areaIds = {0},
+ .sampleRate = 10.0,
+ .enableVariableUpdateRate = false,
+ }},
+ true);
+ ASSERT_TRUE(result.ok()) << "failed to subscribe: " << result.error().message();
+
+ VehiclePropValue value0 = {
+ .prop = 0,
+ .areaId = 0,
+ .value = {.int32Values = {0}},
+ .timestamp = 1,
+ };
+ auto clients = getManager()->getSubscribedClients({value0});
+
+ ASSERT_THAT(clients[client1], UnorderedElementsAre(value0));
+
+ // A new event with the same value arrived. This must update timestamp to 3.
+ VehiclePropValue value1 = {
+ .prop = 0,
+ .areaId = 0,
+ .value = {.int32Values = {0}},
+ .timestamp = 3,
+ };
+ clients = getManager()->getSubscribedClients({value1});
+
+ ASSERT_TRUE(clients.find(client1) == clients.end())
+ << "Must filter out duplicate property events if VUR is enabled";
+
+ // The latest timestamp is 3, so even though the value is not the same, this is outdated and
+ // must be ignored.
+ VehiclePropValue value2 = {
+ .prop = 0,
+ .areaId = 0,
+ .value = {.int32Values = {1}},
+ .timestamp = 2,
+ };
+ clients = getManager()->getSubscribedClients({value1});
+
+ ASSERT_TRUE(clients.find(client1) == clients.end())
+ << "Must filter out outdated property events if VUR is enabled";
+}
+
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc
index 19267cd..9fa7b98 100644
--- a/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc
+++ b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.rc
@@ -1,4 +1,4 @@
-service vendor.vehicle-hal-default /vendor/bin/hw/android.hardware.automotive.vehicle@V1-default-service
+service vendor.vehicle-hal-default /vendor/bin/hw/android.hardware.automotive.vehicle@V3-default-service
class early_hal
user vehicle_network
group system inet
diff --git a/automotive/vehicle/aidl_property/Android.bp b/automotive/vehicle/aidl_property/Android.bp
index 580be68..5db39d8 100644
--- a/automotive/vehicle/aidl_property/Android.bp
+++ b/automotive/vehicle/aidl_property/Android.bp
@@ -28,7 +28,7 @@
// This HAL was originally part of android.hardware.automotive.vehicle
"android/hardware/automotive/vehicle/*.aidl",
],
- frozen: true,
+ frozen: false,
stability: "vintf",
backend: {
cpp: {
@@ -55,7 +55,12 @@
version: "2",
imports: [],
},
-
],
+}
+filegroup {
+ name: "android.hardware.automotive.vehicle.property-files",
+ srcs: [
+ "android/hardware/automotive/vehicle/*.aidl",
+ ],
}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CrossTrafficMonitoringWarningState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CrossTrafficMonitoringWarningState.aidl
new file mode 100644
index 0000000..90e2d8d
--- /dev/null
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/CrossTrafficMonitoringWarningState.aidl
@@ -0,0 +1,45 @@
+/*
+ * 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.automotive.vehicle;
+@Backing(type="int") @VintfStability
+enum CrossTrafficMonitoringWarningState {
+ OTHER = 0,
+ NO_WARNING = 1,
+ WARNING_FRONT_LEFT = 2,
+ WARNING_FRONT_RIGHT = 3,
+ WARNING_FRONT_BOTH = 4,
+ WARNING_REAR_LEFT = 5,
+ WARNING_REAR_RIGHT = 6,
+ WARNING_REAR_BOTH = 7,
+}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDistractionState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDistractionState.aidl
new file mode 100644
index 0000000..54c02d5
--- /dev/null
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDistractionState.aidl
@@ -0,0 +1,40 @@
+/*
+ * 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.automotive.vehicle;
+@Backing(type="int") @VintfStability
+enum DriverDistractionState {
+ OTHER = 0,
+ NOT_DISTRACTED = 1,
+ DISTRACTED = 2,
+}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDistractionWarning.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDistractionWarning.aidl
new file mode 100644
index 0000000..9236b1c
--- /dev/null
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDistractionWarning.aidl
@@ -0,0 +1,40 @@
+/*
+ * 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.automotive.vehicle;
+@Backing(type="int") @VintfStability
+enum DriverDistractionWarning {
+ OTHER = 0,
+ NO_WARNING = 1,
+ WARNING = 2,
+}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDrowsinessAttentionState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDrowsinessAttentionState.aidl
new file mode 100644
index 0000000..22a90f3
--- /dev/null
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDrowsinessAttentionState.aidl
@@ -0,0 +1,47 @@
+/*
+ * 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.automotive.vehicle;
+@Backing(type="int") @VintfStability
+enum DriverDrowsinessAttentionState {
+ OTHER = 0,
+ KSS_RATING_1_EXTREMELY_ALERT = 1,
+ KSS_RATING_2_VERY_ALERT = 2,
+ KSS_RATING_3_ALERT = 3,
+ KSS_RATING_4_RATHER_ALERT = 4,
+ KSS_RATING_5_NEITHER_ALERT_NOR_SLEEPY = 5,
+ KSS_RATING_6_SOME_SLEEPINESS = 6,
+ KSS_RATING_7_SLEEPY_NO_EFFORT = 7,
+ KSS_RATING_8_SLEEPY_SOME_EFFORT = 8,
+ KSS_RATING_9_VERY_SLEEPY = 9,
+}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.aidl
new file mode 100644
index 0000000..dbf2364
--- /dev/null
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.aidl
@@ -0,0 +1,40 @@
+/*
+ * 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.automotive.vehicle;
+@Backing(type="int") @VintfStability
+enum DriverDrowsinessAttentionWarning {
+ OTHER = 0,
+ NO_WARNING = 1,
+ WARNING = 2,
+}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicStabilityControlState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicStabilityControlState.aidl
new file mode 100644
index 0000000..b061a25
--- /dev/null
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ElectronicStabilityControlState.aidl
@@ -0,0 +1,40 @@
+/*
+ * 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.automotive.vehicle;
+@Backing(type="int") @VintfStability
+enum ElectronicStabilityControlState {
+ OTHER = 0,
+ ENABLED = 1,
+ ACTIVATED = 2,
+}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ImpactSensorLocation.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ImpactSensorLocation.aidl
new file mode 100644
index 0000000..6b75d8c
--- /dev/null
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/ImpactSensorLocation.aidl
@@ -0,0 +1,44 @@
+/*
+ * 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.automotive.vehicle;
+@Backing(type="int") @VintfStability
+enum ImpactSensorLocation {
+ OTHER = 0x01,
+ FRONT = 0x02,
+ FRONT_LEFT_DOOR_SIDE = 0x04,
+ FRONT_RIGHT_DOOR_SIDE = 0x08,
+ REAR_LEFT_DOOR_SIDE = 0x10,
+ REAR_RIGHT_DOOR_SIDE = 0x20,
+ REAR = 0x40,
+}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LowSpeedCollisionWarningState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LowSpeedCollisionWarningState.aidl
new file mode 100644
index 0000000..6f6338b
--- /dev/null
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LowSpeedCollisionWarningState.aidl
@@ -0,0 +1,40 @@
+/*
+ * 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.automotive.vehicle;
+@Backing(type="int") @VintfStability
+enum LowSpeedCollisionWarningState {
+ OTHER = 0,
+ NO_WARNING = 1,
+ WARNING = 2,
+}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAirbagLocation.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAirbagLocation.aidl
new file mode 100644
index 0000000..9b966d7
--- /dev/null
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAirbagLocation.aidl
@@ -0,0 +1,43 @@
+/*
+ * 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.automotive.vehicle;
+@Backing(type="int") @VintfStability
+enum VehicleAirbagLocation {
+ OTHER = 0x01,
+ FRONT = 0x02,
+ KNEE = 0x04,
+ LEFT_SIDE = 0x08,
+ RIGHT_SIDE = 0x10,
+ CURTAIN = 0x20,
+}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
index 3fde1c7..8b345b2 100644
--- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
@@ -40,4 +40,5 @@
SLEEP_IMMEDIATELY = 4,
HIBERNATE_IMMEDIATELY = 5,
CAN_HIBERNATE = 6,
+ EMERGENCY_SHUTDOWN = 7,
}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleArea.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleArea.aidl
index db867f4..b63003a 100644
--- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleArea.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleArea.aidl
@@ -40,5 +40,6 @@
SEAT = 0x05000000,
DOOR = 0x06000000,
WHEEL = 0x07000000,
+ VENDOR = 0x08000000,
MASK = 0x0f000000,
}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
index 44c9d54..a24f515 100644
--- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
@@ -34,6 +34,7 @@
package android.hardware.automotive.vehicle;
@Backing(type="int") @VintfStability
enum VehicleAreaSeat {
+ UNKNOWN = 0x0000,
ROW_1_LEFT = 0x0001,
ROW_1_CENTER = 0x0002,
ROW_1_RIGHT = 0x0004,
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAutonomousState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAutonomousState.aidl
new file mode 100644
index 0000000..e15e71e
--- /dev/null
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleAutonomousState.aidl
@@ -0,0 +1,43 @@
+/*
+ * 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.automotive.vehicle;
+@Backing(type="int") @VintfStability
+enum VehicleAutonomousState {
+ LEVEL_0 = 0,
+ LEVEL_1 = 1,
+ LEVEL_2 = 2,
+ LEVEL_3 = 3,
+ LEVEL_4 = 4,
+ LEVEL_5 = 5,
+}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl
index ba75e7b..efae92f 100644
--- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl
@@ -66,9 +66,11 @@
EV_CHARGE_PORT_CONNECTED = (((0x030B + 0x10000000) + 0x01000000) + 0x00200000) /* 287310603 */,
EV_BATTERY_INSTANTANEOUS_CHARGE_RATE = (((0x030C + 0x10000000) + 0x01000000) + 0x00600000) /* 291504908 */,
RANGE_REMAINING = (((0x0308 + 0x10000000) + 0x01000000) + 0x00600000) /* 291504904 */,
+ EV_BATTERY_AVERAGE_TEMPERATURE = (((0x030E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.FLOAT) /* 291504910 */,
TIRE_PRESSURE = (((0x0309 + 0x10000000) + 0x07000000) + 0x00600000) /* 392168201 */,
CRITICALLY_LOW_TIRE_PRESSURE = (((0x030A + 0x10000000) + 0x07000000) + 0x00600000) /* 392168202 */,
ENGINE_IDLE_AUTO_STOP_ENABLED = (((0x0320 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287310624 */,
+ IMPACT_DETECTED = (((0x0330 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289407792 */,
GEAR_SELECTION = (((0x0400 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408000 */,
CURRENT_GEAR = (((0x0401 + 0x10000000) + 0x01000000) + 0x00400000) /* 289408001 */,
PARKING_BRAKE_ON = (((0x0402 + 0x10000000) + 0x01000000) + 0x00200000) /* 287310850 */,
@@ -81,6 +83,8 @@
ABS_ACTIVE = (((0x040A + 0x10000000) + 0x01000000) + 0x00200000) /* 287310858 */,
TRACTION_CONTROL_ACTIVE = (((0x040B + 0x10000000) + 0x01000000) + 0x00200000) /* 287310859 */,
EV_STOPPING_MODE = (((0x040D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289408013 */,
+ ELECTRONIC_STABILITY_CONTROL_ENABLED = (((0x040E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287310862 */,
+ ELECTRONIC_STABILITY_CONTROL_STATE = (((0x040F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289408015 */,
HVAC_FAN_SPEED = (((0x0500 + 0x10000000) + 0x05000000) + 0x00400000) /* 356517120 */,
HVAC_FAN_DIRECTION = (((0x0501 + 0x10000000) + 0x05000000) + 0x00400000) /* 356517121 */,
HVAC_TEMPERATURE_CURRENT = (((0x0502 + 0x10000000) + 0x05000000) + 0x00600000) /* 358614274 */,
@@ -118,6 +122,7 @@
AP_POWER_BOOTUP_REASON = (((0x0A02 + 0x10000000) + 0x01000000) + 0x00400000) /* 289409538 */,
DISPLAY_BRIGHTNESS = (((0x0A03 + 0x10000000) + 0x01000000) + 0x00400000) /* 289409539 */,
PER_DISPLAY_BRIGHTNESS = (((0x0A04 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475076 */,
+ VALET_MODE_ENABLED = (((0x0A05 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287312389 */,
HW_KEY_INPUT = (((0x0A10 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475088 */,
HW_KEY_INPUT_V2 = (((0x0A11 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.MIXED) /* 367004177 */,
HW_MOTION_INPUT = (((0x0A12 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.MIXED) /* 367004178 */,
@@ -167,11 +172,13 @@
SEAT_FOOTWELL_LIGHTS_SWITCH = (((0x0B9C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518812 */,
SEAT_EASY_ACCESS_ENABLED = (((0x0B9D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421661 */,
SEAT_AIRBAG_ENABLED = (((0x0B9E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421662 */,
+ SEAT_AIRBAGS_DEPLOYED = (((0x0BA5 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518821 */,
SEAT_CUSHION_SIDE_SUPPORT_POS = (((0x0B9F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518815 */,
SEAT_CUSHION_SIDE_SUPPORT_MOVE = (((0x0BA0 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518816 */,
SEAT_LUMBAR_VERTICAL_POS = (((0x0BA1 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518817 */,
SEAT_LUMBAR_VERTICAL_MOVE = (((0x0BA2 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518818 */,
SEAT_WALK_IN_POS = (((0x0BA3 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 356518819 */,
+ SEAT_BELT_PRETENSIONER_DEPLOYED = (((0x0BA6 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421670 */,
SEAT_OCCUPANCY = (((0x0BB0 + 0x10000000) + 0x05000000) + 0x00400000) /* 356518832 */,
WINDOW_POS = (((0x0BC0 + 0x10000000) + 0x03000000) + 0x00400000) /* 322964416 */,
WINDOW_MOVE = (((0x0BC1 + 0x10000000) + 0x03000000) + 0x00400000) /* 322964417 */,
@@ -190,6 +197,11 @@
GLOVE_BOX_LOCKED = (((0x0BF1 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421745 */,
VEHICLE_MAP_SERVICE = (((0x0C00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299895808 */,
LOCATION_CHARACTERIZATION = (((0x0C10 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410064 */,
+ ULTRASONICS_SENSOR_POSITION = (((0x0C20 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916128 */,
+ ULTRASONICS_SENSOR_ORIENTATION = (((0x0C21 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916129 */,
+ ULTRASONICS_SENSOR_FIELD_OF_VIEW = (((0x0C22 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916130 */,
+ ULTRASONICS_SENSOR_DETECTION_RANGE = (((0x0C23 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916131 */,
+ ULTRASONICS_SENSOR_SUPPORTED_RANGES = (((0x0C24 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916132 */,
OBD2_LIVE_FRAME = (((0x0D00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896064 */,
OBD2_FREEZE_FRAME = (((0x0D01 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896065 */,
OBD2_FREEZE_FRAME_INFO = (((0x0D02 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896066 */,
@@ -245,6 +257,8 @@
SUPPORTED_PROPERTY_IDS = (((0x0F48 + 0x10000000) + 0x01000000) + 0x00410000) /* 289476424 */,
SHUTDOWN_REQUEST = (((0x0F49 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410889 */,
VEHICLE_IN_USE = (((0x0F4A + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313738 */,
+ CLUSTER_HEARTBEAT = (((0x0F4B + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.MIXED) /* 299896651 */,
+ VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL = (((0x0F4C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410892 */,
AUTOMATIC_EMERGENCY_BRAKING_ENABLED = (((0x1000 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313920 */,
AUTOMATIC_EMERGENCY_BRAKING_STATE = (((0x1001 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411073 */,
FORWARD_COLLISION_WARNING_ENABLED = (((0x1002 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313922 */,
@@ -270,4 +284,16 @@
HANDS_ON_DETECTION_ENABLED = (((0x1016 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313942 */,
HANDS_ON_DETECTION_DRIVER_STATE = (((0x1017 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411095 */,
HANDS_ON_DETECTION_WARNING = (((0x1018 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411096 */,
+ DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED = (((0x1019 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313945 */,
+ DRIVER_DROWSINESS_ATTENTION_STATE = (((0x101A + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411098 */,
+ DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED = (((0x101B + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313947 */,
+ DRIVER_DROWSINESS_ATTENTION_WARNING = (((0x101C + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411100 */,
+ DRIVER_DISTRACTION_SYSTEM_ENABLED = (((0x101D + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313949 */,
+ DRIVER_DISTRACTION_STATE = (((0x101E + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411102 */,
+ DRIVER_DISTRACTION_WARNING_ENABLED = (((0x101F + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313951 */,
+ DRIVER_DISTRACTION_WARNING = (((0x1020 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411104 */,
+ LOW_SPEED_COLLISION_WARNING_ENABLED = (((0x1021 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313953 */,
+ LOW_SPEED_COLLISION_WARNING_STATE = (((0x1022 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411106 */,
+ CROSS_TRAFFIC_MONITORING_ENABLED = (((0x1023 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313955 */,
+ CROSS_TRAFFIC_MONITORING_WARNING_STATE = (((0x1024 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411108 */,
}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
index 714d514..b4f6850 100644
--- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
@@ -36,5 +36,6 @@
enum VehiclePropertyGroup {
SYSTEM = 0x10000000,
VENDOR = 0x20000000,
+ BACKPORTED = 0x30000000,
MASK = 0xf0000000,
}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CrossTrafficMonitoringWarningState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CrossTrafficMonitoringWarningState.aidl
new file mode 100644
index 0000000..05be65d
--- /dev/null
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/CrossTrafficMonitoringWarningState.aidl
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+
+package android.hardware.automotive.vehicle;
+
+/**
+ * Used to enumerate the state of Cross Traffic Monitoring Warning system.
+ */
+@VintfStability
+@Backing(type="int")
+enum CrossTrafficMonitoringWarningState {
+
+ /**
+ * This state is used as an alternative to any CrossTrafficMonitoringWarningState value that is
+ * not defined in the platform. Ideally, implementations of
+ * VehicleProperty#CROSS_TRAFFIC_MONITORING_WARNING_STATE should not use this state. The
+ * framework can use this field to remain backwards compatible if
+ * CrossTrafficMonitoringWarningState is extended to include additional states.
+ */
+ OTHER = 0,
+ /**
+ * Cross Traffic Monitoring Warning is enabled and monitoring safety, but no potential collision
+ * is detected.
+ */
+ NO_WARNING = 1,
+ /**
+ * Cross Traffic Monitoring Warning is enabled and is actively warning the user of incoming
+ * moving objects coming from the driver's left side in front of the vehicle.
+ */
+ WARNING_FRONT_LEFT = 2,
+ /**
+ * Cross Traffic Monitoring Warning is enabled and is actively warning the user of incoming
+ * moving objects coming from the driver's right side in front of the vehicle.
+ */
+ WARNING_FRONT_RIGHT = 3,
+ /**
+ * Cross Traffic Monitoring Warning is enabled and is actively warning the user of incoming
+ * moving objects coming from both the driver's left side and the driver's right side in front
+ * of the vehicle.
+ */
+ WARNING_FRONT_BOTH = 4,
+ /**
+ * Cross Traffic Monitoring Warning is enabled and is actively warning the user of incoming
+ * moving objects coming from the driver's left side behind the vehicle.
+ */
+ WARNING_REAR_LEFT = 5,
+ /**
+ * Cross Traffic Monitoring Warning is enabled and is actively warning the user of incoming
+ * moving objects coming from the driver's right side behind the vehicle.
+ */
+ WARNING_REAR_RIGHT = 6,
+ /**
+ * Cross Traffic Monitoring Warning is enabled and is actively warning the user of incoming
+ * moving objects coming from the driver's left side and the driver's right side behind the
+ * vehicle.
+ */
+ WARNING_REAR_BOTH = 7,
+}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDistractionState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDistractionState.aidl
new file mode 100644
index 0000000..f350a6c
--- /dev/null
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDistractionState.aidl
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+package android.hardware.automotive.vehicle;
+
+/**
+ * Used to enumerate the current state of driver distraction monitoring.
+ *
+ * This enum could be extended in future releases to include additional feature states.
+ */
+@VintfStability
+@Backing(type="int")
+enum DriverDistractionState {
+ /**
+ * This state is used as an alternative for any DriverDistractionState value that is not
+ * defined in the platform. Ideally, implementations of
+ * VehicleProperty#DRIVER_DISTRACTION_STATE should not use this state. The framework
+ * can use this field to remain backwards compatible if DriverDistractionState is
+ * extended to include additional states.
+ */
+ OTHER = 0,
+ /**
+ * The system detects that the driver is attentive / not distracted.
+ */
+ NOT_DISTRACTED = 1,
+ /**
+ * The system detects that the driver is distracted, which can be anything that reduces the
+ * driver's foucs on the primary task of driving/controlling the vehicle.
+ */
+ DISTRACTED = 2,
+}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDistractionWarning.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDistractionWarning.aidl
new file mode 100644
index 0000000..a4b1984
--- /dev/null
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDistractionWarning.aidl
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+
+package android.hardware.automotive.vehicle;
+
+/**
+ * Used to enumerate the current warning state of the driver distraction monitoring system.
+ */
+@VintfStability
+@Backing(type="int")
+enum DriverDistractionWarning {
+ /**
+ * This state is used as an alternative for any DriverDistractionWarning value that is
+ * defined in the platform. Ideally, implementations of
+ * VehicleProperty#DRIVER_DISTRACTION_WARNING should not use this state. The framework
+ * can use this field to remain backwards compatible if DriverDistractionWarning is
+ * extended to include additional states.
+ */
+ OTHER = 0,
+ /**
+ * When the driver distraction warning is enabled and the driver's current distraction level
+ * does not warrant the system to send a warning.
+ */
+ NO_WARNING = 1,
+ /**
+ * When the driver distraction warning is enabled and the system is warning the driver based on
+ * its assessment of the driver's current distraction level.
+ */
+ WARNING = 2,
+}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDrowsinessAttentionState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDrowsinessAttentionState.aidl
new file mode 100644
index 0000000..d2aec1f
--- /dev/null
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDrowsinessAttentionState.aidl
@@ -0,0 +1,74 @@
+/*
+ * 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.
+ */
+
+package android.hardware.automotive.vehicle;
+
+/**
+ * Used to enumerate the current state of driver drowsiness and attention monitoring.
+ *
+ * This enum could be extended in future releases to include additional feature states.
+ */
+@VintfStability
+@Backing(type="int")
+enum DriverDrowsinessAttentionState {
+ /**
+ * This state is used as an alternative for any DriverDrowsinessAttentionState value that is not
+ * defined in the platform. Ideally, implementations of
+ * VehicleProperty#DRIVER_DROWSINESS_ATTENTION_STATE should not use this state. The framework
+ * can use this field to remain backwards compatible if DriverDrowsinessAttentionState is
+ * extended to include additional states.
+ */
+ OTHER = 0,
+ /**
+ * Karolinska Sleepiness Scale Rating 1 described as extermely alert.
+ */
+ KSS_RATING_1_EXTREMELY_ALERT = 1,
+ /**
+ * Karolinska Sleepiness Scale Rating 2 described as very alert.
+ */
+ KSS_RATING_2_VERY_ALERT = 2,
+ /**
+ * Karolinska Sleepiness Scale Rating 3 described as alert.
+ */
+ KSS_RATING_3_ALERT = 3,
+ /**
+ * Karolinska Sleepiness Scale Rating 4 described as rather alert.
+ */
+ KSS_RATING_4_RATHER_ALERT = 4,
+ /**
+ * Karolinska Sleepiness Scale Rating 5 described as neither alert nor sleepy.
+ */
+ KSS_RATING_5_NEITHER_ALERT_NOR_SLEEPY = 5,
+ /**
+ * Karolinska Sleepiness Scale Rating 6 described as some signs of sleepiness.
+ */
+ KSS_RATING_6_SOME_SLEEPINESS = 6,
+ /**
+ * Karolinska Sleepiness Scale Rating 7 described as sleepy with no effort to
+ * keep awake.
+ */
+ KSS_RATING_7_SLEEPY_NO_EFFORT = 7,
+ /**
+ * Karolinska Sleepiness Scale Rating 8 described as sleepy with some effort to
+ * keep awake.
+ */
+ KSS_RATING_8_SLEEPY_SOME_EFFORT = 8,
+ /**
+ * Karolinska Sleepiness Scale Rating 9 described as very sleepy, with great
+ * effort to keep away, and fighthing sleep.
+ */
+ KSS_RATING_9_VERY_SLEEPY = 9,
+}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.aidl
new file mode 100644
index 0000000..53b66b9
--- /dev/null
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/DriverDrowsinessAttentionWarning.aidl
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+package android.hardware.automotive.vehicle;
+
+/**
+ * Used to enumerate the current warning state of the driver drowsiness and attention monitoring
+ * system.
+ */
+@VintfStability
+@Backing(type="int")
+enum DriverDrowsinessAttentionWarning {
+ /**
+ * This state is used as an alternative for any DriverDrowsinessAttentionWarning value that is
+ * defined in the platform. Ideally, implementations of
+ * VehicleProperty#DRIVER_DROWSINESS_ATTENTION_WARNING should not use this state. The framework
+ * can use this field to remain backwards compatible if DriverDrowsinessAttentionWarning is
+ * extended to include additional states.
+ */
+ OTHER = 0,
+ /**
+ * When the driver drowsiness and attention warning is enabled, and the driver's current
+ * drowsiness and attention level does not warrant the system to send a warning.
+ */
+ NO_WARNING = 1,
+ /**
+ * When the driver drowsiness and attention warning is enabled, and the system is warning the
+ * driver based on its assessment of the driver's current drowsiness and attention level.
+ */
+ WARNING = 2,
+}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ElectronicStabilityControlState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ElectronicStabilityControlState.aidl
new file mode 100644
index 0000000..006bbf2
--- /dev/null
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ElectronicStabilityControlState.aidl
@@ -0,0 +1,43 @@
+/*
+ * 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.
+ */
+
+package android.hardware.automotive.vehicle;
+
+/**
+ * Used to enumerate the state of Electronic Stability Control (ESC).
+ */
+@VintfStability
+@Backing(type="int")
+enum ElectronicStabilityControlState {
+
+ /**
+ * This state is used as an alternative to any ElectronicStabilityControlState value that is not
+ * defined in the platform. Ideally, implementations of
+ * VehicleProperty#ELECTRONIC_STABILITY_CONTROL_STATE should not use this state. The framework
+ * can use this field to remain backwards compatible if ElectronicStabilityControlState is
+ * extended to include additional states.
+ */
+ OTHER = 0,
+ /**
+ * ESC is enabled and monitoring safety, but is not actively controlling the tires to prevent
+ * the car from skidding.
+ */
+ ENABLED = 1,
+ /**
+ * ESC is enabled and is actively controlling the tires to prevent the car from skidding.
+ */
+ ACTIVATED = 2,
+}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ImpactSensorLocation.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ImpactSensorLocation.aidl
new file mode 100644
index 0000000..0fc1a50
--- /dev/null
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/ImpactSensorLocation.aidl
@@ -0,0 +1,57 @@
+/*
+ * 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.
+ */
+
+package android.hardware.automotive.vehicle;
+
+/**
+ * Used to enumerate the various impact sensor locations on the car.
+ */
+@VintfStability
+@Backing(type="int")
+enum ImpactSensorLocation {
+ /**
+ * Other impact sensor location. Ideally this should never be used.
+ */
+ OTHER = 0x01,
+ /**
+ * Frontal impact sensor. Used for the sensor that detects head-on impact.
+ */
+ FRONT = 0x02,
+ /**
+ * Front-left door side impact sensor. Used for the sensor that detects collisions from the
+ * side, in particular on the front-left door.
+ */
+ FRONT_LEFT_DOOR_SIDE = 0x04,
+ /**
+ * Front-right door side impact sensor. Used for the sensor that detects collisions from the
+ * side, in particular on the front-right door.
+ */
+ FRONT_RIGHT_DOOR_SIDE = 0x08,
+ /**
+ * Rear-left door side impact sensor. Used for the sensor that detects collisions from the
+ * side, in particular on the rear-left door.
+ */
+ REAR_LEFT_DOOR_SIDE = 0x10,
+ /**
+ * Rear-right door side impact sensor. Used for the sensor that detects collisions from the
+ * side, in particular on the rear-right door.
+ */
+ REAR_RIGHT_DOOR_SIDE = 0x20,
+ /**
+ * Rear impact sensor. Used for the sensor that detects collisions from the rear.
+ */
+ REAR = 0x40,
+}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LowSpeedCollisionWarningState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LowSpeedCollisionWarningState.aidl
new file mode 100644
index 0000000..028a2d9
--- /dev/null
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LowSpeedCollisionWarningState.aidl
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+package android.hardware.automotive.vehicle;
+
+/**
+ * Used to enumerate the state of Low Speed Collision Warning State.
+ */
+@VintfStability
+@Backing(type="int")
+enum LowSpeedCollisionWarningState {
+
+ /**
+ * This state is used as an alternative to any LowSpeedCollisionWarningState value that is not
+ * defined in the platform. Ideally, implementations of
+ * VehicleProperty#LOW_SPEED_COLLISION_WARNING_STATE should not use this state. The framework
+ * can use this field to remain backwards compatible if LowSpeedCollisionWarningState is
+ * extended to include additional states.
+ */
+ OTHER = 0,
+ /**
+ * Low Speed Collision Warning is enabled and monitoring for potential collision, but no
+ * potential collision is detected.
+ */
+ NO_WARNING = 1,
+ /**
+ * Low Speed Collision Warning is enabled, detects a potential collision, and is actively
+ * warning the user.
+ */
+ WARNING = 2,
+}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAirbagLocation.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAirbagLocation.aidl
new file mode 100644
index 0000000..e4c43f7
--- /dev/null
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAirbagLocation.aidl
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+package android.hardware.automotive.vehicle;
+
+/**
+ * Used to enumerate the various airbag locations per seat.
+ */
+@VintfStability
+@Backing(type="int")
+enum VehicleAirbagLocation {
+ /**
+ * This state is used as an alternative to any VehicleAirbagLocation value that is not defined
+ * in the platform. Ideally, implementations of VehicleProperty::SEAT_AIRBAGS_DEPLOYED should
+ * not use this state. The framework can use this field to remain backwards compatible if
+ * VehicleAirbagLocation is extended to include additional states.
+ */
+ OTHER = 0x01,
+ /**
+ * Front airbags. This enum is for the airbags that protect the seated person from the front,
+ * particularly the seated person's torso.
+ */
+ FRONT = 0x02,
+ /**
+ * Knee airbags. This enum is for the airbags that protect the seated person's knees.
+ */
+ KNEE = 0x04,
+ /**
+ * Left side airbags. This enum is for the side airbags that protect the left side of the seated
+ * person.
+ */
+ LEFT_SIDE = 0x08,
+ /**
+ * Right side airbags. This enum is for the side airbags that protect the right side of the
+ * seated person.
+ */
+ RIGHT_SIDE = 0x10,
+ /**
+ * Curtain airbags. This enum is for the airbags lined above the windows of the vehicle.
+ */
+ CURTAIN = 0x20,
+}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
index a863d14..923d42a 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
@@ -45,4 +45,8 @@
* AP can enter hibernation (suspend to disk) instead of shutting down completely.
*/
CAN_HIBERNATE = 6,
+ /**
+ * AP must shutdown (gracefully) without a delay.
+ */
+ EMERGENCY_SHUTDOWN = 7,
}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleArea.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleArea.aidl
index 6f7f783..259b231 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleArea.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleArea.aidl
@@ -49,6 +49,11 @@
DOOR = 0x06000000,
/** WHEEL maps to enum VehicleAreaWheel */
WHEEL = 0x07000000,
+ /**
+ * A property with the VENDOR vehicle area contains area IDs that are vendor defined. Each area
+ * ID within this area type must be unique with no overlapping bits set.
+ */
+ VENDOR = 0x08000000,
MASK = 0x0f000000,
}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
index 89d50ea..e70fb22 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAreaSeat.aidl
@@ -22,6 +22,7 @@
@VintfStability
@Backing(type="int")
enum VehicleAreaSeat {
+ UNKNOWN = 0x0000,
ROW_1_LEFT = 0x0001,
ROW_1_CENTER = 0x0002,
ROW_1_RIGHT = 0x0004,
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAutonomousState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAutonomousState.aidl
new file mode 100644
index 0000000..3860e7f
--- /dev/null
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleAutonomousState.aidl
@@ -0,0 +1,73 @@
+/*
+ * 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.
+ */
+
+package android.hardware.automotive.vehicle;
+
+/**
+ * Used to enumerate the various level of automation that can be expressed by the
+ * VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL property.
+ */
+@VintfStability
+@Backing(type="int")
+enum VehicleAutonomousState {
+ /**
+ * No automation. ADAS systems are limited to providing warnings and momentary assistance. The
+ * driver is in constant supervision of all driving tasks and must steer, brake or accelerate as
+ * needed to maintain safety, and is still responsible for driving while the ADAS systems are
+ * engaged. Usage should be in accordance to Level 0 definition in J3016_202104 version of
+ * vehicle autonomy levels defined by SAE.
+ */
+ LEVEL_0 = 0,
+ /**
+ * Driver assistance. ADAS systems can provide steering or brake/acceleration support to the
+ * driver. The driver is in constant supervision of all driving tasks and must steer, brake or
+ * accelerate as needed to maintain safety, and is still responsible for driving while the ADAS
+ * systems are engaged. Usage should be in accordance to Level 1 definition in J3016_202104
+ * version of vehicle autonomy levels defined by SAE.
+ */
+ LEVEL_1 = 1,
+ /**
+ * Partial automation. ADAS systems can provide both steering and brake/acceleration support to
+ * the driver at the same time. The driver is in constant supervision of all driving tasks and
+ * must steer, brake or accelerate as needed to maintain safety, and is still responsible for
+ * driving while the ADAS systems are engaged. Usage should be in accordance to Level 2
+ * definition in J3016_202104 version of vehicle autonomy levels defined by SAE.
+ */
+ LEVEL_2 = 2,
+ /**
+ * Conditional automation. ADAS systems can drive the vehicle under limited conditions and will
+ * not operate unless all required conditions are met. The driver is required to take over
+ * control of the vehicle when requested to do so by the ADAS systems, however is not
+ * responsible for driving while the ADAS systems are engaged. Usage should be in accordance to
+ * Level 3 definition in J3016_202104 version of vehicle autonomy levels defined by SAE.
+ */
+ LEVEL_3 = 3,
+ /**
+ * High automation. ADAS systems can drive the vehicle under limited conditions and will not
+ * operate unless all required conditions are met. The driver is not required to take over
+ * control of the vehicle and is not responsible for driving while the ADAS systems are engaged.
+ * Usage should be in accordance to Level 4 definition in J3016_202104 version of vehicle
+ * autonomy levels defined by SAE.
+ */
+ LEVEL_4 = 4,
+ /**
+ * Full automation. ADAS systems can drive the vehicle under all conditions. The driver is not
+ * required to take over control of the vehicle and is not responsible for driving while the
+ * ADAS systems are engaged. Usage should be in accordance to Level 5 definition in J3016_202104
+ * version of vehicle autonomy levels defined by SAE.
+ */
+ LEVEL_5 = 5,
+}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
index 717f561..acb6aeb 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
@@ -169,7 +169,7 @@
* int32Values[4] = wheel base
* int32Values[5] = track width front
* int32Values[6] = track width rear
- * int32Values[7] = curb to curb turning radius
+ * int32Values[7] = curb to curb turning diameter
*
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
@@ -345,6 +345,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
FUEL_DOOR_OPEN = 0x0308 + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -383,6 +384,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
EV_CHARGE_PORT_OPEN = 0x030A + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -419,11 +421,25 @@
*
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @unit VehicleUnit:METER
*/
RANGE_REMAINING = 0x0308 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
/**
+ * EV battery average temperature
+ *
+ * Exposes the temperature of the battery in an EV. If multiple batteries exist in the EV, or
+ * multiple temperature sensors exist, this property should be set to the mean or a meaningful
+ * weighted average that best represents the overall temperature of the battery system.
+ *
+ * @change_mode VehiclePropertyChangeMode.CONTINUOUS
+ * @access VehiclePropertyAccess.READ
+ * @unit VehicleUnit:CELSIUS
+ */
+ EV_BATTERY_AVERAGE_TEMPERATURE =
+ 0x030E + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.FLOAT,
+ /**
* Tire pressure
*
* Each tires is identified by its areaConfig.areaId config and their
@@ -476,10 +492,27 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
ENGINE_IDLE_AUTO_STOP_ENABLED =
0x0320 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
/**
+ * Impact detected.
+ *
+ * Bit flag property to relay information on whether an impact has occurred on a particular side
+ * of the vehicle as described through the ImpactSensorLocation enum. As a bit flag property,
+ * this property can be set to multiple ORed together values of the enum when necessary.
+ *
+ * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined
+ * unless all bit flags of ImpactSensorLocation are supported.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ
+ * @data_enum ImpactSensorLocation
+ */
+ IMPACT_DETECTED =
+ 0x0330 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
+ /**
* Currently selected gear
*
* This is the gear selected by the user.
@@ -560,6 +593,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
EV_BRAKE_REGENERATION_LEVEL =
0x040C + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -648,11 +682,51 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum EvStoppingMode
*/
EV_STOPPING_MODE =
0x040D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
/**
+ * Enable or disable Electronic Stability Control (ESC).
+ *
+ * Set true to enable ESC and false to disable ESC. When ESC is enabled, a system in the vehicle
+ * should be controlling the tires during instances with high risk of skidding to actively
+ * prevent the same from happening.
+ *
+ * In general, ELECTRONIC_STABILITY_CONTROL_ENABLED should always return true or false. If the
+ * feature is not available due to some temporary state, such as the vehicle speed being too
+ * high, that information must be conveyed through the ErrorState values in the
+ * ELECTRONIC_STABILITY_CONTROL_STATE property.
+ *
+ * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to
+ * implement it as VehiclePropertyAccess.READ only.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
+ */
+ ELECTRONIC_STABILITY_CONTROL_ENABLED =
+ 0x040E + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
+ /**
+ * Electronic Stability Control (ESC) state.
+ *
+ * Returns the current state of ESC. This property must always return a valid state defined in
+ * ElectronicStabilityControlState or ErrorState. It must not surface errors through StatusCode
+ * and must use the supported error states instead.
+ *
+ * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined
+ * unless all states of both ElectronicStabilityControlState (including OTHER, which is not
+ * recommended) and ErrorState are supported.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ
+ * @data_enum ElectronicStabilityControlState
+ * @data_enum ErrorState
+ */
+ ELECTRONIC_STABILITY_CONTROL_STATE =
+ 0x040F + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
+ /**
* HVAC Properties
*
* Additional rules for mapping non-GLOBAL VehicleArea type HVAC properties
@@ -696,8 +770,9 @@
* and passenger side, an alternative mapping would be:
* - ROW_1_LEFT
* - ROW_1_RIGHT
- *
- *
+ */
+
+ /**
* Fan speed setting
*
* The maxInt32Value and minInt32Value in VehicleAreaConfig must be defined.
@@ -713,6 +788,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
HVAC_FAN_SPEED = 0x0500 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -724,6 +800,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum VehicleHvacFanDirection
*/
HVAC_FAN_DIRECTION = 0x0501 + 0x10000000 + 0x05000000
@@ -763,6 +840,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @unit VehicleUnit:CELSIUS
*/
HVAC_TEMPERATURE_SET = 0x0503 + 0x10000000 + 0x05000000
@@ -775,6 +853,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
HVAC_DEFROSTER = 0x0504 + 0x10000000 + 0x03000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN
@@ -786,6 +865,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @config_flags Supported areaIds
*/
HVAC_AC_ON = 0x0505 + 0x10000000 + 0x05000000
@@ -803,6 +883,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
HVAC_MAX_AC_ON = 0x0506 + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -825,6 +906,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
HVAC_MAX_DEFROST_ON = 0x0507 + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -841,6 +923,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
HVAC_RECIRC_ON = 0x0508 + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -879,6 +962,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
HVAC_DUAL_ON = 0x0509 + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -900,6 +984,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
HVAC_AUTO_ON = 0x050A + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -921,6 +1006,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
HVAC_SEAT_TEMPERATURE = 0x050B + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -943,6 +1029,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
HVAC_SIDE_MIRROR_HEAT = 0x050C + 0x10000000 + 0x04000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32
@@ -965,6 +1052,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
HVAC_STEERING_WHEEL_HEAT = 0x050D + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -989,6 +1077,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum VehicleUnit
*/
HVAC_TEMPERATURE_DISPLAY_UNITS = 0x050E + 0x10000000 + 0x01000000
@@ -1043,6 +1132,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
HVAC_POWER_ON = 0x0510 + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -1077,6 +1167,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
HVAC_AUTO_RECIRC_ON = 0x0512 + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -1101,6 +1192,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
HVAC_SEAT_VENTILATION = 0x0513 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -1112,6 +1204,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
HVAC_ELECTRIC_DEFROSTER_ON = 0x0514 + 0x10000000 + 0x03000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN
@@ -1175,6 +1268,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum VehicleUnit
*/
DISTANCE_DISPLAY_UNITS = 0x0600 + 0x10000000 + 0x01000000
@@ -1198,6 +1292,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum VehicleUnit
*/
FUEL_VOLUME_DISPLAY_UNITS = 0x0601 + 0x10000000 + 0x01000000
@@ -1222,6 +1317,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum VehicleUnit
*/
TIRE_PRESSURE_DISPLAY_UNITS = 0x0602 + 0x10000000 + 0x01000000
@@ -1246,6 +1342,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum VehicleUnit
*/
EV_BATTERY_DISPLAY_UNITS = 0x0603 + 0x10000000 + 0x01000000
@@ -1262,6 +1359,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME = 0x0604 + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -1284,6 +1382,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
VEHICLE_SPEED_DISPLAY_UNITS = 0x0605 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -1475,6 +1574,22 @@
PER_DISPLAY_BRIGHTNESS = 0x0A04 + 0x10000000 + 0x01000000
+ 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
/**
+ * Valet mode enabled
+ *
+ * This property allows the user to enable/disable valet mode in their vehicle. Valet mode is
+ * a privacy and security setting that prevents an untrusted driver to access more private areas
+ * in the vehicle, such as the glove box or the trunk(s).
+ *
+ * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to
+ * implement it as VehiclePropertyAccess.READ only.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
+ */
+ VALET_MODE_ENABLED =
+ 0x0A05 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
+ /**
* Property to feed H/W input events to android
*
* int32Values[0] : action defined by VehicleHwKeyInputAction
@@ -1633,6 +1748,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
DOOR_POS = 0x0B00 + 0x10000000 + 0x06000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:INT32
@@ -1657,6 +1773,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
DOOR_MOVE = 0x0B01 + 0x10000000 + 0x06000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:INT32
@@ -1670,6 +1787,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
DOOR_LOCK = 0x0B02 + 0x10000000 + 0x06000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:BOOLEAN
@@ -1685,6 +1803,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
DOOR_CHILD_LOCK_ENABLED =
0x0B03 + VehiclePropertyGroup.SYSTEM + VehicleArea.DOOR + VehiclePropertyType.BOOLEAN,
@@ -1710,6 +1829,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
MIRROR_Z_POS = 0x0B40 + 0x10000000 + 0x04000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32
@@ -1735,6 +1855,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
MIRROR_Z_MOVE = 0x0B41 + 0x10000000 + 0x04000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32
@@ -1760,6 +1881,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
MIRROR_Y_POS = 0x0B42 + 0x10000000 + 0x04000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32
@@ -1784,6 +1906,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
MIRROR_Y_MOVE = 0x0B43 + 0x10000000 + 0x04000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32
@@ -1797,6 +1920,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
MIRROR_LOCK = 0x0B44 + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -1810,6 +1934,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
MIRROR_FOLD = 0x0B45 + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -1826,6 +1951,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
MIRROR_AUTO_FOLD_ENABLED =
@@ -1843,6 +1969,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
MIRROR_AUTO_TILT_ENABLED =
@@ -1891,6 +2018,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_BELT_BUCKLED = 0x0B82 + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -1915,6 +2043,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_BELT_HEIGHT_POS = 0x0B83 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -1942,6 +2071,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_BELT_HEIGHT_MOVE = 0x0B84 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -1966,6 +2096,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_FORE_AFT_POS = 0x0B85 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -1992,6 +2123,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_FORE_AFT_MOVE = 0x0B86 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2018,6 +2150,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_BACKREST_ANGLE_1_POS = 0x0B87 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2044,6 +2177,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_BACKREST_ANGLE_1_MOVE = 0x0B88 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2072,6 +2206,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_BACKREST_ANGLE_2_POS = 0x0B89 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2098,6 +2233,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_BACKREST_ANGLE_2_MOVE = 0x0B8A + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2120,6 +2256,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_HEIGHT_POS = 0x0B8B + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2144,6 +2281,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_HEIGHT_MOVE = 0x0B8C + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2171,6 +2309,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_DEPTH_POS = 0x0B8D + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2196,6 +2335,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_DEPTH_MOVE = 0x0B8E + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2222,6 +2362,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_TILT_POS = 0x0B8F + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2248,6 +2389,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_TILT_MOVE = 0x0B90 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2272,6 +2414,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_LUMBAR_FORE_AFT_POS = 0x0B91 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2299,6 +2442,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_LUMBAR_FORE_AFT_MOVE = 0x0B92 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2323,6 +2467,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_LUMBAR_SIDE_SUPPORT_POS = 0x0B93 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2350,6 +2495,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_LUMBAR_SIDE_SUPPORT_MOVE = 0x0B94 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2369,6 +2515,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_HEADREST_HEIGHT_POS = 0x0B95 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -2395,6 +2542,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_HEADREST_HEIGHT_POS_V2 =
0x0BA4 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
@@ -2423,6 +2571,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_HEADREST_HEIGHT_MOVE = 0x0B96 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2445,6 +2594,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_HEADREST_ANGLE_POS = 0x0B97 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2472,6 +2622,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_HEADREST_ANGLE_MOVE = 0x0B98 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2494,6 +2645,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_HEADREST_FORE_AFT_POS = 0x0B99 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2521,6 +2673,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_HEADREST_FORE_AFT_MOVE = 0x0B9A + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2565,6 +2718,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
*/
SEAT_FOOTWELL_LIGHTS_SWITCH =
@@ -2581,6 +2735,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_EASY_ACCESS_ENABLED =
0x0B9D + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN,
@@ -2600,10 +2755,33 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_AIRBAG_ENABLED =
0x0B9E + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN,
/**
+ * Seat airbags deployed
+ *
+ * Bit flag property to relay information on which airbags have been deployed in the vehicle at
+ * each seat, vs which ones are currently still armed. If SEAT_AIRBAG_ENABLED is set to false at
+ * a particular areaId, this property should return status code UNAVAILABLE at that areaId.
+ *
+ * Enums apply to each seat, not the global vehicle. For example, VehicleAirbagsLocation#CURTAIN
+ * at the driver seat areaId represents whether the driver side curtain airbag has been
+ * deployed. Multiple bit flags can be set to indicate that multiple different airbags have been
+ * deployed for the seat.
+ *
+ * For each seat area ID, the VehicleAreaConfig#supportedEnumValues array must be defined unless
+ * all states of VehicleAirbagLocation are supported (including OTHER, which is not
+ * recommended).
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ
+ * @data_enum VehicleAirbagLocation
+ */
+ SEAT_AIRBAGS_DEPLOYED =
+ 0x0BA5 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
+ /**
* Represents property for seat’s hipside (bottom cushion’s side) support position.
*
* The maxInt32Value and minInt32Value in each VehicleAreaConfig must be defined. All integers
@@ -2624,6 +2802,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_CUSHION_SIDE_SUPPORT_POS =
0x0B9F + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
@@ -2651,6 +2830,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_CUSHION_SIDE_SUPPORT_MOVE =
0x0BA0 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
@@ -2673,6 +2853,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_LUMBAR_VERTICAL_POS =
0x0BA1 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
@@ -2698,6 +2879,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_LUMBAR_VERTICAL_MOVE =
0x0BA2 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
@@ -2723,10 +2905,29 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
SEAT_WALK_IN_POS =
0x0BA3 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
/**
+ * Seat belt pretensioner deployed.
+ *
+ * Property to relay information on whether the seat belt pretensioner has been deployed for a
+ * particular seat due to a collision. This is different from the regular seat belt tightening
+ * system that continuously adds tension to the seat belts so that they fit snugly around the
+ * person sitting in the seat, nor is it the seat belt retractor system that locks the seat belt
+ * in place during sudden brakes or when the user jerks the seat belt.
+ *
+ * If this property is dependant on the state of other properties, and those properties are
+ * currently in the state that doesn't support this property, this should return
+ * StatusCode#NOT_AVAILABLE
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ
+ */
+ SEAT_BELT_PRETENSIONER_DEPLOYED =
+ 0x0BA6 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN,
+ /**
* Seat Occupancy
*
* Indicates whether a particular seat is occupied or not, to the best of the car's ability
@@ -2770,6 +2971,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
WINDOW_POS = 0x0BC0 + 0x10000000 + 0x03000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32
@@ -2811,6 +3013,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
WINDOW_MOVE = 0x0BC1 + 0x10000000 + 0x03000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32
@@ -2824,6 +3027,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
WINDOW_LOCK = 0x0BC4 + 0x10000000 + 0x03000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN
@@ -2889,6 +3093,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum WindshieldWipersSwitch
*/
WINDSHIELD_WIPERS_SWITCH =
@@ -2915,6 +3120,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
STEERING_WHEEL_DEPTH_POS =
0x0BE0 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -2940,6 +3146,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
STEERING_WHEEL_DEPTH_MOVE =
0x0BE1 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -2962,6 +3169,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
STEERING_WHEEL_HEIGHT_POS =
0x0BE2 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -2987,6 +3195,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
STEERING_WHEEL_HEIGHT_MOVE =
0x0BE3 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -3001,6 +3210,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
STEERING_WHEEL_THEFT_LOCK_ENABLED =
0x0BE4 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -3014,6 +3224,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
STEERING_WHEEL_LOCKED =
0x0BE5 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -3028,6 +3239,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
STEERING_WHEEL_EASY_ACCESS_ENABLED =
0x0BE6 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -3054,6 +3266,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
GLOVE_BOX_DOOR_POS =
0x0BF0 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
@@ -3072,6 +3285,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
GLOVE_BOX_LOCKED =
0x0BF1 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN,
@@ -3113,6 +3327,151 @@
*/
LOCATION_CHARACTERIZATION =
0x0C10 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
+
+ /**
+ * Static data for the position of each ultrasonic sensor installed on the vehicle.
+ *
+ * Each individual sensor is identified by its unique VehicleAreaConfig#areaId and returns the
+ * sensor's position formatted as [x, y, z] where:
+ *
+ * int32Values[0] = x, the position of the sensor along the x-axis relative to the origin of
+ * the Android Automotive sensor coordinate frame in millimeters
+ * int32Values[1] = y, the position of the sensor along the y-axis relative to the origin of
+ * the Android Automotive sensor coordinate frame in millimeters.
+ * int32Values[2] = z, the position of the sensor along the z-axis relative to the origin of
+ * the Android Automotive sensor coordinate frame in millimeters.
+ *
+ * If the data is aggregated by another ECU, then OEMs have the option of reporting the same
+ * reading across all included sensors or reporting a virtual representation of all the included
+ * sensors as if they were one sensor.
+ *
+ * @change_mode VehiclePropertyChangeMode.STATIC
+ * @access VehiclePropertyAccess.READ
+ */
+ ULTRASONICS_SENSOR_POSITION = 0x0C20 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR
+ + VehiclePropertyType.INT32_VEC,
+
+ /**
+ * Static data for the orientation of each ultrasonic sensor installed on the vehicle.
+ *
+ * Each individual sensor is identified by its VehicleAreaConfig#areaId and returns the sensor's
+ * orientation formatted as [qw, qx, qy, qz] where:
+ *
+ * int32Values[0] = qw, the quaternion coefficient w within the quaterinion (w + xi + yj +
+ * zk) describing the rotation of the sensor relative to the Android
+ * Automotive sensor coordinate frame.
+ * int32Values[1] = qx, the quaternion coefficient x within the quaterinion (w + xi + yj +
+ * zk) describing the rotation of the sensor relative to the Android
+ * Automotive sensor coordinate frame.
+ * int32Values[2] = qy, the quaternion coefficient y within the quaterinion (w + xi + yj +
+ * zk) describing the rotation of the sensor relative to the Android
+ * Automotive sensor coordinate frame.
+ * int32Values[3] = qz, the quaternion coefficient z within the quaterinion (w + xi + yj +
+ * zk) describing the rotation of the sensor relative to the Android
+ * Automotive sensor coordinate frame.
+ *
+ * This assumes each sensor uses the same axes conventions as Android Automotive.
+ *
+ * If the data is aggregated by another ECU, then OEMs have the option of reporting the same
+ * reading across all included sensors or reporting a virtual representation of all the included
+ * sensors as if they were one sensor.
+ *
+ * @change_mode VehiclePropertyChangeMode.STATIC
+ * @access VehiclePropertyAccess.READ
+ */
+ ULTRASONICS_SENSOR_ORIENTATION = 0x0C21 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR
+ + VehiclePropertyType.INT32_VEC,
+
+ /**
+ * Static data for the field of view of each ultrasonic sensor in degrees.
+ *
+ * Each individual sensor is identified by its VehicleAreaConfig#areaId and returns the sensor's
+ * field of view formatted as [horizontal, vertical] where:
+ *
+ * int32Values[0] = horizontal, the horizontal field of view for the specified ultrasonic
+ * sensor in degrees.
+ * int32Values[1] = vertical, the vertical field of view for the associated specified
+ * ultrasonic sensor in degrees.
+ *
+ * This assumes each sensor uses the same axes conventions as Android Automotive.
+ *
+ * If the data is aggregated by another ECU, then OEMs have the option of reporting the same
+ * reading across all included sensors or reporting a virtual representation of all the included
+ * sensors as if they were one sensor.
+ *
+ * @change_mode VehiclePropertyChangeMode.STATIC
+ * @access VehiclePropertyAccess.READ
+ */
+ ULTRASONICS_SENSOR_FIELD_OF_VIEW = 0x0C22 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR
+ + VehiclePropertyType.INT32_VEC,
+
+ /**
+ * Static data for the detection range of each ultrasonic sensor in millimeters.
+ *
+ * Each individual sensor is identified by its VehicleAreaConfig#areaId and returns the sensor's
+ * detection range formatted as [minimum, maximum] where:
+ *
+ * int32Values[0] = minimum, the minimum range detectable by the ultrasonic sensor in
+ * millimeters.
+ * int32Values[1] = maximum, the maximum range detectable by the ultrasonic sensor in
+ * millimeters.
+ *
+ * If the data is aggregated by another ECU, then OEMs have the option of reporting the same
+ * reading across all included sensors or reporting a virtual representation of all the included
+ * sensors as if they were one sensor.
+ *
+ * @change_mode VehiclePropertyChangeMode.STATIC
+ * @access VehiclePropertyAccess.READ
+ */
+ ULTRASONICS_SENSOR_DETECTION_RANGE = 0x0C23 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR
+ + VehiclePropertyType.INT32_VEC,
+
+ /**
+ * Static data for the supported ranges of each ultrasonic sensor in millimeters.
+ *
+ * For ultrasonic sensors that only support readings within a specific range. For example, if
+ * an ultrasonic sensor detects an object at 700mm, but can only report that an object has been
+ * detected between 500mm and 1000mm.
+ *
+ * Each individual sensor is identified by its VehicleAreaConfig#areaId and returns the sensor's
+ * supported ranges formatted as [range_min_1, range_max_1, range_min_2, range_max_2, ...]
+ * where:
+ *
+ * int32Values[0] = range_min_1, the minimum of one supported range by the specified sensor
+ * in millimeters, inclusive.
+ * int32Values[1] = range_max_1, the maximum of one supported range by the specified sensor
+ * in millimeters, inclusive.
+ * int32Values[2] = range_min_2, the minimum of another supported range by the specified
+ * sensor in millimeters, inclusive.
+ * int32Values[3] = range_max_2, the maximum of another supported range by the specified
+ sensor in millimeters, inclusive.
+ *
+ * Example:
+ * - Ultrasonic sensor supports the following ranges:
+ * - 150mm to 499mm
+ * - 500mm to 999mm
+ * - 1000mm to 1500mm
+ * - The associated supported ranges should be formatted as:
+ * - int32Values[0] = 150
+ * - int32Values[1] = 499
+ * - int32Values[2] = 500
+ * - int32Values[3] = 999
+ * - int32Values[4] = 1000
+ * - int32Values[5] = 1500
+ *
+ * If this property is not defined, all the values within the ULTRASONICS_SENSOR_DETECTION_RANGE
+ * for the specified sensor are assumed to be supported.
+ *
+ * If the data is aggregated by another ECU, then OEMs have the option of reporting the same
+ * reading across all included sensors or reporting a virtual representation of all the included
+ * sensors as if they were one sensor.
+ *
+ * @change_mode VehiclePropertyChangeMode.STATIC
+ * @access VehiclePropertyAccess.READ
+ */
+ ULTRASONICS_SENSOR_SUPPORTED_RANGES = 0x0C24 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR
+ + VehiclePropertyType.INT32_VEC,
+
/**
* OBD2 Live Sensor Data
*
@@ -3291,6 +3650,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
*/
HEADLIGHTS_SWITCH = 0x0E10 + 0x10000000 + 0x01000000
@@ -3305,6 +3665,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
*/
HIGH_BEAM_LIGHTS_SWITCH = 0x0E11 + 0x10000000 + 0x01000000
@@ -3335,6 +3696,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
*/
FOG_LIGHTS_SWITCH = 0x0E12 + 0x10000000 + 0x01000000
@@ -3349,6 +3711,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
*/
HAZARD_LIGHTS_SWITCH = 0x0E13 + 0x10000000 + 0x01000000
@@ -3377,6 +3740,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
*/
CABIN_LIGHTS_SWITCH = 0x0F02 + 0x10000000 + 0x01000000
@@ -3405,6 +3769,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
*/
READING_LIGHTS_SWITCH = 0x0F04 + 0x10000000 + 0x05000000
@@ -3450,6 +3815,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
*/
STEERING_WHEEL_LIGHTS_SWITCH =
@@ -4119,6 +4485,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
*/
FRONT_FOG_LIGHTS_SWITCH = 0x0F3C + 0x10000000 + 0x01000000
@@ -4150,6 +4517,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
*/
REAR_FOG_LIGHTS_SWITCH = 0x0F3E + 0x10000000 + 0x01000000
@@ -4166,6 +4534,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @unit VehicleUnit:AMPERE
*/
EV_CHARGE_CURRENT_DRAW_LIMIT = 0x0F3F + 0x10000000 + 0x01000000
@@ -4187,6 +4556,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
EV_CHARGE_PERCENT_LIMIT = 0x0F40 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -4214,6 +4584,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
EV_CHARGE_SWITCH = 0x0F42 + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -4375,12 +4746,49 @@
* powers on the vehicle. VEHICLE_IN_USE is set to true. After a driving session, user powers
* off the vehicle, VEHICLE_IN_USE is set to false.
*
+ * <p>This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to
+ * implement it as VehiclePropertyAccess.READ only.
+ *
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
VEHICLE_IN_USE =
0x0F4A + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
+ /**
+ * Sends the heartbeat signal to ClusterOS.
+ *
+ * int64[0]: epochTimeNs
+ * int64[1]: the visibility of ClusterUI, 0 - invisible, 1 - visible
+ * bytes: the app specific metadata, this can be empty when ClusterHomeService use the heartbeat
+ * to deliver the change of the visibility.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.WRITE
+ */
+ CLUSTER_HEARTBEAT =
+ 0x0F4B + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.MIXED,
+
+ /**
+ * Current state of vehicle autonomy.
+ *
+ * Defines the level of autonomy currently engaged in the vehicle from the J3016_202104 revision
+ * of the SAE standard levels 0-5, with 0 representing no autonomy and 5 representing full
+ * driving automation. These levels should be used in accordance with the standards defined in
+ * https://www.sae.org/standards/content/j3016_202104/ and
+ * https://www.sae.org/blog/sae-j3016-update
+ *
+ * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined
+ * unless all states of VehicleAutonomousState are supported.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ
+ * @data_enum VehicleAutonomousState
+ */
+ VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL =
+ 0x0F4C + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
+
/***********************************************************************************************
* Start of ADAS Properties
*
@@ -4403,6 +4811,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
AUTOMATIC_EMERGENCY_BRAKING_ENABLED =
0x1000 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -4445,6 +4854,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
FORWARD_COLLISION_WARNING_ENABLED =
0x1002 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -4484,6 +4894,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
BLIND_SPOT_WARNING_ENABLED =
0x1004 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -4524,6 +4935,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
LANE_DEPARTURE_WARNING_ENABLED =
0x1006 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -4568,6 +4980,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
LANE_KEEP_ASSIST_ENABLED =
0x1008 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -4616,6 +5029,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
LANE_CENTERING_ASSIST_ENABLED =
0x100A + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -4690,6 +5104,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
EMERGENCY_LANE_KEEP_ASSIST_ENABLED =
0x100D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -4733,6 +5148,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
CRUISE_CONTROL_ENABLED =
0x100F + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -4758,6 +5174,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @data_enum CruiseControlType
* @data_enum ErrorState
*/
@@ -4855,6 +5272,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
* @unit VehicleUnit:MILLI_SECS
*/
ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP =
@@ -4906,6 +5324,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
*/
HANDS_ON_DETECTION_ENABLED =
0x1016 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -4956,6 +5375,277 @@
HANDS_ON_DETECTION_WARNING =
0x1018 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
+ /**
+ * Enable or disable driver drowsiness and attention monitoring.
+ *
+ * Set true to enable driver drowsiness and attention monitoring and false to disable driver
+ * drowsiness and attention monitoring. When driver drowsiness and attention monitoring is
+ * enabled, a system inside the vehicle should be monitoring the drowsiness and attention level
+ * of the driver and warn the driver if needed.
+ *
+ * In general, DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED should always return true or false.
+ * If the feature is not available due to some temporary state, that information must be
+ * conveyed through the ErrorState values in the DRIVER_DROWSINESS_ATTENTION_STATE property.
+ *
+ * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to
+ * implement it as VehiclePropertyAccess.READ only.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
+ */
+ DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED =
+ 0x1019 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
+
+ /**
+ * Driver drowsiness and attention level state.
+ *
+ * Returns the current detected state of driver drowiness and attention level based on the
+ * Karolinska Sleepiness scale. If alternative measurement methods are used, the value should be
+ * translated to the Karolinska Sleepiness Scale equivalent.
+ *
+ * Generally, this property should return a valid state defined in the
+ * DriverDrowsinessAttentionState or ErrorState. For example, if the feature is not available
+ * due to some temporary state, that information should be conveyed through ErrorState.
+ *
+ * If the vehicle is sending a warning to the user because the driver is too drowsy, the warning
+ * should be surfaced through {@link #DRIVER_DROWSINESS_ATTENTION_WARNING}.
+ *
+ * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined
+ * unless all states of both DriverDrowsinessAttentionState (including OTHER, which is not
+ * recommended) and ErrorState are supported.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ
+ * @data_enum DriverDrowsinessAttentionState
+ * @data_enum ErrorState
+ */
+ DRIVER_DROWSINESS_ATTENTION_STATE =
+ 0x101A + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
+
+ /**
+ * Enable or disable driver drowsiness and attention warnings.
+ *
+ * Set true to enable driver drowsiness and attention warnings and false to disable driver
+ * drowsiness and attention warnings.
+ *
+ * When driver drowsiness and attention warnings are enabled, the driver drowsiness and
+ * attention monitoring system inside the vehicle should warn the driver when it detects the
+ * driver is drowsy or not attentive.
+ *
+ * In general, DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED should always return true or false.
+ * If the feature is not available due to some temporary state, that information must be
+ * conveyed through the ErrorState values in the DRIVER_DROWSINESS_ATTENTION_WARNING property.
+ *
+ * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to
+ * implement it as VehiclePropertyAccess.READ only.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
+ */
+ DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED =
+ 0x101B + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
+
+ /**
+ * Driver drowsiness and attention warning.
+ *
+ * Returns whether a warning is being sent to the driver for being drowsy or not attentive.
+ *
+ * Generally, this property should return a valid state defined in
+ * DriverDrowsinessAttentionWarning or ErrorState. For example, if the feature is not available
+ * due to some temporary state, that information should be conveyed through an ErrorState.
+ *
+ * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined
+ * unless all states of both DriverDrowsinessAttentionWarning (including OTHER, which is not
+ * recommended) and ErrorState are supported.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ
+ * @data_enum DriverDrowsinessAttentionWarning
+ * @data_enum ErrorState
+ */
+ DRIVER_DROWSINESS_ATTENTION_WARNING =
+ 0x101C + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
+
+ /**
+ * Enable or disable driver distraction monitoring.
+ *
+ * Set true to enable driver distraction monitoring and false to disable driver
+ * distraction monitoring. When driver distraction monitoring is enabled, a system
+ * inside the vehicle should be monitoring the distraction level of the driver and
+ * warn the driver if needed.
+ *
+ * In general, DRIVER_DISTRACTION_SYSTEM_ENABLED should always return true or false. If the
+ * feature is not available due to some temporary state, that information must be conveyed
+ * through the ErrorState values in the DRIVER_DISTRACTION_STATE property.
+ *
+ * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to
+ * implement it as VehiclePropertyAccess.READ only.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
+ */
+ DRIVER_DISTRACTION_SYSTEM_ENABLED =
+ 0x101D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
+
+ /**
+ * Driver distraction state.
+ *
+ * Returns the current detected driver distraction state.
+ *
+ * Generally, this property should return a valid state defined in the DriverDistractionState or
+ * ErrorState. For example, if the feature is not available due to some temporary state, that
+ * information should be conveyed through ErrorState.
+ *
+ * If the vehicle is sending a warning to the user because the driver is too distracted, the
+ * warning should be surfaced through {@link #DRIVER_DISTRACTION_WARNING}.
+ *
+ * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined
+ * unless all states of both DriverDistractionState (including OTHER, which is not
+ * recommended) and ErrorState are supported.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ
+ * @data_enum DriverDistractionState
+ * @data_enum ErrorState
+ */
+ DRIVER_DISTRACTION_STATE =
+ 0x101E + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
+
+ /**
+ * Enable or disable driver distraction warnings.
+ *
+ * Set true to enable driver distraction warnings and false to disable driver distraction
+ * warnings.
+ *
+ * When driver distraction warnings are enabled, the driver distraction monitoring system inside
+ * the vehicle should warn the driver when it detects the driver is distracted.
+ *
+ * In general, DRIVER_DISTRACTION_WARNING_ENABLED should always return true or false. If the
+ * feature is not available due to some temporary state, that information must be conveyed
+ * through the ErrorState values in the DRIVER_DISTRACTION_WARNING property.
+ *
+ * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to
+ * implement it as VehiclePropertyAccess.READ only.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
+ */
+ DRIVER_DISTRACTION_WARNING_ENABLED =
+ 0x101F + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
+
+ /**
+ * Driver distraction warning.
+ *
+ * Returns whether a warning is being sent to the driver for being distracted.
+ *
+ * Generally, this property should return a valid state defined in DriverDistractionWarning or
+ * ErrorState. For example, if the feature is not available due to some temporary state, that
+ * information should be conveyed through an ErrorState.
+ *
+ * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined
+ * unless all states of both DriverDistractionWarning (including OTHER, which is not
+ * recommended) and ErrorState are supported.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ
+ * @data_enum DriverDistractionWarning
+ * @data_enum ErrorState
+ */
+ DRIVER_DISTRACTION_WARNING =
+ 0x1020 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
+
+ /**
+ * Enable or disable Low Speed Collision Warning.
+ *
+ * Set true to enable low speed collision warning and false to disable low speed collision
+ * warning. When low speed collision warning is enabled, the ADAS system in the vehicle should
+ * warn the driver of potential collisions at low speeds. This property is different from the
+ * pre-existing FORWARD_COLLISION_WARNING_ENABLED, which should apply to higher speed
+ * applications only. If the vehicle doesn't have a separate collision detection system for low
+ * speed environments, this property should not be implemented.
+ *
+ * In general, LOW_SPEED_COLLISION_WARNING_ENABLED should always return true or false. If the
+ * feature is not available due to some temporary state, such as the vehicle speed being too
+ * high, that information must be conveyed through the ErrorState values in the
+ * LOW_SPEED_COLLISION_WARNING_STATE property.
+ *
+ * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to
+ * implement it as VehiclePropertyAccess.READ only.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
+ */
+ LOW_SPEED_COLLISION_WARNING_ENABLED =
+ 0x1021 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
+
+ /**
+ * Low Speed Collision Warning state.
+ *
+ * Returns the current state of Low Speed Collision Warning. This property must always return a
+ * valid state defined in LowSpeedCollisionWarningState or ErrorState. It must not surface
+ * errors through StatusCode and must use the supported error states instead. This property is
+ * different from the pre-existing FORWARD_COLLISION_WARNING_STATE, which should apply to higher
+ * speed applications only. If the vehicle doesn't have a separate collision detection system
+ * for low speed environments, this property should not be implemented.
+ *
+ * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined
+ * unless all states of both LowSpeedCollisionWarningState (including OTHER, which is not
+ * recommended) and ErrorState are supported.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ
+ * @data_enum LowSpeedCollisionWarningState
+ * @data_enum ErrorState
+ */
+ LOW_SPEED_COLLISION_WARNING_STATE =
+ 0x1022 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
+
+ /**
+ * Enable or disable Cross Traffic Monitoring.
+ *
+ * Set true to enable Cross Traffic Monitoring and false to disable Cross Traffic Monitoring.
+ * When Cross Traffic Monitoring is enabled, the ADAS system in the vehicle should be turned on
+ * and monitoring for potential sideways collisions.
+ *
+ * In general, CROSS_TRAFFIC_MONITORING_ENABLED should always return true or false. If the
+ * feature is not available due to some temporary state, such as the vehicle speed being too
+ * high, that information must be conveyed through the ErrorState values in the
+ * CROSS_TRAFFIC_MONITORING_STATE property.
+ *
+ * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to
+ * implement it as VehiclePropertyAccess.READ only.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
+ */
+ CROSS_TRAFFIC_MONITORING_ENABLED =
+ 0x1023 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
+
+ /**
+ * Cross Traffic Monitoring warning state.
+ *
+ * Returns the current state of Cross Traffic Monitoring Warning. This property must always
+ * return a valid state defined in CrossTrafficMonitoringWarningState or ErrorState. It must not
+ * surface errors through StatusCode and must use the supported error states instead.
+ *
+ * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined
+ * unless all states of both CrossTrafficMonitoringWarningState (including OTHER, which is not
+ * recommended) and ErrorState are supported.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ
+ * @data_enum CrossTrafficMonitoringWarningState
+ * @data_enum ErrorState
+ */
+ CROSS_TRAFFIC_MONITORING_WARNING_STATE =
+ 0x1024 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
+
/***************************************************************************
* End of ADAS Properties
**************************************************************************/
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
index a2cbdec..a417388 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehiclePropertyGroup.aidl
@@ -29,5 +29,34 @@
*/
VENDOR = 0x20000000,
+ /**
+ * Group reserved for backporting system properties introduced in a newer Android
+ * release to an older Android release.
+ *
+ * It is recommended to map the system property ID to a backported property ID by replacing the
+ * VehiclePropertyGroup, e.g. backported PERF_VEHICLE_SPEED(0x11600207) would be 0x31600207.
+ *
+ * When updated to a newer Android release where the property is defined as system properties,
+ * the backported properties must be migrated to system properties.
+ *
+ * In Android system, the backported property is treated the same as a vendor defined property
+ * with the same vendor permission model, a.k.a. Default required permission is
+ * `android.car.Car.PERMISSION_VENDOR_EXTENSION`, or customized by
+ * `SUPPORT_CUSTOMIZE_VENDOR_PERMISSION` VHAL property.
+ *
+ * Only applications with vendor permissions may access these backported properties.
+ *
+ * Vendors must also make sure this property's behavior is consistent with what is expected for
+ * the backported system property, e.g. the access mode, the change mode and the config array
+ * must be correct.
+ *
+ * When vendors define custom properties, they must use {@code VENDOR} flag, instead of
+ * {@code BACKPORTED}
+ */
+ BACKPORTED = 0x30000000,
+
+ /**
+ * The bit mask for {@code VehiclePropertyGroup}. This is not a group by itself.
+ */
MASK = 0xf0000000,
}
diff --git a/automotive/vehicle/tools/generate_annotation_enums.py b/automotive/vehicle/tools/generate_annotation_enums.py
old mode 100644
new mode 100755
index c36cbb0..05fc99a
--- a/automotive/vehicle/tools/generate_annotation_enums.py
+++ b/automotive/vehicle/tools/generate_annotation_enums.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
# Copyright (C) 2022 The Android Open Source Project
#
@@ -18,37 +18,45 @@
Need ANDROID_BUILD_TOP environmental variable to be set. This script will update
ChangeModeForVehicleProperty.h and AccessForVehicleProperty.h under generated_lib/cpp and
- ChangeModeForVehicleProperty.java and AccessForVehicleProperty.java under generated_lib/java.
+ ChangeModeForVehicleProperty.java, AccessForVehicleProperty.java, EnumForVehicleProperty.java under generated_lib/java.
Usage:
$ python generate_annotation_enums.py
"""
+import argparse
+import filecmp
import os
import re
import sys
+import tempfile
-PROP_AIDL_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl_property/android/hardware/" +
- "automotive/vehicle/VehicleProperty.aidl")
-CHANGE_MODE_CPP_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl/generated_lib/cpp/" +
- "ChangeModeForVehicleProperty.h")
-ACCESS_CPP_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl/generated_lib/cpp/" +
- "AccessForVehicleProperty.h")
-CHANGE_MODE_JAVA_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/" +
- "ChangeModeForVehicleProperty.java")
-ACCESS_JAVA_FILE_PATH = ("hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/" +
- "AccessForVehicleProperty.java")
+PROP_AIDL_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl_property/android/hardware/' +
+ 'automotive/vehicle/VehicleProperty.aidl')
+CHANGE_MODE_CPP_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/cpp/' +
+ 'ChangeModeForVehicleProperty.h')
+ACCESS_CPP_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/cpp/' +
+ 'AccessForVehicleProperty.h')
+CHANGE_MODE_JAVA_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/' +
+ 'ChangeModeForVehicleProperty.java')
+ACCESS_JAVA_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/' +
+ 'AccessForVehicleProperty.java')
+ENUM_JAVA_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/' +
+ 'EnumForVehicleProperty.java')
+SCRIPT_PATH = 'hardware/interfaces/automotive/vehicle/tools/generate_annotation_enums.py'
-TAB = " "
-RE_ENUM_START = re.compile("\s*enum VehicleProperty \{")
-RE_ENUM_END = re.compile("\s*\}\;")
-RE_COMMENT_BEGIN = re.compile("\s*\/\*\*?")
-RE_COMMENT_END = re.compile("\s*\*\/")
-RE_CHANGE_MODE = re.compile("\s*\* @change_mode (\S+)\s*")
-RE_ACCESS = re.compile("\s*\* @access (\S+)\s*")
-RE_VALUE = re.compile("\s*(\w+)\s*=(.*)")
+TAB = ' '
+RE_ENUM_START = re.compile('\s*enum VehicleProperty \{')
+RE_ENUM_END = re.compile('\s*\}\;')
+RE_COMMENT_BEGIN = re.compile('\s*\/\*\*?')
+RE_COMMENT_END = re.compile('\s*\*\/')
+RE_CHANGE_MODE = re.compile('\s*\* @change_mode (\S+)\s*')
+RE_ACCESS = re.compile('\s*\* @access (\S+)\s*')
+RE_DATA_ENUM = re.compile('\s*\* @data_enum (\S+)\s*')
+RE_UNIT = re.compile('\s*\* @unit (\S+)\s+')
+RE_VALUE = re.compile('\s*(\w+)\s*=(.*)')
LICENSE = """/*
- * Copyright (C) 2022 The Android Open Source Project
+ * 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.
@@ -161,57 +169,145 @@
}
"""
+ENUM_JAVA_HEADER = """package android.hardware.automotive.vehicle;
-class Converter:
+import java.util.List;
+import java.util.Map;
- def __init__(self, name, annotation_re):
- self.name = name
- self.annotation_re = annotation_re
+public final class EnumForVehicleProperty {
- def convert(self, input, output, header, footer, cpp):
+ public static final Map<Integer, List<Class<?>>> values = Map.ofEntries(
+"""
+
+ENUM_JAVA_FOOTER = """
+ );
+
+}
+"""
+
+
+class PropertyConfig:
+ """Represents one VHAL property definition in VehicleProperty.aidl."""
+
+ def __init__(self):
+ self.name = None
+ self.description = None
+ self.change_mode = None
+ self.access_modes = []
+ self.enum_types = []
+ self.unit_type = None
+
+ def __repr__(self):
+ return self.__str__()
+
+ def __str__(self):
+ return ('PropertyConfig{{' +
+ 'name: {}, description: {}, change_mode: {}, access_modes: {}, enum_types: {}' +
+ ', unit_type: {}}}').format(self.name, self.description, self.change_mode,
+ self.access_modes, self.enum_types, self.unit_type)
+
+
+class FileParser:
+
+ def __init__(self):
+ self.configs = None
+
+ def parseFile(self, input_file):
+ """Parses the input VehicleProperty.aidl file into a list of property configs."""
processing = False
in_comment = False
- content = LICENSE + header
- annotation = None
- id = 0
- with open(input, 'r') as f:
+ configs = []
+ config = None
+ with open(input_file, 'r') as f:
for line in f.readlines():
if RE_ENUM_START.match(line):
processing = True
- annotation = None
elif RE_ENUM_END.match(line):
processing = False
if not processing:
continue
if RE_COMMENT_BEGIN.match(line):
in_comment = True
+ config = PropertyConfig()
+ description = ''
if RE_COMMENT_END.match(line):
in_comment = False
if in_comment:
- match = self.annotation_re.match(line)
+ if not config.description:
+ sline = line.strip()
+ # Skip the first line of comment
+ if sline.startswith('*'):
+ # Remove the '*'.
+ sline = sline[1:].strip()
+ # We reach an empty line of comment, the description part is ending.
+ if sline == '':
+ config.description = description
+ else:
+ if description != '':
+ description += ' '
+ description += sline
+ match = RE_CHANGE_MODE.match(line)
if match:
- annotation = match.group(1)
+ config.change_mode = match.group(1).replace('VehiclePropertyChangeMode.', '')
+ match = RE_ACCESS.match(line)
+ if match:
+ config.access_modes.append(match.group(1).replace('VehiclePropertyAccess.', ''))
+ match = RE_UNIT.match(line)
+ if match:
+ config.unit_type = match.group(1)
+ match = RE_DATA_ENUM.match(line)
+ if match:
+ config.enum_types.append(match.group(1))
else:
match = RE_VALUE.match(line)
if match:
prop_name = match.group(1)
- if prop_name == "INVALID":
+ if prop_name == 'INVALID':
continue
- if not annotation:
- print("No @" + self.name + " annotation for property: " + prop_name)
- sys.exit(1)
- if id != 0:
- content += "\n"
- if cpp:
- annotation = annotation.replace(".", "::")
- content += (TAB + TAB + "{VehicleProperty::" + prop_name + ", " +
- annotation + "},")
- else:
- content += (TAB + TAB + "Map.entry(VehicleProperty." + prop_name + ", " +
- annotation + "),")
- id += 1
+ if not config.change_mode:
+ raise Exception(
+ 'No change_mode annotation for property: ' + prop_name)
+ if not config.access_modes:
+ raise Exception(
+ 'No access_mode annotation for property: ' + prop_name)
+ config.name = prop_name
+ configs.append(config)
- # Remove the additional "," at the end for the Java file.
+ self.configs = configs
+
+ def convert(self, output, header, footer, cpp, field):
+ """Converts the property config file to C++/Java output file."""
+ counter = 0
+ content = LICENSE + header
+ for config in self.configs:
+ if field == 'change_mode':
+ if cpp:
+ annotation = "VehiclePropertyChangeMode::" + config.change_mode
+ else:
+ annotation = "VehiclePropertyChangeMode." + config.change_mode
+ elif field == 'access_mode':
+ if cpp:
+ annotation = "VehiclePropertyAccess::" + config.access_modes[0]
+ else:
+ annotation = "VehiclePropertyAccess." + config.access_modes[0]
+ elif field == 'enum_types':
+ if len(config.enum_types) < 1:
+ continue;
+ if not cpp:
+ annotation = "List.of(" + ', '.join([class_name + ".class" for class_name in config.enum_types]) + ")"
+ else:
+ raise Exception('Unknown field: ' + field)
+ if counter != 0:
+ content += '\n'
+ if cpp:
+ content += (TAB + TAB + '{VehicleProperty::' + config.name + ', ' +
+ annotation + '},')
+ else:
+ content += (TAB + TAB + 'Map.entry(VehicleProperty.' + config.name + ', ' +
+ annotation + '),')
+ counter += 1
+
+ # Remove the additional ',' at the end for the Java file.
if not cpp:
content = content[:-1]
@@ -220,26 +316,125 @@
with open(output, 'w') as f:
f.write(content)
+ def outputAsCsv(self, output):
+ content = 'name,description,change mode,access mode,enum type,unit type\n'
+ for config in self.configs:
+ enum_types = None
+ if not config.enum_types:
+ enum_types = '/'
+ else:
+ enum_types = '/'.join(config.enum_types)
+ unit_type = config.unit_type
+ if not unit_type:
+ unit_type = '/'
+ access_modes = ''
+ content += '"{}","{}","{}","{}","{}","{}"\n'.format(
+ config.name,
+ # Need to escape quote as double quote.
+ config.description.replace('"', '""'),
+ config.change_mode,
+ '/'.join(config.access_modes),
+ enum_types,
+ unit_type)
+
+ with open(output, 'w+') as f:
+ f.write(content)
+
+
+def createTempFile():
+ f = tempfile.NamedTemporaryFile(delete=False);
+ f.close();
+ return f.name
+
def main():
- android_top = os.environ['ANDROID_BUILD_TOP']
+ parser = argparse.ArgumentParser(
+ description='Generate Java and C++ enums based on annotations in VehicleProperty.aidl')
+ parser.add_argument('--android_build_top', required=False, help='Path to ANDROID_BUILD_TOP')
+ parser.add_argument('--preupload_files', nargs='*', required=False, help='modified files')
+ parser.add_argument('--check_only', required=False, action='store_true',
+ help='only check whether the generated files need update')
+ parser.add_argument('--output_csv', required=False,
+ help='Path to the parsing result in CSV style, useful for doc generation')
+ args = parser.parse_args();
+ android_top = None
+ output_folder = None
+ if args.android_build_top:
+ android_top = args.android_build_top
+ vehiclePropertyUpdated = False
+ for preuload_file in args.preupload_files:
+ if preuload_file.endswith('VehicleProperty.aidl'):
+ vehiclePropertyUpdated = True
+ break
+ if not vehiclePropertyUpdated:
+ return
+ else:
+ android_top = os.environ['ANDROID_BUILD_TOP']
if not android_top:
- print("ANDROID_BUILD_TOP is not in envorinmental variable, please run source and lunch " +
- "at the android root")
+ print('ANDROID_BUILD_TOP is not in environmental variable, please run source and lunch ' +
+ 'at the android root')
aidl_file = os.path.join(android_top, PROP_AIDL_FILE_PATH)
- change_mode_cpp_output = os.path.join(android_top, CHANGE_MODE_CPP_FILE_PATH);
- access_cpp_output = os.path.join(android_top, ACCESS_CPP_FILE_PATH);
- change_mode_java_output = os.path.join(android_top, CHANGE_MODE_JAVA_FILE_PATH);
- access_java_output = os.path.join(android_top, ACCESS_JAVA_FILE_PATH);
+ f = FileParser();
+ f.parseFile(aidl_file)
- c = Converter("change_mode", RE_CHANGE_MODE);
- c.convert(aidl_file, change_mode_cpp_output, CHANGE_MODE_CPP_HEADER, CHANGE_MODE_CPP_FOOTER, True)
- c.convert(aidl_file, change_mode_java_output, CHANGE_MODE_JAVA_HEADER, CHANGE_MODE_JAVA_FOOTER, False)
- c = Converter("access", RE_ACCESS)
- c.convert(aidl_file, access_cpp_output, ACCESS_CPP_HEADER, ACCESS_CPP_FOOTER, True)
- c.convert(aidl_file, access_java_output, ACCESS_JAVA_HEADER, ACCESS_JAVA_FOOTER, False)
+ if args.output_csv:
+ f.outputAsCsv(args.output_csv)
+ return
+
+ change_mode_cpp_file = os.path.join(android_top, CHANGE_MODE_CPP_FILE_PATH);
+ access_cpp_file = os.path.join(android_top, ACCESS_CPP_FILE_PATH);
+ change_mode_java_file = os.path.join(android_top, CHANGE_MODE_JAVA_FILE_PATH);
+ access_java_file = os.path.join(android_top, ACCESS_JAVA_FILE_PATH);
+ enum_java_file = os.path.join(android_top, ENUM_JAVA_FILE_PATH);
+ temp_files = []
+
+ if not args.check_only:
+ change_mode_cpp_output = change_mode_cpp_file
+ access_cpp_output = access_cpp_file
+ change_mode_java_output = change_mode_java_file
+ access_java_output = access_java_file
+ enum_java_output = enum_java_file
+ else:
+ change_mode_cpp_output = createTempFile()
+ temp_files.append(change_mode_cpp_output)
+ access_cpp_output = createTempFile()
+ temp_files.append(access_cpp_output)
+ change_mode_java_output = createTempFile()
+ temp_files.append(change_mode_java_output)
+ access_java_output = createTempFile()
+ temp_files.append(access_java_output)
+ enum_java_output = createTempFile()
+ temp_files.append(enum_java_output)
+
+ try:
+ f.convert(change_mode_cpp_output, CHANGE_MODE_CPP_HEADER, CHANGE_MODE_CPP_FOOTER,
+ True, 'change_mode')
+ f.convert(change_mode_java_output, CHANGE_MODE_JAVA_HEADER,
+ CHANGE_MODE_JAVA_FOOTER, False, 'change_mode')
+ f.convert(access_cpp_output, ACCESS_CPP_HEADER, ACCESS_CPP_FOOTER, True, 'access_mode')
+ f.convert(access_java_output, ACCESS_JAVA_HEADER, ACCESS_JAVA_FOOTER, False, 'access_mode')
+ f.convert(enum_java_output, ENUM_JAVA_HEADER, ENUM_JAVA_FOOTER, False, 'enum_types')
+
+ if not args.check_only:
+ return
+
+ if ((not filecmp.cmp(change_mode_cpp_output, change_mode_cpp_file)) or
+ (not filecmp.cmp(change_mode_java_output, change_mode_java_file)) or
+ (not filecmp.cmp(access_cpp_output, access_cpp_file)) or
+ (not filecmp.cmp(access_java_output, access_java_file)) or
+ (not filecmp.cmp(enum_java_output, enum_java_file))):
+ print('The generated enum files for VehicleProperty.aidl requires update, ')
+ print('Run \npython ' + android_top + '/' + SCRIPT_PATH)
+ sys.exit(1)
+ except Exception as e:
+ print('Error parsing VehicleProperty.aidl')
+ print(e)
+ sys.exit(1)
+ finally:
+ for file in temp_files:
+ os.remove(file)
-if __name__ == "__main__":
+if __name__ == '__main__':
main()
\ No newline at end of file
diff --git a/automotive/vehicle/tools/generate_emu_metadata/Android.bp b/automotive/vehicle/tools/generate_emu_metadata/Android.bp
new file mode 100644
index 0000000..4cb6d3b
--- /dev/null
+++ b/automotive/vehicle/tools/generate_emu_metadata/Android.bp
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2024 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 {
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+java_binary_host {
+ name: "EnumMetadataGenerator",
+ srcs: ["src/**/*.java"],
+ manifest: "manifest.txt",
+ static_libs: [
+ "javaparser",
+ "javaparser-symbol-solver",
+ "json-prebuilt",
+ "androidx.annotation_annotation",
+ ],
+}
+
+// A rule to convert VHAL property AIDL files to java files.
+gensrcs {
+ name: "gen_vehicle_property_java_file",
+ srcs: [
+ ":android.hardware.automotive.vehicle.property-files",
+ ],
+ tools: ["aidl"],
+ cmd: "$(location aidl) --lang=java --structured --stability=vintf $(in) -I hardware/interfaces/automotive/vehicle/aidl_property --out $(genDir)/hardware/interfaces/automotive/vehicle/aidl_property",
+ output_extension: "java",
+}
+
+// A target to check whether android.hardware.automotive.vehicle-types-meta.json
+// needs to be updated. The output is just an empty cpp file to be included
+// in the higher-level build target.
+// It will generate generated.json at output directory based on VHAL property
+// java files and check it against
+// android.hardware.automotive.vehicle-types-meta.json. If not the same, the
+// build will fail.
+genrule {
+ name: "check_generated_enum_metadata_json",
+ tools: ["EnumMetadataGenerator"],
+ srcs: [
+ ":android.hardware.automotive.vehicle-types-meta",
+ ":gen_vehicle_property_java_file",
+ ],
+ cmd: "$(location EnumMetadataGenerator) --check_against $(location :android.hardware.automotive.vehicle-types-meta) --output_empty_file $(out) --output_json $(genDir)/generate_enum_metadata.json --input_files $(locations :gen_vehicle_property_java_file)",
+ out: ["generate_enum_metadata_checked.cpp"],
+}
diff --git a/automotive/vehicle/tools/generate_emu_metadata/manifest.txt b/automotive/vehicle/tools/generate_emu_metadata/manifest.txt
new file mode 100644
index 0000000..07696da
--- /dev/null
+++ b/automotive/vehicle/tools/generate_emu_metadata/manifest.txt
@@ -0,0 +1 @@
+Main-Class: com.android.car.tool.EmuMetadataGenerator
diff --git a/automotive/vehicle/tools/generate_emu_metadata/src/com/android/car/tool/EmuMetadataGenerator.java b/automotive/vehicle/tools/generate_emu_metadata/src/com/android/car/tool/EmuMetadataGenerator.java
new file mode 100644
index 0000000..8e12f67
--- /dev/null
+++ b/automotive/vehicle/tools/generate_emu_metadata/src/com/android/car/tool/EmuMetadataGenerator.java
@@ -0,0 +1,403 @@
+/*
+ * Copyright (C) 2024 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.car.tool;
+
+import com.github.javaparser.StaticJavaParser;
+import com.github.javaparser.ast.CompilationUnit;
+import com.github.javaparser.ast.body.AnnotationDeclaration;
+import com.github.javaparser.ast.body.FieldDeclaration;
+import com.github.javaparser.ast.body.VariableDeclarator;
+import com.github.javaparser.ast.comments.Comment;
+import com.github.javaparser.ast.expr.AnnotationExpr;
+import com.github.javaparser.ast.expr.ArrayInitializerExpr;
+import com.github.javaparser.ast.expr.Expression;
+import com.github.javaparser.ast.expr.NormalAnnotationExpr;
+import com.github.javaparser.ast.expr.SingleMemberAnnotationExpr;
+import com.github.javaparser.ast.expr.UnaryExpr;
+import com.github.javaparser.ast.type.ClassOrInterfaceType;
+import com.github.javaparser.javadoc.Javadoc;
+import com.github.javaparser.javadoc.JavadocBlockTag;
+import com.github.javaparser.javadoc.description.JavadocDescription;
+import com.github.javaparser.javadoc.description.JavadocDescriptionElement;
+import com.github.javaparser.javadoc.description.JavadocInlineTag;
+import com.github.javaparser.resolution.declarations.ResolvedFieldDeclaration;
+import com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration;
+import com.github.javaparser.symbolsolver.JavaSymbolSolver;
+import com.github.javaparser.symbolsolver.javaparsermodel.declarations.JavaParserFieldDeclaration;
+import com.github.javaparser.symbolsolver.model.resolution.TypeSolver;
+import com.github.javaparser.symbolsolver.resolution.typesolvers.CombinedTypeSolver;
+import com.github.javaparser.symbolsolver.resolution.typesolvers.JavaParserTypeSolver;
+import com.github.javaparser.symbolsolver.resolution.typesolvers.ReflectionTypeSolver;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Optional;
+import java.util.Set;
+import org.json.JSONArray;
+import org.json.JSONObject;
+
+public final class EmuMetadataGenerator {
+ private static final String DEFAULT_PACKAGE_NAME = "android.hardware.automotive.vehicle";
+ private static final String INPUT_DIR_OPTION = "--input_dir";
+ private static final String INPUT_FILES_OPTION = "--input_files";
+ private static final String PACKAGE_NAME_OPTION = "--package_name";
+ private static final String OUTPUT_JSON_OPTION = "--output_json";
+ private static final String OUTPUT_EMPTY_FILE_OPTION = "--output_empty_file";
+ private static final String CHECK_AGAINST_OPTION = "--check_against";
+ private static final String USAGE = "EnumMetadataGenerator " + INPUT_DIR_OPTION
+ + " [path_to_aidl_gen_dir] " + INPUT_FILES_OPTION + " [input_files] "
+ + PACKAGE_NAME_OPTION + " [package_name] " + OUTPUT_JSON_OPTION + " [output_json] "
+ + OUTPUT_EMPTY_FILE_OPTION + " [output_header_file] " + CHECK_AGAINST_OPTION
+ + " [json_file_to_check_against]\n"
+ + "Parses the VHAL property AIDL interface generated Java files to a json file to be"
+ + " used by emulator\n"
+ + "Options: \n" + INPUT_DIR_OPTION
+ + ": the path to a directory containing AIDL interface Java files, "
+ + "either this or input_files must be specified\n" + INPUT_FILES_OPTION
+ + ": one or more Java files, this is used to decide the input "
+ + "directory\n" + PACKAGE_NAME_OPTION
+ + ": the optional package name for the interface, by default is " + DEFAULT_PACKAGE_NAME
+ + "\n" + OUTPUT_JSON_OPTION + ": The output JSON file\n" + OUTPUT_EMPTY_FILE_OPTION
+ + ": Only used for check_mode, this file will be created if "
+ + "check passed\n" + CHECK_AGAINST_OPTION
+ + ": An optional JSON file to check against. If specified, the "
+ + "generated output file will be checked against this file, if they are not the same, "
+ + "the script will fail, otherwise, the output_empty_file will be created\n"
+ + "For example: \n"
+ + "EnumMetadataGenerator --input_dir out/soong/.intermediates/hardware/"
+ + "interfaces/automotive/vehicle/aidl_property/android.hardware.automotive.vehicle."
+ + "property-V3-java-source/gen/ --package_name android.hardware.automotive.vehicle "
+ + "--output_json /tmp/android.hardware.automotive.vehicle-types-meta.json";
+ private static final String VEHICLE_PROPERTY_FILE = "VehicleProperty.java";
+ private static final String CHECK_FILE_PATH =
+ "${ANDROID_BUILD_TOP}/hardware/interfaces/automotive/vehicle/aidl/emu_metadata/"
+ + "android.hardware.automotive.vehicle-types-meta.json";
+
+ // Emulator can display at least this many characters before cutting characters.
+ private static final int MAX_PROPERTY_NAME_LENGTH = 30;
+
+ /**
+ * Parses the enum field declaration as an int value.
+ */
+ private static int parseIntEnumField(FieldDeclaration fieldDecl) {
+ VariableDeclarator valueDecl = fieldDecl.getVariables().get(0);
+ Expression expr = valueDecl.getInitializer().get();
+ if (expr.isIntegerLiteralExpr()) {
+ return expr.asIntegerLiteralExpr().asInt();
+ }
+ // For case like -123
+ if (expr.isUnaryExpr() && expr.asUnaryExpr().getOperator() == UnaryExpr.Operator.MINUS) {
+ return -expr.asUnaryExpr().getExpression().asIntegerLiteralExpr().asInt();
+ }
+ System.out.println("Unsupported expression: " + expr);
+ System.exit(1);
+ return 0;
+ }
+
+ private static boolean isPublicAndStatic(FieldDeclaration fieldDecl) {
+ return fieldDecl.isPublic() && fieldDecl.isStatic();
+ }
+
+ private static String getFieldName(FieldDeclaration fieldDecl) {
+ VariableDeclarator valueDecl = fieldDecl.getVariables().get(0);
+ return valueDecl.getName().asString();
+ }
+
+ private static class Enum {
+ Enum(String name, String packageName) {
+ this.name = name;
+ this.packageName = packageName;
+ }
+
+ public String name;
+ public String packageName;
+ public final List<ValueField> valueFields = new ArrayList<>();
+ }
+
+ private static class ValueField {
+ public String name;
+ public Integer value;
+ public final List<String> dataEnums = new ArrayList<>();
+
+ ValueField(String name, Integer value) {
+ this.name = name;
+ this.value = value;
+ }
+ }
+
+ private static Enum parseEnumInterface(
+ String inputDir, String dirName, String packageName, String enumName) throws Exception {
+ Enum enumIntf = new Enum(enumName, packageName);
+ CompilationUnit cu = StaticJavaParser.parse(new File(
+ inputDir + File.separator + dirName + File.separator + enumName + ".java"));
+ AnnotationDeclaration vehiclePropertyIdsClass =
+ cu.getAnnotationDeclarationByName(enumName).get();
+
+ List<FieldDeclaration> variables = vehiclePropertyIdsClass.findAll(FieldDeclaration.class);
+ for (int i = 0; i < variables.size(); i++) {
+ FieldDeclaration propertyDef = variables.get(i).asFieldDeclaration();
+ if (!isPublicAndStatic(propertyDef)) {
+ continue;
+ }
+ ValueField field =
+ new ValueField(getFieldName(propertyDef), parseIntEnumField(propertyDef));
+ enumIntf.valueFields.add(field);
+ }
+ return enumIntf;
+ }
+
+ // A hacky way to make the key in-order in the JSON object.
+ private static final class OrderedJSONObject extends JSONObject {
+ OrderedJSONObject() {
+ try {
+ Field map = JSONObject.class.getDeclaredField("nameValuePairs");
+ map.setAccessible(true);
+ map.set(this, new LinkedHashMap<>());
+ map.setAccessible(false);
+ } catch (IllegalAccessException | NoSuchFieldException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ }
+
+ private static String readFileContent(String fileName) throws Exception {
+ StringBuffer contentBuffer = new StringBuffer();
+ int bufferSize = 1024;
+ try (BufferedReader reader = new BufferedReader(new FileReader(fileName))) {
+ char buffer[] = new char[bufferSize];
+ while (true) {
+ int read = reader.read(buffer, 0, bufferSize);
+ if (read == -1) {
+ break;
+ }
+ contentBuffer.append(buffer, 0, read);
+ }
+ }
+ return contentBuffer.toString();
+ }
+
+ private static final class Args {
+ public final String inputDir;
+ public final String pkgName;
+ public final String pkgDir;
+ public final String output;
+ public final String checkFile;
+ public final String outputEmptyFile;
+
+ public Args(String[] args) throws IllegalArgumentException {
+ Map<String, List<String>> valuesByKey = new LinkedHashMap<>();
+ String key = null;
+ for (int i = 0; i < args.length; i++) {
+ String arg = args[i];
+ if (arg.startsWith("--")) {
+ key = arg;
+ continue;
+ }
+ if (key == null) {
+ throw new IllegalArgumentException("Missing key for value: " + arg);
+ }
+ if (valuesByKey.get(key) == null) {
+ valuesByKey.put(key, new ArrayList<>());
+ }
+ valuesByKey.get(key).add(arg);
+ }
+ String pkgName;
+ List<String> values = valuesByKey.get(PACKAGE_NAME_OPTION);
+ if (values == null) {
+ pkgName = DEFAULT_PACKAGE_NAME;
+ } else {
+ pkgName = values.get(0);
+ }
+ String pkgDir = pkgName.replace(".", File.separator);
+ this.pkgName = pkgName;
+ this.pkgDir = pkgDir;
+ String inputDir;
+ values = valuesByKey.get(INPUT_DIR_OPTION);
+ if (values == null) {
+ List<String> inputFiles = valuesByKey.get(INPUT_FILES_OPTION);
+ if (inputFiles == null) {
+ throw new IllegalArgumentException("Either " + INPUT_DIR_OPTION + " or "
+ + INPUT_FILES_OPTION + " must be specified");
+ }
+ inputDir = new File(inputFiles.get(0)).getParent().replace(pkgDir, "");
+ } else {
+ inputDir = values.get(0);
+ }
+ this.inputDir = inputDir;
+ values = valuesByKey.get(OUTPUT_JSON_OPTION);
+ if (values == null) {
+ throw new IllegalArgumentException(OUTPUT_JSON_OPTION + " must be specified");
+ }
+ this.output = values.get(0);
+ values = valuesByKey.get(CHECK_AGAINST_OPTION);
+ if (values != null) {
+ this.checkFile = values.get(0);
+ } else {
+ this.checkFile = null;
+ }
+ values = valuesByKey.get(OUTPUT_EMPTY_FILE_OPTION);
+ if (values != null) {
+ this.outputEmptyFile = values.get(0);
+ } else {
+ this.outputEmptyFile = null;
+ }
+ }
+ }
+
+ /**
+ * Main function.
+ */
+ public static void main(final String[] args) throws Exception {
+ Args parsedArgs;
+ try {
+ parsedArgs = new Args(args);
+ } catch (IllegalArgumentException e) {
+ System.out.println("Invalid arguments: " + e.getMessage());
+ System.out.println(USAGE);
+ System.exit(1);
+ // Never reach here.
+ return;
+ }
+
+ TypeSolver typeSolver = new CombinedTypeSolver(
+ new ReflectionTypeSolver(), new JavaParserTypeSolver(parsedArgs.inputDir));
+ StaticJavaParser.getConfiguration().setSymbolResolver(new JavaSymbolSolver(typeSolver));
+
+ Enum vehicleProperty = new Enum("VehicleProperty", parsedArgs.pkgName);
+ CompilationUnit cu = StaticJavaParser.parse(new File(parsedArgs.inputDir + File.separator
+ + parsedArgs.pkgDir + File.separator + VEHICLE_PROPERTY_FILE));
+ AnnotationDeclaration vehiclePropertyIdsClass =
+ cu.getAnnotationDeclarationByName("VehicleProperty").get();
+
+ Set<String> dataEnumTypes = new HashSet<>();
+ List<FieldDeclaration> variables = vehiclePropertyIdsClass.findAll(FieldDeclaration.class);
+ for (int i = 0; i < variables.size(); i++) {
+ FieldDeclaration propertyDef = variables.get(i).asFieldDeclaration();
+ if (!isPublicAndStatic(propertyDef)) {
+ continue;
+ }
+ String propertyName = getFieldName(propertyDef);
+ if (propertyName.equals("INVALID")) {
+ continue;
+ }
+
+ Optional<Comment> maybeComment = propertyDef.getComment();
+ if (!maybeComment.isPresent()) {
+ System.out.println("missing comment for property: " + propertyName);
+ System.exit(1);
+ }
+ Javadoc doc = maybeComment.get().asJavadocComment().parse();
+
+ int propertyId = parseIntEnumField(propertyDef);
+ // We use the first paragraph as the property's name
+ String propertyDescription = doc.getDescription().toText().split("\n\n")[0];
+ String name = propertyDescription;
+ if (propertyDescription.indexOf("\n") != -1
+ || propertyDescription.length() > MAX_PROPERTY_NAME_LENGTH) {
+ // The description is too long, we just use the property name.
+ name = propertyName;
+ }
+ ValueField field = new ValueField(name, propertyId);
+
+ List<JavadocBlockTag> blockTags = doc.getBlockTags();
+ List<Integer> dataEnums = new ArrayList<>();
+ for (int j = 0; j < blockTags.size(); j++) {
+ String commentTagName = blockTags.get(j).getTagName();
+ String commentTagContent = blockTags.get(j).getContent().toText();
+ if (!commentTagName.equals("data_enum")) {
+ continue;
+ }
+ field.dataEnums.add(commentTagContent);
+ dataEnumTypes.add(commentTagContent);
+ }
+
+ vehicleProperty.valueFields.add(field);
+ }
+
+ List<Enum> enumTypes = new ArrayList<>();
+ enumTypes.add(vehicleProperty);
+
+ for (String dataEnumType : dataEnumTypes) {
+ Enum dataEnum = parseEnumInterface(
+ parsedArgs.inputDir, parsedArgs.pkgDir, parsedArgs.pkgName, dataEnumType);
+ enumTypes.add(dataEnum);
+ }
+
+ // Output enumTypes as JSON to output.
+ JSONArray jsonEnums = new JSONArray();
+ for (int i = 0; i < enumTypes.size(); i++) {
+ Enum enumType = enumTypes.get(i);
+
+ JSONObject jsonEnum = new OrderedJSONObject();
+ jsonEnum.put("name", enumType.name);
+ jsonEnum.put("package", enumType.packageName);
+ JSONArray values = new JSONArray();
+ jsonEnum.put("values", values);
+
+ for (int j = 0; j < enumType.valueFields.size(); j++) {
+ ValueField valueField = enumType.valueFields.get(j);
+ JSONObject jsonValueField = new OrderedJSONObject();
+ jsonValueField.put("name", valueField.name);
+ jsonValueField.put("value", valueField.value);
+ if (!valueField.dataEnums.isEmpty()) {
+ JSONArray jsonDataEnums = new JSONArray();
+ for (String dataEnum : valueField.dataEnums) {
+ jsonDataEnums.put(dataEnum);
+ }
+ jsonValueField.put("data_enums", jsonDataEnums);
+ // To be backward compatible with older format where data_enum is a single
+ // entry.
+ jsonValueField.put("data_enum", valueField.dataEnums.get(0));
+ }
+ values.put(jsonValueField);
+ }
+
+ jsonEnums.put(jsonEnum);
+ }
+
+ try (FileOutputStream outputStream = new FileOutputStream(parsedArgs.output)) {
+ outputStream.write(jsonEnums.toString(4).getBytes());
+ }
+ System.out.println("Input at folder: " + parsedArgs.inputDir
+ + " successfully parsed. Output at: " + parsedArgs.output);
+
+ if (parsedArgs.checkFile != null) {
+ String checkFileContent = readFileContent(parsedArgs.checkFile);
+ String generatedFileContent = readFileContent(parsedArgs.output);
+ String generatedFilePath = new File(parsedArgs.output).getAbsolutePath();
+ if (!checkFileContent.equals(generatedFileContent)) {
+ System.out.println("The file: " + CHECK_FILE_PATH + " needs to be updated, run: "
+ + "\n\ncp " + generatedFilePath + " " + CHECK_FILE_PATH + "\n");
+ System.exit(1);
+ }
+
+ if (parsedArgs.outputEmptyFile != null) {
+ try (FileOutputStream outputStream =
+ new FileOutputStream(parsedArgs.outputEmptyFile)) {
+ // Do nothing, just create the file.
+ }
+ }
+ }
+ }
+}
diff --git a/automotive/vehicle/tools/translate_aidl_enums.py b/automotive/vehicle/tools/translate_aidl_enums.py
new file mode 100644
index 0000000..d224f6f
--- /dev/null
+++ b/automotive/vehicle/tools/translate_aidl_enums.py
@@ -0,0 +1,231 @@
+#!/usr/bin/python3
+
+# 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.
+#
+"""A script to generate ENUM_NAME.java file and test files using ENUM_NAME.aidl file.
+
+ Need ANDROID_BUILD_TOP environmental variable to be set. This script will update ENUM_NAME.java
+ under packages/services/Car/car-lib/src/android/car/hardware/property, as well as the
+ ENUM_NAMETest.java files in cts/tests/tests/car/src/android/car/cts and
+ packages/services/Car/tests/android_car_api_test/src/android/car/apitest
+
+ Usage:
+ $ python translate_aidl_enums.py ENUM_NAME.aidl
+"""
+import os
+import sys
+
+LICENSE = """/*
+ * 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.
+ */
+"""
+
+class EnumParser:
+ def __init__(self, file_path, file_name):
+ self.filePath = file_path
+ self.fileName = file_name
+ self.lowerFileName = self.fileName[0].lower() + self.fileName[1:]
+ self.enums = []
+ self.outputMsg = []
+ self.outputMsg.append(LICENSE)
+ self.outputMsg.append("\npackage android.car.hardware.property;\n")
+ self.outputMsg.append("""
+import android.annotation.IntDef;
+import android.annotation.NonNull;
+
+import com.android.car.internal.util.ConstantDebugUtils;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+""")
+
+ with open(self.filePath, 'r') as f:
+ for line in f.readlines()[16:]:
+ if line in ["package android.hardware.automotive.vehicle;\n",
+ "@VintfStability\n",
+ '@Backing(type="int")\n']:
+ continue
+
+ msg = line
+ msgSplit = msg.strip().split()
+ if len(msgSplit) > 0 and msgSplit[0] == "enum":
+ msgSplit[0] = "public final class"
+ msg = " ".join(msgSplit) + "\n"
+ elif len(msgSplit) > 1 and msgSplit[1] == '=':
+ msgSplit.insert(0, " public static final int")
+ self.enums.append(msgSplit[1])
+ msgSplit[-1] = msgSplit[-1][:-1] + ";\n"
+ msg = " ".join(msgSplit)
+ elif msg == "}\n":
+ self.outputMsg.append("""
+ private {2}() {{}}
+
+ /**
+ * Returns a user-friendly representation of {{@code {2}}}.
+ */
+ @NonNull
+ public static String toString(@{2}Int int {0}) {{
+ String {0}String = ConstantDebugUtils.toName(
+ {2}.class, {0});
+ return ({0}String != null)
+ ? {0}String
+ : "0x" + Integer.toHexString({0});
+ }}
+
+ /** @hide */
+ @IntDef({1})
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface {2}Int {{}}\n""".format(self.lowerFileName, "{" + ", ".join(self.enums) + "}",
+ self.fileName))
+ self.outputMsg.append(msg)
+ self.outputMsg.append("TODO: delete this line and manually update this file with app-facing documentation and necessary tags.\n")
+
+ self.outputMsgApiTest = []
+ self.outputMsgApiTest.append(LICENSE)
+ self.outputMsgApiTest.append("""package android.car.apitest;
+
+import static com.google.common.truth.Truth.assertWithMessage;
+
+import android.test.suitebuilder.annotation.SmallTest;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+
+import java.util.Arrays;
+import java.util.Collection;
+
+@SmallTest
+@RunWith(Parameterized.class)
+public class {0}Test {{
+ private final int mJavaConstantValue;
+ private final int mHalConstantValue;
+
+ public {0}Test(int javaConstantValue, int halConstantValue) {{
+ mJavaConstantValue = javaConstantValue;
+ mHalConstantValue = halConstantValue;
+ }}
+
+ @Parameterized.Parameters
+ public static Collection constantValues() {{
+ return Arrays.asList(
+ new Object[][] {{""".format(self.fileName))
+ for enum in self.enums:
+ self.outputMsgApiTest.append("""
+ {{
+ android.car.hardware.property.{0}.{1},
+ android.hardware.automotive.vehicle.{0}.{1}
+ }},""".format(self.fileName, enum))
+ self.outputMsgApiTest.append("""
+ });
+ }
+
+ @Test
+ public void testMatchWithVehicleHal() {
+ assertWithMessage("Java constant")
+ .that(mJavaConstantValue)
+ .isEqualTo(mHalConstantValue);
+ }
+}
+""")
+
+ self.outputMsgCtsTest = []
+ self.outputMsgCtsTest.append(LICENSE)
+ self.outputMsgCtsTest.append("""
+package android.car.cts;
+
+import static com.google.common.truth.Truth.assertThat;
+import static com.google.common.truth.Truth.assertWithMessage;
+
+import android.car.cts.utils.VehiclePropertyUtils;
+import android.car.hardware.property.{0};
+
+import org.junit.Test;
+
+import java.util.List;
+
+public class {0}Test {{
+
+ @Test
+ public void testToString() {{""".format(self.fileName))
+ for enum in self.enums:
+ self.outputMsgCtsTest.append("""
+ assertThat({0}.toString(
+ {0}.{1}))
+ .isEqualTo("{1}");""".format(self.fileName, enum))
+ self.outputMsgCtsTest.append("""
+ assertThat({0}.toString({1})).isEqualTo("{2}");
+ assertThat({0}.toString(12)).isEqualTo("0xc");
+ }}
+
+ @Test
+ public void testAll{0}sAreMappedInToString() {{
+ List<Integer> {3}s =
+ VehiclePropertyUtils.getIntegersFromDataEnums({0}.class);
+ for (Integer {3} : {3}s) {{
+ String {3}String = {0}.toString(
+ {3});
+ assertWithMessage("%s starts with 0x", {3}String).that(
+ {3}String.startsWith("0x")).isFalse();
+ }}
+ }}
+}}
+""".format(self.fileName, len(self.enums), hex(len(self.enums)), self.lowerFileName))
+
+def main():
+ if len(sys.argv) != 2:
+ print("Usage: {} enum_aidl_file".format(sys.argv[0]))
+ sys.exit(1)
+ print("WARNING: This file only generates the base enum values in the framework layer. The "
+ + "generated files must be reviewed by you and edited if any additional changes are "
+ + "required. The java enum file should be updated with app-developer facing "
+ + "documentation, the @FlaggedApi tag for the new API, and with the @SystemApi tag if "
+ + "the new property is system API")
+ file_path = sys.argv[1]
+ file_name = file_path.split('/')[-1][:-5]
+ parser = EnumParser(file_path, file_name)
+
+ android_top = os.environ['ANDROID_BUILD_TOP']
+ if not android_top:
+ print('ANDROID_BUILD_TOP is not in environmental variable, please run source and lunch '
+ + 'at the android root')
+
+ with open(android_top + "/packages/services/Car/car-lib/src/android/car/hardware/property/"
+ + file_name + ".java", 'w') as f:
+ f.write("".join(parser.outputMsg))
+
+ with open(android_top
+ + "/packages/services/Car/tests/android_car_api_test/src/android/car/apitest/"
+ + file_name + "Test.java", 'w') as f:
+ f.write("".join(parser.outputMsgApiTest))
+
+ with open(android_top + "/cts/tests/tests/car/src/android/car/cts/" + file_name + "Test.java",
+ 'w') as f:
+ f.write("".join(parser.outputMsgCtsTest))
+
+if __name__ == "__main__":
+ main()
\ No newline at end of file
diff --git a/automotive/vehicle/vhal_static_cpp_lib.mk b/automotive/vehicle/vhal_static_cpp_lib.mk
index 995589c..6b3d486 100644
--- a/automotive/vehicle/vhal_static_cpp_lib.mk
+++ b/automotive/vehicle/vhal_static_cpp_lib.mk
@@ -16,5 +16,5 @@
# interface and VHAL properties.
LOCAL_STATIC_LIBRARIES += \
- android.hardware.automotive.vehicle-V2-ndk \
- android.hardware.automotive.vehicle.property-V2-ndk
+ android.hardware.automotive.vehicle-V3-ndk \
+ android.hardware.automotive.vehicle.property-V3-ndk
diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
index e40ac90..65cea26 100644
--- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
+++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
@@ -176,9 +176,8 @@
ASSERT_TRUE(result.ok()) << "Failed to get all property configs, error: "
<< result.error().message();
- ASSERT_GE(result.value().size(), 1u)
- << StringPrintf("Expect to get at least 1 property config, got %zu",
- result.value().size());
+ ASSERT_GE(result.value().size(), 1u) << StringPrintf(
+ "Expect to get at least 1 property config, got %zu", result.value().size());
}
// Test getPropConfigs() can query properties returned by getAllPropConfigs.
@@ -198,9 +197,8 @@
ASSERT_TRUE(result.ok()) << "Failed to get required property config, error: "
<< result.error().message();
- ASSERT_EQ(result.value().size(), properties.size())
- << StringPrintf("Expect to get exactly %zu configs, got %zu",
- properties.size(), result.value().size());
+ ASSERT_EQ(result.value().size(), properties.size()) << StringPrintf(
+ "Expect to get exactly %zu configs, got %zu", properties.size(), result.value().size());
}
// Test getPropConfig() with an invalid propertyId returns an error code.
@@ -634,6 +632,37 @@
VehicleArea::GLOBAL, VehiclePropertyType::INT32);
}
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorPositionConfig) {
+ verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_POSITION, VehiclePropertyAccess::READ,
+ VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorOrientationConfig) {
+ verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyAccess::READ,
+ VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorFieldOfViewConfig) {
+ verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyAccess::READ,
+ VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorDetectionRangeConfig) {
+ verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyAccess::READ,
+ VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorSupportedRangesConfig) {
+ verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_SUPPORTED_RANGES,
+ VehiclePropertyAccess::READ, VehiclePropertyChangeMode::STATIC,
+ VehiclePropertyGroup::SYSTEM, VehicleArea::VENDOR,
+ VehiclePropertyType::INT32_VEC);
+}
+
TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEmergencyLaneKeepAssistEnabledConfig) {
verifyProperty(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED,
VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
@@ -707,6 +736,54 @@
VehicleArea::GLOBAL, VehiclePropertyType::INT32);
}
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDrowsinessAttentionSystemEnabledConfig) {
+ verifyProperty(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED,
+ VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
+ VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDrowsinessAttentionStateConfig) {
+ verifyProperty(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_STATE, VehiclePropertyAccess::READ,
+ VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::GLOBAL, VehiclePropertyType::INT32);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDrowsinessAttentionWarningEnabledConfig) {
+ verifyProperty(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED,
+ VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
+ VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDrowsinessAttentionWarningConfig) {
+ verifyProperty(VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING,
+ VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE,
+ VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionSystemEnabledConfig) {
+ verifyProperty(VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED,
+ VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
+ VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionStateConfig) {
+ verifyProperty(VehicleProperty::DRIVER_DISTRACTION_STATE, VehiclePropertyAccess::READ,
+ VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::GLOBAL, VehiclePropertyType::INT32);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionWarningEnabledConfig) {
+ verifyProperty(VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED,
+ VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
+ VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyDriverDistractionWarningConfig) {
+ verifyProperty(VehicleProperty::DRIVER_DISTRACTION_WARNING, VehiclePropertyAccess::READ,
+ VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::GLOBAL, VehiclePropertyType::INT32);
+}
+
TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvBrakeRegenerationLevelConfig) {
verifyProperty(VehicleProperty::EV_BRAKE_REGENERATION_LEVEL,
VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
@@ -971,6 +1048,84 @@
VehicleArea::GLOBAL, VehiclePropertyType::INT32);
}
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyClusterHeartbeatConfig) {
+ verifyProperty(VehicleProperty::CLUSTER_HEARTBEAT, VehiclePropertyAccess::WRITE,
+ VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::GLOBAL, VehiclePropertyType::MIXED);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyVehicleDrivingAutomationCurrentLevelConfig) {
+ verifyProperty(VehicleProperty::VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL,
+ VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE,
+ VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatAirbagsDeployedConfig) {
+ verifyProperty(VehicleProperty::SEAT_AIRBAGS_DEPLOYED, VehiclePropertyAccess::READ,
+ VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::SEAT, VehiclePropertyType::INT32);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifySeatBeltPretensionerDeployedConfig) {
+ verifyProperty(VehicleProperty::SEAT_BELT_PRETENSIONER_DEPLOYED, VehiclePropertyAccess::READ,
+ VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::SEAT, VehiclePropertyType::BOOLEAN);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyImpactDetectedConfig) {
+ verifyProperty(VehicleProperty::IMPACT_DETECTED, VehiclePropertyAccess::READ,
+ VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::GLOBAL, VehiclePropertyType::INT32);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEvBatteryAverageTemperatureConfig) {
+ verifyProperty(VehicleProperty::EV_BATTERY_AVERAGE_TEMPERATURE, VehiclePropertyAccess::READ,
+ VehiclePropertyChangeMode::CONTINUOUS, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::GLOBAL, VehiclePropertyType::FLOAT);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLowSpeedCollisionWarningEnabledConfig) {
+ verifyProperty(VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED,
+ VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
+ VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLowSpeedCollisionWarningStateConfig) {
+ verifyProperty(VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyAccess::READ,
+ VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::GLOBAL, VehiclePropertyType::INT32);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyValetModeEnabledConfig) {
+ verifyProperty(VehicleProperty::VALET_MODE_ENABLED, VehiclePropertyAccess::READ_WRITE,
+ VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyElectronicStabilityControlEnabledConfig) {
+ verifyProperty(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED,
+ VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
+ VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyElectronicStabilityControlStateConfig) {
+ verifyProperty(VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE, VehiclePropertyAccess::READ,
+ VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::GLOBAL, VehiclePropertyType::INT32);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCrossTrafficMonitoringEnabledConfig) {
+ verifyProperty(VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED,
+ VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
+ VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyCrossTrafficMonitoringWarningStateConfig) {
+ verifyProperty(VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE,
+ VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE,
+ VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32);
+}
+
bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) {
auto result = mVhalClient->getPropConfigs({propertyId});
return result.ok();
diff --git a/biometrics/common/aidl/Android.bp b/biometrics/common/aidl/Android.bp
index b41a937..8502a82 100644
--- a/biometrics/common/aidl/Android.bp
+++ b/biometrics/common/aidl/Android.bp
@@ -13,7 +13,7 @@
srcs: [
"android/hardware/biometrics/common/*.aidl",
],
- frozen: true,
+ frozen: false,
stability: "vintf",
backend: {
java: {
diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/FoldState.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/FoldState.aidl
new file mode 100644
index 0000000..06baf00
--- /dev/null
+++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/FoldState.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.biometrics.common;
+/* @hide */
+@Backing(type="int") @VintfStability
+enum FoldState {
+ UNKNOWN,
+ HALF_OPENED,
+ FULLY_OPENED,
+ FULLY_CLOSED,
+}
diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl
index 378017e..42c305a 100644
--- a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl
+++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl
@@ -45,4 +45,5 @@
android.hardware.biometrics.common.WakeReason wakeReason = android.hardware.biometrics.common.WakeReason.UNKNOWN;
android.hardware.biometrics.common.DisplayState displayState = android.hardware.biometrics.common.DisplayState.UNKNOWN;
@nullable android.hardware.biometrics.common.AuthenticateReason authenticateReason;
+ android.hardware.biometrics.common.FoldState foldState = android.hardware.biometrics.common.FoldState.UNKNOWN;
}
diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/FoldState.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/FoldState.aidl
new file mode 100644
index 0000000..03e606a
--- /dev/null
+++ b/biometrics/common/aidl/android/hardware/biometrics/common/FoldState.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.
+ */
+
+package android.hardware.biometrics.common;
+
+/**
+ * Fold/Unfold state during an operation.
+ *
+ * @hide
+ */
+@VintfStability
+@Backing(type="int")
+enum FoldState {
+ /** The fold state is unknown. */
+ UNKNOWN,
+
+ /** The fold state is half opened. */
+ HALF_OPENED,
+
+ /** The fold state is fully opened. */
+ FULLY_OPENED,
+
+ /** The fold state is fully closed. */
+ FULLY_CLOSED,
+}
diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl
index f4191d7..584057d 100644
--- a/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl
+++ b/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl
@@ -18,6 +18,7 @@
import android.hardware.biometrics.common.AuthenticateReason;
import android.hardware.biometrics.common.DisplayState;
+import android.hardware.biometrics.common.FoldState;
import android.hardware.biometrics.common.OperationReason;
import android.hardware.biometrics.common.WakeReason;
@@ -71,4 +72,7 @@
* framework may choose to omit the reason at any time based on the device's policy.
*/
@nullable AuthenticateReason authenticateReason;
+
+ /** The current fold/unfold state. */
+ FoldState foldState = FoldState.UNKNOWN;
}
diff --git a/biometrics/common/util/Android.bp b/biometrics/common/util/Android.bp
index b990812..599c491 100644
--- a/biometrics/common/util/Android.bp
+++ b/biometrics/common/util/Android.bp
@@ -13,6 +13,6 @@
shared_libs: [
"libbase",
"libbinder_ndk",
- "android.hardware.biometrics.common-V3-ndk",
+ "android.hardware.biometrics.common-V4-ndk",
],
}
diff --git a/biometrics/common/util/include/util/Util.h b/biometrics/common/util/include/util/Util.h
index da19dc6..efd66bc 100644
--- a/biometrics/common/util/include/util/Util.h
+++ b/biometrics/common/util/include/util/Util.h
@@ -23,6 +23,9 @@
#include <thread>
#include <vector>
+#include <android-base/parseint.h>
+using ::android::base::ParseInt;
+
namespace aidl::android::hardware::biometrics {
#define SLEEP_MS(x) \
@@ -64,6 +67,87 @@
std::sregex_token_iterator());
return parts;
}
+
+ // Returns a vector of integers for the string separated by comma,
+ // Empty vector is returned if there is any parsing error
+ static std::vector<int32_t> parseIntSequence(const std::string& str,
+ const std::string& sep = ",") {
+ std::vector<std::string> seqs = Util::split(str, sep);
+ std::vector<int32_t> res;
+
+ for (const auto& seq : seqs) {
+ int32_t val;
+ if (ParseInt(seq, &val)) {
+ res.push_back(val);
+ } else {
+ LOG(WARNING) << "Invalid int sequence:" + str + " seq:" + seq;
+ res.clear();
+ break;
+ }
+ }
+
+ return res;
+ }
+
+ // Parses a single enrollment stage string in the format of
+ // enroll_stage_spec: <duration>[-acquiredInfos]
+ // duration: integerInMs
+ // acquiredInfos: [info1,info2,...]
+ //
+ // Returns false if there is parsing error
+ //
+ static bool parseEnrollmentCaptureSingle(const std::string& str,
+ std::vector<std::vector<int32_t>>& res) {
+ std::vector<int32_t> defaultAcquiredInfo = {1};
+ bool aborted = true;
+
+ do {
+ std::smatch sms;
+ // Parses strings like "1000-[5,1]" or "500"
+ std::regex ex("((\\d+)(-\\[([\\d|,]+)\\])?)");
+ if (!regex_match(str.cbegin(), str.cend(), sms, ex)) break;
+ int32_t duration;
+ if (!ParseInt(sms.str(2), &duration)) break;
+ res.push_back({duration});
+ if (!sms.str(4).empty()) {
+ auto acqv = parseIntSequence(sms.str(4));
+ if (acqv.empty()) break;
+ res.push_back(acqv);
+ } else
+ res.push_back(defaultAcquiredInfo);
+ aborted = false;
+ } while (0);
+
+ return !aborted;
+ }
+
+ // Parses enrollment string consisting of one or more stages in the formst of
+ // <enroll_stage_spec>[,enroll_stage_spec,...]
+ // Empty vector is returned in case of parsing error
+ static std::vector<std::vector<int32_t>> parseEnrollmentCapture(const std::string& str) {
+ std::vector<std::vector<int32_t>> res;
+
+ std::string s(str);
+ s.erase(std::remove_if(s.begin(), s.end(), ::isspace), s.end());
+ bool aborted = false;
+ std::smatch sms;
+ // Parses strings like "1000-[5,1],500,800-[6,5,1]"
+ // -------------- ----- ---------------
+ // into parts: A B C
+ while (regex_search(s, sms, std::regex("^(,)?(\\d+(-\\[[\\d|,]+\\])?)"))) {
+ if (!parseEnrollmentCaptureSingle(sms.str(2), res)) {
+ aborted = true;
+ break;
+ }
+ s = sms.suffix();
+ }
+ if (aborted || s.length() != 0) {
+ res.clear();
+ LOG(ERROR) << "Failed to parse enrollment captures:" + str;
+ }
+
+ return res;
+ }
};
} // namespace aidl::android::hardware::biometrics
diff --git a/biometrics/face/aidl/Android.bp b/biometrics/face/aidl/Android.bp
index 79df9c6..fadcde7 100644
--- a/biometrics/face/aidl/Android.bp
+++ b/biometrics/face/aidl/Android.bp
@@ -14,10 +14,13 @@
"android/hardware/biometrics/face/**/*.aidl",
],
imports: [
- "android.hardware.biometrics.common-V3",
+ "android.hardware.biometrics.common-V4",
"android.hardware.common-V2",
"android.hardware.keymaster-V4",
],
+ include_dirs: [
+ "frameworks/native/aidl/gui",
+ ],
stability: "vintf",
backend: {
java: {
@@ -26,6 +29,14 @@
cpp: {
enabled: false,
},
+ rust: {
+ enabled: false,
+ },
+ ndk: {
+ additional_shared_libraries: [
+ "libnativewindow",
+ ],
+ },
},
versions_with_info: [
{
@@ -52,6 +63,14 @@
"android.hardware.keymaster-V4",
],
},
+ {
+ version: "4",
+ imports: [
+ "android.hardware.biometrics.common-V4",
+ "android.hardware.common-V2",
+ "android.hardware.keymaster-V4",
+ ],
+ },
],
frozen: true,
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/.hash b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/.hash
new file mode 100644
index 0000000..e9a5aa3
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/.hash
@@ -0,0 +1 @@
+c43fbb9be4a662cc9ace640dba21cccdb84c6c21
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AcquiredInfo.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AcquiredInfo.aidl
new file mode 100644
index 0000000..1420cdc
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AcquiredInfo.aidl
@@ -0,0 +1,65 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@Backing(type="byte") @VintfStability
+enum AcquiredInfo {
+ UNKNOWN,
+ GOOD,
+ INSUFFICIENT,
+ TOO_BRIGHT,
+ TOO_DARK,
+ TOO_CLOSE,
+ TOO_FAR,
+ FACE_TOO_HIGH,
+ FACE_TOO_LOW,
+ FACE_TOO_RIGHT,
+ FACE_TOO_LEFT,
+ POOR_GAZE,
+ NOT_DETECTED,
+ TOO_MUCH_MOTION,
+ RECALIBRATE,
+ TOO_DIFFERENT,
+ TOO_SIMILAR,
+ PAN_TOO_EXTREME,
+ TILT_TOO_EXTREME,
+ ROLL_TOO_EXTREME,
+ FACE_OBSCURED,
+ START,
+ SENSOR_DIRTY,
+ VENDOR,
+ FIRST_FRAME_RECEIVED,
+ DARK_GLASSES_DETECTED,
+ MOUTH_COVERING_DETECTED,
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AuthenticationFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AuthenticationFrame.aidl
new file mode 100644
index 0000000..bbaca12
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/AuthenticationFrame.aidl
@@ -0,0 +1,39 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@VintfStability
+parcelable AuthenticationFrame {
+ android.hardware.biometrics.face.BaseFrame data;
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/BaseFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/BaseFrame.aidl
new file mode 100644
index 0000000..1dd0a9c
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/BaseFrame.aidl
@@ -0,0 +1,44 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@VintfStability
+parcelable BaseFrame {
+ android.hardware.biometrics.face.AcquiredInfo acquiredInfo = android.hardware.biometrics.face.AcquiredInfo.UNKNOWN;
+ int vendorCode;
+ float pan;
+ float tilt;
+ float distance;
+ boolean isCancellable;
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Cell.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Cell.aidl
new file mode 100644
index 0000000..d423a69
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Cell.aidl
@@ -0,0 +1,41 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@VintfStability
+parcelable Cell {
+ int x;
+ int y;
+ int z;
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentFrame.aidl
new file mode 100644
index 0000000..90be5d0
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentFrame.aidl
@@ -0,0 +1,41 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@VintfStability
+parcelable EnrollmentFrame {
+ @nullable android.hardware.biometrics.face.Cell cell;
+ android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.UNKNOWN;
+ android.hardware.biometrics.face.BaseFrame data;
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStage.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStage.aidl
new file mode 100644
index 0000000..89b06ca
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStage.aidl
@@ -0,0 +1,45 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@Backing(type="byte") @VintfStability
+enum EnrollmentStage {
+ UNKNOWN,
+ FIRST_FRAME_RECEIVED,
+ WAITING_FOR_CENTERING,
+ HOLD_STILL_IN_CENTER,
+ ENROLLING_MOVEMENT_1,
+ ENROLLING_MOVEMENT_2,
+ ENROLLMENT_FINISHED,
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStageConfig.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStageConfig.aidl
new file mode 100644
index 0000000..ee1c01a
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentStageConfig.aidl
@@ -0,0 +1,40 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@VintfStability
+parcelable EnrollmentStageConfig {
+ android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.UNKNOWN;
+ List<android.hardware.biometrics.face.Cell> cells;
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentType.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentType.aidl
new file mode 100644
index 0000000..180ea5d
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/EnrollmentType.aidl
@@ -0,0 +1,40 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@Backing(type="byte") @VintfStability
+enum EnrollmentType {
+ DEFAULT,
+ ACCESSIBILITY,
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Error.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Error.aidl
new file mode 100644
index 0000000..5761e31
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Error.aidl
@@ -0,0 +1,47 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@Backing(type="byte") @VintfStability
+enum Error {
+ UNKNOWN,
+ HW_UNAVAILABLE,
+ UNABLE_TO_PROCESS,
+ TIMEOUT,
+ NO_SPACE,
+ CANCELED,
+ UNABLE_TO_REMOVE,
+ VENDOR,
+ REENROLL_REQUIRED,
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceEnrollOptions.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceEnrollOptions.aidl
new file mode 100644
index 0000000..c961531
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceEnrollOptions.aidl
@@ -0,0 +1,47 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@VintfStability
+parcelable FaceEnrollOptions {
+ android.hardware.keymaster.HardwareAuthToken hardwareAuthToken;
+ android.hardware.biometrics.face.EnrollmentType enrollmentType;
+ android.hardware.biometrics.face.Feature[] features;
+ /**
+ * @deprecated use {@link surfacePreview} instead {@link NativeHandle} a handle used to render content from the face HAL. Note that only one of [{@link surfacePreview}, {@link nativeHandlePreview}] should be set at one time.
+ */
+ @nullable android.hardware.common.NativeHandle nativeHandlePreview;
+ @nullable android.view.Surface surfacePreview;
+ @nullable android.hardware.biometrics.common.OperationContext context;
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceSensorType.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceSensorType.aidl
new file mode 100644
index 0000000..ec03733
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/FaceSensorType.aidl
@@ -0,0 +1,41 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@Backing(type="byte") @VintfStability
+enum FaceSensorType {
+ UNKNOWN,
+ RGB,
+ IR,
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Feature.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Feature.aidl
new file mode 100644
index 0000000..3337df8
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/Feature.aidl
@@ -0,0 +1,41 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@Backing(type="byte") @VintfStability
+enum Feature {
+ REQUIRE_ATTENTION,
+ REQUIRE_DIVERSE_POSES,
+ DEBUG,
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/IFace.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/IFace.aidl
new file mode 100644
index 0000000..1ae76de
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/IFace.aidl
@@ -0,0 +1,40 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@VintfStability
+interface IFace {
+ android.hardware.biometrics.face.SensorProps[] getSensorProps();
+ android.hardware.biometrics.face.ISession createSession(in int sensorId, in int userId, in android.hardware.biometrics.face.ISessionCallback cb);
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISession.aidl
new file mode 100644
index 0000000..b655d5f
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISession.aidl
@@ -0,0 +1,63 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@VintfStability
+interface ISession {
+ void generateChallenge();
+ void revokeChallenge(in long challenge);
+ android.hardware.biometrics.face.EnrollmentStageConfig[] getEnrollmentConfig(in android.hardware.biometrics.face.EnrollmentType enrollmentType);
+ /**
+ * @deprecated use {@link enrollWithOptions} instead.
+ */
+ android.hardware.biometrics.common.ICancellationSignal enroll(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.EnrollmentType type, in android.hardware.biometrics.face.Feature[] features, in @nullable android.hardware.common.NativeHandle previewSurface);
+ android.hardware.biometrics.common.ICancellationSignal authenticate(in long operationId);
+ android.hardware.biometrics.common.ICancellationSignal detectInteraction();
+ void enumerateEnrollments();
+ void removeEnrollments(in int[] enrollmentIds);
+ void getFeatures();
+ void setFeature(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.Feature feature, boolean enabled);
+ void getAuthenticatorId();
+ void invalidateAuthenticatorId();
+ void resetLockout(in android.hardware.keymaster.HardwareAuthToken hat);
+ void close();
+ android.hardware.biometrics.common.ICancellationSignal authenticateWithContext(in long operationId, in android.hardware.biometrics.common.OperationContext context);
+ /**
+ * @deprecated use {@link enrollWithOptions} instead.
+ */
+ android.hardware.biometrics.common.ICancellationSignal enrollWithContext(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.EnrollmentType type, in android.hardware.biometrics.face.Feature[] features, in @nullable android.hardware.common.NativeHandle previewSurface, in android.hardware.biometrics.common.OperationContext context);
+ android.hardware.biometrics.common.ICancellationSignal detectInteractionWithContext(in android.hardware.biometrics.common.OperationContext context);
+ void onContextChanged(in android.hardware.biometrics.common.OperationContext context);
+ android.hardware.biometrics.common.ICancellationSignal enrollWithOptions(in android.hardware.biometrics.face.FaceEnrollOptions options);
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISessionCallback.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISessionCallback.aidl
new file mode 100644
index 0000000..c6c035b
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/ISessionCallback.aidl
@@ -0,0 +1,57 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@VintfStability
+interface ISessionCallback {
+ void onChallengeGenerated(in long challenge);
+ void onChallengeRevoked(in long challenge);
+ void onAuthenticationFrame(in android.hardware.biometrics.face.AuthenticationFrame frame);
+ void onEnrollmentFrame(in android.hardware.biometrics.face.EnrollmentFrame frame);
+ void onError(in android.hardware.biometrics.face.Error error, in int vendorCode);
+ void onEnrollmentProgress(in int enrollmentId, int remaining);
+ void onAuthenticationSucceeded(in int enrollmentId, in android.hardware.keymaster.HardwareAuthToken hat);
+ void onAuthenticationFailed();
+ void onLockoutTimed(in long durationMillis);
+ void onLockoutPermanent();
+ void onLockoutCleared();
+ void onInteractionDetected();
+ void onEnrollmentsEnumerated(in int[] enrollmentIds);
+ void onFeaturesRetrieved(in android.hardware.biometrics.face.Feature[] features);
+ void onFeatureSet(android.hardware.biometrics.face.Feature feature);
+ void onEnrollmentsRemoved(in int[] enrollmentIds);
+ void onAuthenticatorIdRetrieved(in long authenticatorId);
+ void onAuthenticatorIdInvalidated(in long newAuthenticatorId);
+ void onSessionClosed();
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/SensorProps.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/SensorProps.aidl
new file mode 100644
index 0000000..918332b
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/4/android/hardware/biometrics/face/SensorProps.aidl
@@ -0,0 +1,48 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@VintfStability
+parcelable SensorProps {
+ android.hardware.biometrics.common.CommonProps commonProps;
+ android.hardware.biometrics.face.FaceSensorType sensorType = android.hardware.biometrics.face.FaceSensorType.UNKNOWN;
+ boolean halControlsPreview;
+ int previewDisplayId;
+ int enrollPreviewWidth;
+ int enrollPreviewHeight;
+ float enrollTranslationX;
+ float enrollTranslationY;
+ float enrollPreviewScale;
+ boolean supportsDetectInteraction;
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AcquiredInfo.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AcquiredInfo.aidl
index eaa43f3..1420cdc 100644
--- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AcquiredInfo.aidl
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AcquiredInfo.aidl
@@ -32,33 +32,34 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.biometrics.face;
+/* @hide */
@Backing(type="byte") @VintfStability
enum AcquiredInfo {
- UNKNOWN = 0,
- GOOD = 1,
- INSUFFICIENT = 2,
- TOO_BRIGHT = 3,
- TOO_DARK = 4,
- TOO_CLOSE = 5,
- TOO_FAR = 6,
- FACE_TOO_HIGH = 7,
- FACE_TOO_LOW = 8,
- FACE_TOO_RIGHT = 9,
- FACE_TOO_LEFT = 10,
- POOR_GAZE = 11,
- NOT_DETECTED = 12,
- TOO_MUCH_MOTION = 13,
- RECALIBRATE = 14,
- TOO_DIFFERENT = 15,
- TOO_SIMILAR = 16,
- PAN_TOO_EXTREME = 17,
- TILT_TOO_EXTREME = 18,
- ROLL_TOO_EXTREME = 19,
- FACE_OBSCURED = 20,
- START = 21,
- SENSOR_DIRTY = 22,
- VENDOR = 23,
- FIRST_FRAME_RECEIVED = 24,
- DARK_GLASSES_DETECTED = 25,
- MOUTH_COVERING_DETECTED = 26,
+ UNKNOWN,
+ GOOD,
+ INSUFFICIENT,
+ TOO_BRIGHT,
+ TOO_DARK,
+ TOO_CLOSE,
+ TOO_FAR,
+ FACE_TOO_HIGH,
+ FACE_TOO_LOW,
+ FACE_TOO_RIGHT,
+ FACE_TOO_LEFT,
+ POOR_GAZE,
+ NOT_DETECTED,
+ TOO_MUCH_MOTION,
+ RECALIBRATE,
+ TOO_DIFFERENT,
+ TOO_SIMILAR,
+ PAN_TOO_EXTREME,
+ TILT_TOO_EXTREME,
+ ROLL_TOO_EXTREME,
+ FACE_OBSCURED,
+ START,
+ SENSOR_DIRTY,
+ VENDOR,
+ FIRST_FRAME_RECEIVED,
+ DARK_GLASSES_DETECTED,
+ MOUTH_COVERING_DETECTED,
}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AuthenticationFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AuthenticationFrame.aidl
index 20bc767..bbaca12 100644
--- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AuthenticationFrame.aidl
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/AuthenticationFrame.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.biometrics.face;
+/* @hide */
@VintfStability
parcelable AuthenticationFrame {
android.hardware.biometrics.face.BaseFrame data;
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/BaseFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/BaseFrame.aidl
index 67b5cf4..1dd0a9c 100644
--- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/BaseFrame.aidl
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/BaseFrame.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.biometrics.face;
+/* @hide */
@VintfStability
parcelable BaseFrame {
android.hardware.biometrics.face.AcquiredInfo acquiredInfo = android.hardware.biometrics.face.AcquiredInfo.UNKNOWN;
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Cell.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Cell.aidl
index 6be8c8e..d423a69 100644
--- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Cell.aidl
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Cell.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.biometrics.face;
+/* @hide */
@VintfStability
parcelable Cell {
int x;
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentFrame.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentFrame.aidl
index 0ea10d6..90be5d0 100644
--- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentFrame.aidl
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentFrame.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.biometrics.face;
+/* @hide */
@VintfStability
parcelable EnrollmentFrame {
@nullable android.hardware.biometrics.face.Cell cell;
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStage.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStage.aidl
index ce5679a..89b06ca 100644
--- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStage.aidl
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStage.aidl
@@ -32,13 +32,14 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.biometrics.face;
+/* @hide */
@Backing(type="byte") @VintfStability
enum EnrollmentStage {
- UNKNOWN = 0,
- FIRST_FRAME_RECEIVED = 1,
- WAITING_FOR_CENTERING = 2,
- HOLD_STILL_IN_CENTER = 3,
- ENROLLING_MOVEMENT_1 = 4,
- ENROLLING_MOVEMENT_2 = 5,
- ENROLLMENT_FINISHED = 6,
+ UNKNOWN,
+ FIRST_FRAME_RECEIVED,
+ WAITING_FOR_CENTERING,
+ HOLD_STILL_IN_CENTER,
+ ENROLLING_MOVEMENT_1,
+ ENROLLING_MOVEMENT_2,
+ ENROLLMENT_FINISHED,
}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStageConfig.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStageConfig.aidl
index 48db2cf..ee1c01a 100644
--- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStageConfig.aidl
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentStageConfig.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.biometrics.face;
+/* @hide */
@VintfStability
parcelable EnrollmentStageConfig {
android.hardware.biometrics.face.EnrollmentStage stage = android.hardware.biometrics.face.EnrollmentStage.UNKNOWN;
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentType.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentType.aidl
index 8e99ad6..180ea5d 100644
--- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentType.aidl
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/EnrollmentType.aidl
@@ -32,8 +32,9 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.biometrics.face;
+/* @hide */
@Backing(type="byte") @VintfStability
enum EnrollmentType {
- DEFAULT = 0,
- ACCESSIBILITY = 1,
+ DEFAULT,
+ ACCESSIBILITY,
}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Error.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Error.aidl
index 1a21661..5761e31 100644
--- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Error.aidl
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Error.aidl
@@ -32,15 +32,16 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.biometrics.face;
+/* @hide */
@Backing(type="byte") @VintfStability
enum Error {
- UNKNOWN = 0,
- HW_UNAVAILABLE = 1,
- UNABLE_TO_PROCESS = 2,
- TIMEOUT = 3,
- NO_SPACE = 4,
- CANCELED = 5,
- UNABLE_TO_REMOVE = 6,
- VENDOR = 7,
- REENROLL_REQUIRED = 8,
+ UNKNOWN,
+ HW_UNAVAILABLE,
+ UNABLE_TO_PROCESS,
+ TIMEOUT,
+ NO_SPACE,
+ CANCELED,
+ UNABLE_TO_REMOVE,
+ VENDOR,
+ REENROLL_REQUIRED,
}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/FaceEnrollOptions.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/FaceEnrollOptions.aidl
new file mode 100644
index 0000000..c961531
--- /dev/null
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/FaceEnrollOptions.aidl
@@ -0,0 +1,47 @@
+/*
+ * 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.biometrics.face;
+/* @hide */
+@VintfStability
+parcelable FaceEnrollOptions {
+ android.hardware.keymaster.HardwareAuthToken hardwareAuthToken;
+ android.hardware.biometrics.face.EnrollmentType enrollmentType;
+ android.hardware.biometrics.face.Feature[] features;
+ /**
+ * @deprecated use {@link surfacePreview} instead {@link NativeHandle} a handle used to render content from the face HAL. Note that only one of [{@link surfacePreview}, {@link nativeHandlePreview}] should be set at one time.
+ */
+ @nullable android.hardware.common.NativeHandle nativeHandlePreview;
+ @nullable android.view.Surface surfacePreview;
+ @nullable android.hardware.biometrics.common.OperationContext context;
+}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/FaceSensorType.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/FaceSensorType.aidl
index a215b99..ec03733 100644
--- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/FaceSensorType.aidl
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/FaceSensorType.aidl
@@ -32,9 +32,10 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.biometrics.face;
+/* @hide */
@Backing(type="byte") @VintfStability
enum FaceSensorType {
- UNKNOWN = 0,
- RGB = 1,
- IR = 2,
+ UNKNOWN,
+ RGB,
+ IR,
}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Feature.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Feature.aidl
index 1875b97..3337df8 100644
--- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Feature.aidl
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/Feature.aidl
@@ -32,9 +32,10 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.biometrics.face;
+/* @hide */
@Backing(type="byte") @VintfStability
enum Feature {
- REQUIRE_ATTENTION = 0,
- REQUIRE_DIVERSE_POSES = 1,
- DEBUG = 2,
+ REQUIRE_ATTENTION,
+ REQUIRE_DIVERSE_POSES,
+ DEBUG,
}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/IFace.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/IFace.aidl
index fc4a4d0..1ae76de 100644
--- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/IFace.aidl
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/IFace.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.biometrics.face;
+/* @hide */
@VintfStability
interface IFace {
android.hardware.biometrics.face.SensorProps[] getSensorProps();
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISession.aidl
index 3665534..b655d5f 100644
--- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISession.aidl
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISession.aidl
@@ -32,11 +32,15 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.biometrics.face;
+/* @hide */
@VintfStability
interface ISession {
void generateChallenge();
void revokeChallenge(in long challenge);
android.hardware.biometrics.face.EnrollmentStageConfig[] getEnrollmentConfig(in android.hardware.biometrics.face.EnrollmentType enrollmentType);
+ /**
+ * @deprecated use {@link enrollWithOptions} instead.
+ */
android.hardware.biometrics.common.ICancellationSignal enroll(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.EnrollmentType type, in android.hardware.biometrics.face.Feature[] features, in @nullable android.hardware.common.NativeHandle previewSurface);
android.hardware.biometrics.common.ICancellationSignal authenticate(in long operationId);
android.hardware.biometrics.common.ICancellationSignal detectInteraction();
@@ -49,7 +53,11 @@
void resetLockout(in android.hardware.keymaster.HardwareAuthToken hat);
void close();
android.hardware.biometrics.common.ICancellationSignal authenticateWithContext(in long operationId, in android.hardware.biometrics.common.OperationContext context);
+ /**
+ * @deprecated use {@link enrollWithOptions} instead.
+ */
android.hardware.biometrics.common.ICancellationSignal enrollWithContext(in android.hardware.keymaster.HardwareAuthToken hat, in android.hardware.biometrics.face.EnrollmentType type, in android.hardware.biometrics.face.Feature[] features, in @nullable android.hardware.common.NativeHandle previewSurface, in android.hardware.biometrics.common.OperationContext context);
android.hardware.biometrics.common.ICancellationSignal detectInteractionWithContext(in android.hardware.biometrics.common.OperationContext context);
void onContextChanged(in android.hardware.biometrics.common.OperationContext context);
+ android.hardware.biometrics.common.ICancellationSignal enrollWithOptions(in android.hardware.biometrics.face.FaceEnrollOptions options);
}
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISessionCallback.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISessionCallback.aidl
index bbace29..c6c035b 100644
--- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISessionCallback.aidl
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/ISessionCallback.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.biometrics.face;
+/* @hide */
@VintfStability
interface ISessionCallback {
void onChallengeGenerated(in long challenge);
diff --git a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/SensorProps.aidl b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/SensorProps.aidl
index 8b3c51b..918332b 100644
--- a/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/SensorProps.aidl
+++ b/biometrics/face/aidl/aidl_api/android.hardware.biometrics.face/current/android/hardware/biometrics/face/SensorProps.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.biometrics.face;
+/* @hide */
@VintfStability
parcelable SensorProps {
android.hardware.biometrics.common.CommonProps commonProps;
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/AcquiredInfo.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/AcquiredInfo.aidl
index cf68421..48b3e8c 100644
--- a/biometrics/face/aidl/android/hardware/biometrics/face/AcquiredInfo.aidl
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/AcquiredInfo.aidl
@@ -15,7 +15,9 @@
*/
package android.hardware.biometrics.face;
-
+/**
+ * @hide
+ */
@VintfStability
@Backing(type="byte")
enum AcquiredInfo {
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/AuthenticationFrame.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/AuthenticationFrame.aidl
index be61a20..08ef973 100644
--- a/biometrics/face/aidl/android/hardware/biometrics/face/AuthenticationFrame.aidl
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/AuthenticationFrame.aidl
@@ -20,6 +20,7 @@
/**
* Describes an individual frame captured during authentication.
+ * @hide
*/
@VintfStability
parcelable AuthenticationFrame {
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/BaseFrame.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/BaseFrame.aidl
index 58ad01a..e407d91 100644
--- a/biometrics/face/aidl/android/hardware/biometrics/face/BaseFrame.aidl
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/BaseFrame.aidl
@@ -22,6 +22,7 @@
* Metadata of an individual frame. Can be used by the framework to provide user feedback.
* This parcelable is part of AuthenticationFrame and EnrollmentFrame, and shouldn't be used
* independently of those parcelables.
+ * @hide
*/
@VintfStability
parcelable BaseFrame {
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/Cell.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/Cell.aidl
index 77f33b9..8960d57 100644
--- a/biometrics/face/aidl/android/hardware/biometrics/face/Cell.aidl
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/Cell.aidl
@@ -18,6 +18,7 @@
/**
* Coordinates of an enrollment UI cell in a vendor-defined coordinate system.
+ * @hide
*/
@VintfStability
parcelable Cell {
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentFrame.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentFrame.aidl
index ecb0e79..15f019c 100644
--- a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentFrame.aidl
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentFrame.aidl
@@ -22,6 +22,7 @@
/**
* Describes an individual frame captured during enrollment.
+ * @hide
*/
@VintfStability
parcelable EnrollmentFrame {
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStage.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStage.aidl
index 5974838..1a3c029 100644
--- a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStage.aidl
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStage.aidl
@@ -18,6 +18,7 @@
/**
* Enrollment stages that can be mapped to the enrollment UI actions in the framework.
+ * @hide
*/
@VintfStability
@Backing(type="byte")
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStageConfig.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStageConfig.aidl
index a8fa9ab..362d752 100644
--- a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStageConfig.aidl
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentStageConfig.aidl
@@ -19,6 +19,9 @@
import android.hardware.biometrics.face.Cell;
import android.hardware.biometrics.face.EnrollmentStage;
+/**
+ * @hide
+ */
@VintfStability
parcelable EnrollmentStageConfig {
/**
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentType.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentType.aidl
index c960933..5d92087 100644
--- a/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentType.aidl
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/EnrollmentType.aidl
@@ -16,6 +16,9 @@
package android.hardware.biometrics.face;
+/**
+ * @hide
+ */
@VintfStability
@Backing(type="byte")
enum EnrollmentType {
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/Error.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/Error.aidl
index e99415a..77d4717 100644
--- a/biometrics/face/aidl/android/hardware/biometrics/face/Error.aidl
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/Error.aidl
@@ -15,7 +15,9 @@
*/
package android.hardware.biometrics.face;
-
+/**
+ * @hide
+ */
@VintfStability
@Backing(type="byte")
enum Error {
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/FaceEnrollOptions.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/FaceEnrollOptions.aidl
new file mode 100644
index 0000000..c57fb55
--- /dev/null
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/FaceEnrollOptions.aidl
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+
+package android.hardware.biometrics.face;
+
+import android.hardware.biometrics.common.OperationContext;
+import android.hardware.biometrics.face.EnrollmentStageConfig;
+import android.hardware.biometrics.face.EnrollmentType;
+import android.hardware.biometrics.face.Feature;
+import android.hardware.common.NativeHandle;
+import android.hardware.keymaster.HardwareAuthToken;
+import android.view.Surface;
+
+/**
+ * Enroll options used to pass information to the HAL when requesting an enroll operation.
+ * @hide
+ */
+@VintfStability
+parcelable FaceEnrollOptions {
+ /**
+ * See {@link HardwareAuthToken}.
+ */
+ HardwareAuthToken hardwareAuthToken;
+
+ /**
+ * See {@link EnrollmentType}
+ */
+ EnrollmentType enrollmentType;
+
+ /**
+ * See {@link Feature}
+ */
+ Feature[] features;
+
+ /**
+ * @deprecated use {@link surfacePreview} instead
+ *
+ * {@link NativeHandle} a handle used to render content from the face HAL.
+ *
+ * Note that only one of [{@link surfacePreview}, {@link nativeHandlePreview}]
+ * should be set at one time.
+ */
+ @nullable NativeHandle nativeHandlePreview;
+
+ /**
+ * {@link Surface} a surface used to render content from the face HAL.
+ *
+ * Note that only one of [{@link surfacePreview}, {@link nativeHandlePreview}]
+ * should be set at one time.
+ */
+ @nullable Surface surfacePreview;
+
+ /**
+ * See {@link OperationContext}
+ */
+ @nullable OperationContext context;
+}
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/FaceSensorType.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/FaceSensorType.aidl
index a5ed2e8..bf315a5 100644
--- a/biometrics/face/aidl/android/hardware/biometrics/face/FaceSensorType.aidl
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/FaceSensorType.aidl
@@ -16,6 +16,9 @@
package android.hardware.biometrics.face;
+/**
+ * @hide
+ */
@VintfStability
@Backing(type="byte")
enum FaceSensorType {
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/Feature.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/Feature.aidl
index bff1a02..9cbab55 100644
--- a/biometrics/face/aidl/android/hardware/biometrics/face/Feature.aidl
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/Feature.aidl
@@ -16,6 +16,9 @@
package android.hardware.biometrics.face;
+/**
+ * @hide
+ */
@VintfStability
@Backing(type="byte")
enum Feature {
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/IFace.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/IFace.aidl
index 65c589f..0ead435 100644
--- a/biometrics/face/aidl/android/hardware/biometrics/face/IFace.aidl
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/IFace.aidl
@@ -20,6 +20,9 @@
import android.hardware.biometrics.face.ISessionCallback;
import android.hardware.biometrics.face.SensorProps;
+/**
+ * @hide
+ */
@VintfStability
interface IFace {
/**
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl
index 2be76cb..26cb361 100644
--- a/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/ISession.aidl
@@ -20,6 +20,7 @@
import android.hardware.biometrics.common.OperationContext;
import android.hardware.biometrics.face.EnrollmentStageConfig;
import android.hardware.biometrics.face.EnrollmentType;
+import android.hardware.biometrics.face.FaceEnrollOptions;
import android.hardware.biometrics.face.Feature;
import android.hardware.common.NativeHandle;
import android.hardware.keymaster.HardwareAuthToken;
@@ -41,6 +42,7 @@
* ISession only supports execution of one operation at a time, regardless of whether it's
* cancellable or not. The framework must wait for a corresponding callback indicating the end of
* the current operation before a new operation can be started.
+ * @hide
*/
@VintfStability
@@ -115,44 +117,7 @@
EnrollmentStageConfig[] getEnrollmentConfig(in EnrollmentType enrollmentType);
/**
- * enroll:
- *
- * A request to add a face enrollment.
- *
- * At any point during enrollment, if a non-recoverable error occurs, the HAL must notify the
- * framework via ISessionCallback#onError with the applicable enrollment-specific error.
- *
- * Before capturing face data, the HAL must first verify the authenticity and integrity of the
- * provided HardwareAuthToken. In addition, it must check that the challenge within the provided
- * HardwareAuthToken is valid. See ISession#generateChallenge. If any of the above checks fail,
- * the framework must be notified using ISessionCallback#onError with Error::UNABLE_TO_PROCESS.
- *
- * During enrollment, the HAL may notify the framework via ISessionCallback#onAcquired with
- * messages that may be used to guide the user. This callback can be invoked multiple times if
- * necessary. Similarly, the framework may be notified of enrollment progress changes via
- * ISessionCallback#onEnrollmentProgress. Once the framework is notified that there are 0
- * "remaining" steps, the framework may cache the "enrollmentId". See
- * ISessionCallback#onEnrollmentProgress for more info.
- *
- * When a face is successfully added and before the framework is notified of remaining=0, the
- * HAL must update and associate this (sensorId, userId) pair with a new entropy-encoded random
- * identifier. See ISession#getAuthenticatorId for more information.
- *
- * Callbacks that signify the end of this operation's lifecycle:
- * - ISessionCallback#onError
- * - ISessionCallback#onEnrollmentProgress(enrollmentId, remaining=0)
- *
- * Other applicable callbacks:
- * - ISessionCallback#onAcquired
- *
- * @param hat See above documentation.
- * @param enrollmentType See the EnrollmentType enum.
- * @param features See the Feature enum.
- * @param previewSurface A surface provided by the framework if SensorProps#halControlsPreview
- * is set to true. The HAL must send the preview frames to previewSurface
- * if it's not null.
- * @return ICancellationSignal An object that can be used by the framework to cancel this
- * operation.
+ * @deprecated use {@link enrollWithOptions} instead.
*/
ICancellationSignal enroll(in HardwareAuthToken hat, in EnrollmentType type,
in Feature[] features, in @nullable NativeHandle previewSurface);
@@ -456,7 +421,9 @@
/* See ISession#authenticateWithContext(long) */
ICancellationSignal authenticateWithContext(in long operationId, in OperationContext context);
- /* See ISession#enroll(HardwareAuthToken, EnrollmentType, Feature[], NativeHandle) */
+ /*
+ * @deprecated use {@link enrollWithOptions} instead.
+ */
ICancellationSignal enrollWithContext(in HardwareAuthToken hat, in EnrollmentType type,
in Feature[] features, in @nullable NativeHandle previewSurface,
in OperationContext context);
@@ -469,4 +436,41 @@
* running when the context changes.
*/
void onContextChanged(in OperationContext context);
+
+ /**
+ * enrollWithOptions:
+ *
+ * A request to add a face enrollment.
+ *
+ * At any point during enrollment, if a non-recoverable error occurs, the HAL must notify the
+ * framework via ISessionCallback#onError with the applicable enrollment-specific error.
+ *
+ * Before capturing face data, the HAL must first verify the authenticity and integrity of the
+ * provided HardwareAuthToken. In addition, it must check that the challenge within the provided
+ * HardwareAuthToken is valid. See ISession#generateChallenge. If any of the above checks fail,
+ * the framework must be notified using ISessionCallback#onError with Error::UNABLE_TO_PROCESS.
+ *
+ * During enrollment, the HAL may notify the framework via ISessionCallback#onAcquired with
+ * messages that may be used to guide the user. This callback can be invoked multiple times if
+ * necessary. Similarly, the framework may be notified of enrollment progress changes via
+ * ISessionCallback#onEnrollmentProgress. Once the framework is notified that there are 0
+ * "remaining" steps, the framework may cache the "enrollmentId". See
+ * ISessionCallback#onEnrollmentProgress for more info.
+ *
+ * When a face is successfully added and before the framework is notified of remaining=0, the
+ * HAL must update and associate this (sensorId, userId) pair with a new entropy-encoded random
+ * identifier. See ISession#getAuthenticatorId for more information.
+ *
+ * Callbacks that signify the end of this operation's lifecycle:
+ * - ISessionCallback#onError
+ * - ISessionCallback#onEnrollmentProgress(enrollmentId, remaining=0)
+ *
+ * Other applicable callbacks:
+ * - ISessionCallback#onAcquired
+ *
+ * @param FaceEnrollOptions See {@link FaceEnrollOptions} for more detail.
+ * @return ICancellationSignal An object that can be used by the framework to cancel this
+ * operation.
+ */
+ ICancellationSignal enrollWithOptions(in FaceEnrollOptions options);
}
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/ISessionCallback.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/ISessionCallback.aidl
index 9eb575c..b38e366 100644
--- a/biometrics/face/aidl/android/hardware/biometrics/face/ISessionCallback.aidl
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/ISessionCallback.aidl
@@ -23,6 +23,9 @@
import android.hardware.biometrics.face.Feature;
import android.hardware.keymaster.HardwareAuthToken;
+/**
+ * @hide
+ */
@VintfStability
interface ISessionCallback {
/**
diff --git a/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl b/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl
index 5f881ca..09fd9e5 100644
--- a/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl
+++ b/biometrics/face/aidl/android/hardware/biometrics/face/SensorProps.aidl
@@ -19,6 +19,9 @@
import android.hardware.biometrics.common.CommonProps;
import android.hardware.biometrics.face.FaceSensorType;
+/**
+ * @hide
+ */
@VintfStability
parcelable SensorProps {
/**
diff --git a/biometrics/face/aidl/default/Android.bp b/biometrics/face/aidl/default/Android.bp
index 5043573..685639c 100644
--- a/biometrics/face/aidl/default/Android.bp
+++ b/biometrics/face/aidl/default/Android.bp
@@ -9,36 +9,48 @@
}
filegroup {
- name: "face-default.rc",
- srcs: ["face-default.rc"],
+ name: "face-example.rc",
+ srcs: ["face-example.rc"],
}
filegroup {
- name: "face-default.xml",
- srcs: ["face-default.xml"],
+ name: "face-example.xml",
+ srcs: ["face-example.xml"],
}
cc_binary {
name: "android.hardware.biometrics.face-service.example",
relative_install_path: "hw",
- init_rc: [":face-default.rc"],
- vintf_fragments: [":face-default.xml"],
+ init_rc: [":face-example.rc"],
+ vintf_fragments: [":face-example.xml"],
vendor: true,
+
shared_libs: [
- "libbase",
"libbinder_ndk",
- "android.hardware.biometrics.face-V3-ndk",
- "android.hardware.biometrics.common-V3-ndk",
- "android.hardware.biometrics.common.thread",
- "android.hardware.biometrics.common.util",
+ "liblog",
+ "libnativewindow",
],
srcs: [
+ "FakeLockoutTracker.cpp",
"main.cpp",
"Face.cpp",
"FakeFaceEngine.cpp",
"Session.cpp",
],
- static_libs: ["libandroid.hardware.biometrics.face.VirtualProps"],
+ include_dirs: [
+ "frameworks/native/aidl/gui",
+ ],
+ stl: "c++_static",
+ static_libs: [
+ "android.hardware.biometrics.common-V4-ndk",
+ "android.hardware.biometrics.common.thread",
+ "android.hardware.biometrics.common.util",
+ "android.hardware.biometrics.face-V4-ndk",
+ "android.hardware.common-V2-ndk",
+ "android.hardware.keymaster-V4-ndk",
+ "libandroid.hardware.biometrics.face.VirtualProps",
+ "libbase",
+ ],
}
sysprop_library {
@@ -53,15 +65,46 @@
srcs: [
"tests/FakeFaceEngineTest.cpp",
"FakeFaceEngine.cpp",
+ "FakeLockoutTracker.cpp",
],
shared_libs: [
"libbase",
"libbinder_ndk",
+ "libnativewindow",
+ ],
+ include_dirs: [
+ "frameworks/native/aidl/gui",
],
static_libs: [
"libandroid.hardware.biometrics.face.VirtualProps",
- "android.hardware.biometrics.face-V3-ndk",
- "android.hardware.biometrics.common-V3-ndk",
+ "android.hardware.biometrics.face-V4-ndk",
+ "android.hardware.biometrics.common-V4-ndk",
+ "android.hardware.keymaster-V4-ndk",
+ "android.hardware.biometrics.common.util",
+ ],
+ vendor: true,
+ test_suites: ["general-tests"],
+ require_root: true,
+}
+
+cc_test {
+ name: "android.hardware.biometrics.face.FakeLockoutTrackerTest",
+ srcs: [
+ "tests/FakeLockoutTrackerTest.cpp",
+ "FakeLockoutTracker.cpp",
+ ],
+ shared_libs: [
+ "libbase",
+ "libbinder_ndk",
+ "libnativewindow",
+ ],
+ include_dirs: [
+ "frameworks/native/aidl/gui",
+ ],
+ static_libs: [
+ "libandroid.hardware.biometrics.face.VirtualProps",
+ "android.hardware.biometrics.face-V4-ndk",
+ "android.hardware.biometrics.common-V4-ndk",
"android.hardware.keymaster-V4-ndk",
"android.hardware.biometrics.common.util",
],
diff --git a/biometrics/face/aidl/default/FakeFaceEngine.cpp b/biometrics/face/aidl/default/FakeFaceEngine.cpp
index 0f088f4..7380611 100644
--- a/biometrics/face/aidl/default/FakeFaceEngine.cpp
+++ b/biometrics/face/aidl/default/FakeFaceEngine.cpp
@@ -1,3 +1,21 @@
+/*
+ * 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 "FaceVirtualHalEngine"
+
#include "FakeFaceEngine.h"
#include <android-base/logging.h>
@@ -53,15 +71,6 @@
const std::vector<Feature>& /*features*/,
const std::future<void>& cancel) {
BEGIN_OP(FaceHalProperties::operation_start_enroll_latency().value_or(0));
- // format is "<id>,<bucket_id>:<delay>:<succeeds>,<bucket_id>:<delay>:<succeeds>...
- auto nextEnroll = FaceHalProperties::next_enrollment().value_or("");
- // Erase the next enrollment
- FaceHalProperties::next_enrollment({});
-
- AuthenticationFrame frame;
- frame.data.acquiredInfo = AcquiredInfo::START;
- frame.data.vendorCode = 0;
- cb->onAuthenticationFrame(frame);
// Do proper HAT verification in the real implementation.
if (hat.mac.empty()) {
@@ -70,32 +79,159 @@
return;
}
- if (FaceHalProperties::operation_enroll_fails().value_or(false)) {
- LOG(ERROR) << "Fail: operation_enroll_fails";
+ // Format: <id>:<progress_ms-[acquiredInfo,...],...:<success>
+ // ------:-----------------------------------------:--------------
+ // | | |--->enrollment success (true/false)
+ // | |--> progress_steps
+ // |
+ // |-->enrollment id
+ //
+ //
+ // progress_steps
+ // <progress_duration>-[acquiredInfo,...]+
+ // ---------------------------- ---------------------
+ // | |-> sequence of acquiredInfo code
+ // | --> time duration of the step in ms
+ //
+ // E.g. 1:2000-[21,1108,5,6,1],1000-[1113,4,1]:true
+ // A success enrollement of id 1 by 2 steps
+ // 1st step lasts 2000ms with acquiredInfo codes (21,1108,5,6,1)
+ // 2nd step lasts 1000ms with acquiredInfo codes (1113,4,1)
+ //
+ std::string defaultNextEnrollment =
+ "1:1000-[21,7,1,1103],1500-[1108,1],2000-[1113,1],2500-[1118,1]:true";
+ auto nextEnroll = FaceHalProperties::next_enrollment().value_or(defaultNextEnrollment);
+ auto parts = Util::split(nextEnroll, ":");
+ if (parts.size() != 3) {
+ LOG(ERROR) << "Fail: invalid next_enrollment:" << nextEnroll;
cb->onError(Error::VENDOR, 0 /* vendorError */);
return;
}
-
- auto parts = Util::split(nextEnroll, ",");
- if (parts.size() < 2) {
- LOG(ERROR) << "Fail: invalid next_enrollment for : " << nextEnroll;
- cb->onError(Error::VENDOR, 0 /* vendorError */);
- return;
- }
-
auto enrollmentId = std::stoi(parts[0]);
- const int numBuckets = parts.size() - 1;
- for (size_t i = 1; i < parts.size(); i++) {
- auto enrollHit = Util::split(parts[i], ":");
- if (enrollHit.size() != 3) {
- LOG(ERROR) << "Error when unpacking enrollment hit: " << parts[i];
- cb->onError(Error::VENDOR, 0 /* vendorError */);
- }
- std::string bucket = enrollHit[0];
- std::string delay = enrollHit[1];
- std::string succeeds = enrollHit[2];
+ auto progress = Util::parseEnrollmentCapture(parts[1]);
+ for (size_t i = 0; i < progress.size(); i += 2) {
+ auto left = (progress.size() - i) / 2 - 1;
+ auto duration = progress[i][0];
+ auto acquired = progress[i + 1];
+ auto N = acquired.size();
- SLEEP_MS(std::stoi(delay));
+ for (int j = 0; j < N; j++) {
+ SLEEP_MS(duration / N);
+
+ if (shouldCancel(cancel)) {
+ LOG(ERROR) << "Fail: cancel";
+ cb->onError(Error::CANCELED, 0 /* vendorCode */);
+ return;
+ }
+ EnrollmentFrame frame = {};
+ auto ac = convertAcquiredInfo(acquired[j]);
+ frame.data.acquiredInfo = ac.first;
+ frame.data.vendorCode = ac.second;
+ frame.stage = (i == 0 && j == 0) ? EnrollmentStage::FIRST_FRAME_RECEIVED
+ : (i == progress.size() - 2 && j == N - 1)
+ ? EnrollmentStage::ENROLLMENT_FINISHED
+ : EnrollmentStage::WAITING_FOR_CENTERING;
+ cb->onEnrollmentFrame(frame);
+ }
+
+ if (left == 0 && !IS_TRUE(parts[2])) { // end and failed
+ LOG(ERROR) << "Fail: requested by caller: " << nextEnroll;
+ FaceHalProperties::next_enrollment({});
+ cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorCode */);
+ } else { // progress and update props if last time
+ LOG(INFO) << "onEnroll: " << enrollmentId << " left: " << left;
+ if (left == 0) {
+ auto enrollments = FaceHalProperties::enrollments();
+ enrollments.emplace_back(enrollmentId);
+ FaceHalProperties::enrollments(enrollments);
+ FaceHalProperties::next_enrollment({});
+ // change authenticatorId after new enrollment
+ auto id = FaceHalProperties::authenticator_id().value_or(0);
+ auto newId = id + 1;
+ FaceHalProperties::authenticator_id(newId);
+ LOG(INFO) << "Enrolled: " << enrollmentId;
+ }
+ cb->onEnrollmentProgress(enrollmentId, left);
+ }
+ }
+}
+
+void FakeFaceEngine::authenticateImpl(ISessionCallback* cb, int64_t /*operationId*/,
+ const std::future<void>& cancel) {
+ BEGIN_OP(FaceHalProperties::operation_authenticate_latency().value_or(0));
+
+ auto id = FaceHalProperties::enrollment_hit().value_or(0);
+ auto enrolls = FaceHalProperties::enrollments();
+ auto isEnrolled = std::find(enrolls.begin(), enrolls.end(), id) != enrolls.end();
+
+ auto vec2str = [](std::vector<AcquiredInfo> va) {
+ std::stringstream ss;
+ bool isFirst = true;
+ for (auto ac : va) {
+ if (!isFirst) ss << ",";
+ ss << std::to_string((int8_t)ac);
+ isFirst = false;
+ }
+ return ss.str();
+ };
+
+ // default behavior mimic face sensor in U
+ int64_t defaultAuthDuration = 500;
+ std::string defaultAcquiredInfo =
+ vec2str({AcquiredInfo::START, AcquiredInfo::FIRST_FRAME_RECEIVED});
+ if (!isEnrolled) {
+ std::vector<AcquiredInfo> v;
+ for (int i = 0; i < 56; i++) v.push_back(AcquiredInfo::NOT_DETECTED);
+ defaultAcquiredInfo += "," + vec2str(v);
+ defaultAuthDuration = 2100;
+ } else {
+ defaultAcquiredInfo += "," + vec2str({AcquiredInfo::TOO_BRIGHT, AcquiredInfo::TOO_BRIGHT,
+ AcquiredInfo::TOO_BRIGHT, AcquiredInfo::TOO_BRIGHT,
+ AcquiredInfo::GOOD, AcquiredInfo::GOOD});
+ }
+
+ int64_t now = Util::getSystemNanoTime();
+ int64_t duration =
+ FaceHalProperties::operation_authenticate_duration().value_or(defaultAuthDuration);
+ auto acquired =
+ FaceHalProperties::operation_authenticate_acquired().value_or(defaultAcquiredInfo);
+ auto acquiredInfos = Util::parseIntSequence(acquired);
+ int N = acquiredInfos.size();
+
+ if (N == 0) {
+ LOG(ERROR) << "Fail to parse authentiate acquired info: " + acquired;
+ cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */);
+ return;
+ }
+
+ if (mLockoutTracker.checkIfLockout(cb)) {
+ return;
+ }
+
+ int i = 0;
+ do {
+ if (FaceHalProperties::lockout().value_or(false)) {
+ LOG(ERROR) << "Fail: lockout";
+ cb->onLockoutPermanent();
+ cb->onError(Error::HW_UNAVAILABLE, 0 /* vendorError */);
+ return;
+ }
+
+ if (FaceHalProperties::operation_authenticate_fails().value_or(false)) {
+ LOG(ERROR) << "Fail: operation_authenticate_fails";
+ mLockoutTracker.addFailedAttempt(cb);
+ cb->onAuthenticationFailed();
+ return;
+ }
+
+ auto err = FaceHalProperties::operation_authenticate_error().value_or(0);
+ if (err != 0) {
+ LOG(ERROR) << "Fail: operation_authenticate_error";
+ auto ec = convertError(err);
+ cb->onError(ec.first, ec.second);
+ return; /* simply terminating current operation for any user inserted error,
+ revisit if tests need*/
+ }
if (shouldCancel(cancel)) {
LOG(ERROR) << "Fail: cancel";
@@ -103,89 +239,55 @@
return;
}
- if (!IS_TRUE(succeeds)) { // end and failed
- LOG(ERROR) << "Fail: requested by caller: " << parts[i];
- cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorCode */);
- return;
+ if (i < N) {
+ auto ac = convertAcquiredInfo(acquiredInfos[i]);
+ AuthenticationFrame frame;
+ frame.data.acquiredInfo = ac.first;
+ frame.data.vendorCode = ac.second;
+ cb->onAuthenticationFrame(frame);
+ LOG(INFO) << "AcquiredInfo:" << i << ": (" << (int)ac.first << "," << (int)ac.second
+ << ")";
+ i++;
}
- EnrollmentFrame frame;
+ SLEEP_MS(duration / N);
+ } while (!Util::hasElapsed(now, duration));
- frame.data.acquiredInfo = AcquiredInfo::GOOD;
- frame.data.vendorCode = 0;
- cb->onEnrollmentFrame(frame);
-
- frame.data.acquiredInfo = AcquiredInfo::VENDOR;
- frame.data.vendorCode = std::stoi(bucket);
- cb->onEnrollmentFrame(frame);
-
- int remainingBuckets = numBuckets - i;
- if (remainingBuckets > 0) {
- cb->onEnrollmentProgress(enrollmentId, remainingBuckets);
- }
+ if (id > 0 && isEnrolled) {
+ mLockoutTracker.reset();
+ cb->onAuthenticationSucceeded(id, {} /* hat */);
+ return;
+ } else {
+ LOG(ERROR) << "Fail: face not enrolled";
+ mLockoutTracker.addFailedAttempt(cb);
+ cb->onAuthenticationFailed();
+ cb->onError(Error::TIMEOUT, 0 /* vendorError*/);
+ return;
}
-
- auto enrollments = FaceHalProperties::enrollments();
- enrollments.push_back(enrollmentId);
- FaceHalProperties::enrollments(enrollments);
- LOG(INFO) << "enrolled : " << enrollmentId;
- cb->onEnrollmentProgress(enrollmentId, 0);
}
-void FakeFaceEngine::authenticateImpl(ISessionCallback* cb, int64_t /*operationId*/,
- const std::future<void>& cancel) {
- BEGIN_OP(FaceHalProperties::operation_authenticate_latency().value_or(0));
-
- // Signal to the framework that we have begun authenticating.
- AuthenticationFrame frame;
- frame.data.acquiredInfo = AcquiredInfo::START;
- frame.data.vendorCode = 0;
- cb->onAuthenticationFrame(frame);
-
- // Also signal that we have opened the camera.
- frame = {};
- frame.data.acquiredInfo = AcquiredInfo::FIRST_FRAME_RECEIVED;
- frame.data.vendorCode = 0;
- cb->onAuthenticationFrame(frame);
-
- auto now = Util::getSystemNanoTime();
- int64_t duration = FaceHalProperties::operation_authenticate_duration().value_or(0);
- if (duration > 0) {
- do {
- SLEEP_MS(5);
- } while (!Util::hasElapsed(now, duration));
+std::pair<AcquiredInfo, int32_t> FakeFaceEngine::convertAcquiredInfo(int32_t code) {
+ std::pair<AcquiredInfo, int32_t> res;
+ if (code > FACE_ACQUIRED_VENDOR_BASE) {
+ res.first = AcquiredInfo::VENDOR;
+ res.second = code - FACE_ACQUIRED_VENDOR_BASE;
+ } else {
+ res.first = (AcquiredInfo)code;
+ res.second = 0;
}
+ return res;
+}
- if (FaceHalProperties::operation_authenticate_fails().value_or(false)) {
- LOG(ERROR) << "Fail: operation_authenticate_fails";
- cb->onError(Error::VENDOR, 0 /* vendorError */);
- return;
+std::pair<Error, int32_t> FakeFaceEngine::convertError(int32_t code) {
+ std::pair<Error, int32_t> res;
+ if (code > FACE_ERROR_VENDOR_BASE) {
+ res.first = Error::VENDOR;
+ res.second = code - FACE_ERROR_VENDOR_BASE;
+ } else {
+ res.first = (Error)code;
+ res.second = 0;
}
-
- if (FaceHalProperties::lockout().value_or(false)) {
- LOG(ERROR) << "Fail: lockout";
- cb->onLockoutPermanent();
- cb->onError(Error::HW_UNAVAILABLE, 0 /* vendorError */);
- return;
- }
-
- if (shouldCancel(cancel)) {
- LOG(ERROR) << "Fail: cancel";
- cb->onError(Error::CANCELED, 0 /* vendorCode */);
- return;
- }
-
- auto id = FaceHalProperties::enrollment_hit().value_or(0);
- auto enrolls = FaceHalProperties::enrollments();
- auto isEnrolled = std::find(enrolls.begin(), enrolls.end(), id) != enrolls.end();
- if (id < 0 || !isEnrolled) {
- LOG(ERROR) << (isEnrolled ? "invalid enrollment hit" : "Fail: not enrolled");
- cb->onAuthenticationFailed();
- cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */);
- return;
- }
-
- cb->onAuthenticationSucceeded(id, {} /* hat */);
+ return res;
}
void FakeFaceEngine::detectInteractionImpl(ISessionCallback* cb, const std::future<void>& cancel) {
@@ -312,7 +414,8 @@
const keymaster::HardwareAuthToken& /*hat*/) {
BEGIN_OP(0);
FaceHalProperties::lockout(false);
+ mLockoutTracker.reset();
cb->onLockoutCleared();
}
-} // namespace aidl::android::hardware::biometrics::face
\ No newline at end of file
+} // namespace aidl::android::hardware::biometrics::face
diff --git a/biometrics/face/aidl/default/FakeFaceEngine.h b/biometrics/face/aidl/default/FakeFaceEngine.h
index edb54ce..8d9303c 100644
--- a/biometrics/face/aidl/default/FakeFaceEngine.h
+++ b/biometrics/face/aidl/default/FakeFaceEngine.h
@@ -21,11 +21,12 @@
#include <aidl/android/hardware/biometrics/face/FaceSensorType.h>
#include <aidl/android/hardware/biometrics/face/ISessionCallback.h>
-#include <random>
-
#include <future>
+#include <random>
#include <vector>
+#include "FakeLockoutTracker.h"
+
namespace aidl::android::hardware::biometrics::face {
namespace face = aidl::android::hardware::biometrics::face;
@@ -37,6 +38,7 @@
class FakeFaceEngine {
public:
FakeFaceEngine() : mRandom(std::mt19937::default_seed) {}
+ virtual ~FakeFaceEngine() {}
static face::FaceSensorType GetSensorType();
static common::SensorStrength GetSensorStrength();
@@ -59,7 +61,21 @@
void invalidateAuthenticatorIdImpl(ISessionCallback* cb);
void resetLockoutImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& /*hat*/);
+ virtual std::string toString() const {
+ std::ostringstream os;
+ os << "----- FakeFaceEngine:: -----" << std::endl;
+ os << mLockoutTracker.toString();
+ return os.str();
+ }
+
std::mt19937 mRandom;
+
+ private:
+ static constexpr int32_t FACE_ACQUIRED_VENDOR_BASE = 1000;
+ static constexpr int32_t FACE_ERROR_VENDOR_BASE = 1000;
+ std::pair<AcquiredInfo, int32_t> convertAcquiredInfo(int32_t code);
+ std::pair<Error, int32_t> convertError(int32_t code);
+ FakeLockoutTracker mLockoutTracker;
};
-} // namespace aidl::android::hardware::biometrics::face
\ No newline at end of file
+} // namespace aidl::android::hardware::biometrics::face
diff --git a/biometrics/face/aidl/default/FakeLockoutTracker.cpp b/biometrics/face/aidl/default/FakeLockoutTracker.cpp
new file mode 100644
index 0000000..70bf08e
--- /dev/null
+++ b/biometrics/face/aidl/default/FakeLockoutTracker.cpp
@@ -0,0 +1,138 @@
+/*
+ * 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 "FaceVirtualHalLockoutTracker"
+
+#include "FakeLockoutTracker.h"
+#include <android-base/logging.h>
+#include <face.sysprop.h>
+#include "util/Util.h"
+
+using namespace ::android::face::virt;
+
+namespace aidl::android::hardware::biometrics::face {
+
+void FakeLockoutTracker::reset(bool dueToTimerExpire) {
+ if (!dueToTimerExpire) {
+ mFailedCount = 0;
+ mLastFailedTime = 0;
+ }
+ mTimedFailedCount = 0;
+ mCurrentMode = LockoutMode::kNone;
+ abortTimer();
+}
+
+void FakeLockoutTracker::addFailedAttempt(ISessionCallback* cb) {
+ bool lockoutEnabled = FaceHalProperties::lockout_enable().value_or(false);
+ bool timedLockoutenabled = FaceHalProperties::lockout_timed_enable().value_or(false);
+ if (lockoutEnabled) {
+ mFailedCount++;
+ mTimedFailedCount++;
+ mLastFailedTime = Util::getSystemNanoTime();
+ int32_t lockoutTimedThreshold = FaceHalProperties::lockout_timed_threshold().value_or(3);
+ int32_t lockoutPermanetThreshold =
+ FaceHalProperties::lockout_permanent_threshold().value_or(5);
+ if (mFailedCount >= lockoutPermanetThreshold) {
+ mCurrentMode = LockoutMode::kPermanent;
+ LOG(ERROR) << "FakeLockoutTracker: lockoutPermanent";
+ cb->onLockoutPermanent();
+ abortTimer();
+ } else if (timedLockoutenabled && mTimedFailedCount >= lockoutTimedThreshold) {
+ if (mCurrentMode == LockoutMode::kNone) {
+ mCurrentMode = LockoutMode::kTimed;
+ startLockoutTimer(getTimedLockoutDuration(), cb);
+ }
+ LOG(ERROR) << "FakeLockoutTracker: lockoutTimed";
+ cb->onLockoutTimed(getLockoutTimeLeft());
+ }
+ } else {
+ reset();
+ }
+}
+
+FakeLockoutTracker::LockoutMode FakeLockoutTracker::getMode() {
+ return mCurrentMode;
+}
+
+int32_t FakeLockoutTracker::getTimedLockoutDuration() {
+ return FaceHalProperties::lockout_timed_duration().value_or(10 * 1000);
+}
+
+int64_t FakeLockoutTracker::getLockoutTimeLeft() {
+ int64_t res = 0;
+
+ if (mLastFailedTime > 0) {
+ auto now = Util::getSystemNanoTime();
+ auto elapsed = (now - mLastFailedTime) / 1000000LL;
+ res = getTimedLockoutDuration() - elapsed;
+ LOG(INFO) << "elapsed=" << elapsed << " now = " << now
+ << " mLastFailedTime=" << mLastFailedTime << " res=" << res;
+ }
+
+ return res;
+}
+
+bool FakeLockoutTracker::checkIfLockout(ISessionCallback* cb) {
+ if (mCurrentMode == LockoutMode::kPermanent) {
+ LOG(ERROR) << "Lockout permanent";
+ cb->onLockoutPermanent();
+ return true;
+ } else if (mCurrentMode == LockoutMode::kTimed) {
+ auto timeLeft = getLockoutTimeLeft();
+ LOG(ERROR) << "Lockout timed " << timeLeft;
+ cb->onLockoutTimed(timeLeft);
+ return true;
+ }
+ return false;
+}
+
+void FakeLockoutTracker::startLockoutTimer(int64_t timeout, ISessionCallback* cb) {
+ LOG(ERROR) << "startLockoutTimer: to=" << timeout;
+ if (mIsLockoutTimerStarted) return;
+ std::function<void(ISessionCallback*)> action =
+ std::bind(&FakeLockoutTracker::lockoutTimerExpired, this, std::placeholders::_1);
+ std::thread([timeout, action, cb]() {
+ std::this_thread::sleep_for(std::chrono::milliseconds(timeout));
+ action(cb);
+ }).detach();
+
+ mIsLockoutTimerStarted = true;
+}
+
+void FakeLockoutTracker::lockoutTimerExpired(ISessionCallback* cb) {
+ LOG(INFO) << "lockout timer expired";
+ mIsLockoutTimerStarted = false;
+
+ if (mIsLockoutTimerAborted) {
+ mIsLockoutTimerAborted = false;
+ return;
+ }
+
+ // if more failures seen since the timer started, need to restart timer again
+ auto deltaTime = getLockoutTimeLeft();
+ if (deltaTime <= 0) {
+ cb->onLockoutCleared();
+ reset(true);
+ } else {
+ startLockoutTimer(deltaTime, cb);
+ }
+}
+
+void FakeLockoutTracker::abortTimer() {
+ if (mIsLockoutTimerStarted) mIsLockoutTimerAborted = true;
+}
+
+} // namespace aidl::android::hardware::biometrics::face
diff --git a/biometrics/face/aidl/default/FakeLockoutTracker.h b/biometrics/face/aidl/default/FakeLockoutTracker.h
new file mode 100644
index 0000000..f2d38f3
--- /dev/null
+++ b/biometrics/face/aidl/default/FakeLockoutTracker.h
@@ -0,0 +1,70 @@
+/*
+ * 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 <aidl/android/hardware/biometrics/face/ISessionCallback.h>
+#include <android/binder_to_string.h>
+#include <stdint.h>
+#include <string>
+
+namespace aidl::android::hardware::biometrics::face {
+
+// Lockout implementation for Face Virtual HAL
+class FakeLockoutTracker {
+ public:
+ FakeLockoutTracker()
+ : mFailedCount(0),
+ mLastFailedTime(0),
+ mIsLockoutTimerStarted(false),
+ mIsLockoutTimerAborted(false) {}
+ ~FakeLockoutTracker() {}
+
+ enum class LockoutMode : int8_t { kNone = 0, kTimed, kPermanent };
+
+ bool checkIfLockout(ISessionCallback*);
+ void addFailedAttempt(ISessionCallback*);
+ int64_t getLockoutTimeLeft();
+ LockoutMode getMode();
+ void reset(bool dueToTimerExpire = false);
+ inline std::string toString() const {
+ std::ostringstream os;
+ os << "----- FakeLockoutTracker:: -----" << std::endl;
+ os << "mFailedCount:" << mFailedCount;
+ os << ", mCurrentMode:" << (int)mCurrentMode;
+ os << ", mLastFailedTime:" << (int)(mLastFailedTime / 1000000LL);
+ os << ", mIsLockoutTimerStarted:" << mIsLockoutTimerStarted;
+ os << ", mIsLockoutTimerAborted:" << mIsLockoutTimerAborted;
+ os << std::endl;
+ return os.str();
+ }
+
+ private:
+ void startLockoutTimer(int64_t timeout, ISessionCallback* cb);
+ void lockoutTimerExpired(ISessionCallback* cb);
+ int32_t getTimedLockoutDuration();
+ void abortTimer();
+
+ private:
+ int32_t mFailedCount;
+ int32_t mTimedFailedCount;
+ int64_t mLastFailedTime;
+ LockoutMode mCurrentMode;
+ bool mIsLockoutTimerStarted;
+ bool mIsLockoutTimerAborted;
+};
+
+} // namespace aidl::android::hardware::biometrics::face
diff --git a/biometrics/face/aidl/default/README.md b/biometrics/face/aidl/default/README.md
index 1655973..c9a8cfe 100644
--- a/biometrics/face/aidl/default/README.md
+++ b/biometrics/face/aidl/default/README.md
@@ -1,77 +1,127 @@
-# Virtual Face HAL
+# Face Virtual HAL (VHAL)
-This is a virtual HAL implementation that is backed by system properties
-instead of actual hardware. It's intended for testing and UI development
-on debuggable builds to allow devices to masquerade as alternative device
-types and for emulators.
+This is a virtual HAL implementation that is backed by system properties instead
+of actual hardware. It's intended for testing and UI development on debuggable
+builds to allow devices to masquerade as alternative device types and for
+emulators. Note: The virtual face HAL feature development will be done in
+phases. Refer to this doc often for the latest supported features
-## Device Selection
+## Supported Devices
-You can either run the FakeFaceEngine on a [real device](#actual-device) or a [virtual device/cuttlefish](#getting-started-on-a-virtual-device-cuttlefish). This document should
-help you to get started on either one.
+The face virtual hal is automatically built in in all debug builds (userdebug<br/>
+and eng) for the latest pixel devices and CF. The instructions in this doc<br/>
+applies to all
-After setting up a device, go ahead and try out [enrolling](#enrolling) & [authenticating](#authenticating)
+## Enabling Face Virtual HAL
-### Getting started on a Virtual Device (cuttlefish)
+On pixel devicse (non-CF), by default (after manufacture reset), Face VHAL is <br/>
+not enabled. Therefore real Face HAL is used. Face VHAL enabling is gated by the<br/>
+following two AND conditions:<br/>
+1. The Face VHAL feature flag (as part ofTrunk-development strategy) must be<br/>
+ turned on until the flags life-cycle ends.
+2. The Face VHAL must be enabled via sysprop.
+See the adb commands below
-Note, I'm running this via a cloudtop virtual device.
+## Getting Stared
-1. Setup cuttlefish on cloudtop, See [this](https://g3doc.corp.google.com/company/teams/android/teampages/acloud/getting_started.md?cl=head) for more details.
-2. acloud create --local-image
-3. Enter in the shell command to disable hidl
+A basic use case for a successful authentication via Face VHAL is given as an
+exmple below.
+
+### Enabling VHAL
```shell
$ adb root
-$ adb shell settings put secure com.android.server.biometrics.AuthService.hidlDisabled 1
-$ adb reboot
-```
-4. You should now be able to do fake enrollments and authentications (as seen down below)
-
-### Actual Device
-
-1. Modify your real devices make file (I.E. vendor/google/products/{YOUR_DEVICE}.mk)
-2. Ensure that there is no other face HAL that is being included by the device
-3. Add the following
-```
-PRODUCT_COPY_FILES += \
- frameworks/native/data/etc/android.hardware.biometrics.face.xml:$(TARGET_COPY_OUT_PRODUCT)/etc/permissions/android.hardware.biometrics.face.xml
-
-PRODUCT_PACKAGES += \
- android.hardware.biometrics.face-service.example \
-
-```
-4. Now build and flash m -j120 && flash
-5. Run the following commands
-
-```shell
-# This is a temporary workaround
-$ adb root
-$ adb shell setprop persist.vendor.face.virtual.type RGB
+$ adb shell device_config put biometrics_framework com.android.server.biometrics.face_vhal_feature true
+$ adb shell settings put secure biometric_virtual_enabled 1
$ adb shell setprop persist.vendor.face.virtual.strength strong
-$ adb shell locksettings set-pin 0000
+$ adb shell setprop persist.vendor.face.virtual.type RGB
$ adb reboot
```
-## Enrolling
+### Direct Enrollment
```shell
-# authenticar_id,bucket_id:duration:(true|false)....
-$ adb shell setprop vendor.face.virtual.next_enrollment 1,0:500:true,5:250:true,10:150:true,15:500:true
-$ adb shell am start -n com.android.settings/.biometrics.face.FaceEnrollIntroduction
-# If you would like to get rid of the enrollment, run the follwoing command
-$ adb shell setprop persist.vendor.face.virtual.enrollments \"\"
+$ adb shell locksettings set-pin 0000
+$ adb shell setprop persist.vendor.face.virtual.enrollments 1
+$ adb shell cmd face syncadb shell cmd face sync
```
## Authenticating
-```shell
-# If enrollment hasn't been setup
-$ adb shell setprop persist.vendor.face.virtual.enrollments 1
-$ adb shell cmd face sync
-# After enrollment has been setup
+To authenticate successfully, the captured (hit) must match the enrollment id<br/>
+set above. To trigger authentication failure, set the hit id to a different value.
+`shell
$ adb shell setprop vendor.face.virtual.operation_authenticate_duration 800
-$ adb shell setprop vendor.face.virtual.enrollment_hit 1
-# Power button press to simulate auth
-$ adb shell input keyevent 26
+$ adb shell setprop vendor.face.virtual.enrollment_hit 1`
+
+### AcquiredInfo
+
+AcquiredInfo codes can be sent during authentication by specifying the sysprop.<br/>
+The codes is sent in sequence and in the interval of operation_authentication_duration/numberOfAcquiredInfoCode
+`shell
+$ adb shell setprop vendor.face.virtual.operation_authenticate_acquired 6,9,1013`
+Refer to [AcquiredInfo.aidl](https://source.corp.google.com/h/googleplex-android/platform/superproject/main/+/main:hardware/interfaces/biometrics/face/aidl/android/hardware/biometrics/face/AcquiredInfo.aidl) for full face acquiredInfo codes.
+Note: For vendor specific acquired info, acquiredInfo = 1000 + vendorCode.
+
+### Error Insertion
+
+Error can be inserted during authentction by specifying the authenticate_error
+sysprop. `shell $ adb shell setprop
+vendor.face.virtual.operation_authenticate_error 4` Refer to
+[Error.aidl](https://source.corp.google.com/h/googleplex-android/platform/superproject/main/+/main:hardware/interfaces/biometrics/face/aidl/android/hardware/biometrics/face/Error.aidl)
+for full face error codes
+
+## Enrollment via Settings
+
+Enrollment process is specified by sysprop `next_enrollment` in the following
+format
+
+```shell
+Format: <id>:<progress_ms-[acquiredInfo,...],...:<success>
+ ----:-----------------------------------:---------
+ | | |--->sucess (true/false)
+ | |--> progress_step(s)
+ |
+ |-->enrollment_id
+
+E.g.
+$ adb shell setprop vendor.face.virtual.next_enrollment 1:6000-[21,8,1,1108,1,10,1113,1,1118,1124]:true
```
+
+If next_enrollment prop is not set, the following default value is used:<br/>
+ defaultNextEnrollment="1:1000-[21,7,1,1103],1500-[1108,1],2000-[1113,1],2500-[1118,1]:true"<br/>
+Note: Enrollment data and configuration can be supported upon request in case of needs
+
+## Lockout
+
+Device lockout is based on the number of consecutive failed authentication attempts. There are a few
+flavors of lockout mechanisms that are supported by virtula HAL <br/>
+
+### Permanent Lockout
+
+There are two sysprop to control permanent lockout <br/>
+1. general lockout feature enable <br/>
+2. threshold of failed attempts <br/>
+`shell
+$ adb shell setprop persist.vendor.face.virtual.lockout_enable true
+$ adb shell setprop persist.vendor.face.virtual.lockout_permanent_threshold 3`
+
+### Temporary Lockout
+
+There are a few parameters to control temporary lockout (aka timed lockout): <br/>
+1. enable lockout (general lockout feature enable, and timed lcokout enable) <br/>
+2. threshold of failed attempts <br/>
+3. timeout in ms <br/>
+`shell
+$ adb shell setprop persist.vendor.face.virtual.lockout_enable true
+$ adb shell setprop persist.vendor.face.virtual.lockout_timed_enable true
+$ adb shell setprop persist.vendor.face.virtual.lockout_timed_threshold 5
+$ adb shell setprop persist.vendor.face.virtual.lockout_timed_duration 10000`
+
+### Forced Lockout
+
+A permanent lockout can be inserted on next authentication attempt independent of the failed <br/>
+attempt count. This is a feature purely for test purpose.
+`shell
+$ adb shell setprop persist.vendor.face.virtual.lockout true`
diff --git a/biometrics/face/aidl/default/Session.cpp b/biometrics/face/aidl/default/Session.cpp
index 1188459..6f3f2fc 100644
--- a/biometrics/face/aidl/default/Session.cpp
+++ b/biometrics/face/aidl/default/Session.cpp
@@ -18,6 +18,9 @@
#include "Session.h"
+#undef LOG_TAG
+#define LOG_TAG "FaceVirtualHalSession"
+
namespace aidl::android::hardware::biometrics::face {
constexpr size_t MAX_WORKER_QUEUE_SIZE = 5;
@@ -172,4 +175,10 @@
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus Session::enrollWithOptions(const FaceEnrollOptions& options,
+ std::shared_ptr<common::ICancellationSignal>* out) {
+ return enroll(options.hardwareAuthToken, options.enrollmentType, options.features,
+ options.nativeHandlePreview, out);
+}
+
} // namespace aidl::android::hardware::biometrics::face
diff --git a/biometrics/face/aidl/default/Session.h b/biometrics/face/aidl/default/Session.h
index 7ca6a1f..ce6e7f1 100644
--- a/biometrics/face/aidl/default/Session.h
+++ b/biometrics/face/aidl/default/Session.h
@@ -19,6 +19,7 @@
#include <random>
#include <aidl/android/hardware/biometrics/face/BnSession.h>
+#include <aidl/android/hardware/biometrics/face/FaceEnrollOptions.h>
#include <aidl/android/hardware/biometrics/face/ISessionCallback.h>
#include "FakeFaceEngine.h"
@@ -88,6 +89,10 @@
ndk::ScopedAStatus onContextChanged(const common::OperationContext& context) override;
+ ndk::ScopedAStatus enrollWithOptions(
+ const FaceEnrollOptions& options,
+ std::shared_ptr<common::ICancellationSignal>* out) override;
+
private:
std::unique_ptr<FakeFaceEngine> mEngine;
std::shared_ptr<ISessionCallback> mCb;
diff --git a/biometrics/face/aidl/default/apex/Android.bp b/biometrics/face/aidl/default/apex/Android.bp
index 0ae1463..86c4e12 100644
--- a/biometrics/face/aidl/default/apex/Android.bp
+++ b/biometrics/face/aidl/default/apex/Android.bp
@@ -17,7 +17,7 @@
}
apex {
- name: "com.android.hardware.biometrics.face",
+ name: "com.android.hardware.biometrics.face.virtual",
manifest: "manifest.json",
file_contexts: "file_contexts",
key: "com.android.hardware.key",
@@ -31,11 +31,9 @@
],
prebuilts: [
// init_rc
- "face-default-apex.rc",
+ "face-example-apex.rc",
// vintf_fragment
- "face-default-apex.xml",
- // permission
- "android.hardware.biometrics.face.prebuilt.xml",
+ "face-example-apex.xml",
],
overrides: [
@@ -44,23 +42,21 @@
}
prebuilt_etc {
- name: "face-default-apex.rc",
- src: ":gen-face-default-apex.rc",
- vendor: true,
+ name: "face-example-apex.rc",
+ src: ":gen-face-example-apex.rc",
installable: false,
}
genrule {
- name: "gen-face-default-apex.rc",
- srcs: [":face-default.rc"],
- out: ["face-default-apex.rc"],
- cmd: "sed -e 's@/vendor/bin/@/apex/com.android.hardware.biometrics.face/bin/@' $(in) > $(out)",
+ name: "gen-face-example-apex.rc",
+ srcs: [":face-example.rc"],
+ out: ["face-example-apex.rc"],
+ cmd: "sed -e 's@/vendor/bin/@/apex/com.android.hardware.biometrics.face.virtual/bin/@' $(in) > $(out)",
}
prebuilt_etc {
- name: "face-default-apex.xml",
- src: ":face-default.xml",
+ name: "face-example-apex.xml",
+ src: ":face-example.xml",
sub_dir: "vintf",
- vendor: true,
installable: false,
}
diff --git a/biometrics/face/aidl/default/apex/manifest.json b/biometrics/face/aidl/default/apex/manifest.json
index 4d46896..e7d177b 100644
--- a/biometrics/face/aidl/default/apex/manifest.json
+++ b/biometrics/face/aidl/default/apex/manifest.json
@@ -1,4 +1,4 @@
{
- "name": "com.android.hardware.biometrics.face",
- "version": 1
+ "name": "com.android.hardware.biometrics.face.virtual",
+ "version": 2
}
diff --git a/biometrics/face/aidl/default/face-default.rc b/biometrics/face/aidl/default/face-default.rc
deleted file mode 100644
index f6499f0..0000000
--- a/biometrics/face/aidl/default/face-default.rc
+++ /dev/null
@@ -1,5 +0,0 @@
-service vendor.face-default /vendor/bin/hw/android.hardware.biometrics.face-service.example
- class hal
- user nobody
- group nobody
-
diff --git a/biometrics/face/aidl/default/face-example.rc b/biometrics/face/aidl/default/face-example.rc
new file mode 100644
index 0000000..b0d82c6
--- /dev/null
+++ b/biometrics/face/aidl/default/face-example.rc
@@ -0,0 +1,8 @@
+service vendor.face-example /vendor/bin/hw/android.hardware.biometrics.face-service.example
+ class hal
+ user nobody
+ group nobody
+ interface aidl android.hardware.biometrics.face.IFace/virtual
+ oneshot
+ disabled
+
diff --git a/biometrics/face/aidl/default/face-default.xml b/biometrics/face/aidl/default/face-example.xml
similarity index 67%
rename from biometrics/face/aidl/default/face-default.xml
rename to biometrics/face/aidl/default/face-example.xml
index 8f2fbb8..2b39b3d 100644
--- a/biometrics/face/aidl/default/face-default.xml
+++ b/biometrics/face/aidl/default/face-example.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.biometrics.face</name>
- <version>3</version>
- <fqname>IFace/default</fqname>
+ <version>4</version>
+ <fqname>IFace/virtual</fqname>
</hal>
</manifest>
diff --git a/biometrics/face/aidl/default/face.sysprop b/biometrics/face/aidl/default/face.sysprop
index 6b0f37f..95b0b43 100644
--- a/biometrics/face/aidl/default/face.sysprop
+++ b/biometrics/face/aidl/default/face.sysprop
@@ -92,7 +92,7 @@
api_name: "challenge"
}
-# if locked out
+# if forced to lock out (Default to false)
prop {
prop_name: "vendor.face.virtual.lockout"
type: Boolean
@@ -157,3 +157,66 @@
access: ReadWrite
api_name: "operation_authenticate_duration"
}
+
+# insert error for authenticate operations
+prop {
+ prop_name: "vendor.face.virtual.operation_authenticate_error"
+ type: Integer
+ scope: Internal
+ access: ReadWrite
+ api_name: "operation_authenticate_error"
+}
+
+# acquired info during authentication in format of sequence
+prop {
+ prop_name: "vendor.face.virtual.operation_authenticate_acquired"
+ type: String
+ scope: Internal
+ access: ReadWrite
+ api_name: "operation_authenticate_acquired"
+}
+
+# whether support lockout based on the failed auth attempts (default: false)
+prop {
+ prop_name: "persist.vendor.face.virtual.lockout_enable"
+ type: Boolean
+ scope: Internal
+ access: ReadWrite
+ api_name: "lockout_enable"
+}
+
+# whether support timed_lockout based on the failed auth attempts (default: false)
+prop {
+ prop_name: "persist.vendor.face.virtual.lockout_timed_enable"
+ type: Boolean
+ scope: Internal
+ access: ReadWrite
+ api_name: "lockout_timed_enable"
+}
+
+# temperory lockout threshold in number of consecutive failed auth attempts
+prop {
+ prop_name: "persist.vendor.face.virtual.lockout_timed_threshold"
+ type: Integer
+ scope: Internal
+ access: ReadWrite
+ api_name: "lockout_timed_threshold"
+}
+
+# temporary lockout duration in ms (default: 10000ms)
+prop {
+ prop_name: "persist.vendor.face.virtual.lockout_timed_duration"
+ type: Integer
+ scope: Internal
+ access: ReadWrite
+ api_name: "lockout_timed_duration"
+}
+
+# permanently lockout threshold in number of consecutive failed auth attempts
+prop {
+ prop_name: "persist.vendor.face.virtual.lockout_permanent_threshold"
+ type: Integer
+ scope: Internal
+ access: ReadWrite
+ api_name: "lockout_permanent_threshold"
+}
diff --git a/biometrics/face/aidl/default/main.cpp b/biometrics/face/aidl/default/main.cpp
index b7274e3..38e1c63 100644
--- a/biometrics/face/aidl/default/main.cpp
+++ b/biometrics/face/aidl/default/main.cpp
@@ -27,9 +27,11 @@
ABinderProcess_setThreadPoolMaxThreadCount(0);
std::shared_ptr<Face> hal = ndk::SharedRefBase::make<Face>();
- const std::string instance = std::string(Face::descriptor) + "/default";
- binder_status_t status = AServiceManager_addService(hal->asBinder().get(), instance.c_str());
+ const std::string instance = std::string(Face::descriptor) + "/virtual";
+ binder_status_t status =
+ AServiceManager_registerLazyService(hal->asBinder().get(), instance.c_str());
CHECK_EQ(status, STATUS_OK);
+ AServiceManager_forceLazyServicesPersist(true);
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
diff --git a/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp b/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp
index c8ad6b7..69c9bf4 100644
--- a/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp
+++ b/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp
@@ -45,6 +45,7 @@
};
::ndk::ScopedAStatus onEnrollmentProgress(int32_t enrollmentId, int32_t remaining) override {
if (remaining == 0) mLastEnrolled = enrollmentId;
+ mRemaining = remaining;
return ndk::ScopedAStatus::ok();
};
@@ -128,6 +129,7 @@
bool mAuthenticatorIdInvalidated = false;
bool mLockoutPermanent = false;
int mInteractionDetectedCount = 0;
+ int mRemaining = -1;
};
class FakeFaceEngineTest : public ::testing::Test {
@@ -193,7 +195,7 @@
}
TEST_F(FakeFaceEngineTest, Enroll) {
- FaceHalProperties::next_enrollment("1,0:30:true,1:0:true,2:0:true,3:0:true,4:0:true");
+ FaceHalProperties::next_enrollment("1,0:1000-[21,5,6,7,1],1100-[1118,1108,1]:true");
keymaster::HardwareAuthToken hat{.mac = {2, 4}};
mEngine.enrollImpl(mCallback.get(), hat, {} /*enrollmentType*/, {} /*features*/,
mCancel.get_future());
@@ -201,10 +203,11 @@
ASSERT_EQ(1, FaceHalProperties::enrollments().size());
ASSERT_EQ(1, FaceHalProperties::enrollments()[0].value());
ASSERT_EQ(1, mCallback->mLastEnrolled);
+ ASSERT_EQ(0, mCallback->mRemaining);
}
TEST_F(FakeFaceEngineTest, EnrollFails) {
- FaceHalProperties::next_enrollment("1,0:30:true,1:0:true,2:0:true,3:0:true,4:0:false");
+ FaceHalProperties::next_enrollment("1,0:1000-[21,5,6,7,1],1100-[1118,1108,1]:false");
keymaster::HardwareAuthToken hat{.mac = {2, 4}};
mEngine.enrollImpl(mCallback.get(), hat, {} /*enrollmentType*/, {} /*features*/,
mCancel.get_future());
@@ -213,7 +216,7 @@
}
TEST_F(FakeFaceEngineTest, EnrollCancel) {
- FaceHalProperties::next_enrollment("1,0:30:true,1:0:true,2:0:true,3:0:true,4:0:false");
+ FaceHalProperties::next_enrollment("1:2000-[21,8,9],300:false");
keymaster::HardwareAuthToken hat{.mac = {2, 4}};
mCancel.set_value();
mEngine.enrollImpl(mCallback.get(), hat, {} /*enrollmentType*/, {} /*features*/,
@@ -221,7 +224,7 @@
ASSERT_EQ(Error::CANCELED, mCallback->mError);
ASSERT_EQ(-1, mCallback->mLastEnrolled);
ASSERT_EQ(0, FaceHalProperties::enrollments().size());
- ASSERT_FALSE(FaceHalProperties::next_enrollment().has_value());
+ ASSERT_TRUE(FaceHalProperties::next_enrollment().has_value());
}
TEST_F(FakeFaceEngineTest, Authenticate) {
@@ -245,7 +248,7 @@
FaceHalProperties::enrollments({3});
FaceHalProperties::enrollment_hit(100);
mEngine.authenticateImpl(mCallback.get(), 0 /* operationId*/, mCancel.get_future());
- ASSERT_EQ(Error::UNABLE_TO_PROCESS, mCallback->mError);
+ ASSERT_EQ(Error::TIMEOUT, mCallback->mError);
ASSERT_TRUE(mCallback->mAuthenticateFailed);
}
@@ -380,4 +383,4 @@
ASSERT_FALSE(mCallback->mAuthenticateFailed);
}
-} // namespace aidl::android::hardware::biometrics::face
\ No newline at end of file
+} // namespace aidl::android::hardware::biometrics::face
diff --git a/biometrics/face/aidl/default/tests/FakeLockoutTrackerTest.cpp b/biometrics/face/aidl/default/tests/FakeLockoutTrackerTest.cpp
new file mode 100644
index 0000000..fa07d1d
--- /dev/null
+++ b/biometrics/face/aidl/default/tests/FakeLockoutTrackerTest.cpp
@@ -0,0 +1,216 @@
+/*
+ * 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/biometrics/face/BnSessionCallback.h>
+#include <android/binder_process.h>
+#include <face.sysprop.h>
+#include <gtest/gtest.h>
+
+#include <android-base/logging.h>
+
+#include "FakeLockoutTracker.h"
+#include "util/Util.h"
+
+using namespace ::android::face::virt;
+using namespace ::aidl::android::hardware::biometrics::face;
+
+namespace aidl::android::hardware::biometrics::face {
+
+class TestSessionCallback : public BnSessionCallback {
+ public:
+ ndk::ScopedAStatus onChallengeGenerated(int64_t /*challenge*/) override {
+ return ndk::ScopedAStatus::ok();
+ };
+ ::ndk::ScopedAStatus onChallengeRevoked(int64_t /*challenge*/) override {
+ return ndk::ScopedAStatus::ok();
+ };
+ ::ndk::ScopedAStatus onError(face::Error, int32_t /*vendorCode*/) override {
+ return ndk::ScopedAStatus::ok();
+ };
+ ::ndk::ScopedAStatus onEnrollmentProgress(int32_t /*enrollmentId*/,
+ int32_t /*remaining*/) override {
+ return ndk::ScopedAStatus::ok();
+ };
+ ::ndk::ScopedAStatus onAuthenticationSucceeded(int32_t /*enrollmentId*/,
+ const keymaster::HardwareAuthToken&) override {
+ return ndk::ScopedAStatus::ok();
+ };
+ ::ndk::ScopedAStatus onAuthenticationFailed() override { return ndk::ScopedAStatus::ok(); };
+ ::ndk::ScopedAStatus onInteractionDetected() override { return ndk::ScopedAStatus::ok(); };
+ ::ndk::ScopedAStatus onEnrollmentsEnumerated(const std::vector<int32_t>&) override {
+ return ndk::ScopedAStatus::ok();
+ };
+ ::ndk::ScopedAStatus onEnrollmentsRemoved(
+ const std::vector<int32_t>& /*enrollmentIds*/) override {
+ return ndk::ScopedAStatus::ok();
+ };
+ ::ndk::ScopedAStatus onAuthenticatorIdRetrieved(int64_t /*authenticatorId*/) override {
+ return ndk::ScopedAStatus::ok();
+ };
+ ::ndk::ScopedAStatus onAuthenticatorIdInvalidated(int64_t /*authenticatorId*/) override {
+ return ndk::ScopedAStatus::ok();
+ };
+ ::ndk::ScopedAStatus onEnrollmentFrame(const EnrollmentFrame&) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onFeaturesRetrieved(const std::vector<Feature>&) {
+ return ndk::ScopedAStatus::ok();
+ };
+ ::ndk::ScopedAStatus onFeatureSet(Feature) override { return ndk::ScopedAStatus::ok(); }
+ ::ndk::ScopedAStatus onSessionClosed() override { return ndk::ScopedAStatus::ok(); }
+ ::ndk::ScopedAStatus onAuthenticationFrame(const AuthenticationFrame&) override {
+ return ndk::ScopedAStatus::ok();
+ }
+
+ ndk::ScopedAStatus onLockoutTimed(int64_t timeLeft) override {
+ mLockoutTimed++;
+ mTimeLeft = timeLeft;
+ return ndk::ScopedAStatus::ok();
+ };
+ ::ndk::ScopedAStatus onLockoutPermanent() override {
+ mLockoutPermanent++;
+ return ndk::ScopedAStatus::ok();
+ };
+ ::ndk::ScopedAStatus onLockoutCleared() override {
+ mTimeLeft = 0;
+ mLockoutTimed = 0;
+ mLockoutPermanent = 0;
+ return ndk::ScopedAStatus::ok();
+ };
+
+ int64_t mTimeLeft = 0;
+ int mLockoutTimed = 0;
+ int mLockoutPermanent = 0;
+};
+
+class FakeLockoutTrackerTest : public ::testing::Test {
+ protected:
+ static constexpr int32_t LOCKOUT_TIMED_THRESHOLD = 3;
+ static constexpr int32_t LOCKOUT_PERMANENT_THRESHOLD = 5;
+ static constexpr int32_t LOCKOUT_TIMED_DURATION = 100;
+
+ void SetUp() override {
+ FaceHalProperties::lockout_timed_threshold(LOCKOUT_TIMED_THRESHOLD);
+ FaceHalProperties::lockout_timed_duration(LOCKOUT_TIMED_DURATION);
+ FaceHalProperties::lockout_permanent_threshold(LOCKOUT_PERMANENT_THRESHOLD);
+ mCallback = ndk::SharedRefBase::make<TestSessionCallback>();
+ }
+
+ void TearDown() override {
+ // reset to default
+ FaceHalProperties::lockout_timed_threshold(5);
+ FaceHalProperties::lockout_timed_duration(20);
+ FaceHalProperties::lockout_permanent_threshold(10000);
+ FaceHalProperties::lockout_enable(false);
+ FaceHalProperties::lockout(false);
+ }
+
+ FakeLockoutTracker mLockoutTracker;
+ std::shared_ptr<TestSessionCallback> mCallback;
+};
+
+TEST_F(FakeLockoutTrackerTest, addFailedAttemptDisable) {
+ FaceHalProperties::lockout_enable(false);
+ for (int i = 0; i < LOCKOUT_TIMED_THRESHOLD + 1; i++)
+ mLockoutTracker.addFailedAttempt(mCallback.get());
+ ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kNone);
+ ASSERT_EQ(0, mCallback->mLockoutTimed);
+}
+
+TEST_F(FakeLockoutTrackerTest, addFailedAttemptPermanent) {
+ FaceHalProperties::lockout_enable(true);
+ ASSERT_FALSE(mLockoutTracker.checkIfLockout(mCallback.get()));
+ for (int i = 0; i < LOCKOUT_PERMANENT_THRESHOLD - 1; i++)
+ mLockoutTracker.addFailedAttempt(mCallback.get());
+ ASSERT_NE(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kPermanent);
+ ASSERT_EQ(0, mCallback->mLockoutPermanent);
+ mLockoutTracker.addFailedAttempt(mCallback.get());
+ ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kPermanent);
+ ASSERT_EQ(1, mCallback->mLockoutPermanent);
+ ASSERT_TRUE(mLockoutTracker.checkIfLockout(mCallback.get()));
+ ASSERT_EQ(2, mCallback->mLockoutPermanent);
+}
+
+TEST_F(FakeLockoutTrackerTest, addFailedAttemptLockoutTimed) {
+ FaceHalProperties::lockout_enable(true);
+ FaceHalProperties::lockout_timed_enable(true);
+ ASSERT_FALSE(mLockoutTracker.checkIfLockout(mCallback.get()));
+ for (int i = 0; i < LOCKOUT_TIMED_THRESHOLD; i++)
+ mLockoutTracker.addFailedAttempt(mCallback.get());
+ ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kTimed);
+ ASSERT_EQ(1, mCallback->mLockoutTimed);
+ ASSERT_TRUE(mLockoutTracker.checkIfLockout(mCallback.get()));
+ ASSERT_EQ(2, mCallback->mLockoutTimed);
+ // time left
+ int N = 5;
+ int64_t prevTimeLeft = INT_MAX;
+ for (int i = 0; i < N; i++) {
+ SLEEP_MS(LOCKOUT_TIMED_DURATION / N + 1);
+ int64_t currTimeLeft = mLockoutTracker.getLockoutTimeLeft();
+ ASSERT_TRUE(currTimeLeft < prevTimeLeft);
+ prevTimeLeft = currTimeLeft;
+ }
+ SLEEP_MS(LOCKOUT_TIMED_DURATION / N);
+ ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kNone);
+}
+
+TEST_F(FakeLockoutTrackerTest, addFailedAttemptLockout_TimedThenPermanent) {
+ FaceHalProperties::lockout_enable(true);
+ FaceHalProperties::lockout_timed_enable(true);
+ ASSERT_FALSE(mLockoutTracker.checkIfLockout(mCallback.get()));
+ for (int i = 0; i < LOCKOUT_TIMED_THRESHOLD; i++)
+ mLockoutTracker.addFailedAttempt(mCallback.get());
+ ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kTimed);
+ SLEEP_MS(LOCKOUT_TIMED_DURATION + 20);
+ ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kNone);
+ for (int i = 0; i < LOCKOUT_PERMANENT_THRESHOLD - LOCKOUT_TIMED_THRESHOLD; i++)
+ mLockoutTracker.addFailedAttempt(mCallback.get());
+ ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kPermanent);
+}
+
+TEST_F(FakeLockoutTrackerTest, addFailedAttemptLockoutTimedTwice) {
+ FaceHalProperties::lockout_enable(true);
+ FaceHalProperties::lockout_timed_enable(true);
+ ASSERT_FALSE(mLockoutTracker.checkIfLockout(mCallback.get()));
+ ASSERT_EQ(0, mCallback->mLockoutTimed);
+ for (int i = 0; i < LOCKOUT_TIMED_THRESHOLD; i++)
+ mLockoutTracker.addFailedAttempt(mCallback.get());
+ SLEEP_MS(LOCKOUT_TIMED_DURATION / 2);
+ mLockoutTracker.addFailedAttempt(mCallback.get());
+ SLEEP_MS(LOCKOUT_TIMED_DURATION);
+ ASSERT_EQ(2, mCallback->mLockoutTimed);
+ ASSERT_TRUE(mLockoutTracker.checkIfLockout(mCallback.get()));
+ SLEEP_MS(LOCKOUT_TIMED_DURATION);
+ ASSERT_FALSE(mLockoutTracker.checkIfLockout(mCallback.get()));
+}
+
+TEST_F(FakeLockoutTrackerTest, resetLockout) {
+ FaceHalProperties::lockout_enable(true);
+ ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kNone);
+ for (int i = 0; i < LOCKOUT_PERMANENT_THRESHOLD; i++)
+ mLockoutTracker.addFailedAttempt(mCallback.get());
+ ASSERT_EQ(mLockoutTracker.getMode(), FakeLockoutTracker::LockoutMode::kPermanent);
+ mLockoutTracker.reset();
+ ASSERT_FALSE(mLockoutTracker.checkIfLockout(mCallback.get()));
+}
+
+} // namespace aidl::android::hardware::biometrics::face
+
+int main(int argc, char** argv) {
+ testing::InitGoogleTest(&argc, argv);
+ ABinderProcess_startThreadPool();
+ return RUN_ALL_TESTS();
+}
diff --git a/biometrics/fingerprint/aidl/Android.bp b/biometrics/fingerprint/aidl/Android.bp
index c543a93..1a099a5 100644
--- a/biometrics/fingerprint/aidl/Android.bp
+++ b/biometrics/fingerprint/aidl/Android.bp
@@ -14,7 +14,7 @@
"android/hardware/biometrics/fingerprint/**/*.aidl",
],
imports: [
- "android.hardware.biometrics.common-V3",
+ "android.hardware.biometrics.common-V4",
"android.hardware.keymaster-V4",
],
stability: "vintf",
@@ -50,5 +50,5 @@
},
],
- frozen: true,
+ frozen: false,
}
diff --git a/biometrics/fingerprint/aidl/default/Android.bp b/biometrics/fingerprint/aidl/default/Android.bp
index 1133b13..115e5b0 100644
--- a/biometrics/fingerprint/aidl/default/Android.bp
+++ b/biometrics/fingerprint/aidl/default/Android.bp
@@ -31,8 +31,8 @@
static_libs: [
"libandroid.hardware.biometrics.fingerprint.VirtualProps",
"libbase",
- "android.hardware.biometrics.fingerprint-V3-ndk",
- "android.hardware.biometrics.common-V3-ndk",
+ "android.hardware.biometrics.fingerprint-V4-ndk",
+ "android.hardware.biometrics.common-V4-ndk",
"android.hardware.biometrics.common.thread",
"android.hardware.biometrics.common.util",
"android.hardware.keymaster-V4-ndk",
@@ -55,8 +55,8 @@
],
static_libs: [
"libandroid.hardware.biometrics.fingerprint.VirtualProps",
- "android.hardware.biometrics.fingerprint-V3-ndk",
- "android.hardware.biometrics.common-V3-ndk",
+ "android.hardware.biometrics.fingerprint-V4-ndk",
+ "android.hardware.biometrics.common-V4-ndk",
"android.hardware.keymaster-V4-ndk",
"android.hardware.biometrics.common.util",
],
@@ -81,8 +81,8 @@
],
static_libs: [
"libandroid.hardware.biometrics.fingerprint.VirtualProps",
- "android.hardware.biometrics.fingerprint-V3-ndk",
- "android.hardware.biometrics.common-V3-ndk",
+ "android.hardware.biometrics.fingerprint-V4-ndk",
+ "android.hardware.biometrics.common-V4-ndk",
"android.hardware.keymaster-V4-ndk",
"android.hardware.biometrics.common.util",
],
@@ -105,8 +105,8 @@
],
static_libs: [
"libandroid.hardware.biometrics.fingerprint.VirtualProps",
- "android.hardware.biometrics.fingerprint-V3-ndk",
- "android.hardware.biometrics.common-V3-ndk",
+ "android.hardware.biometrics.fingerprint-V4-ndk",
+ "android.hardware.biometrics.common-V4-ndk",
"android.hardware.keymaster-V4-ndk",
"android.hardware.biometrics.common.util",
],
@@ -131,8 +131,8 @@
],
static_libs: [
"libandroid.hardware.biometrics.fingerprint.VirtualProps",
- "android.hardware.biometrics.fingerprint-V3-ndk",
- "android.hardware.biometrics.common-V3-ndk",
+ "android.hardware.biometrics.fingerprint-V4-ndk",
+ "android.hardware.biometrics.common-V4-ndk",
"android.hardware.keymaster-V4-ndk",
"android.hardware.biometrics.common.util",
],
diff --git a/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp b/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp
index 54076c8..4e80052 100644
--- a/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp
+++ b/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp
@@ -32,7 +32,9 @@
namespace aidl::android::hardware::biometrics::fingerprint {
FakeFingerprintEngine::FakeFingerprintEngine()
- : mRandom(std::mt19937::default_seed), mWorkMode(WorkMode::kIdle) {}
+ : mRandom(std::mt19937::default_seed),
+ mWorkMode(WorkMode::kIdle),
+ isLockoutTimerSupported(true) {}
void FakeFingerprintEngine::generateChallengeImpl(ISessionCallback* cb) {
BEGIN_OP(0);
@@ -142,7 +144,7 @@
return true;
}
auto enrollmentId = std::stoi(parts[0]);
- auto progress = parseEnrollmentCapture(parts[1]);
+ auto progress = Util::parseEnrollmentCapture(parts[1]);
for (size_t i = 0; i < progress.size(); i += 2) {
auto left = (progress.size() - i) / 2 - 1;
auto duration = progress[i][0];
@@ -193,7 +195,7 @@
int64_t now = Util::getSystemNanoTime();
int64_t duration = FingerprintHalProperties::operation_authenticate_duration().value_or(10);
auto acquired = FingerprintHalProperties::operation_authenticate_acquired().value_or("1");
- auto acquiredInfos = parseIntSequence(acquired);
+ auto acquiredInfos = Util::parseIntSequence(acquired);
int N = acquiredInfos.size();
if (N == 0) {
@@ -271,7 +273,7 @@
FingerprintHalProperties::operation_detect_interaction_duration().value_or(10);
auto acquired = FingerprintHalProperties::operation_detect_interaction_acquired().value_or("1");
- auto acquiredInfos = parseIntSequence(acquired);
+ auto acquiredInfos = Util::parseIntSequence(acquired);
int N = acquiredInfos.size();
int64_t now = Util::getSystemNanoTime();
@@ -305,15 +307,6 @@
SLEEP_MS(duration / N);
} while (!Util::hasElapsed(now, duration));
- auto id = FingerprintHalProperties::enrollment_hit().value_or(0);
- auto enrolls = FingerprintHalProperties::enrollments();
- auto isEnrolled = std::find(enrolls.begin(), enrolls.end(), id) != enrolls.end();
- if (id <= 0 || !isEnrolled) {
- LOG(ERROR) << "Fail: not enrolled";
- cb->onError(Error::UNABLE_TO_PROCESS, 0 /* vendorError */);
- return true;
- }
-
cb->onInteractionDetected();
return true;
@@ -386,7 +379,7 @@
return;
}
clearLockout(cb);
- isLockoutTimerAborted = true;
+ if (isLockoutTimerStarted) isLockoutTimerAborted = true;
}
void FakeFingerprintEngine::clearLockout(ISessionCallback* cb) {
@@ -450,76 +443,6 @@
return SensorLocation();
}
-std::vector<int32_t> FakeFingerprintEngine::parseIntSequence(const std::string& str,
- const std::string& sep) {
- std::vector<std::string> seqs = Util::split(str, sep);
- std::vector<int32_t> res;
-
- for (const auto& seq : seqs) {
- int32_t val;
- if (ParseInt(seq, &val)) {
- res.push_back(val);
- } else {
- LOG(WARNING) << "Invalid int sequence:" + str;
- res.clear();
- break;
- }
- }
-
- return res;
-}
-
-bool FakeFingerprintEngine::parseEnrollmentCaptureSingle(const std::string& str,
- std::vector<std::vector<int32_t>>& res) {
- std::vector<int32_t> defaultAcquiredInfo = {(int32_t)AcquiredInfo::GOOD};
- bool aborted = true;
-
- do {
- std::smatch sms;
- // Parses strings like "1000-[5,1]" or "500"
- std::regex ex("((\\d+)(-\\[([\\d|,]+)\\])?)");
- if (!regex_match(str.cbegin(), str.cend(), sms, ex)) break;
- int32_t duration;
- if (!ParseInt(sms.str(2), &duration)) break;
- res.push_back({duration});
- if (!sms.str(4).empty()) {
- auto acqv = parseIntSequence(sms.str(4));
- if (acqv.empty()) break;
- res.push_back(acqv);
- } else
- res.push_back(defaultAcquiredInfo);
- aborted = false;
- } while (0);
-
- return !aborted;
-}
-
-std::vector<std::vector<int32_t>> FakeFingerprintEngine::parseEnrollmentCapture(
- const std::string& str) {
- std::vector<std::vector<int32_t>> res;
-
- std::string s(str);
- s.erase(std::remove_if(s.begin(), s.end(), ::isspace), s.end());
- bool aborted = false;
- std::smatch sms;
- // Parses strings like "1000-[5,1],500,800-[6,5,1]"
- // ---------- --- -----------
- // into parts: A B C
- while (regex_search(s, sms, std::regex("^(,)?(\\d+(-\\[[\\d|,]+\\])?)"))) {
- if (!parseEnrollmentCaptureSingle(sms.str(2), res)) {
- aborted = true;
- break;
- }
- s = sms.suffix();
- }
- if (aborted || s.length() != 0) {
- res.clear();
- LOG(ERROR) << "Failed to parse enrollment captures:" + str;
- }
-
- return res;
-}
-
std::pair<AcquiredInfo, int32_t> FakeFingerprintEngine::convertAcquiredInfo(int32_t code) {
std::pair<AcquiredInfo, int32_t> res;
if (code > FINGERPRINT_ACQUIRED_VENDOR_BASE) {
@@ -603,6 +526,7 @@
isLockoutTimerStarted = true;
}
void FakeFingerprintEngine::lockoutTimerExpired(ISessionCallback* cb) {
+ BEGIN_OP(0);
if (!isLockoutTimerAborted) {
clearLockout(cb);
}
diff --git a/biometrics/fingerprint/aidl/default/FakeFingerprintEngineSide.cpp b/biometrics/fingerprint/aidl/default/FakeFingerprintEngineSide.cpp
index a78cdcd..acb792d 100644
--- a/biometrics/fingerprint/aidl/default/FakeFingerprintEngineSide.cpp
+++ b/biometrics/fingerprint/aidl/default/FakeFingerprintEngineSide.cpp
@@ -27,9 +27,7 @@
namespace aidl::android::hardware::biometrics::fingerprint {
-FakeFingerprintEngineSide::FakeFingerprintEngineSide() : FakeFingerprintEngine() {
- isLockoutTimerSupported = true;
-}
+FakeFingerprintEngineSide::FakeFingerprintEngineSide() : FakeFingerprintEngine() {}
SensorLocation FakeFingerprintEngineSide::defaultSensorLocation() {
return SensorLocation{.sensorLocationX = defaultSensorLocationX,
diff --git a/biometrics/fingerprint/aidl/default/fingerprint-example.xml b/biometrics/fingerprint/aidl/default/fingerprint-example.xml
index e977b98..827813f 100644
--- a/biometrics/fingerprint/aidl/default/fingerprint-example.xml
+++ b/biometrics/fingerprint/aidl/default/fingerprint-example.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.biometrics.fingerprint</name>
- <version>3</version>
+ <version>4</version>
<fqname>IFingerprint/virtual</fqname>
</hal>
</manifest>
diff --git a/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngine.h b/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngine.h
index 2450115..15d8360 100644
--- a/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngine.h
+++ b/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngine.h
@@ -68,10 +68,6 @@
virtual void fingerDownAction();
- std::vector<int32_t> parseIntSequence(const std::string& str, const std::string& sep = ",");
-
- std::vector<std::vector<int32_t>> parseEnrollmentCapture(const std::string& str);
-
int32_t getLatency(const std::vector<std::optional<std::int32_t>>& latencyVec);
std::mt19937 mRandom;
@@ -110,8 +106,6 @@
static constexpr int32_t FINGERPRINT_ERROR_VENDOR_BASE = 1000;
std::pair<AcquiredInfo, int32_t> convertAcquiredInfo(int32_t code);
std::pair<Error, int32_t> convertError(int32_t code);
- bool parseEnrollmentCaptureSingle(const std::string& str,
- std::vector<std::vector<int32_t>>& res);
int32_t getRandomInRange(int32_t bound1, int32_t bound2);
bool checkSensorLockout(ISessionCallback*);
void clearLockout(ISessionCallback* cb);
diff --git a/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp b/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp
index fe405f4..eedcae1 100644
--- a/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp
+++ b/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp
@@ -357,7 +357,7 @@
FingerprintHalProperties::enrollment_hit({});
mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future());
mEngine.fingerDownAction();
- ASSERT_EQ(0, mCallback->mInteractionDetectedCount);
+ ASSERT_EQ(1, mCallback->mInteractionDetectedCount);
}
TEST_F(FakeFingerprintEngineTest, InteractionDetectNotEnrolled) {
@@ -365,7 +365,7 @@
FingerprintHalProperties::enrollment_hit(25);
mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future());
mEngine.fingerDownAction();
- ASSERT_EQ(0, mCallback->mInteractionDetectedCount);
+ ASSERT_EQ(1, mCallback->mInteractionDetectedCount);
}
TEST_F(FakeFingerprintEngineTest, InteractionDetectError) {
@@ -421,29 +421,29 @@
TEST_F(FakeFingerprintEngineTest, parseIntSequence) {
std::vector<int32_t> seqV;
- seqV = mEngine.parseIntSequence("");
+ seqV = Util::parseIntSequence("");
ASSERT_EQ(0, seqV.size());
- seqV = mEngine.parseIntSequence("2");
+ seqV = Util::parseIntSequence("2");
ASSERT_EQ(1, seqV.size());
ASSERT_EQ(2, seqV[0]);
- seqV = mEngine.parseIntSequence("2,3,4");
+ seqV = Util::parseIntSequence("2,3,4");
std::vector<int32_t> expV{2, 3, 4};
ASSERT_EQ(expV, seqV);
- seqV = mEngine.parseIntSequence("2,3,a");
+ seqV = Util::parseIntSequence("2,3,a");
ASSERT_EQ(0, seqV.size());
- seqV = mEngine.parseIntSequence("2, 3, 4");
+ seqV = Util::parseIntSequence("2, 3, 4");
ASSERT_EQ(expV, seqV);
- seqV = mEngine.parseIntSequence("123,456");
+ seqV = Util::parseIntSequence("123,456");
ASSERT_EQ(2, seqV.size());
std::vector<int32_t> expV1{123, 456};
ASSERT_EQ(expV1, seqV);
- seqV = mEngine.parseIntSequence("12f3,456");
+ seqV = Util::parseIntSequence("12f3,456");
ASSERT_EQ(0, seqV.size());
}
TEST_F(FakeFingerprintEngineTest, parseEnrollmentCaptureOk) {
std::vector<std::vector<int32_t>> ecV;
- ecV = mEngine.parseEnrollmentCapture("100,200,300");
+ ecV = Util::parseEnrollmentCapture("100,200,300");
ASSERT_EQ(6, ecV.size());
std::vector<std::vector<int32_t>> expE{{100}, {200}, {300}};
std::vector<int32_t> defC{1};
@@ -451,26 +451,26 @@
ASSERT_EQ(expE[i / 2], ecV[i]);
ASSERT_EQ(defC, ecV[i + 1]);
}
- ecV = mEngine.parseEnrollmentCapture("100");
+ ecV = Util::parseEnrollmentCapture("100");
ASSERT_EQ(2, ecV.size());
ASSERT_EQ(expE[0], ecV[0]);
ASSERT_EQ(defC, ecV[1]);
- ecV = mEngine.parseEnrollmentCapture("100-[5,6,7]");
+ ecV = Util::parseEnrollmentCapture("100-[5,6,7]");
std::vector<int32_t> expC{5, 6, 7};
ASSERT_EQ(2, ecV.size());
for (int i = 0; i < ecV.size(); i += 2) {
ASSERT_EQ(expE[i / 2], ecV[i]);
ASSERT_EQ(expC, ecV[i + 1]);
}
- ecV = mEngine.parseEnrollmentCapture("100-[5,6,7], 200, 300-[9,10]");
+ ecV = Util::parseEnrollmentCapture("100-[5,6,7], 200, 300-[9,10]");
std::vector<std::vector<int32_t>> expC1{{5, 6, 7}, {1}, {9, 10}};
ASSERT_EQ(6, ecV.size());
for (int i = 0; i < ecV.size(); i += 2) {
ASSERT_EQ(expE[i / 2], ecV[i]);
ASSERT_EQ(expC1[i / 2], ecV[i + 1]);
}
- ecV = mEngine.parseEnrollmentCapture("100-[5,6,7], 200-[2,1], 300-[9]");
+ ecV = Util::parseEnrollmentCapture("100-[5,6,7], 200-[2,1], 300-[9]");
std::vector<std::vector<int32_t>> expC2{{5, 6, 7}, {2, 1}, {9}};
ASSERT_EQ(ecV.size(), 6);
for (int i = 0; i < ecV.size(); i += 2) {
@@ -484,7 +484,7 @@
"100,2x0,300", "200-[f]", "a,b"};
std::vector<std::vector<int32_t>> ecV;
for (const auto& s : badStr) {
- ecV = mEngine.parseEnrollmentCapture(s);
+ ecV = Util::parseEnrollmentCapture(s);
ASSERT_EQ(ecV.size(), 0);
}
}
@@ -508,7 +508,7 @@
TEST_F(FakeFingerprintEngineTest, lockoutTimer) {
mEngine.startLockoutTimer(200, mCallback.get());
ASSERT_TRUE(mEngine.getLockoutTimerStarted());
- std::this_thread::sleep_for(std::chrono::milliseconds(210));
+ std::this_thread::sleep_for(std::chrono::milliseconds(250));
ASSERT_FALSE(mEngine.getLockoutTimerStarted());
ASSERT_TRUE(mCallback->mLockoutCleared);
}
diff --git a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
index 9451087..82dda61 100644
--- a/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
+++ b/bluetooth/1.0/vts/functional/VtsHalBluetoothV1_0TargetTest.cpp
@@ -43,6 +43,8 @@
#define HCI_MINIMUM_HCI_VERSION 5 // Bluetooth Core Specification 3.0 + HS
#define HCI_MINIMUM_LMP_VERSION 5 // Bluetooth Core Specification 3.0 + HS
+#define HCI_BLUETOOTH4_2_HCI_VERSION 8 // Bluetooth 4.2
+#define HCI_BLUETOOTH4_2_LMP_VERSION 8 // Bluetooth 4.2
#define NUM_HCI_COMMANDS_BANDWIDTH 1000
#define NUM_SCO_PACKETS_BANDWIDTH 1000
#define NUM_ACL_PACKETS_BANDWIDTH 1000
@@ -52,6 +54,7 @@
#define WAIT_FOR_ACL_DATA_TIMEOUT std::chrono::milliseconds(1000)
#define INTERFACE_CLOSE_DELAY_MS std::chrono::milliseconds(600)
+// { OCF, OGF << 2, Length of command parameters}
#define COMMAND_HCI_SHOULD_BE_UNKNOWN \
{ 0xff, 0x3B, 0x08, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }
#define COMMAND_HCI_READ_LOCAL_VERSION_INFORMATION \
@@ -64,6 +67,10 @@
{ 0x03, 0x0c, 0x00 }
#define COMMAND_HCI_WRITE_LOCAL_NAME \
{ 0x13, 0x0c, 0xf8 }
+#define COMMAND_HCI_READ_LOCAL_SUPPORTED_FEATURES \
+ { 0x03, 0x04 << 2, 0x00 } // OGF=0x04, OCF=0x0003 / 7.4 INFORMATIONAL PARAMETERS
+#define COMMAND_HCI_LE_READ_LOCAL_SUPPORTED_FEATURES \
+ { 0x03, 0x08 << 2, 0x00 } // OGF=0x08, OCF=0x0003 / 7.8 LE CONTROLLER COMMANDS
#define HCI_STATUS_SUCCESS 0x00
#define HCI_STATUS_UNKNOWN_HCI_COMMAND 0x01
@@ -85,6 +92,30 @@
#define EVENT_COMMAND_COMPLETE_FIRST_PARAM_BYTE 6
#define EVENT_LOCAL_HCI_VERSION_BYTE EVENT_COMMAND_COMPLETE_FIRST_PARAM_BYTE
#define EVENT_LOCAL_LMP_VERSION_BYTE EVENT_LOCAL_HCI_VERSION_BYTE + 3
+/**
+ * See Bluetooth Spec 5.4, Vol 2, Part C
+ * Link Manager Protocol, 3.3 Feature Mask Definition
+ *
+ * No | Supported Feature | Byte | Bit | Page
+ * ...
+ * 38 | LE Supported (Controller) | 4 | 6 | 0
+ * ...
+ */
+#define EVENT_LOCAL_SUPPORTED_FEATURES_LE_SUPPORTED_BYTE \
+ (EVENT_COMMAND_COMPLETE_FIRST_PARAM_BYTE + 0x04)
+#define EVENT_LOCAL_SUPPORTED_FEATURES_LE_SUPPORTED_BITMASK (0x01 << 6)
+/**
+ * See Bluetooth Spec 5.4, Vol 6, Part B
+ * 4.6 Feature Support
+ *
+ * Bit | Link Layer Feature
+ * ...
+ * 5 | LE Data Packet Length Extension
+ * ...
+ */
+#define EVENT_LOCAL_LE_SUPPORTED_FEATURES_DATA_LENGTH_EXTENSION_BYTE \
+ (EVENT_COMMAND_COMPLETE_FIRST_PARAM_BYTE + 0x00)
+#define EVENT_LOCAL_LE_SUPPORTED_FEATURES_DATA_LENGTH_BITMASK (0x01 << 5)
#define EVENT_CONNECTION_COMPLETE_PARAM_LENGTH 11
#define EVENT_CONNECTION_COMPLETE_TYPE 11
@@ -209,7 +240,7 @@
std::vector<uint16_t>& acl_handles);
void handle_no_ops();
void wait_for_event(bool timeout_is_error);
- void wait_for_command_complete_event(hidl_vec<uint8_t> cmd);
+ hidl_vec<uint8_t> wait_for_command_complete_event(hidl_vec<uint8_t> cmd);
int wait_for_completed_packets_event(uint16_t handle);
class BluetoothHciDeathRecipient : public hidl_death_recipient {
@@ -338,17 +369,19 @@
}
// Wait until a COMMAND_COMPLETE is received.
-void BluetoothHidlTest::wait_for_command_complete_event(hidl_vec<uint8_t> cmd) {
+hidl_vec<uint8_t> BluetoothHidlTest::wait_for_command_complete_event(hidl_vec<uint8_t> cmd) {
wait_for_event();
hidl_vec<uint8_t> event = event_queue.front();
event_queue.pop();
- ASSERT_GT(event.size(),
+ EXPECT_GT(event.size(),
static_cast<size_t>(EVENT_COMMAND_COMPLETE_STATUS_BYTE));
- ASSERT_EQ(EVENT_COMMAND_COMPLETE, event[EVENT_CODE_BYTE]);
- ASSERT_EQ(cmd[0], event[EVENT_COMMAND_COMPLETE_OPCODE_LSBYTE]);
- ASSERT_EQ(cmd[1], event[EVENT_COMMAND_COMPLETE_OPCODE_LSBYTE + 1]);
- ASSERT_EQ(HCI_STATUS_SUCCESS, event[EVENT_COMMAND_COMPLETE_STATUS_BYTE]);
+ EXPECT_EQ(EVENT_COMMAND_COMPLETE, event[EVENT_CODE_BYTE]);
+ EXPECT_EQ(cmd[0], event[EVENT_COMMAND_COMPLETE_OPCODE_LSBYTE]);
+ EXPECT_EQ(cmd[1], event[EVENT_COMMAND_COMPLETE_OPCODE_LSBYTE + 1]);
+ EXPECT_EQ(HCI_STATUS_SUCCESS, event[EVENT_COMMAND_COMPLETE_STATUS_BYTE]);
+
+ return event;
}
// Send the command to read the controller's buffer sizes.
@@ -623,6 +656,36 @@
ASSERT_LE(HCI_MINIMUM_LMP_VERSION, event[EVENT_LOCAL_LMP_VERSION_BYTE]);
}
+/**
+ * VSR-5.3.14-007 MUST support Bluetooth 4.2 and Bluetooth LE Data Length Extension.
+ * VSR-5.3.14-008 MUST support Bluetooth Low Energy (BLE).
+ */
+// @VsrTest = 5.3.14-007
+// @VsrTest = 5.3.14-008
+TEST_P(BluetoothHidlTest, Bluetooth4_2) {
+ // Bluetooth 4.2+
+ hidl_vec<uint8_t> cmd = COMMAND_HCI_READ_LOCAL_VERSION_INFORMATION;
+ bluetooth->sendHciCommand(cmd);
+ auto event = wait_for_command_complete_event(cmd);
+
+ EXPECT_LE(HCI_BLUETOOTH4_2_HCI_VERSION, event[EVENT_LOCAL_HCI_VERSION_BYTE]);
+ EXPECT_LE(HCI_BLUETOOTH4_2_LMP_VERSION, event[EVENT_LOCAL_LMP_VERSION_BYTE]);
+
+ // BLE
+ cmd = COMMAND_HCI_READ_LOCAL_SUPPORTED_FEATURES;
+ bluetooth->sendHciCommand(cmd);
+ event = wait_for_command_complete_event(cmd);
+ EXPECT_TRUE(event[EVENT_LOCAL_SUPPORTED_FEATURES_LE_SUPPORTED_BYTE] &
+ EVENT_LOCAL_SUPPORTED_FEATURES_LE_SUPPORTED_BITMASK);
+
+ // BLE Data Length Extension
+ cmd = COMMAND_HCI_LE_READ_LOCAL_SUPPORTED_FEATURES;
+ bluetooth->sendHciCommand(cmd);
+ event = wait_for_command_complete_event(cmd);
+ EXPECT_TRUE(event[EVENT_LOCAL_LE_SUPPORTED_FEATURES_DATA_LENGTH_EXTENSION_BYTE] &
+ EVENT_LOCAL_LE_SUPPORTED_FEATURES_DATA_LENGTH_BITMASK);
+}
+
// Send an unknown HCI command and wait for the error message.
TEST_P(BluetoothHidlTest, HciUnknownCommand) {
hidl_vec<uint8_t> cmd = COMMAND_HCI_SHOULD_BE_UNKNOWN;
diff --git a/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp b/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
index 28ac603..687765f 100644
--- a/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
+++ b/bluetooth/1.1/vts/functional/VtsHalBluetoothV1_1TargetTest.cpp
@@ -43,6 +43,8 @@
#define HCI_MINIMUM_HCI_VERSION 5 // Bluetooth Core Specification 3.0 + HS
#define HCI_MINIMUM_LMP_VERSION 5 // Bluetooth Core Specification 3.0 + HS
+#define HCI_BLUETOOTH4_2_HCI_VERSION 8 // Bluetooth 4.2
+#define HCI_BLUETOOTH4_2_LMP_VERSION 8 // Bluetooth 4.2
#define NUM_HCI_COMMANDS_BANDWIDTH 1000
#define NUM_SCO_PACKETS_BANDWIDTH 1000
#define NUM_ACL_PACKETS_BANDWIDTH 1000
@@ -52,6 +54,7 @@
#define WAIT_FOR_ACL_DATA_TIMEOUT std::chrono::milliseconds(1000)
#define INTERFACE_CLOSE_DELAY_MS std::chrono::milliseconds(200)
+// { OCF, OGF << 2, Length of bytes of command parameters }
#define COMMAND_HCI_SHOULD_BE_UNKNOWN \
{ 0xff, 0x3B, 0x08, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 }
#define COMMAND_HCI_READ_LOCAL_VERSION_INFORMATION \
@@ -64,6 +67,10 @@
{ 0x03, 0x0c, 0x00 }
#define COMMAND_HCI_WRITE_LOCAL_NAME \
{ 0x13, 0x0c, 0xf8 }
+#define COMMAND_HCI_READ_LOCAL_SUPPORTED_FEATURES \
+ { 0x03, 0x04 << 2, 0x00 } // OGF=0x04, OCF=0x0003 / 7.4 INFORMATIONAL PARAMETERS
+#define COMMAND_HCI_LE_READ_LOCAL_SUPPORTED_FEATURES \
+ { 0x03, 0x08 << 2, 0x00 } // OGF=0x08, OCF=0x0003 / 7.8 LE CONTROLLER COMMANDS
#define HCI_STATUS_SUCCESS 0x00
#define HCI_STATUS_UNKNOWN_HCI_COMMAND 0x01
@@ -85,6 +92,30 @@
#define EVENT_COMMAND_COMPLETE_FIRST_PARAM_BYTE 6
#define EVENT_LOCAL_HCI_VERSION_BYTE EVENT_COMMAND_COMPLETE_FIRST_PARAM_BYTE
#define EVENT_LOCAL_LMP_VERSION_BYTE EVENT_LOCAL_HCI_VERSION_BYTE + 3
+/**
+ * See Bluetooth Spec 5.4, Vol 2, Part C
+ * Link Manager Protocol, 3.3 Feature Mask Definition
+ *
+ * No | Supported Feature | Byte | Bit | Page
+ * ...
+ * 38 | LE Supported (Controller) | 4 | 6 | 0
+ * ...
+ */
+#define EVENT_LOCAL_SUPPORTED_FEATURES_LE_SUPPORTED_BYTE \
+ (EVENT_COMMAND_COMPLETE_FIRST_PARAM_BYTE + 0x04)
+#define EVENT_LOCAL_SUPPORTED_FEATURES_LE_SUPPORTED_BITMASK (0x01 << 6)
+/**
+ * See Bluetooth Spec 5.4, Vol 6, Part B
+ * 4.6 Feature Support
+ *
+ * Bit | Link Layer Feature
+ * ...
+ * 5 | LE Data Packet Length Extension
+ * ...
+ */
+#define EVENT_LOCAL_LE_SUPPORTED_FEATURES_DATA_LENGTH_EXTENSION_BYTE \
+ (EVENT_COMMAND_COMPLETE_FIRST_PARAM_BYTE + 0x00)
+#define EVENT_LOCAL_LE_SUPPORTED_FEATURES_DATA_LENGTH_BITMASK (0x01 << 5)
#define EVENT_CONNECTION_COMPLETE_PARAM_LENGTH 11
#define EVENT_CONNECTION_COMPLETE_TYPE 11
@@ -211,7 +242,7 @@
std::vector<uint16_t>* acl_handles);
void handle_no_ops();
void wait_for_event(bool timeout_is_error);
- void wait_for_command_complete_event(hidl_vec<uint8_t> cmd);
+ hidl_vec<uint8_t> wait_for_command_complete_event(hidl_vec<uint8_t> cmd);
int wait_for_completed_packets_event(uint16_t handle);
class BluetoothHciDeathRecipient : public hidl_death_recipient {
@@ -350,7 +381,7 @@
}
// Wait until a COMMAND_COMPLETE is received.
-void BluetoothHidlTest::wait_for_command_complete_event(hidl_vec<uint8_t> cmd) {
+hidl_vec<uint8_t> BluetoothHidlTest::wait_for_command_complete_event(hidl_vec<uint8_t> cmd) {
wait_for_event();
hidl_vec<uint8_t> event = event_queue.front();
event_queue.pop();
@@ -361,6 +392,8 @@
EXPECT_EQ(cmd[0], event[EVENT_COMMAND_COMPLETE_OPCODE_LSBYTE]);
EXPECT_EQ(cmd[1], event[EVENT_COMMAND_COMPLETE_OPCODE_LSBYTE + 1]);
EXPECT_EQ(HCI_STATUS_SUCCESS, event[EVENT_COMMAND_COMPLETE_STATUS_BYTE]);
+
+ return event;
}
// Send the command to read the controller's buffer sizes.
@@ -646,6 +679,36 @@
EXPECT_LE(HCI_MINIMUM_LMP_VERSION, event[EVENT_LOCAL_LMP_VERSION_BYTE]);
}
+/**
+ * VSR-5.3.14-007 MUST support Bluetooth 4.2 and Bluetooth LE Data Length Extension.
+ * VSR-5.3.14-008 MUST support Bluetooth Low Energy (BLE).
+ */
+// @VsrTest = 5.3.14-007
+// @VsrTest = 5.3.14-008
+TEST_P(BluetoothHidlTest, Bluetooth4_2) {
+ // Bluetooth 4.2+
+ hidl_vec<uint8_t> cmd = COMMAND_HCI_READ_LOCAL_VERSION_INFORMATION;
+ bluetooth->sendHciCommand(cmd);
+ auto event = wait_for_command_complete_event(cmd);
+
+ EXPECT_LE(HCI_BLUETOOTH4_2_HCI_VERSION, event[EVENT_LOCAL_HCI_VERSION_BYTE]);
+ EXPECT_LE(HCI_BLUETOOTH4_2_LMP_VERSION, event[EVENT_LOCAL_LMP_VERSION_BYTE]);
+
+ // BLE
+ cmd = COMMAND_HCI_READ_LOCAL_SUPPORTED_FEATURES;
+ bluetooth->sendHciCommand(cmd);
+ event = wait_for_command_complete_event(cmd);
+ EXPECT_TRUE(event[EVENT_LOCAL_SUPPORTED_FEATURES_LE_SUPPORTED_BYTE] &
+ EVENT_LOCAL_SUPPORTED_FEATURES_LE_SUPPORTED_BITMASK);
+
+ // BLE Data Length Extension
+ cmd = COMMAND_HCI_LE_READ_LOCAL_SUPPORTED_FEATURES;
+ bluetooth->sendHciCommand(cmd);
+ event = wait_for_command_complete_event(cmd);
+ EXPECT_TRUE(event[EVENT_LOCAL_LE_SUPPORTED_FEATURES_DATA_LENGTH_EXTENSION_BYTE] &
+ EVENT_LOCAL_LE_SUPPORTED_FEATURES_DATA_LENGTH_BITMASK);
+}
+
// Send an unknown HCI command and wait for the error message.
TEST_P(BluetoothHidlTest, HciUnknownCommand) {
hidl_vec<uint8_t> cmd = COMMAND_HCI_SHOULD_BE_UNKNOWN;
diff --git a/bluetooth/aidl/vts/Android.bp b/bluetooth/aidl/vts/Android.bp
index ade3bef..c69ced4 100644
--- a/bluetooth/aidl/vts/Android.bp
+++ b/bluetooth/aidl/vts/Android.bp
@@ -28,6 +28,7 @@
static_libs: [
"android.hardware.bluetooth-V1-ndk",
"libbluetooth_hci_pdl",
+ "libbluetooth_log",
],
test_config: "VtsHalBluetoothTargetTest.xml",
test_suites: [
diff --git a/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp b/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp
index 24eb4d0..140b956 100644
--- a/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp
+++ b/bluetooth/aidl/vts/VtsHalBluetoothTargetTest.cpp
@@ -118,6 +118,10 @@
testing::deviceSupportsFeature("android.hardware.type.television");
}
+static bool isHandheld() {
+ return testing::deviceSupportsFeature("android.hardware.type.handheld");
+}
+
class ThroughputLogger {
public:
explicit ThroughputLogger(std::string task)
@@ -150,6 +154,9 @@
// The main test class for Bluetooth HAL.
class BluetoothAidlTest : public ::testing::TestWithParam<std::string> {
+ std::chrono::time_point<std::chrono::system_clock>
+ time_after_initialize_complete;
+
public:
void SetUp() override {
// currently test passthrough mode only
@@ -180,12 +187,16 @@
event_cb_count = 0;
acl_cb_count = 0;
sco_cb_count = 0;
+ std::chrono::time_point<std::chrono::system_clock>
+ timeout_after_initialize =
+ std::chrono::system_clock::now() + kWaitForInitTimeout;
ASSERT_TRUE(hci->initialize(hci_cb).isOk());
auto future = initialized_promise.get_future();
auto timeout_status = future.wait_for(kWaitForInitTimeout);
ASSERT_EQ(timeout_status, std::future_status::ready);
ASSERT_TRUE(future.get());
+ ASSERT_GE(timeout_after_initialize, time_after_initialize_complete);
}
void TearDown() override {
@@ -237,6 +248,10 @@
~BluetoothHciCallbacks() override = default;
ndk::ScopedAStatus initializationComplete(Status status) override {
+ if (status == Status::SUCCESS) {
+ parent_.time_after_initialize_complete =
+ std::chrono::system_clock::now();
+ }
parent_.initialized_promise.set_value(status == Status::SUCCESS);
ALOGV("%s (status = %d)", __func__, static_cast<int>(status));
return ScopedAStatus::ok();
@@ -1039,6 +1054,47 @@
ASSERT_GE(num_resolving_list, kMinLeResolvingListForBt5);
}
+/**
+ * VSR-5.3.14-007 MUST support Bluetooth 4.2 and Bluetooth LE Data Length Extension.
+ * VSR-5.3.14-008 MUST support Bluetooth Low Energy (BLE).
+ */
+// @VsrTest = 5.3.14-007
+// @VsrTest = 5.3.14-008
+TEST_P(BluetoothAidlTest, Vsr_Bluetooth4_2Requirements) {
+ // test only applies to handheld devices
+ if (!isHandheld()) {
+ return;
+ }
+
+ 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();
+ // Starting with Android 15, Fails when HCI version is lower than 4.2.
+ ASSERT_GE(static_cast<int>(version.hci_version_),
+ static_cast<int>(::bluetooth::hci::HciVersion::V_4_2));
+ ASSERT_GE(static_cast<int>(version.lmp_version_),
+ static_cast<int>(::bluetooth::hci::LmpVersion::V_4_2));
+
+ 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::LE_EXTENDED_ADVERTISING));
+
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(BluetoothAidlTest);
INSTANTIATE_TEST_SUITE_P(PerInstance, BluetoothAidlTest,
testing::ValuesIn(android::getAidlHalInstanceNames(
diff --git a/bluetooth/audio/aidl/default/A2dpOffloadAudioProvider.cpp b/bluetooth/audio/aidl/default/A2dpOffloadAudioProvider.cpp
index c7761c5..1eb6a6d 100644
--- a/bluetooth/audio/aidl/default/A2dpOffloadAudioProvider.cpp
+++ b/bluetooth/audio/aidl/default/A2dpOffloadAudioProvider.cpp
@@ -120,6 +120,12 @@
ndk::ScopedAStatus A2dpOffloadAudioProvider::parseA2dpConfiguration(
const CodecId& codec_id, const std::vector<uint8_t>& configuration,
CodecParameters* codec_parameters, A2dpStatus* _aidl_return) {
+ if (!kEnableA2dpCodecExtensibility) {
+ // parseA2dpConfiguration must not be implemented if A2dp codec
+ // extensibility is not supported.
+ return ndk::ScopedAStatus::fromStatus(STATUS_UNKNOWN_TRANSACTION);
+ }
+
auto codec = codec_factory_.GetCodec(codec_id);
if (!codec) {
LOG(INFO) << __func__ << " - SessionType=" << toString(session_type_)
@@ -136,6 +142,12 @@
const std::vector<A2dpRemoteCapabilities>& remote_a2dp_capabilities,
const A2dpConfigurationHint& hint,
std::optional<audio::A2dpConfiguration>* _aidl_return) {
+ if (!kEnableA2dpCodecExtensibility) {
+ // getA2dpConfiguration must not be implemented if A2dp codec
+ // extensibility is not supported.
+ return ndk::ScopedAStatus::fromStatus(STATUS_UNKNOWN_TRANSACTION);
+ }
+
*_aidl_return = std::nullopt;
A2dpConfiguration avdtp_configuration;
diff --git a/bluetooth/audio/aidl/default/Android.bp b/bluetooth/audio/aidl/default/Android.bp
index 69db1b3..af6bf86 100644
--- a/bluetooth/audio/aidl/default/Android.bp
+++ b/bluetooth/audio/aidl/default/Android.bp
@@ -40,3 +40,10 @@
"libbluetooth_audio_session_aidl",
],
}
+
+prebuilt_etc {
+ name: "android.hardware.bluetooth.audio.xml",
+ src: "bluetooth_audio.xml",
+ sub_dir: "vintf",
+ installable: false,
+}
diff --git a/bluetooth/audio/aidl/default/BluetoothAudioProvider.h b/bluetooth/audio/aidl/default/BluetoothAudioProvider.h
index 2c21440..866eaeb 100644
--- a/bluetooth/audio/aidl/default/BluetoothAudioProvider.h
+++ b/bluetooth/audio/aidl/default/BluetoothAudioProvider.h
@@ -35,6 +35,23 @@
namespace bluetooth {
namespace audio {
+/// Enable flag for the reference implementation for A2dp Codec
+/// Extensibility.
+///
+/// A2dp Codec extensibility cannot be enabled until the following
+/// requirements are fulfilled.
+///
+/// 1. The Bluetooth controller must support the HCI Requirements
+/// v1.04 or later, and must support the vendor HCI command
+/// A2DP Offload Start (v2), A2DP Offload Stop (v2) as indicated
+/// by the field a2dp_offload_v2 of the vendor capabilities.
+///
+/// 2. The implementation of the provider must be completed with
+/// DSP configuration for streaming.
+enum : bool {
+ kEnableA2dpCodecExtensibility = false,
+};
+
class BluetoothAudioProvider : public BnBluetoothAudioProvider {
public:
BluetoothAudioProvider();
diff --git a/bluetooth/audio/aidl/default/BluetoothAudioProviderFactory.cpp b/bluetooth/audio/aidl/default/BluetoothAudioProviderFactory.cpp
index c7c6e6d..dc36ac0 100644
--- a/bluetooth/audio/aidl/default/BluetoothAudioProviderFactory.cpp
+++ b/bluetooth/audio/aidl/default/BluetoothAudioProviderFactory.cpp
@@ -39,6 +39,9 @@
static const std::string kLeAudioOffloadProviderName =
"LE_AUDIO_OFFLOAD_HARDWARE_OFFLOAD_PROVIDER";
+static const std::string kHfpOffloadProviderName =
+ "HFP_OFFLOAD_HARDWARE_OFFLOAD_PROVIDER";
+
BluetoothAudioProviderFactory::BluetoothAudioProviderFactory() {}
ndk::ScopedAStatus BluetoothAudioProviderFactory::openProvider(
@@ -159,11 +162,18 @@
if (session_type == SessionType::A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH ||
session_type == SessionType::A2DP_HARDWARE_OFFLOAD_DECODING_DATAPATH) {
+ if (!kEnableA2dpCodecExtensibility) {
+ // Implementing getProviderInfo equates supporting
+ // A2dp codec extensibility.
+ return ndk::ScopedAStatus::fromStatus(STATUS_UNKNOWN_TRANSACTION);
+ }
+
auto& provider_info = _aidl_return->emplace();
provider_info.name = a2dp_offload_codec_factory_.name;
for (auto codec : a2dp_offload_codec_factory_.codecs)
provider_info.codecInfos.push_back(codec->info);
+ return ndk::ScopedAStatus::ok();
}
if (session_type ==
@@ -178,12 +188,23 @@
auto& provider_info = _aidl_return->emplace();
provider_info.name = kLeAudioOffloadProviderName;
provider_info.codecInfos = db_codec_info;
- *_aidl_return = provider_info;
return ndk::ScopedAStatus::ok();
}
}
- return ndk::ScopedAStatus::ok();
+ if (session_type == SessionType::HFP_HARDWARE_OFFLOAD_DATAPATH) {
+ std::vector<CodecInfo> db_codec_info =
+ BluetoothAudioCodecs::GetHfpOffloadCodecInfo();
+ if (!db_codec_info.empty()) {
+ auto& provider_info = _aidl_return->emplace();
+ provider_info.name = kHfpOffloadProviderName;
+ provider_info.codecInfos = db_codec_info;
+ return ndk::ScopedAStatus::ok();
+ }
+ }
+
+ // Unsupported for other sessions
+ return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
} // namespace audio
diff --git a/bluetooth/audio/aidl/vts/VtsHalBluetoothAudioTargetTest.cpp b/bluetooth/audio/aidl/vts/VtsHalBluetoothAudioTargetTest.cpp
index 7b98634..c313fb7 100644
--- a/bluetooth/audio/aidl/vts/VtsHalBluetoothAudioTargetTest.cpp
+++ b/bluetooth/audio/aidl/vts/VtsHalBluetoothAudioTargetTest.cpp
@@ -1944,6 +1944,7 @@
BluetoothAudioHalVersion::VERSION_AIDL_V4) {
GTEST_SKIP();
}
+ GetProviderInfoHelper(SessionType::HFP_HARDWARE_OFFLOAD_DATAPATH);
OpenProviderHelper(SessionType::HFP_HARDWARE_OFFLOAD_DATAPATH);
// Can open or empty capability
ASSERT_TRUE(temp_provider_capabilities_.empty() ||
@@ -2583,6 +2584,10 @@
TEST_P(BluetoothAudioProviderLeAudioOutputHardwareAidl,
GetDataPathConfiguration) {
+ if (GetProviderFactoryInterfaceVersion() <
+ BluetoothAudioHalVersion::VERSION_AIDL_V4) {
+ GTEST_SKIP();
+ }
IBluetoothAudioProvider::StreamConfig sink_requirement;
IBluetoothAudioProvider::StreamConfig source_requirement;
std::vector<IBluetoothAudioProvider::LeAudioDataPathConfiguration>
diff --git a/bluetooth/audio/flags/Android.bp b/bluetooth/audio/flags/Android.bp
index 0d18a4d..c3c8cf5 100644
--- a/bluetooth/audio/flags/Android.bp
+++ b/bluetooth/audio/flags/Android.bp
@@ -1,6 +1,7 @@
aconfig_declarations {
name: "btaudiohal_flags",
package: "com.android.btaudio.hal.flags",
+ container: "system",
srcs: ["btaudiohal.aconfig"],
}
diff --git a/bluetooth/audio/flags/btaudiohal.aconfig b/bluetooth/audio/flags/btaudiohal.aconfig
index 763777e..4c1500a 100644
--- a/bluetooth/audio/flags/btaudiohal.aconfig
+++ b/bluetooth/audio/flags/btaudiohal.aconfig
@@ -1,4 +1,5 @@
package: "com.android.btaudio.hal.flags"
+container: "system"
flag {
name: "dsa_lea"
diff --git a/bluetooth/audio/utils/Android.bp b/bluetooth/audio/utils/Android.bp
index c0817f5..cecf8f0 100644
--- a/bluetooth/audio/utils/Android.bp
+++ b/bluetooth/audio/utils/Android.bp
@@ -42,6 +42,7 @@
"aidl_session/BluetoothAudioSession.cpp",
"aidl_session/HidlToAidlMiddleware.cpp",
"aidl_session/BluetoothLeAudioCodecsProvider.cpp",
+ "aidl_session/BluetoothHfpCodecsProvider.cpp",
"aidl_session/BluetoothLeAudioAseConfigurationSettingProvider.cpp",
],
export_include_dirs: ["aidl_session/"],
@@ -68,9 +69,13 @@
static_libs: [
"btaudiohal_flags_c_lib",
],
- generated_sources: ["le_audio_codec_capabilities"],
+ generated_sources: [
+ "le_audio_codec_capabilities",
+ "hfp_codec_capabilities",
+ ],
generated_headers: [
"le_audio_codec_capabilities",
+ "hfp_codec_capabilities",
"AIDLLeAudioSetConfigSchemas_h",
],
required: [
@@ -78,6 +83,7 @@
"aidl_audio_set_configurations_json",
"aidl_audio_set_scenarios_bfbs",
"aidl_audio_set_scenarios_json",
+ "hfp_codec_capabilities_xml",
],
}
@@ -106,6 +112,35 @@
generated_headers: ["le_audio_codec_capabilities"],
}
+cc_test {
+ name: "BluetoothHfpCodecsProviderTest",
+ defaults: [
+ "latest_android_hardware_audio_common_ndk_static",
+ "latest_android_hardware_bluetooth_audio_ndk_static",
+ "latest_android_media_audio_common_types_ndk_static",
+ ],
+ srcs: [
+ "aidl_session/BluetoothHfpCodecsProvider.cpp",
+ "aidl_session/BluetoothHfpCodecsProviderTest.cpp",
+ ],
+ header_libs: [
+ "libxsdc-utils",
+ ],
+ shared_libs: [
+ "libbase",
+ "libbinder_ndk",
+ "libxml2",
+ ],
+ test_suites: [
+ "general-tests",
+ ],
+ test_options: {
+ unit_test: false,
+ },
+ generated_sources: ["hfp_codec_capabilities"],
+ generated_headers: ["hfp_codec_capabilities"],
+}
+
xsd_config {
name: "le_audio_codec_capabilities",
srcs: ["le_audio_codec_capabilities/le_audio_codec_capabilities.xsd"],
@@ -114,6 +149,14 @@
root_elements: ["leAudioOffloadSetting"],
}
+xsd_config {
+ name: "hfp_codec_capabilities",
+ srcs: ["hfp_codec_capabilities/hfp_codec_capabilities.xsd"],
+ package_name: "aidl.android.hardware.bluetooth.audio.hfp.setting",
+ api_dir: "hfp_codec_capabilities/schema",
+ root_elements: ["hfpOffloadSetting"],
+}
+
genrule {
name: "AIDLLeAudioSetConfigSchemas_h",
tools: [
@@ -177,6 +220,14 @@
}
prebuilt_etc {
+ name: "hfp_codec_capabilities_xml",
+ src: "hfp_codec_capabilities/hfp_codec_capabilities.xml",
+ filename: "hfp_codec_capabilities.xml",
+ sub_dir: "aidl/hfp",
+ vendor: true,
+}
+
+prebuilt_etc {
name: "aidl_audio_set_configurations_bfbs",
src: ":AIDLLeAudioSetConfigsSchema_bfbs",
filename: "aidl_audio_set_configurations.bfbs",
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp
index d37825a..c25b102 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.cpp
@@ -32,6 +32,7 @@
#include <aidl/android/hardware/bluetooth/audio/SbcChannelMode.h>
#include <android-base/logging.h>
+#include "BluetoothHfpCodecsProvider.h"
#include "BluetoothLeAudioAseConfigurationSettingProvider.h"
#include "BluetoothLeAudioCodecsProvider.h"
@@ -100,6 +101,7 @@
std::vector<LeAudioCodecCapabilitiesSetting> kDefaultOffloadLeAudioCapabilities;
std::unordered_map<SessionType, std::vector<CodecInfo>>
kDefaultOffloadLeAudioCodecInfoMap;
+std::vector<CodecInfo> kDefaultOffloadHfpCodecInfo;
template <class T>
bool BluetoothAudioCodecs::ContainedInVector(
@@ -439,6 +441,17 @@
return codec_info_map_iter->second;
}
+std::vector<CodecInfo> BluetoothAudioCodecs::GetHfpOffloadCodecInfo() {
+ if (kDefaultOffloadHfpCodecInfo.empty()) {
+ auto hfp_offload_setting =
+ BluetoothHfpCodecsProvider::ParseFromHfpOffloadSettingFile();
+ // Load file into list
+ kDefaultOffloadHfpCodecInfo =
+ BluetoothHfpCodecsProvider::GetHfpAudioCodecInfo(hfp_offload_setting);
+ }
+ return kDefaultOffloadHfpCodecInfo;
+}
+
std::vector<LeAudioAseConfigurationSetting>
BluetoothAudioCodecs::GetLeAudioAseConfigurationSettings() {
return AudioSetConfigurationProviderJson::
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.h b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.h
index 057b9a7..0a1f708 100644
--- a/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.h
+++ b/bluetooth/audio/utils/aidl_session/BluetoothAudioCodecs.h
@@ -57,6 +57,8 @@
static std::vector<LeAudioAseConfigurationSetting>
GetLeAudioAseConfigurationSettings();
+ static std::vector<CodecInfo> GetHfpOffloadCodecInfo();
+
private:
template <typename T>
struct identity {
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothHfpCodecsProvider.cpp b/bluetooth/audio/utils/aidl_session/BluetoothHfpCodecsProvider.cpp
new file mode 100644
index 0000000..d61ec5a
--- /dev/null
+++ b/bluetooth/audio/utils/aidl_session/BluetoothHfpCodecsProvider.cpp
@@ -0,0 +1,115 @@
+/*
+ * Copyright (C) 2024 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 "BluetoothHfpCodecsProvider.h"
+
+#include <unordered_map>
+
+namespace aidl {
+namespace android {
+namespace hardware {
+namespace bluetooth {
+namespace audio {
+
+using hfp::setting::CodecType;
+using hfp::setting::PathConfiguration;
+
+static const char* kHfpCodecCapabilitiesFile =
+ "/vendor/etc/aidl/hfp/hfp_codec_capabilities.xml";
+
+std::optional<HfpOffloadSetting>
+BluetoothHfpCodecsProvider::ParseFromHfpOffloadSettingFile() {
+ auto hfp_offload_setting =
+ hfp::setting::readHfpOffloadSetting(kHfpCodecCapabilitiesFile);
+ if (!hfp_offload_setting.has_value()) {
+ LOG(ERROR) << __func__ << ": Failed to read " << kHfpCodecCapabilitiesFile;
+ }
+ return hfp_offload_setting;
+}
+
+std::vector<CodecInfo> BluetoothHfpCodecsProvider::GetHfpAudioCodecInfo(
+ const std::optional<HfpOffloadSetting>& hfp_offload_setting) {
+ std::vector<CodecInfo> result;
+ if (!hfp_offload_setting.has_value()) return result;
+
+ // Convert path configuration into map
+ // Currently transport configuration is unused
+ if (!hfp_offload_setting.value().hasPathConfiguration() ||
+ hfp_offload_setting.value().getPathConfiguration().empty()) {
+ LOG(WARNING) << __func__ << ": path configurations is empty";
+ return result;
+ }
+ auto path_configurations = hfp_offload_setting.value().getPathConfiguration();
+ std::unordered_map<std::string, PathConfiguration> path_config_map;
+ for (const auto& path_cfg : path_configurations)
+ if (path_cfg.hasName() && path_cfg.hasDataPath())
+ path_config_map.insert(make_pair(path_cfg.getName(), path_cfg));
+
+ for (const auto& cfg : hfp_offload_setting.value().getConfiguration()) {
+ auto input_path_cfg = path_config_map.find(cfg.getInputPathConfiguration());
+ auto output_path_cfg =
+ path_config_map.find(cfg.getOutputPathConfiguration());
+ if (input_path_cfg == path_config_map.end()) {
+ LOG(WARNING) << __func__ << ": Input path configuration not found: "
+ << cfg.getInputPathConfiguration();
+ continue;
+ }
+
+ if (output_path_cfg == path_config_map.end()) {
+ LOG(WARNING) << __func__ << ": Output path configuration not found: "
+ << cfg.getOutputPathConfiguration();
+ continue;
+ }
+
+ CodecInfo codec_info;
+
+ switch (cfg.getCodec()) {
+ case CodecType::LC3:
+ codec_info.id = CodecId::Core::LC3;
+ break;
+ case CodecType::MSBC:
+ codec_info.id = CodecId::Core::MSBC;
+ break;
+ case CodecType::CVSD:
+ codec_info.id = CodecId::Core::CVSD;
+ break;
+ default:
+ LOG(WARNING) << __func__ << ": Unknown codec from " << cfg.getName();
+ codec_info.id = CodecId::Vendor();
+ break;
+ }
+ codec_info.name = cfg.getName();
+
+ codec_info.transport =
+ CodecInfo::Transport::make<CodecInfo::Transport::Tag::hfp>();
+
+ auto& transport =
+ codec_info.transport.get<CodecInfo::Transport::Tag::hfp>();
+ transport.useControllerCodec = cfg.getUseControllerCodec();
+ transport.inputDataPath = input_path_cfg->second.getDataPath();
+ transport.outputDataPath = output_path_cfg->second.getDataPath();
+
+ result.push_back(codec_info);
+ }
+ LOG(INFO) << __func__ << ": Has " << result.size() << " codec info";
+ return result;
+}
+
+} // namespace audio
+} // namespace bluetooth
+} // namespace hardware
+} // namespace android
+} // namespace aidl
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothHfpCodecsProvider.h b/bluetooth/audio/utils/aidl_session/BluetoothHfpCodecsProvider.h
new file mode 100644
index 0000000..642ee02
--- /dev/null
+++ b/bluetooth/audio/utils/aidl_session/BluetoothHfpCodecsProvider.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2024 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 <android-base/logging.h>
+
+#include <vector>
+
+#include "aidl/android/hardware/bluetooth/audio/CodecInfo.h"
+#include "aidl_android_hardware_bluetooth_audio_hfp_setting.h"
+#include "aidl_android_hardware_bluetooth_audio_hfp_setting_enums.h"
+
+namespace aidl {
+namespace android {
+namespace hardware {
+namespace bluetooth {
+namespace audio {
+
+using hfp::setting::HfpOffloadSetting;
+
+class BluetoothHfpCodecsProvider {
+ public:
+ static std::optional<HfpOffloadSetting> ParseFromHfpOffloadSettingFile();
+
+ static std::vector<CodecInfo> GetHfpAudioCodecInfo(
+ const std::optional<HfpOffloadSetting>& hfp_offload_setting);
+};
+} // namespace audio
+} // namespace bluetooth
+} // namespace hardware
+} // namespace android
+} // namespace aidl
diff --git a/bluetooth/audio/utils/aidl_session/BluetoothHfpCodecsProviderTest.cpp b/bluetooth/audio/utils/aidl_session/BluetoothHfpCodecsProviderTest.cpp
new file mode 100644
index 0000000..b08c3eb
--- /dev/null
+++ b/bluetooth/audio/utils/aidl_session/BluetoothHfpCodecsProviderTest.cpp
@@ -0,0 +1,153 @@
+/*
+ * Copyright (C) 2024 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 <gtest/gtest.h>
+
+#include <optional>
+#include <tuple>
+
+#include "BluetoothHfpCodecsProvider.h"
+#include "gtest/gtest.h"
+
+using aidl::android::hardware::bluetooth::audio::BluetoothHfpCodecsProvider;
+using aidl::android::hardware::bluetooth::audio::CodecInfo;
+using aidl::android::hardware::bluetooth::audio::hfp::setting::CodecType;
+using aidl::android::hardware::bluetooth::audio::hfp::setting::Configuration;
+using aidl::android::hardware::bluetooth::audio::hfp::setting::
+ HfpOffloadSetting;
+using aidl::android::hardware::bluetooth::audio::hfp::setting::
+ PathConfiguration;
+using aidl::android::hardware::bluetooth::audio::hfp::setting::
+ TransportConfiguration;
+
+typedef std::tuple<std::vector<PathConfiguration>,
+ std::vector<TransportConfiguration>,
+ std::vector<Configuration>>
+ HfpOffloadSettingTuple;
+
+// Define valid components for each list
+// PathConfiguration
+static const PathConfiguration kValidPathConfigurationCVSD("CVSD_IO", 16000,
+ CodecType::CVSD, 16,
+ 2, 0, 1, 0);
+static const PathConfiguration kInvalidPathConfigurationNULL(std::nullopt,
+ 16000,
+ CodecType::CVSD,
+ 16, 2, 0, 1, 0);
+static const PathConfiguration kInvalidPathConfigurationNoPath(
+ "CVSD_NULL", 16000, CodecType::CVSD, 16, 2, 0, std::nullopt, 0);
+
+// Configuration
+static const Configuration kValidConfigurationCVSD("CVSD", CodecType::CVSD,
+ 65535, 7, 0, true, "CVSD_IO",
+ "CVSD_IO", std::nullopt,
+ std::nullopt);
+static const Configuration kInvalidConfigurationCVSDNoPath(
+ "CVSD", CodecType::CVSD, 65535, 7, 0, true, "CVSD_NULL", "CVSD_NULL",
+ std::nullopt, std::nullopt);
+static const Configuration kInvalidConfigurationCVSDNotFound(
+ "CVSD", CodecType::CVSD, 65535, 7, 0, true, "CVSD_N", "CVSD_N",
+ std::nullopt, std::nullopt);
+
+class BluetoothHfpCodecsProviderTest : public ::testing::Test {
+ public:
+ static std::vector<HfpOffloadSettingTuple> CreateTestCases(
+ const std::vector<std::vector<PathConfiguration>> path_configs_list,
+ const std::vector<std::vector<TransportConfiguration>>
+ transport_configs_list,
+ const std::vector<std::vector<Configuration>> configs_list) {
+ std::vector<HfpOffloadSettingTuple> test_cases;
+ for (const auto& path_configs : path_configs_list) {
+ for (const auto& transport_configs : transport_configs_list) {
+ for (const auto& configs : configs_list)
+ test_cases.push_back(
+ CreateTestCase(path_configs, transport_configs, configs));
+ }
+ }
+ return test_cases;
+ }
+
+ protected:
+ std::vector<CodecInfo> RunTestCase(HfpOffloadSettingTuple test_case) {
+ auto& [path_configuration_list, transport_configuration_list,
+ configuration_list] = test_case;
+ HfpOffloadSetting hfp_offload_setting(path_configuration_list,
+ transport_configuration_list,
+ configuration_list);
+ auto capabilities =
+ BluetoothHfpCodecsProvider::GetHfpAudioCodecInfo(hfp_offload_setting);
+ return capabilities;
+ }
+
+ private:
+ static inline HfpOffloadSettingTuple CreateTestCase(
+ const std::vector<PathConfiguration> path_config_list,
+ const std::vector<TransportConfiguration> transport_config_list,
+ const std::vector<Configuration> config_list) {
+ return std::make_tuple(path_config_list, transport_config_list,
+ config_list);
+ }
+};
+
+class GetHfpCodecInfoTest : public BluetoothHfpCodecsProviderTest {
+ public:
+ static std::vector<std::vector<PathConfiguration>>
+ GetInvalidPathConfigurationLists() {
+ std::vector<std::vector<PathConfiguration>> result;
+ result.push_back({kInvalidPathConfigurationNULL});
+ result.push_back({kInvalidPathConfigurationNoPath});
+ result.push_back({});
+ return result;
+ }
+
+ static std::vector<std::vector<Configuration>>
+ GetInvalidConfigurationLists() {
+ std::vector<std::vector<Configuration>> result;
+ result.push_back({kInvalidConfigurationCVSDNotFound});
+ result.push_back({kInvalidConfigurationCVSDNoPath});
+ result.push_back({});
+ return result;
+ }
+};
+
+TEST_F(GetHfpCodecInfoTest, InvalidPathConfiguration) {
+ auto test_cases = BluetoothHfpCodecsProviderTest::CreateTestCases(
+ GetHfpCodecInfoTest::GetInvalidPathConfigurationLists(), {{}},
+ {{kValidConfigurationCVSD}});
+ for (auto& test_case : test_cases) {
+ auto hfp_codec_capabilities = RunTestCase(test_case);
+ ASSERT_TRUE(hfp_codec_capabilities.empty());
+ }
+}
+
+TEST_F(GetHfpCodecInfoTest, InvalidConfigurationName) {
+ auto test_cases = BluetoothHfpCodecsProviderTest::CreateTestCases(
+ GetHfpCodecInfoTest::GetInvalidPathConfigurationLists(), {{}},
+ {GetHfpCodecInfoTest::GetInvalidConfigurationLists()});
+ for (auto& test_case : test_cases) {
+ auto hfp_codec_capabilities = RunTestCase(test_case);
+ ASSERT_TRUE(hfp_codec_capabilities.empty());
+ }
+}
+
+TEST_F(GetHfpCodecInfoTest, ValidConfiguration) {
+ auto test_cases = BluetoothHfpCodecsProviderTest::CreateTestCases(
+ {{kValidPathConfigurationCVSD}}, {{}}, {{kValidConfigurationCVSD}});
+ for (auto& test_case : test_cases) {
+ auto hfp_codec_capabilities = RunTestCase(test_case);
+ ASSERT_FALSE(hfp_codec_capabilities.empty());
+ }
+}
diff --git a/bluetooth/audio/utils/hfp_codec_capabilities/hfp_codec_capabilities.xml b/bluetooth/audio/utils/hfp_codec_capabilities/hfp_codec_capabilities.xml
new file mode 100644
index 0000000..c94843f
--- /dev/null
+++ b/bluetooth/audio/utils/hfp_codec_capabilities/hfp_codec_capabilities.xml
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!---
+ This is an example to configure HFP hardware offload supported capability settings
+ There are 3 list in this file. Add element into each list as needed.
+
+ pathConfiguration: input / output path configuration
+ transportConfiguration: transmit / receive configuration
+
+ configuration:
+ For each configuration, there are attributes:
+ - name
+ - codec
+ - useControllerCodec
+ - maxLatencyMs
+ - packetTypes
+ - retransmissionEffort
+ - input and output path configuration (reference by name)
+ - transmit and receive configuration (reference by name)
+-->
+<hfpOffloadSetting>
+
+ <pathConfiguration name="CVSD_IO" bandwidth="16000" codec="CVSD" codedDataSize="16" pcmDataFormat="2" pcmPayloadMsbPosition="0" dataPath="1" transportUnitSize="0" />
+ <pathConfiguration name="MSBC_IO" bandwidth="32000" codec="MSBC" codedDataSize="16" pcmDataFormat="2" pcmPayloadMsbPosition="0" dataPath="1" transportUnitSize="0" />
+ <pathConfiguration name="LC3_IO" bandwidth="64000" codec="MSBC" codedDataSize="16" pcmDataFormat="2" pcmPayloadMsbPosition="0" dataPath="1" transportUnitSize="0" />
+
+ <transportConfiguration name="CVSD_TXRX" bandwidth="8000" codec="CVSD" codedFrameSize="60" />
+ <transportConfiguration name="MSBC_TXRX" bandwidth="8000" codec="MSBC" codedFrameSize="60" />
+ <transportConfiguration name="LC3_TXRX" bandwidth="8000" codec="LC3" codedFrameSize="60" />
+
+ <configuration name="CVSD_D1_controller" codec="CVSD" maxLatencyMs="65535" packetTypes="7" retransmissionEffort="0" useControllerCodec="true" inputPathConfiguration="CVSD_IO" outputPathConfiguration="CVSD_IO" inputTransportConfiguration="CVSD_TXRX" outTransportConfiguration="CVSD_TXRX" />
+ <configuration name="CVSD_S3_controller" codec="CVSD" maxLatencyMs="10" packetTypes="959" retransmissionEffort="1" useControllerCodec="true" inputPathConfiguration="CVSD_IO" outputPathConfiguration="CVSD_IO" inputTransportConfiguration="CVSD_TXRX" outTransportConfiguration="CVSD_TXRX" />
+ <configuration name="CVSD_S4_controller" codec="CVSD" maxLatencyMs="12" packetTypes="959" retransmissionEffort="2" useControllerCodec="true" inputPathConfiguration="CVSD_IO" outputPathConfiguration="CVSD_IO" inputTransportConfiguration="CVSD_TXRX" outTransportConfiguration="CVSD_TXRX" />
+
+ <configuration name="MSBC_T1_controller" codec="MSBC" maxLatencyMs="8" packetTypes="968" retransmissionEffort="2" useControllerCodec="true" inputPathConfiguration="MSBC_IO" outputPathConfiguration="MSBC_IO" inputTransportConfiguration="MSBC_TXRX" outTransportConfiguration="MSBC_TXRX" />
+ <configuration name="MSBC_T2_controller" codec="MSBC" maxLatencyMs="13" packetTypes="904" retransmissionEffort="2" useControllerCodec="true" inputPathConfiguration="MSBC_IO" outputPathConfiguration="MSBC_IO" inputTransportConfiguration="MSBC_TXRX" outTransportConfiguration="MSBC_TXRX" />
+
+ <configuration name="LC3_T1_controller" codec="LC3" maxLatencyMs="8" packetTypes="968" retransmissionEffort="2" useControllerCodec="true" inputPathConfiguration="LC3_IO" outputPathConfiguration="LC3_IO" inputTransportConfiguration="LC3_TXRX" outTransportConfiguration="LC3_TXRX" />
+ <configuration name="LC3_T2_controller" codec="LC3" maxLatencyMs="13" packetTypes="896" retransmissionEffort="2" useControllerCodec="true" inputPathConfiguration="LC3_IO" outputPathConfiguration="LC3_IO" inputTransportConfiguration="LC3_TXRX" outTransportConfiguration="LC3_TXRX" />
+
+</hfpOffloadSetting>
diff --git a/bluetooth/audio/utils/hfp_codec_capabilities/hfp_codec_capabilities.xsd b/bluetooth/audio/utils/hfp_codec_capabilities/hfp_codec_capabilities.xsd
new file mode 100644
index 0000000..c4787b9
--- /dev/null
+++ b/bluetooth/audio/utils/hfp_codec_capabilities/hfp_codec_capabilities.xsd
@@ -0,0 +1,51 @@
+<!-- HFP Offload Codec Capability Schema -->
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:element name="hfpOffloadSetting">
+ <xs:complexType>
+ <xs:element ref="pathConfiguration" minOccurs="1" maxOccurs="unbounded"/>
+ <xs:element ref="transportConfiguration" minOccurs="1" maxOccurs="unbounded"/>
+ <xs:element ref="configuration" minOccurs="1" maxOccurs="unbounded"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="pathConfiguration">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="bandwidth" type="xs:unsignedInt"/>
+ <xs:attribute name="codec" type="codecType"/>
+ <xs:attribute name="codedDataSize" type="xs:unsignedShort"/>
+ <xs:attribute name="pcmDataFormat" type="xs:unsignedByte"/>
+ <xs:attribute name="pcmPayloadMsbPosition" type="xs:unsignedByte"/>
+ <xs:attribute name="dataPath" type="xs:unsignedByte"/>
+ <xs:attribute name="transportUnitSize" type="xs:unsignedByte"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="transportConfiguration">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="bandwidth" type="xs:unsignedInt"/>
+ <xs:attribute name="codec" type="codecType"/>
+ <xs:attribute name="codedFrameSize" type="xs:unsignedShort"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="configuration">
+ <xs:complexType>
+ <xs:attribute name="name" type="xs:string"/>
+ <xs:attribute name="codec" type="codecType"/>
+ <xs:attribute name="maxLatencyMs" type="xs:unsignedShort"/>
+ <xs:attribute name="packetTypes" type="xs:unsignedShort"/>
+ <xs:attribute name="retransmissionEffort" type="xs:unsignedByte"/>
+ <xs:attribute name="useControllerCodec" type="xs:boolean"/>
+ <xs:attribute name="inputPathConfiguration" type="xs:string"/>
+ <xs:attribute name="outputPathConfiguration" type="xs:string"/>
+ <xs:attribute name="inputTransportConfiguration" type="xs:string"/>
+ <xs:attribute name="outputTransportConfiguration" type="xs:string"/>
+ </xs:complexType>
+ </xs:element>
+ <xs:simpleType name="codecType">
+ <xs:restriction base="xs:string">
+ <xs:enumeration value="LC3"/>
+ <xs:enumeration value="CVSD"/>
+ <xs:enumeration value="MSBC"/>
+ </xs:restriction>
+ </xs:simpleType>
+</xs:schema>
diff --git a/bluetooth/audio/utils/hfp_codec_capabilities/schema/current.txt b/bluetooth/audio/utils/hfp_codec_capabilities/schema/current.txt
new file mode 100644
index 0000000..4b49929
--- /dev/null
+++ b/bluetooth/audio/utils/hfp_codec_capabilities/schema/current.txt
@@ -0,0 +1,82 @@
+// Signature format: 2.0
+package aidl.android.hardware.bluetooth.audio.hfp.setting {
+
+ public enum CodecType {
+ method public String getRawName();
+ enum_constant public static final aidl.android.hardware.bluetooth.audio.hfp.setting.CodecType CVSD;
+ enum_constant public static final aidl.android.hardware.bluetooth.audio.hfp.setting.CodecType LC3;
+ enum_constant public static final aidl.android.hardware.bluetooth.audio.hfp.setting.CodecType MSBC;
+ }
+
+ public class Configuration {
+ ctor public Configuration();
+ method public aidl.android.hardware.bluetooth.audio.hfp.setting.CodecType getCodec();
+ method public String getInputPathConfiguration();
+ method public String getInputTransportConfiguration();
+ method public int getMaxLatencyMs();
+ method public String getName();
+ method public String getOutputPathConfiguration();
+ method public String getOutputTransportConfiguration();
+ method public int getPacketTypes();
+ method public short getRetransmissionEffort();
+ method public boolean getUseControllerCodec();
+ method public void setCodec(aidl.android.hardware.bluetooth.audio.hfp.setting.CodecType);
+ method public void setInputPathConfiguration(String);
+ method public void setInputTransportConfiguration(String);
+ method public void setMaxLatencyMs(int);
+ method public void setName(String);
+ method public void setOutputPathConfiguration(String);
+ method public void setOutputTransportConfiguration(String);
+ method public void setPacketTypes(int);
+ method public void setRetransmissionEffort(short);
+ method public void setUseControllerCodec(boolean);
+ }
+
+ public class HfpOffloadSetting {
+ ctor public HfpOffloadSetting();
+ method public java.util.List<aidl.android.hardware.bluetooth.audio.hfp.setting.Configuration> getConfiguration();
+ method public java.util.List<aidl.android.hardware.bluetooth.audio.hfp.setting.PathConfiguration> getPathConfiguration();
+ method public java.util.List<aidl.android.hardware.bluetooth.audio.hfp.setting.TransportConfiguration> getTransportConfiguration();
+ }
+
+ public class PathConfiguration {
+ ctor public PathConfiguration();
+ method public long getBandwidth();
+ method public aidl.android.hardware.bluetooth.audio.hfp.setting.CodecType getCodec();
+ method public int getCodedDataSize();
+ method public short getDataPath();
+ method public String getName();
+ method public short getPcmDataFormat();
+ method public short getPcmPayloadMsbPosition();
+ method public short getTransportUnitSize();
+ method public void setBandwidth(long);
+ method public void setCodec(aidl.android.hardware.bluetooth.audio.hfp.setting.CodecType);
+ method public void setCodedDataSize(int);
+ method public void setDataPath(short);
+ method public void setName(String);
+ method public void setPcmDataFormat(short);
+ method public void setPcmPayloadMsbPosition(short);
+ method public void setTransportUnitSize(short);
+ }
+
+ public class TransportConfiguration {
+ ctor public TransportConfiguration();
+ method public long getBandwidth();
+ method public aidl.android.hardware.bluetooth.audio.hfp.setting.CodecType getCodec();
+ method public int getCodedFrameSize();
+ method public String getName();
+ method public void setBandwidth(long);
+ method public void setCodec(aidl.android.hardware.bluetooth.audio.hfp.setting.CodecType);
+ method public void setCodedFrameSize(int);
+ method public void setName(String);
+ }
+
+ public class XmlParser {
+ ctor public XmlParser();
+ method public static aidl.android.hardware.bluetooth.audio.hfp.setting.HfpOffloadSetting readHfpOffloadSetting(java.io.InputStream) throws javax.xml.datatype.DatatypeConfigurationException, java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ method public static String readText(org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ method public static void skip(org.xmlpull.v1.XmlPullParser) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
+ }
+
+}
+
diff --git a/bluetooth/audio/utils/hfp_codec_capabilities/schema/last_current.txt b/bluetooth/audio/utils/hfp_codec_capabilities/schema/last_current.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/bluetooth/audio/utils/hfp_codec_capabilities/schema/last_current.txt
@@ -0,0 +1 @@
+
diff --git a/bluetooth/audio/utils/hfp_codec_capabilities/schema/last_removed.txt b/bluetooth/audio/utils/hfp_codec_capabilities/schema/last_removed.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/bluetooth/audio/utils/hfp_codec_capabilities/schema/last_removed.txt
@@ -0,0 +1 @@
+
diff --git a/bluetooth/audio/utils/hfp_codec_capabilities/schema/removed.txt b/bluetooth/audio/utils/hfp_codec_capabilities/schema/removed.txt
new file mode 100644
index 0000000..d802177
--- /dev/null
+++ b/bluetooth/audio/utils/hfp_codec_capabilities/schema/removed.txt
@@ -0,0 +1 @@
+// Signature format: 2.0
diff --git a/bluetooth/finder/aidl/vts/VtsHalBluetoothFinderTargetTest.cpp b/bluetooth/finder/aidl/vts/VtsHalBluetoothFinderTargetTest.cpp
index be07a7d..fee9e242 100644
--- a/bluetooth/finder/aidl/vts/VtsHalBluetoothFinderTargetTest.cpp
+++ b/bluetooth/finder/aidl/vts/VtsHalBluetoothFinderTargetTest.cpp
@@ -18,6 +18,7 @@
#include <aidl/Vintf.h>
#include <aidl/android/hardware/bluetooth/finder/IBluetoothFinder.h>
#include <android-base/logging.h>
+#include <android-base/properties.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
#include <binder/IServiceManager.h>
@@ -71,6 +72,12 @@
return bluetooth_finder->getPoweredOffFinderMode(status);
}
+TEST_P(BluetoothFinderTest, PropertyIsSet) {
+ ASSERT_EQ(
+ android::base::GetProperty("ro.bluetooth.finder.supported", "false"),
+ "true");
+}
+
TEST_P(BluetoothFinderTest, SendEidsSingle) {
ScopedAStatus status = sendEids(1);
ASSERT_TRUE(status.isOk());
diff --git a/broadcastradio/aidl/Android.bp b/broadcastradio/aidl/Android.bp
index 3f89029..e8bc5eb 100644
--- a/broadcastradio/aidl/Android.bp
+++ b/broadcastradio/aidl/Android.bp
@@ -43,6 +43,6 @@
imports: [],
},
],
- frozen: true,
+ frozen: false,
}
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl
index fe8489c..b96def3 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/AmFmRegionConfig.aidl
@@ -37,8 +37,8 @@
android.hardware.broadcastradio.AmFmBandRange[] ranges;
int fmDeemphasis;
int fmRds;
- const int DEEMPHASIS_D50 = (1 << 0);
- const int DEEMPHASIS_D75 = (1 << 1);
- const int RDS = (1 << 0);
- const int RBDS = (1 << 1);
+ const int DEEMPHASIS_D50 = (1 << 0) /* 1 */;
+ const int DEEMPHASIS_D75 = (1 << 1) /* 2 */;
+ const int RDS = (1 << 0) /* 1 */;
+ const int RBDS = (1 << 1) /* 2 */;
}
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl
index 98af437..d6d33bc 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ConfigFlag.aidl
@@ -35,6 +35,9 @@
@Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability
enum ConfigFlag {
FORCE_MONO = 1,
+ /**
+ * @deprecated Use {link #FORCE_ANALOG_FM} instead
+ */
FORCE_ANALOG,
FORCE_DIGITAL,
RDS_AF,
@@ -43,4 +46,6 @@
DAB_FM_LINKING,
DAB_DAB_SOFT_LINKING,
DAB_FM_SOFT_LINKING,
+ FORCE_ANALOG_FM,
+ FORCE_ANALOG_AM,
}
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/HdSubChannel.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/HdSubChannel.aidl
new file mode 100644
index 0000000..dd06134
--- /dev/null
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/HdSubChannel.aidl
@@ -0,0 +1,45 @@
+/*
+ * 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.broadcastradio;
+@Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability
+enum HdSubChannel {
+ HD1 = 0,
+ HD2 = 1,
+ HD3 = 2,
+ HD4 = 3,
+ HD5 = 4,
+ HD6 = 5,
+ HD7 = 6,
+ HD8 = 7,
+}
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl
index 4df272c..ed41af0 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/IdentifierType.aidl
@@ -47,6 +47,13 @@
DAB_FREQUENCY_KHZ,
DRMO_SERVICE_ID,
DRMO_FREQUENCY_KHZ,
- SXM_SERVICE_ID = (DRMO_FREQUENCY_KHZ + 2),
+ /**
+ * @deprecated SiriusXM Satellite Radio is not supported.
+ */
+ SXM_SERVICE_ID = (DRMO_FREQUENCY_KHZ + 2) /* 12 */,
+ /**
+ * @deprecated SiriusXM Satellite Radio is not supported.
+ */
SXM_CHANNEL,
+ HD_STATION_LOCATION,
}
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Metadata.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Metadata.aidl
index e02b6b1..b4a1efa 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Metadata.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Metadata.aidl
@@ -50,4 +50,12 @@
String dabServiceNameShort;
String dabComponentName;
String dabComponentNameShort;
+ String genre;
+ String commentShortDescription;
+ String commentActualText;
+ String commercial;
+ String[] ufids;
+ String hdStationNameShort;
+ String hdStationNameLong;
+ int hdSubChannelsAvailable;
}
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl
index b14023a..997cdd7 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/ProgramInfo.aidl
@@ -42,10 +42,13 @@
int signalQuality;
android.hardware.broadcastradio.Metadata[] metadata;
android.hardware.broadcastradio.VendorKeyValue[] vendorInfo;
- const int FLAG_LIVE = (1 << 0);
- const int FLAG_MUTED = (1 << 1);
- const int FLAG_TRAFFIC_PROGRAM = (1 << 2);
- const int FLAG_TRAFFIC_ANNOUNCEMENT = (1 << 3);
- const int FLAG_TUNABLE = (1 << 4);
- const int FLAG_STEREO = (1 << 5);
+ const int FLAG_LIVE = (1 << 0) /* 1 */;
+ const int FLAG_MUTED = (1 << 1) /* 2 */;
+ const int FLAG_TRAFFIC_PROGRAM = (1 << 2) /* 4 */;
+ const int FLAG_TRAFFIC_ANNOUNCEMENT = (1 << 3) /* 8 */;
+ const int FLAG_TUNABLE = (1 << 4) /* 16 */;
+ const int FLAG_STEREO = (1 << 5) /* 32 */;
+ const int FLAG_SIGNAL_ACQUISITION = (1 << 6) /* 64 */;
+ const int FLAG_HD_SIS_ACQUISITION = (1 << 7) /* 128 */;
+ const int FLAG_HD_AUDIO_ACQUISITION = (1 << 8) /* 256 */;
}
diff --git a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl
index 8af74c7..b0fc018 100644
--- a/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl
+++ b/broadcastradio/aidl/aidl_api/android.hardware.broadcastradio/current/android/hardware/broadcastradio/Result.aidl
@@ -34,7 +34,7 @@
package android.hardware.broadcastradio;
@Backing(type="int") @JavaDerive(equals=true, toString=true) @VintfStability
enum Result {
- OK,
+ OK = 0,
INTERNAL_ERROR,
INVALID_ARGUMENTS,
INVALID_STATE,
diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/ConfigFlag.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/ConfigFlag.aidl
index 11da39c..ddf60e0 100644
--- a/broadcastradio/aidl/android/hardware/broadcastradio/ConfigFlag.aidl
+++ b/broadcastradio/aidl/android/hardware/broadcastradio/ConfigFlag.aidl
@@ -36,10 +36,12 @@
* Forces the analog playback for the supporting radio technology.
*
* User may disable digital playback for FM HD Radio or hybrid FM/DAB with
- * this option. This is purely user choice, ie. does not reflect digital-
+ * this option. This is purely user choice, i.e. does not reflect digital-
* analog handover state managed from the HAL implementation side.
*
- * Some radio technologies may not support this, ie. DAB.
+ * Some radio technologies may not support this, i.e. DAB.
+ *
+ * @deprecated Use {link #FORCE_ANALOG_FM} instead
*/
FORCE_ANALOG,
@@ -89,4 +91,26 @@
* Enables DAB-FM soft-linking (related content).
*/
DAB_FM_SOFT_LINKING,
+
+ /**
+ * Forces the FM analog playback for the supporting radio technology.
+ *
+ * User may disable FM digital playback for FM HD Radio or hybrid FM/DAB
+ * with this option. This is purely user choice, i.e. does not reflect
+ * digital-analog handover state managed from the HAL implementation side.
+ *
+ * Some radio technologies may not support this, i.e. DAB.
+ */
+ FORCE_ANALOG_FM,
+
+ /**
+ * Forces the AM analog playback for the supporting radio technology.
+ *
+ * User may disable AM digital playback for AM HD Radio or hybrid AM/DAB
+ * with this option. This is purely user choice, i.e. does not reflect
+ * digital-analog handover state managed from the HAL implementation side.
+ *
+ * Some radio technologies may not support this, i.e. DAB.
+ */
+ FORCE_ANALOG_AM,
}
diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/HdSubChannel.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/HdSubChannel.aidl
new file mode 100644
index 0000000..46a3e0c
--- /dev/null
+++ b/broadcastradio/aidl/android/hardware/broadcastradio/HdSubChannel.aidl
@@ -0,0 +1,62 @@
+/*
+ * 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.
+ */
+
+package android.hardware.broadcastradio;
+
+/**
+ * Index of HD radio subchannel.
+ */
+@VintfStability
+@Backing(type="int")
+@JavaDerive(equals=true, toString=true)
+enum HdSubChannel {
+ /**
+ * Index of HD radio subchannel 1.
+ *
+ * <p>There are at most 8 HD radio subchannels of 1-based om HD radio standard. It is
+ * converted to 0-based index. 0 is the index of main program service (MPS). 1 to 7
+ * are indexes of additional supplemental program services (SPS).
+ */
+ HD1 = 0,
+ /**
+ * {@see HD1}
+ */
+ HD2 = 1,
+ /**
+ * {@see HD1}
+ */
+ HD3 = 2,
+ /**
+ * {@see HD1}
+ */
+ HD4 = 3,
+ /**
+ * {@see HD1}
+ */
+ HD5 = 4,
+ /**
+ * {@see HD1}
+ */
+ HD6 = 5,
+ /**
+ * {@see HD1}
+ */
+ HD7 = 6,
+ /**
+ * {@see HD1}
+ */
+ HD8 = 7,
+}
diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl
index 646c502..4a95a41 100644
--- a/broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl
+++ b/broadcastradio/aidl/android/hardware/broadcastradio/IdentifierType.aidl
@@ -154,11 +154,42 @@
/**
* 32bit primary identifier for SiriusXM Satellite Radio.
+ *
+ * @deprecated SiriusXM Satellite Radio is not supported.
*/
SXM_SERVICE_ID = DRMO_FREQUENCY_KHZ + 2,
/**
* 0-999 range
+ *
+ * @deprecated SiriusXM Satellite Radio is not supported.
*/
SXM_CHANNEL,
+
+ /**
+ * 64bit additional identifier for HD Radio representing station location.
+ *
+ * Consists of (from the LSB):
+ * - 4 bit: Bits 0:3 of altitude
+ * - 13 bit: Fractional bits of longitude
+ * - 8 bit: Integer bits of longitude
+ * - 1 bit: 0 for east and 1 for west for longitude
+ * - 1 bit: 0, representing latitude
+ * - 5 bit: pad of zeros separating longitude and latitude
+ * - 4 bit: Bits 4:7 of altitude
+ * - 13 bit: Fractional bits of latitude
+ * - 8 bit: Integer bits of latitude
+ * - 1 bit: 0 for north and 1 for south for latitude
+ * - 1 bit: 1, representing latitude
+ * - 5 bit: pad of zeros
+ *
+ * This format is defined in NRSC-5-C document: SY_IDD_1020s.
+ *
+ * Due to Station ID abuse, some HD_STATION_ID_EXT identifiers may be not
+ * globally unique. To provide a best-effort solution, the station’s
+ * broadcast antenna containing the latitude and longitude may be carried
+ * as additional identifier and may be used by the tuner hardware to
+ * double-check tuning.
+ */
+ HD_STATION_LOCATION,
}
diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl
index 7769b8c..0ce967f 100644
--- a/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl
+++ b/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl
@@ -116,4 +116,70 @@
* <p>Note: The string must be up to 8 characters long.
*/
String dabComponentNameShort;
+
+ /**
+ * Genre of the current audio piece (string)
+ *
+ * <p>(see NRSC-G200-A and id3v2.3.0 for more info)
+ */
+ String genre;
+
+ /**
+ * Short context description of comment (string)
+ *
+ * <p>Comment could relate to the current audio program content, or it might
+ * be unrelated information that the station chooses to send. It is
+ * composed of short content description and actual text (see NRSC-G200-A
+ * and id3v2.3.0 for more info).
+ */
+ String commentShortDescription;
+
+ /**
+ * Actual text of comment (string)
+ *
+ * @see #commentShortDescription
+ */
+ String commentActualText;
+
+ /**
+ * Commercial (string)
+ *
+ * <p>Commercial is application specific and generally used to facilitate the
+ * sale of products and services (see NRSC-G200-A and id3v2.3.0 for more info).
+ */
+ String commercial;
+
+ /**
+ * HD Unique File Identifiers (Array of strings)
+ *
+ * <p>Unique File Identifier (UFID) can be used to transmit an alphanumeric
+ * identifier of the current content, or of an advertised product or service
+ * (see NRSC-G200-A and id3v2.3.0 for more info).
+ */
+ String[] ufids;
+
+ /**
+ * HD short station name or HD universal short station name
+ *
+ * <p>It can be up to 12 characters (see SY_IDD_1020s for more info).
+ */
+ String hdStationNameShort;
+
+ /**
+ * HD long station name, HD station slogan or HD station message
+ *
+ * <p>(see SY_IDD_1020s for more info)
+ */
+ String hdStationNameLong;
+
+ /**
+ * Bit mask of all HD Radio subchannels available (uint8_t)
+ *
+ * <p>Bit {@link HdSubChannel#HD1} from LSB represents the availability
+ * of HD-1 subchannel (main program service, MPS). Bits
+ * {@link HdSubChannel#HD2} to {@link HdSubChannel#HD8} from LSB represent
+ * HD-2 to HD-8 subchannel (supplemental program services, SPS)
+ * respectively.
+ */
+ int hdSubChannelsAvailable;
}
diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/ProgramInfo.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramInfo.aidl
index 7632c81..d4ccd01 100644
--- a/broadcastradio/aidl/android/hardware/broadcastradio/ProgramInfo.aidl
+++ b/broadcastradio/aidl/android/hardware/broadcastradio/ProgramInfo.aidl
@@ -71,6 +71,23 @@
const int FLAG_STEREO = 1 << 5;
/**
+ * A signal has been acquired if this bit is set.
+ */
+
+ const int FLAG_SIGNAL_ACQUISITION = 1 << 6;
+ /**
+ * An HD Station Information Service (SIS) information is available if this
+ * bit is set.
+ */
+
+ const int FLAG_HD_SIS_ACQUISITION = 1 << 7;
+
+ /**
+ * An HD digital audio is available if this bit is set.
+ */
+ const int FLAG_HD_AUDIO_ACQUISITION = 1 << 8;
+
+ /**
* An identifier used to point at the program (primarily to tune to it).
*
* This field is required - its type field must not be set to
@@ -153,7 +170,8 @@
*
* It can be a combination of {@link #FLAG_LIVE}, {@link #FLAG_MUTED},
* {@link #FLAG_TRAFFIC_PROGRAM}, {@link #FLAG_TRAFFIC_ANNOUNCEMENT},
- * {@link #FLAG_TUNABLE}, and {@link #FLAG_STEREO}.
+ * {@link #FLAG_TUNABLE}, {@link #FLAG_STEREO}, {@link #FLAG_SIGNAL_ACQUISITION},
+ * {@link #FLAG_HD_SIS_ACQUISITION}, and {@link #FLAG_HD_AUDIO_ACQUISITION}.
*/
int infoFlags;
diff --git a/broadcastradio/aidl/default/Android.bp b/broadcastradio/aidl/default/Android.bp
index 720aa8a..743365a 100644
--- a/broadcastradio/aidl/default/Android.bp
+++ b/broadcastradio/aidl/default/Android.bp
@@ -23,32 +23,75 @@
default_applicable_licenses: ["hardware_interfaces_license"],
}
+cc_defaults {
+ name: "BroadcastRadioHalDefaults",
+ static_libs: [
+ "android.hardware.broadcastradio@common-utils-aidl-lib-V2",
+ "android.hardware.broadcastradio@common-utils-lib",
+ ],
+ shared_libs: [
+ "android.hardware.broadcastradio-V2-ndk",
+ "libbase",
+ "libbinder_ndk",
+ "liblog",
+ "libcutils",
+ ],
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Werror",
+ ],
+}
+
cc_binary {
name: "android.hardware.broadcastradio-service.default",
relative_install_path: "hw",
init_rc: ["broadcastradio-default.rc"],
vintf_fragments: ["broadcastradio-default.xml"],
vendor: true,
- cflags: [
- "-Wall",
- "-Wextra",
- "-Werror",
+ defaults: [
+ "BroadcastRadioHalDefaults",
+ ],
+ srcs: [
+ "main.cpp",
+ ],
+ static_libs: [
+ "DefaultBroadcastRadioHal",
+ ],
+}
+
+cc_library {
+ name: "DefaultBroadcastRadioHal",
+ vendor_available: true,
+ export_include_dirs: ["."],
+ defaults: [
+ "BroadcastRadioHalDefaults",
],
srcs: [
"BroadcastRadio.cpp",
- "main.cpp",
"VirtualProgram.cpp",
"VirtualRadio.cpp",
],
+}
+
+cc_fuzz {
+ name: "android.hardware.broadcastradio-service.default_fuzzer",
+ // TODO(b/307611931): avoid fuzzing on vendor until hermiticity issue is fixed
+ // vendor: true,
+ defaults: [
+ "BroadcastRadioHalDefaults",
+ "service_fuzzer_defaults",
+ ],
static_libs: [
- "android.hardware.broadcastradio@common-utils-aidl-lib",
- "android.hardware.broadcastradio@common-utils-lib",
+ "DefaultBroadcastRadioHal",
+ "android.hardware.broadcastradio-V2-ndk",
],
- shared_libs: [
- "android.hardware.broadcastradio-V1-ndk",
- "libbase",
- "libbinder_ndk",
- "liblog",
- "libcutils",
+ srcs: [
+ "fuzzer.cpp",
],
+ fuzz_config: {
+ cc: [
+ "xuweilin@google.com",
+ ],
+ },
}
diff --git a/broadcastradio/aidl/default/BroadcastRadio.cpp b/broadcastradio/aidl/default/BroadcastRadio.cpp
index c0c475a..4d6d81d 100644
--- a/broadcastradio/aidl/default/BroadcastRadio.cpp
+++ b/broadcastradio/aidl/default/BroadcastRadio.cpp
@@ -16,6 +16,7 @@
#include "BroadcastRadio.h"
#include <broadcastradio-utils-aidl/Utils.h>
+#include <broadcastradio-utils-aidl/UtilsV2.h>
#include "resources.h"
#include <aidl/android/hardware/broadcastradio/IdentifierType.h>
@@ -47,6 +48,8 @@
inline constexpr std::chrono::seconds kListDelayTimeS = 1s;
// clang-format off
+const AmFmBandRange kFmFullBandRange = {65000, 108000, 10, 0};
+const AmFmBandRange kAmFullBandRange = {150, 30000, 1, 0};
const AmFmRegionConfig kDefaultAmFmConfig = {
{
{87500, 108000, 100, 100}, // FM
@@ -63,12 +66,7 @@
prop.maker = "Android";
prop.product = virtualRadio.getName();
- prop.supportedIdentifierTypes = vector<IdentifierType>({
- IdentifierType::AMFM_FREQUENCY_KHZ,
- IdentifierType::RDS_PI,
- IdentifierType::HD_STATION_ID_EXT,
- IdentifierType::DAB_SID_EXT,
- });
+ prop.supportedIdentifierTypes = virtualRadio.getSupportedIdentifierTypes();
prop.vendorInfo = vector<VendorKeyValue>({
{"com.android.sample", "sample"},
});
@@ -76,14 +74,71 @@
return prop;
}
+bool isDigitalProgramAllowed(const ProgramSelector& sel, bool forceAnalogFm, bool forceAnalogAm) {
+ if (sel.primaryId.type != IdentifierType::HD_STATION_ID_EXT) {
+ return true;
+ }
+ int32_t freq = static_cast<int32_t>(utils::getAmFmFrequency(sel));
+ bool isFm = freq >= kFmFullBandRange.lowerBound && freq <= kFmFullBandRange.upperBound;
+ return isFm ? !forceAnalogFm : !forceAnalogAm;
+}
+
+/**
+ * Checks whether a program selector is in the current band.
+ *
+ * <p>For an AM/FM program, this method checks whether it is in the current AM/FM band. For a
+ * program selector is also an HD program, it is also checked whether HD radio is enabled in the
+ * current AM/FM band. For a non-AM/FM program, the method will returns {@code true} directly.
+ * @param sel Program selector to be checked
+ * @param currentAmFmBandRange the current AM/FM band
+ * @param forceAnalogFm whether FM band is forced to be analog
+ * @param forceAnalogAm whether AM band is forced to be analog
+ * @return whether the program selector is in the current band if it is an AM/FM (including HD)
+ * selector, {@code true} otherwise
+ */
+bool isProgramInBand(const ProgramSelector& sel,
+ const std::optional<AmFmBandRange>& currentAmFmBandRange, bool forceAnalogFm,
+ bool forceAnalogAm) {
+ if (!utils::hasAmFmFrequency(sel)) {
+ return true;
+ }
+ if (!currentAmFmBandRange.has_value()) {
+ return false;
+ }
+ int32_t freq = static_cast<int32_t>(utils::getAmFmFrequency(sel));
+ if (freq < currentAmFmBandRange->lowerBound || freq > currentAmFmBandRange->upperBound) {
+ return false;
+ }
+ return isDigitalProgramAllowed(sel, forceAnalogFm, forceAnalogAm);
+}
+
// Makes ProgramInfo that does not point to any particular program
ProgramInfo makeSampleProgramInfo(const ProgramSelector& selector) {
ProgramInfo info = {};
info.selector = selector;
- info.logicallyTunedTo =
- utils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ,
- utils::getId(selector, IdentifierType::AMFM_FREQUENCY_KHZ));
- info.physicallyTunedTo = info.logicallyTunedTo;
+ switch (info.selector.primaryId.type) {
+ case IdentifierType::AMFM_FREQUENCY_KHZ:
+ info.logicallyTunedTo = utils::makeIdentifier(
+ IdentifierType::AMFM_FREQUENCY_KHZ,
+ utils::getId(selector, IdentifierType::AMFM_FREQUENCY_KHZ));
+ info.physicallyTunedTo = info.logicallyTunedTo;
+ break;
+ case IdentifierType::HD_STATION_ID_EXT:
+ info.logicallyTunedTo = utils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ,
+ utils::getAmFmFrequency(info.selector));
+ info.physicallyTunedTo = info.logicallyTunedTo;
+ break;
+ case IdentifierType::DAB_SID_EXT:
+ info.logicallyTunedTo = info.selector.primaryId;
+ info.physicallyTunedTo = utils::makeIdentifier(
+ IdentifierType::DAB_FREQUENCY_KHZ,
+ utils::getId(selector, IdentifierType::DAB_FREQUENCY_KHZ));
+ break;
+ default:
+ info.logicallyTunedTo = info.selector.primaryId;
+ info.physicallyTunedTo = info.logicallyTunedTo;
+ break;
+ }
return info;
}
@@ -111,19 +166,21 @@
} else {
mCurrentProgram = sel;
}
+ adjustAmFmRangeLocked();
}
}
BroadcastRadio::~BroadcastRadio() {
- mThread.reset();
+ mTuningThread.reset();
+ mProgramListThread.reset();
}
ScopedAStatus BroadcastRadio::getAmFmRegionConfig(bool full, AmFmRegionConfig* returnConfigs) {
if (full) {
*returnConfigs = {};
returnConfigs->ranges = vector<AmFmBandRange>({
- {65000, 108000, 10, 0}, // FM
- {150, 30000, 1, 0}, // AM
+ kFmFullBandRange,
+ kAmFullBandRange,
});
returnConfigs->fmDeemphasis =
AmFmRegionConfig::DEEMPHASIS_D50 | AmFmRegionConfig::DEEMPHASIS_D75;
@@ -169,14 +226,27 @@
VirtualProgram virtualProgram = {};
ProgramInfo programInfo;
- if (mVirtualRadio.getProgram(sel, &virtualProgram)) {
+ bool isProgramAllowed =
+ isDigitalProgramAllowed(sel, isConfigFlagSetLocked(ConfigFlag::FORCE_ANALOG_FM),
+ isConfigFlagSetLocked(ConfigFlag::FORCE_ANALOG_AM));
+ if (isProgramAllowed && mVirtualRadio.getProgram(sel, &virtualProgram)) {
mCurrentProgram = virtualProgram.selector;
programInfo = virtualProgram;
} else {
- mCurrentProgram = sel;
+ if (!isProgramAllowed) {
+ mCurrentProgram = utils::makeSelectorAmfm(utils::getAmFmFrequency(sel));
+ } else {
+ mCurrentProgram = sel;
+ }
programInfo = makeSampleProgramInfo(sel);
}
- mIsTuneCompleted = true;
+ programInfo.infoFlags |= ProgramInfo::FLAG_SIGNAL_ACQUISITION;
+ if (programInfo.selector.primaryId.type != IdentifierType::HD_STATION_ID_EXT) {
+ mIsTuneCompleted = true;
+ }
+ if (adjustAmFmRangeLocked()) {
+ startProgramListUpdatesLocked({});
+ }
return programInfo;
}
@@ -204,6 +274,32 @@
return ScopedAStatus::ok();
}
+void BroadcastRadio::handleProgramInfoUpdateRadioCallback(
+ ProgramInfo programInfo, const std::shared_ptr<ITunerCallback>& callback) {
+ callback->onCurrentProgramInfoChanged(programInfo);
+ if (programInfo.selector.primaryId.type != IdentifierType::HD_STATION_ID_EXT) {
+ return;
+ }
+ ProgramSelector sel = programInfo.selector;
+ auto cancelTask = [sel, callback]() { callback->onTuneFailed(Result::CANCELED, sel); };
+ programInfo.infoFlags |= ProgramInfo::FLAG_HD_SIS_ACQUISITION;
+ auto sisAcquiredTask = [this, callback, programInfo, cancelTask]() {
+ callback->onCurrentProgramInfoChanged(programInfo);
+ auto audioAcquiredTask = [this, callback, programInfo]() {
+ ProgramInfo hdProgramInfoWithAudio = programInfo;
+ hdProgramInfoWithAudio.infoFlags |= ProgramInfo::FLAG_HD_AUDIO_ACQUISITION;
+ callback->onCurrentProgramInfoChanged(hdProgramInfoWithAudio);
+ lock_guard<mutex> lk(mMutex);
+ mIsTuneCompleted = true;
+ };
+ lock_guard<mutex> lk(mMutex);
+ mTuningThread->schedule(audioAcquiredTask, cancelTask, kTuneDelayTimeMs);
+ };
+
+ lock_guard<mutex> lk(mMutex);
+ mTuningThread->schedule(sisAcquiredTask, cancelTask, kTuneDelayTimeMs);
+}
+
ScopedAStatus BroadcastRadio::tune(const ProgramSelector& program) {
LOG(DEBUG) << __func__ << ": tune to " << program.toString() << "...";
@@ -220,7 +316,7 @@
resultToInt(Result::NOT_SUPPORTED), "selector is not supported");
}
- if (!utils::isValid(program)) {
+ if (!utils::isValidV2(program)) {
LOG(ERROR) << __func__ << ": selector is not valid: " << program.toString();
return ScopedAStatus::fromServiceSpecificErrorWithMessage(
resultToInt(Result::INVALID_ARGUMENTS), "selector is not valid");
@@ -236,14 +332,130 @@
lock_guard<mutex> lk(mMutex);
programInfo = tuneInternalLocked(program);
}
- callback->onCurrentProgramInfoChanged(programInfo);
+ handleProgramInfoUpdateRadioCallback(programInfo, callback);
};
auto cancelTask = [program, callback]() { callback->onTuneFailed(Result::CANCELED, program); };
- mThread->schedule(task, cancelTask, kTuneDelayTimeMs);
+ mTuningThread->schedule(task, cancelTask, kTuneDelayTimeMs);
return ScopedAStatus::ok();
}
+bool BroadcastRadio::findNextLocked(const ProgramSelector& current, bool directionUp,
+ bool skipSubChannel, VirtualProgram* nextProgram) const {
+ if (mProgramList.empty()) {
+ return false;
+ }
+ // The list is not sorted here since it has already stored in VirtualRadio.
+ bool hasAmFmFrequency = utils::hasAmFmFrequency(current);
+ bool hasDabSId = utils::hasId(current, IdentifierType::DAB_SID_EXT);
+ uint32_t currentChannel =
+ hasAmFmFrequency ? utils::getAmFmFrequency(current) : utils::getDabSId(current);
+ auto found =
+ std::lower_bound(mProgramList.begin(), mProgramList.end(), VirtualProgram({current}));
+ if (directionUp) {
+ if (found < mProgramList.end() - 1) {
+ // When seeking up, tuner will jump to the first selector which is main program service
+ // greater than and of the same band as the current program selector in the program
+ // list (if not exist, jump to the first selector in the same band) for skipping
+ // sub-channels case or AM/FM without HD radio enabled case. Otherwise, the tuner will
+ // jump to the first selector which is greater than and of the same band as the current
+ // program selector.
+ if (utils::tunesTo(current, found->selector)) found++;
+ if (skipSubChannel) {
+ if (hasAmFmFrequency || hasDabSId) {
+ auto firstFound = found;
+ while ((hasAmFmFrequency &&
+ utils::getAmFmFrequency(found->selector) == currentChannel) ||
+ (hasDabSId && utils::getDabSId(found->selector) == currentChannel)) {
+ if (found < mProgramList.end() - 1) {
+ found++;
+ } else {
+ found = mProgramList.begin();
+ }
+ if (found == firstFound) {
+ // Only one main channel exists in the program list, the tuner cannot
+ // skip sub-channel to the next program selector.
+ return false;
+ }
+ }
+ }
+ }
+ } else {
+ // If the selector of current program is no less than all selectors of the same band or
+ // not found in the program list, seeking up should wrap the tuner to the first program
+ // selector of the same band in the program list.
+ found = mProgramList.begin();
+ }
+ } else {
+ if (found > mProgramList.begin() && found != mProgramList.end()) {
+ // When seeking down, tuner will jump to the first selector which is main program
+ // service less than and of the same band as the current program selector in the
+ // program list (if not exist, jump to the last main program service selector of the
+ // same band) for skipping sub-channels case or AM/FM without HD radio enabled case.
+ // Otherwise, the tuner will jump to the first selector less than and of the same band
+ // as the current program selector.
+ found--;
+ if ((hasAmFmFrequency && utils::hasAmFmFrequency(found->selector)) ||
+ (hasDabSId && utils::hasId(found->selector, IdentifierType::DAB_SID_EXT))) {
+ uint32_t nextChannel = hasAmFmFrequency ? utils::getAmFmFrequency(found->selector)
+ : utils::getDabSId(found->selector);
+ if (nextChannel != currentChannel) {
+ jumpToFirstSubChannelLocked(found);
+ } else if (skipSubChannel) {
+ jumpToFirstSubChannelLocked(found);
+ auto firstFound = found;
+ if (found > mProgramList.begin()) {
+ found--;
+ } else {
+ found = mProgramList.end() - 1;
+ }
+ jumpToFirstSubChannelLocked(found);
+ if (found == firstFound) {
+ // Only one main channel exists in the program list, the tuner cannot skip
+ // sub-channel to the next program selector.
+ return false;
+ }
+ }
+ }
+ } else {
+ // If the selector of current program is no greater than all selectors of the same band
+ // or not found in the program list, seeking down should wrap the tuner to the last
+ // selector of the same band in the program list. If the last program selector in the
+ // program list is sub-channel and skipping sub-channels is needed, the tuner will jump
+ // to the last main program service of the same band in the program list.
+ found = mProgramList.end() - 1;
+ jumpToFirstSubChannelLocked(found);
+ }
+ }
+ *nextProgram = *found;
+ return true;
+}
+
+void BroadcastRadio::jumpToFirstSubChannelLocked(vector<VirtualProgram>::const_iterator& it) const {
+ if (it == mProgramList.begin()) {
+ return;
+ }
+ bool hasAmFmFrequency = utils::hasAmFmFrequency(it->selector);
+ bool hasDabSId = utils::hasId(it->selector, IdentifierType::DAB_SID_EXT);
+ if (hasAmFmFrequency || hasDabSId) {
+ uint32_t currentChannel = hasAmFmFrequency ? utils::getAmFmFrequency(it->selector)
+ : utils::getDabSId(it->selector);
+ it--;
+ while (it != mProgramList.begin()) {
+ if (hasAmFmFrequency && utils::hasAmFmFrequency(it->selector) &&
+ utils::getAmFmFrequency(it->selector) == currentChannel) {
+ it--;
+ } else if (hasDabSId && utils::hasId(it->selector, IdentifierType::DAB_SID_EXT) &&
+ utils::getDabSId(it->selector) == currentChannel) {
+ it--;
+ } else {
+ break;
+ }
+ }
+ it++;
+ }
+}
+
ScopedAStatus BroadcastRadio::seek(bool directionUp, bool skipSubChannel) {
LOG(DEBUG) << __func__ << ": seek " << (directionUp ? "up" : "down") << " with skipSubChannel? "
<< (skipSubChannel ? "yes" : "no") << "...";
@@ -257,50 +469,40 @@
cancelLocked();
+ auto filterCb = [this](const VirtualProgram& program) {
+ return isProgramInBand(program.selector, mCurrentAmFmBandRange,
+ isConfigFlagSetLocked(ConfigFlag::FORCE_ANALOG_FM),
+ isConfigFlagSetLocked(ConfigFlag::FORCE_ANALOG_AM));
+ };
const auto& list = mVirtualRadio.getProgramList();
+ mProgramList.clear();
+ std::copy_if(list.begin(), list.end(), std::back_inserter(mProgramList), filterCb);
std::shared_ptr<ITunerCallback> callback = mCallback;
auto cancelTask = [callback]() { callback->onTuneFailed(Result::CANCELED, {}); };
- if (list.empty()) {
- mIsTuneCompleted = false;
+
+ VirtualProgram nextProgram = {};
+ bool foundNext = findNextLocked(mCurrentProgram, directionUp, skipSubChannel, &nextProgram);
+ mIsTuneCompleted = false;
+ if (!foundNext) {
auto task = [callback]() {
LOG(DEBUG) << "seek: program list is empty, seek couldn't stop";
callback->onTuneFailed(Result::TIMEOUT, {});
};
- mThread->schedule(task, cancelTask, kSeekDelayTimeMs);
+ mTuningThread->schedule(task, cancelTask, kSeekDelayTimeMs);
return ScopedAStatus::ok();
}
- // The list is not sorted here since it has already stored in VirtualRadio.
- // If the list is not sorted in advance, it should be sorted here.
- const auto& current = mCurrentProgram;
- auto found = std::lower_bound(list.begin(), list.end(), VirtualProgram({current}));
- if (directionUp) {
- if (found < list.end() - 1) {
- if (tunesTo(current, found->selector)) found++;
- } else {
- found = list.begin();
- }
- } else {
- if (found > list.begin() && found != list.end()) {
- found--;
- } else {
- found = list.end() - 1;
- }
- }
- const ProgramSelector tuneTo = found->selector;
-
- mIsTuneCompleted = false;
- auto task = [this, tuneTo, callback]() {
+ auto task = [this, nextProgram, callback]() {
ProgramInfo programInfo = {};
{
lock_guard<mutex> lk(mMutex);
- programInfo = tuneInternalLocked(tuneTo);
+ programInfo = tuneInternalLocked(nextProgram.selector);
}
- callback->onCurrentProgramInfoChanged(programInfo);
+ handleProgramInfoUpdateRadioCallback(programInfo, callback);
};
- mThread->schedule(task, cancelTask, kSeekDelayTimeMs);
+ mTuningThread->schedule(task, cancelTask, kSeekDelayTimeMs);
return ScopedAStatus::ok();
}
@@ -317,31 +519,33 @@
cancelLocked();
- if (!utils::hasId(mCurrentProgram, IdentifierType::AMFM_FREQUENCY_KHZ)) {
+ int64_t stepTo;
+ if (utils::hasId(mCurrentProgram, IdentifierType::AMFM_FREQUENCY_KHZ)) {
+ stepTo = utils::getId(mCurrentProgram, IdentifierType::AMFM_FREQUENCY_KHZ);
+ } else if (mCurrentProgram.primaryId.type == IdentifierType::HD_STATION_ID_EXT) {
+ stepTo = utils::getHdFrequency(mCurrentProgram);
+ } else {
LOG(WARNING) << __func__ << ": can't step in anything else than AM/FM";
return ScopedAStatus::fromServiceSpecificErrorWithMessage(
resultToInt(Result::NOT_SUPPORTED), "cannot step in anything else than AM/FM");
}
- int64_t stepTo = utils::getId(mCurrentProgram, IdentifierType::AMFM_FREQUENCY_KHZ);
- std::optional<AmFmBandRange> range = getAmFmRangeLocked();
- if (!range) {
- LOG(ERROR) << __func__ << ": can't find current band or tune operation is in process";
- ScopedAStatus::fromServiceSpecificErrorWithMessage(
- resultToInt(Result::INTERNAL_ERROR),
- "can't find current band or tune operation is in process");
+ if (!mCurrentAmFmBandRange.has_value()) {
+ LOG(ERROR) << __func__ << ": can't find current band";
+ return ScopedAStatus::fromServiceSpecificErrorWithMessage(
+ resultToInt(Result::INTERNAL_ERROR), "can't find current band");
}
if (directionUp) {
- stepTo += range->spacing;
+ stepTo += mCurrentAmFmBandRange->spacing;
} else {
- stepTo -= range->spacing;
+ stepTo -= mCurrentAmFmBandRange->spacing;
}
- if (stepTo > range->upperBound) {
- stepTo = range->lowerBound;
+ if (stepTo > mCurrentAmFmBandRange->upperBound) {
+ stepTo = mCurrentAmFmBandRange->lowerBound;
}
- if (stepTo < range->lowerBound) {
- stepTo = range->upperBound;
+ if (stepTo < mCurrentAmFmBandRange->lowerBound) {
+ stepTo = mCurrentAmFmBandRange->upperBound;
}
mIsTuneCompleted = false;
@@ -352,18 +556,18 @@
lock_guard<mutex> lk(mMutex);
programInfo = tuneInternalLocked(utils::makeSelectorAmfm(stepTo));
}
- callback->onCurrentProgramInfoChanged(programInfo);
+ handleProgramInfoUpdateRadioCallback(programInfo, callback);
};
auto cancelTask = [callback]() { callback->onTuneFailed(Result::CANCELED, {}); };
- mThread->schedule(task, cancelTask, kStepDelayTimeMs);
+ mTuningThread->schedule(task, cancelTask, kStepDelayTimeMs);
return ScopedAStatus::ok();
}
void BroadcastRadio::cancelLocked() {
- LOG(DEBUG) << __func__ << ": cancelling current operations...";
+ LOG(DEBUG) << __func__ << ": cancelling current tuning operations...";
- mThread->cancelAll();
+ mTuningThread->cancelAll();
if (mCurrentProgram.primaryId.type != IdentifierType::INVALID) {
mIsTuneCompleted = true;
}
@@ -378,15 +582,15 @@
return ScopedAStatus::ok();
}
-ScopedAStatus BroadcastRadio::startProgramListUpdates(const ProgramFilter& filter) {
- LOG(DEBUG) << __func__ << ": requested program list updates, filter = " << filter.toString()
- << "...";
-
- auto filterCb = [&filter](const VirtualProgram& program) {
- return utils::satisfies(filter, program.selector);
+void BroadcastRadio::startProgramListUpdatesLocked(const ProgramFilter& filter) {
+ auto filterCb = [&filter, this](const VirtualProgram& program) {
+ return utils::satisfies(filter, program.selector) &&
+ isProgramInBand(program.selector, mCurrentAmFmBandRange,
+ isConfigFlagSetLocked(ConfigFlag::FORCE_ANALOG_FM),
+ isConfigFlagSetLocked(ConfigFlag::FORCE_ANALOG_AM));
};
- lock_guard<mutex> lk(mMutex);
+ cancelProgramListUpdateLocked();
const auto& list = mVirtualRadio.getProgramList();
vector<VirtualProgram> filteredList;
@@ -410,31 +614,65 @@
callback->onProgramListUpdated(chunk);
};
- mThread->schedule(task, kListDelayTimeS);
+ mProgramListThread->schedule(task, kListDelayTimeS);
+}
+
+ScopedAStatus BroadcastRadio::startProgramListUpdates(const ProgramFilter& filter) {
+ LOG(DEBUG) << __func__ << ": requested program list updates, filter = " << filter.toString()
+ << "...";
+
+ lock_guard<mutex> lk(mMutex);
+
+ startProgramListUpdatesLocked(filter);
return ScopedAStatus::ok();
}
+void BroadcastRadio::cancelProgramListUpdateLocked() {
+ LOG(DEBUG) << __func__ << ": cancelling current program list update operations...";
+ mProgramListThread->cancelAll();
+}
+
ScopedAStatus BroadcastRadio::stopProgramListUpdates() {
LOG(DEBUG) << __func__ << ": requested program list updates to stop...";
- // TODO(b/243681584) Implement stop program list updates method
+ lock_guard<mutex> lk(mMutex);
+ cancelProgramListUpdateLocked();
return ScopedAStatus::ok();
}
-ScopedAStatus BroadcastRadio::isConfigFlagSet(ConfigFlag flag, [[maybe_unused]] bool* returnIsSet) {
+bool BroadcastRadio::isConfigFlagSetLocked(ConfigFlag flag) const {
+ int flagBit = static_cast<int>(flag);
+ return ((mConfigFlagValues >> flagBit) & 1) == 1;
+}
+
+ScopedAStatus BroadcastRadio::isConfigFlagSet(ConfigFlag flag, bool* returnIsSet) {
LOG(DEBUG) << __func__ << ": flag = " << toString(flag);
- LOG(INFO) << __func__ << ": getting ConfigFlag is not supported";
- return ScopedAStatus::fromServiceSpecificErrorWithMessage(
- resultToInt(Result::NOT_SUPPORTED), "getting ConfigFlag is not supported");
+ if (flag == ConfigFlag::FORCE_ANALOG) {
+ flag = ConfigFlag::FORCE_ANALOG_FM;
+ }
+ lock_guard<mutex> lk(mMutex);
+ *returnIsSet = isConfigFlagSetLocked(flag);
+ return ScopedAStatus::ok();
}
ScopedAStatus BroadcastRadio::setConfigFlag(ConfigFlag flag, bool value) {
LOG(DEBUG) << __func__ << ": flag = " << toString(flag) << ", value = " << value;
- LOG(INFO) << __func__ << ": setting ConfigFlag is not supported";
- return ScopedAStatus::fromServiceSpecificErrorWithMessage(
- resultToInt(Result::NOT_SUPPORTED), "setting ConfigFlag is not supported");
+ if (flag == ConfigFlag::FORCE_ANALOG) {
+ flag = ConfigFlag::FORCE_ANALOG_FM;
+ }
+ int flagBitMask = 1 << (static_cast<int>(flag));
+ lock_guard<mutex> lk(mMutex);
+ if (value) {
+ mConfigFlagValues |= flagBitMask;
+ } else {
+ mConfigFlagValues &= ~flagBitMask;
+ }
+ if (flag == ConfigFlag::FORCE_ANALOG_AM || flag == ConfigFlag::FORCE_ANALOG_FM) {
+ startProgramListUpdatesLocked({});
+ }
+ return ScopedAStatus::ok();
}
ScopedAStatus BroadcastRadio::setParameters(
@@ -452,24 +690,25 @@
return ScopedAStatus::ok();
}
-std::optional<AmFmBandRange> BroadcastRadio::getAmFmRangeLocked() const {
- if (!mIsTuneCompleted) {
- LOG(WARNING) << __func__ << ": tune operation is in process";
- return {};
- }
- if (!utils::hasId(mCurrentProgram, IdentifierType::AMFM_FREQUENCY_KHZ)) {
+bool BroadcastRadio::adjustAmFmRangeLocked() {
+ bool hasBandBefore = mCurrentAmFmBandRange.has_value();
+ if (!utils::hasAmFmFrequency(mCurrentProgram)) {
LOG(WARNING) << __func__ << ": current program does not has AMFM_FREQUENCY_KHZ identifier";
- return {};
+ mCurrentAmFmBandRange.reset();
+ return hasBandBefore;
}
- int64_t freq = utils::getId(mCurrentProgram, IdentifierType::AMFM_FREQUENCY_KHZ);
+ int32_t freq = static_cast<int32_t>(utils::getAmFmFrequency(mCurrentProgram));
for (const auto& range : mAmFmConfig.ranges) {
if (range.lowerBound <= freq && range.upperBound >= freq) {
- return range;
+ bool isBandChanged = hasBandBefore ? *mCurrentAmFmBandRange != range : true;
+ mCurrentAmFmBandRange = range;
+ return isBandChanged;
}
}
- return {};
+ mCurrentAmFmBandRange.reset();
+ return !hasBandBefore;
}
ScopedAStatus BroadcastRadio::registerAnnouncementListener(
diff --git a/broadcastradio/aidl/default/BroadcastRadio.h b/broadcastradio/aidl/default/BroadcastRadio.h
index 1c85ddc..60ea907 100644
--- a/broadcastradio/aidl/default/BroadcastRadio.h
+++ b/broadcastradio/aidl/default/BroadcastRadio.h
@@ -39,21 +39,25 @@
public:
explicit BroadcastRadio(const VirtualRadio& virtualRadio);
~BroadcastRadio();
- ndk::ScopedAStatus getAmFmRegionConfig(bool full, AmFmRegionConfig* returnConfigs) override;
+ ndk::ScopedAStatus getAmFmRegionConfig(bool full, AmFmRegionConfig* returnConfigs)
+ EXCLUDES(mMutex) override;
ndk::ScopedAStatus getDabRegionConfig(std::vector<DabTableEntry>* returnConfigs) override;
ndk::ScopedAStatus getImage(int32_t id, std::vector<uint8_t>* returnImage) override;
- ndk::ScopedAStatus getProperties(Properties* returnProperties) override;
+ ndk::ScopedAStatus getProperties(Properties* returnProperties) EXCLUDES(mMutex) override;
- ndk::ScopedAStatus setTunerCallback(const std::shared_ptr<ITunerCallback>& callback) override;
- ndk::ScopedAStatus unsetTunerCallback() override;
- ndk::ScopedAStatus tune(const ProgramSelector& program) override;
- ndk::ScopedAStatus seek(bool directionUp, bool skipSubChannel) override;
- ndk::ScopedAStatus step(bool directionUp) override;
- ndk::ScopedAStatus cancel() override;
- ndk::ScopedAStatus startProgramListUpdates(const ProgramFilter& filter) override;
- ndk::ScopedAStatus stopProgramListUpdates() override;
- ndk::ScopedAStatus isConfigFlagSet(ConfigFlag flag, bool* returnIsSet) override;
- ndk::ScopedAStatus setConfigFlag(ConfigFlag flag, bool in_value) override;
+ ndk::ScopedAStatus setTunerCallback(const std::shared_ptr<ITunerCallback>& callback)
+ EXCLUDES(mMutex) override;
+ ndk::ScopedAStatus unsetTunerCallback() EXCLUDES(mMutex) override;
+ ndk::ScopedAStatus tune(const ProgramSelector& program) EXCLUDES(mMutex) override;
+ ndk::ScopedAStatus seek(bool directionUp, bool skipSubChannel) EXCLUDES(mMutex) override;
+ ndk::ScopedAStatus step(bool directionUp) EXCLUDES(mMutex) override;
+ ndk::ScopedAStatus cancel() EXCLUDES(mMutex) override;
+ ndk::ScopedAStatus startProgramListUpdates(const ProgramFilter& filter)
+ EXCLUDES(mMutex) override;
+ ndk::ScopedAStatus stopProgramListUpdates() EXCLUDES(mMutex) override;
+ ndk::ScopedAStatus isConfigFlagSet(ConfigFlag flag, bool* returnIsSet)
+ EXCLUDES(mMutex) override;
+ ndk::ScopedAStatus setConfigFlag(ConfigFlag flag, bool in_value) EXCLUDES(mMutex) override;
ndk::ScopedAStatus setParameters(const std::vector<VendorKeyValue>& parameters,
std::vector<VendorKeyValue>* returnParameters) override;
ndk::ScopedAStatus getParameters(const std::vector<std::string>& keys,
@@ -62,22 +66,39 @@
const std::shared_ptr<IAnnouncementListener>& listener,
const std::vector<AnnouncementType>& enabled,
std::shared_ptr<ICloseHandle>* returnCloseHandle) override;
- binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
+ binder_status_t dump(int fd, const char** args, uint32_t numArgs) EXCLUDES(mMutex) override;
private:
const VirtualRadio& mVirtualRadio;
std::mutex mMutex;
AmFmRegionConfig mAmFmConfig GUARDED_BY(mMutex);
- std::unique_ptr<::android::WorkerThread> mThread GUARDED_BY(mMutex) =
+ std::unique_ptr<::android::WorkerThread> mTuningThread GUARDED_BY(mMutex) =
+ std::unique_ptr<::android::WorkerThread>(new ::android::WorkerThread());
+ std::unique_ptr<::android::WorkerThread> mProgramListThread GUARDED_BY(mMutex) =
std::unique_ptr<::android::WorkerThread>(new ::android::WorkerThread());
bool mIsTuneCompleted GUARDED_BY(mMutex) = true;
Properties mProperties GUARDED_BY(mMutex);
ProgramSelector mCurrentProgram GUARDED_BY(mMutex) = {};
+ std::vector<VirtualProgram> mProgramList GUARDED_BY(mMutex) = {};
+ std::optional<AmFmBandRange> mCurrentAmFmBandRange GUARDED_BY(mMutex);
std::shared_ptr<ITunerCallback> mCallback GUARDED_BY(mMutex);
- std::optional<AmFmBandRange> getAmFmRangeLocked() const;
- void cancelLocked();
- ProgramInfo tuneInternalLocked(const ProgramSelector& sel);
+ // Bitmap for all ConfigFlag values
+ int mConfigFlagValues GUARDED_BY(mMutex) = 0;
+
+ bool adjustAmFmRangeLocked() REQUIRES(mMutex);
+ void cancelLocked() REQUIRES(mMutex);
+ ProgramInfo tuneInternalLocked(const ProgramSelector& sel) REQUIRES(mMutex);
+ void startProgramListUpdatesLocked(const ProgramFilter& filter) REQUIRES(mMutex);
+ void cancelProgramListUpdateLocked() REQUIRES(mMutex);
+ void handleProgramInfoUpdateRadioCallback(ProgramInfo programInfo,
+ const std::shared_ptr<ITunerCallback>& callback)
+ EXCLUDES(mMutex);
+ bool findNextLocked(const ProgramSelector& current, bool directionUp, bool skipSubChannel,
+ VirtualProgram* nextProgram) const REQUIRES(mMutex);
+ void jumpToFirstSubChannelLocked(std::vector<VirtualProgram>::const_iterator& it) const
+ REQUIRES(mMutex);
+ bool isConfigFlagSetLocked(ConfigFlag flag) const REQUIRES(mMutex);
binder_status_t cmdHelp(int fd) const;
binder_status_t cmdTune(int fd, const char** args, uint32_t numArgs);
@@ -87,7 +108,7 @@
binder_status_t cmdStartProgramListUpdates(int fd, const char** args, uint32_t numArgs);
binder_status_t cmdStopProgramListUpdates(int fd, uint32_t numArgs);
- binder_status_t dumpsys(int fd);
+ binder_status_t dumpsys(int fd) EXCLUDES(mMutex);
};
} // namespace aidl::android::hardware::broadcastradio
diff --git a/broadcastradio/aidl/default/VirtualProgram.cpp b/broadcastradio/aidl/default/VirtualProgram.cpp
index 4fe6567..fab4a49 100644
--- a/broadcastradio/aidl/default/VirtualProgram.cpp
+++ b/broadcastradio/aidl/default/VirtualProgram.cpp
@@ -49,7 +49,12 @@
break;
case IdentifierType::HD_STATION_ID_EXT:
info.logicallyTunedTo = selectId(IdentifierType::HD_STATION_ID_EXT);
- info.physicallyTunedTo = selectId(IdentifierType::AMFM_FREQUENCY_KHZ);
+ if (utils::hasId(info.selector, IdentifierType::AMFM_FREQUENCY_KHZ)) {
+ info.physicallyTunedTo = selectId(IdentifierType::AMFM_FREQUENCY_KHZ);
+ } else {
+ info.physicallyTunedTo = utils::makeIdentifier(
+ IdentifierType::AMFM_FREQUENCY_KHZ, utils::getHdFrequency(info.selector));
+ }
break;
case IdentifierType::DAB_SID_EXT:
info.logicallyTunedTo = selectId(IdentifierType::DAB_SID_EXT);
@@ -88,13 +93,7 @@
}
bool operator<(const VirtualProgram& lhs, const VirtualProgram& rhs) {
- auto& l = lhs.selector;
- auto& r = rhs.selector;
-
- // Two programs with the same primaryId are considered the same.
- if (l.primaryId.type != r.primaryId.type) return l.primaryId.type < r.primaryId.type;
-
- return l.primaryId.value < r.primaryId.value;
+ return utils::ProgramSelectorComparator()(lhs.selector, rhs.selector);
}
} // namespace aidl::android::hardware::broadcastradio
diff --git a/broadcastradio/aidl/default/VirtualRadio.cpp b/broadcastradio/aidl/default/VirtualRadio.cpp
index 86c5a96..d6e58cd 100644
--- a/broadcastradio/aidl/default/VirtualRadio.cpp
+++ b/broadcastradio/aidl/default/VirtualRadio.cpp
@@ -16,12 +16,15 @@
#include "VirtualRadio.h"
#include <broadcastradio-utils-aidl/Utils.h>
+#include <unordered_set>
namespace aidl::android::hardware::broadcastradio {
using ::aidl::android::hardware::broadcastradio::utils::makeSelectorAmfm;
using ::aidl::android::hardware::broadcastradio::utils::makeSelectorDab;
+using ::aidl::android::hardware::broadcastradio::utils::makeSelectorHd;
using ::std::string;
+using ::std::unordered_set;
using ::std::vector;
VirtualRadio::VirtualRadio(const string& name, const vector<VirtualProgram>& initialList)
@@ -38,15 +41,43 @@
}
bool VirtualRadio::getProgram(const ProgramSelector& selector, VirtualProgram* programOut) const {
- for (const auto& program : mPrograms) {
- if (utils::tunesTo(selector, program.selector)) {
- *programOut = program;
- return true;
+ for (auto it = mPrograms.begin(); it != mPrograms.end(); it++) {
+ if (!utils::tunesTo(selector, it->selector)) {
+ continue;
}
+ auto firstMatchIt = it;
+ if (utils::hasAmFmFrequency(it->selector)) {
+ uint32_t channelFreq = utils::getAmFmFrequency(it->selector);
+ it++;
+ while (it != mPrograms.end() && utils::hasAmFmFrequency(it->selector) &&
+ utils::getAmFmFrequency(it->selector) == channelFreq) {
+ if (it->selector == selector) {
+ *programOut = *it;
+ return true;
+ }
+ it++;
+ }
+ }
+ *programOut = *firstMatchIt;
+ return true;
}
return false;
}
+vector<IdentifierType> VirtualRadio::getSupportedIdentifierTypes() const {
+ unordered_set<IdentifierType> supportedIdentifierTypeSet;
+ for (const auto& program : mPrograms) {
+ IdentifierType type = program.selector.primaryId.type;
+ if (supportedIdentifierTypeSet.count(type)) {
+ continue;
+ }
+ supportedIdentifierTypeSet.insert(type);
+ }
+ vector<IdentifierType> supportedIdentifierTypes(supportedIdentifierTypeSet.begin(),
+ supportedIdentifierTypeSet.end());
+ return supportedIdentifierTypes;
+}
+
// get singleton of AMFM Virtual Radio
const VirtualRadio& VirtualRadio::getAmFmRadio() {
// clang-format off
@@ -56,15 +87,27 @@
{makeSelectorAmfm(/* frequency= */ 94900u), "Wild 94.9", "Drake ft. Rihanna",
"Too Good"},
{makeSelectorAmfm(/* frequency= */ 96500u), "KOIT", "Celine Dion", "All By Myself"},
- {makeSelectorAmfm(/* frequency= */ 97300u), "Alice@97.3", "Drops of Jupiter", "Train"},
- {makeSelectorAmfm(/* frequency= */ 99700u), "99.7 Now!", "The Chainsmokers", "Closer"},
{makeSelectorAmfm(/* frequency= */ 101300u), "101-3 KISS-FM", "Justin Timberlake",
"Rock Your Body"},
{makeSelectorAmfm(/* frequency= */ 103700u), "iHeart80s @ 103.7", "Michael Jackson",
"Billie Jean"},
{makeSelectorAmfm(/* frequency= */ 106100u), "106 KMEL", "Drake", "Marvins Room"},
- {makeSelectorAmfm(/* frequency= */ 700u), "700 AM", "Artist700", "Title700"},
- {makeSelectorAmfm(/* frequency= */ 1700u), "1700 AM", "Artist1700", "Title1700"},
+ {makeSelectorAmfm(/* frequency= */ 560u), "Talk Radio 560 KSFO", "Artist560", "Title560"},
+ {makeSelectorAmfm(/* frequency= */ 680u), "KNBR 680", "Artist680", "Title680"},
+ {makeSelectorAmfm(/* frequency= */ 97300u), "Alice@97.3", "Drops of Jupiter", "Train"},
+ {makeSelectorAmfm(/* frequency= */ 99700u), "99.7 Now!", "The Chainsmokers", "Closer"},
+ {makeSelectorHd(/* stationId= */ 0xA0000001u, /* subChannel= */ 0u, /* frequency= */ 97700u),
+ "K-LOVE", "ArtistHd0", "TitleHd0"},
+ {makeSelectorHd(/* stationId= */ 0xA0000001u, /* subChannel= */ 1u, /* frequency= */ 97700u),
+ "Air1", "ArtistHd1", "TitleHd1"},
+ {makeSelectorHd(/* stationId= */ 0xA0000001u, /* subChannel= */ 2u, /* frequency= */ 97700u),
+ "K-LOVE Classics", "ArtistHd2", "TitleHd2"},
+ {makeSelectorHd(/* stationId= */ 0xA0000001u, /* subChannel= */ 0u, /* frequency= */ 98500u),
+ "98.5-1 South Bay's Classic Rock", "ArtistHd0", "TitleHd0"},
+ {makeSelectorHd(/* stationId= */ 0xA0000001u, /* subChannel= */ 1u, /* frequency= */ 98500u),
+ "Highway 1 - Different", "ArtistHd1", "TitleHd1"},
+ {makeSelectorHd(/* stationId= */ 0xB0000001u, /* subChannel= */ 0u, /* frequency= */ 1170u),
+ "KLOK", "ArtistHd1", "TitleHd1"},
});
// clang-format on
return amFmRadioMock;
@@ -76,14 +119,24 @@
static VirtualRadio dabRadioMock(
"DAB radio mock",
{
- {makeSelectorDab(/* sidExt= */ 0xA000000001u, /* ensemble= */ 0x0001u,
+ {makeSelectorDab(/* sidExt= */ 0x0E10000C221u, /* ensemble= */ 0xCE15u,
/* freq= */ 225648u), "BBC Radio 1", "Khalid", "Talk"},
- {makeSelectorDab(/* sidExt= */ 0xB000000001u, /* ensemble= */ 0x1001u,
+ {makeSelectorDab(/* sidExt= */ 0x0E10000C222u, /* ensemble= */ 0xCE15u,
+ /* freq= */ 225648u), "BBC Radio 2", "Khalid", "Talk"},
+ {makeSelectorDab(/* sidExt= */ 0xE10000C224u, /* ensemble= */ 0xCE15u,
+ /* freq= */ 225648u), "BBC Radio 4", "ArtistBBC1", "TitleCountry1"},
+ {makeSelectorDab(/* sidExt= */ 0x1E10000C224u, /* ensemble= */ 0xCE15u,
+ /* freq= */ 225648u), "BBC Radio 4 LW", "ArtistBBC2", "TitleCountry2"},
+ {makeSelectorDab(/* sidExt= */ 0x0E10000C21Au, /* ensemble= */ 0xC181u,
/* freq= */ 222064u), "Classic FM", "Jean Sibelius", "Andante Festivo"},
- {makeSelectorDab(/* sidExt= */ 0xB000000002u, /* ensemble= */ 0x1002u,
- /* freq= */ 227360u), "Absolute Radio", "Coldplay", "Clocks"},
- {makeSelectorDab(/* sidExt= */ 0xB000000002u, /* ensemble= */ 0x1002u,
+ {makeSelectorDab(/* sidExt= */ 0x0E10000C1C0u, /* ensemble= */ 0xC181u,
+ /* freq= */ 223936u), "Absolute Radio", "Coldplay", "Clocks"},
+ {makeSelectorDab(/* sidExt= */ 0x0E10000C1C0u, /* ensemble= */ 0xC181u,
/* freq= */ 222064u), "Absolute Radio", "Coldplay", "Clocks"},
+ {makeSelectorDab(/* sidExt= */ 0x0E10000CCE7u, /* ensemble= */ 0xC19Du,
+ /* freq= */ 218640u), "Absolute Radio Country", "ArtistCountry1", "TitleCountry1"},
+ {makeSelectorDab(/* sidExt= */ 0x0E10000CCE7u, /* ensemble= */ 0xC1A0u,
+ /* freq= */ 218640u), "Absolute Radio Country", "ArtistCountry2", "TitleCountry2"},
});
// clang-format on
return dabRadioMock;
diff --git a/broadcastradio/aidl/default/VirtualRadio.h b/broadcastradio/aidl/default/VirtualRadio.h
index ae039c4..0d70aef 100644
--- a/broadcastradio/aidl/default/VirtualRadio.h
+++ b/broadcastradio/aidl/default/VirtualRadio.h
@@ -36,6 +36,7 @@
std::string getName() const;
const std::vector<VirtualProgram>& getProgramList() const;
bool getProgram(const ProgramSelector& selector, VirtualProgram* program) const;
+ std::vector<IdentifierType> getSupportedIdentifierTypes() const;
static const VirtualRadio& getAmFmRadio();
static const VirtualRadio& getDabRadio();
diff --git a/broadcastradio/aidl/default/broadcastradio-default.xml b/broadcastradio/aidl/default/broadcastradio-default.xml
index 1555822..a57b724 100644
--- a/broadcastradio/aidl/default/broadcastradio-default.xml
+++ b/broadcastradio/aidl/default/broadcastradio-default.xml
@@ -1,6 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.broadcastradio</name>
+ <version>2</version>
<fqname>IBroadcastRadio/amfm</fqname>
<fqname>IBroadcastRadio/dab</fqname>
</hal>
diff --git a/broadcastradio/aidl/default/fuzzer.cpp b/broadcastradio/aidl/default/fuzzer.cpp
new file mode 100644
index 0000000..d535432
--- /dev/null
+++ b/broadcastradio/aidl/default/fuzzer.cpp
@@ -0,0 +1,39 @@
+/*
+ * 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 <fuzzbinder/libbinder_ndk_driver.h>
+#include <fuzzer/FuzzedDataProvider.h>
+#include "BroadcastRadio.h"
+#include "VirtualRadio.h"
+
+using ::aidl::android::hardware::broadcastradio::BroadcastRadio;
+using ::aidl::android::hardware::broadcastradio::VirtualRadio;
+using ::android::fuzzService;
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ const VirtualRadio& amFmRadioMock = VirtualRadio::getAmFmRadio();
+ std::shared_ptr<BroadcastRadio> amFmRadio =
+ ::ndk::SharedRefBase::make<BroadcastRadio>(amFmRadioMock);
+ const VirtualRadio& dabRadioMock = VirtualRadio::getDabRadio();
+ std::shared_ptr<BroadcastRadio> dabRadio =
+ ::ndk::SharedRefBase::make<BroadcastRadio>(dabRadioMock);
+
+ std::vector<ndk::SpAIBinder> binder_services = {amFmRadio->asBinder(), dabRadio->asBinder()};
+
+ fuzzService(binder_services, FuzzedDataProvider(data, size));
+
+ return 0;
+}
diff --git a/broadcastradio/aidl/vts/Android.bp b/broadcastradio/aidl/vts/Android.bp
index b60387e..87e48a9 100644
--- a/broadcastradio/aidl/vts/Android.bp
+++ b/broadcastradio/aidl/vts/Android.bp
@@ -35,8 +35,8 @@
"libxml2",
],
static_libs: [
- "android.hardware.broadcastradio-V1-ndk",
- "android.hardware.broadcastradio@common-utils-aidl-lib",
+ "android.hardware.broadcastradio-V2-ndk",
+ "android.hardware.broadcastradio@common-utils-aidl-lib-V2",
"android.hardware.broadcastradio@vts-utils-lib",
"libgmock",
],
diff --git a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp
index 790d60b..2668a97 100644
--- a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp
+++ b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp
@@ -32,6 +32,7 @@
#include <aidl/Gtest.h>
#include <aidl/Vintf.h>
#include <broadcastradio-utils-aidl/Utils.h>
+#include <broadcastradio-utils-aidl/UtilsV2.h>
#include <cutils/bitops.h>
#include <gmock/gmock.h>
@@ -50,7 +51,6 @@
using ::aidl::android::hardware::broadcastradio::utils::resultToInt;
using ::ndk::ScopedAStatus;
using ::ndk::SharedRefBase;
-using ::std::string;
using ::std::vector;
using ::testing::_;
using ::testing::AnyNumber;
@@ -73,20 +73,29 @@
ConfigFlag::DAB_FM_SOFT_LINKING,
};
-void printSkipped(const string& msg) {
+constexpr int32_t kAidlVersion1 = 1;
+constexpr int32_t kAidlVersion2 = 2;
+
+void printSkipped(const std::string& msg) {
const auto testInfo = testing::UnitTest::GetInstance()->current_test_info();
LOG(INFO) << "[ SKIPPED ] " << testInfo->test_case_name() << "." << testInfo->name()
<< " with message: " << msg;
}
-bool isValidAmFmFreq(int64_t freq) {
+bool isValidAmFmFreq(int64_t freq, int aidlVersion) {
ProgramIdentifier id = bcutils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, freq);
- return bcutils::isValid(id);
+ if (aidlVersion == kAidlVersion1) {
+ return bcutils::isValid(id);
+ } else if (aidlVersion == kAidlVersion2) {
+ return bcutils::isValidV2(id);
+ }
+ LOG(ERROR) << "Unknown AIDL version " << aidlVersion;
+ return false;
}
-void validateRange(const AmFmBandRange& range) {
- EXPECT_TRUE(isValidAmFmFreq(range.lowerBound));
- EXPECT_TRUE(isValidAmFmFreq(range.upperBound));
+void validateRange(const AmFmBandRange& range, int aidlVersion) {
+ EXPECT_TRUE(isValidAmFmFreq(range.lowerBound, aidlVersion));
+ EXPECT_TRUE(isValidAmFmFreq(range.upperBound, aidlVersion));
EXPECT_LT(range.lowerBound, range.upperBound);
EXPECT_GT(range.spacing, 0u);
EXPECT_EQ((range.upperBound - range.lowerBound) % range.spacing, 0u);
@@ -142,7 +151,7 @@
class TunerCallbackImpl final : public BnTunerCallback {
public:
- TunerCallbackImpl();
+ explicit TunerCallbackImpl(int32_t aidlVersion);
ScopedAStatus onTuneFailed(Result result, const ProgramSelector& selector) override;
ScopedAStatus onCurrentProgramInfoChanged(const ProgramInfo& info) override;
ScopedAStatus onProgramListUpdated(const ProgramListChunk& chunk) override;
@@ -160,6 +169,7 @@
private:
std::mutex mLock;
+ int32_t mCallbackAidlVersion;
bool mAntennaConnectionState GUARDED_BY(mLock);
ProgramInfo mCurrentProgramInfo GUARDED_BY(mLock);
bcutils::ProgramInfoSet mProgramList GUARDED_BY(mLock);
@@ -171,7 +181,7 @@
MOCK_METHOD1(onListUpdated, ScopedAStatus(const vector<Announcement>&));
};
-class BroadcastRadioHalTest : public testing::TestWithParam<string> {
+class BroadcastRadioHalTest : public testing::TestWithParam<std::string> {
protected:
void SetUp() override;
void TearDown() override;
@@ -183,14 +193,17 @@
std::shared_ptr<IBroadcastRadio> mModule;
Properties mProperties;
std::shared_ptr<TunerCallbackImpl> mCallback;
+ int32_t mAidlVersion;
};
-MATCHER_P(InfoHasId, id, string(negation ? "does not contain" : "contains") + " " + id.toString()) {
+MATCHER_P(InfoHasId, id,
+ std::string(negation ? "does not contain" : "contains") + " " + id.toString()) {
vector<int> ids = bcutils::getAllIds(arg.selector, id.type);
return ids.end() != find(ids.begin(), ids.end(), id.value);
}
-TunerCallbackImpl::TunerCallbackImpl() {
+TunerCallbackImpl::TunerCallbackImpl(int32_t aidlVersion) {
+ mCallbackAidlVersion = aidlVersion;
mAntennaConnectionState = true;
}
@@ -230,7 +243,12 @@
physically > IdentifierType::SXM_CHANNEL);
if (logically == IdentifierType::AMFM_FREQUENCY_KHZ) {
- std::optional<string> ps = bcutils::getMetadataString(info, Metadata::rdsPs);
+ std::optional<std::string> ps;
+ if (mCallbackAidlVersion == kAidlVersion1) {
+ ps = bcutils::getMetadataString(info, Metadata::rdsPs);
+ } else {
+ ps = bcutils::getMetadataStringV2(info, Metadata::rdsPs);
+ }
if (ps.has_value()) {
EXPECT_NE(::android::base::Trim(*ps), "")
<< "Don't use empty RDS_PS as an indicator of missing RSD PS data.";
@@ -323,9 +341,13 @@
EXPECT_FALSE(mProperties.product.empty());
EXPECT_GT(mProperties.supportedIdentifierTypes.size(), 0u);
- mCallback = SharedRefBase::make<TunerCallbackImpl>();
+ // get AIDL HAL version
+ ASSERT_TRUE(mModule->getInterfaceVersion(&mAidlVersion).isOk());
+ EXPECT_GE(mAidlVersion, kAidlVersion1);
+ EXPECT_LE(mAidlVersion, kAidlVersion2);
// set callback
+ mCallback = SharedRefBase::make<TunerCallbackImpl>(mAidlVersion);
EXPECT_TRUE(mModule->setTunerCallback(mCallback).isOk());
}
@@ -443,7 +465,7 @@
EXPECT_GT(config.ranges.size(), 0u);
for (const auto& range : config.ranges) {
- validateRange(range);
+ validateRange(range, mAidlVersion);
EXPECT_EQ(range.seekSpacing % range.spacing, 0u);
EXPECT_GE(range.seekSpacing, range.spacing);
}
@@ -494,7 +516,7 @@
EXPECT_GT(config.ranges.size(), 0u);
for (const auto& range : config.ranges) {
- validateRange(range);
+ validateRange(range, mAidlVersion);
EXPECT_EQ(range.seekSpacing, 0u);
}
}
@@ -522,11 +544,17 @@
std::regex re("^[A-Z0-9][A-Z0-9 ]{0,5}[A-Z0-9]$");
for (const auto& entry : config) {
- EXPECT_TRUE(std::regex_match(string(entry.label), re));
+ EXPECT_TRUE(std::regex_match(std::string(entry.label), re));
ProgramIdentifier id =
bcutils::makeIdentifier(IdentifierType::DAB_FREQUENCY_KHZ, entry.frequencyKhz);
- EXPECT_TRUE(bcutils::isValid(id));
+ if (mAidlVersion == kAidlVersion1) {
+ EXPECT_TRUE(bcutils::isValid(id));
+ } else if (mAidlVersion == kAidlVersion2) {
+ EXPECT_TRUE(bcutils::isValidV2(id));
+ } else {
+ LOG(ERROR) << "Unknown callback AIDL version " << mAidlVersion;
+ }
}
}
@@ -674,6 +702,59 @@
}
/**
+ * Test tuning with HD selector.
+ *
+ * Verifies that:
+ * - if AM/FM HD selector is not supported, the method returns NOT_SUPPORTED;
+ * - if it is supported, the method succeeds;
+ * - after a successful tune call, onCurrentProgramInfoChanged callback is
+ * invoked carrying a proper selector;
+ * - program changes to a program info with the program selector requested.
+ */
+TEST_P(BroadcastRadioHalTest, HdTune) {
+ LOG(DEBUG) << "HdTune Test";
+ auto programList = getProgramList();
+ if (!programList) {
+ printSkipped("Empty station list, tune cannot be performed");
+ return;
+ }
+ ProgramSelector hdSel = {};
+ ProgramIdentifier physicallyTunedToExpected = {};
+ bool hdStationPresent = false;
+ for (auto&& programInfo : *programList) {
+ if (programInfo.selector.primaryId.type != IdentifierType::HD_STATION_ID_EXT) {
+ continue;
+ }
+ hdSel = programInfo.selector;
+ hdStationPresent = true;
+ physicallyTunedToExpected = bcutils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ,
+ bcutils::getAmFmFrequency(hdSel));
+ break;
+ }
+ if (!hdStationPresent) {
+ printSkipped("No HD stations in the list, tune cannot be performed");
+ return;
+ }
+
+ // try tuning
+ auto result = mModule->tune(hdSel);
+
+ // expect a failure if it's not supported
+ if (!bcutils::isSupported(mProperties, hdSel)) {
+ EXPECT_EQ(result.getServiceSpecificError(), resultToInt(Result::NOT_SUPPORTED));
+ return;
+ }
+ // expect a callback if it succeeds
+ EXPECT_TRUE(result.isOk());
+ EXPECT_TRUE(mCallback->waitOnCurrentProgramInfoChangedCallback());
+ ProgramInfo infoCb = mCallback->getCurrentProgramInfo();
+ LOG(DEBUG) << "Current program info: " << infoCb.toString();
+ // it should tune exactly to what was requested
+ EXPECT_EQ(infoCb.selector.primaryId, hdSel.primaryId);
+ EXPECT_EQ(infoCb.physicallyTunedTo, physicallyTunedToExpected);
+}
+
+/**
* Test tuning with DAB selector.
*
* Verifies that:
@@ -1175,10 +1256,21 @@
continue;
}
- std::optional<string> name = bcutils::getMetadataString(program, Metadata::programName);
- if (!name) {
- name = bcutils::getMetadataString(program, Metadata::rdsPs);
+ std::optional<std::string> name;
+ if (mAidlVersion == kAidlVersion1) {
+ name = bcutils::getMetadataString(program, Metadata::programName);
+ if (!name) {
+ name = bcutils::getMetadataString(program, Metadata::rdsPs);
+ }
+ } else if (mAidlVersion == kAidlVersion2) {
+ name = bcutils::getMetadataStringV2(program, Metadata::programName);
+ if (!name) {
+ name = bcutils::getMetadataStringV2(program, Metadata::rdsPs);
+ }
+ } else {
+ LOG(ERROR) << "Unknown HAL AIDL version " << mAidlVersion;
}
+
ASSERT_TRUE(name.has_value());
ProgramIdentifier expectedId = bcutils::makeHdRadioStationName(*name);
diff --git a/broadcastradio/common/utilsaidl/Android.bp b/broadcastradio/common/utilsaidl/Android.bp
index fa6de19..4ec635b 100644
--- a/broadcastradio/common/utilsaidl/Android.bp
+++ b/broadcastradio/common/utilsaidl/Android.bp
@@ -25,6 +25,29 @@
cc_library_static {
name: "android.hardware.broadcastradio@common-utils-aidl-lib",
+ defaults: [
+ "VtsBroadcastRadioDefaults",
+ ],
+ shared_libs: [
+ "android.hardware.broadcastradio-V1-ndk",
+ ],
+}
+
+cc_library_static {
+ name: "android.hardware.broadcastradio@common-utils-aidl-lib-V2",
+ defaults: [
+ "VtsBroadcastRadioDefaults",
+ ],
+ srcs: [
+ "src/UtilsV2.cpp",
+ ],
+ shared_libs: [
+ "android.hardware.broadcastradio-V2-ndk",
+ ],
+}
+
+cc_defaults {
+ name: "VtsBroadcastRadioDefaults",
vendor_available: true,
relative_install_path: "hw",
cflags: [
@@ -37,11 +60,10 @@
"-std=c++1z",
],
srcs: [
- "Utils.cpp",
+ "src/Utils.cpp",
],
export_include_dirs: ["include"],
shared_libs: [
- "android.hardware.broadcastradio-V1-ndk",
"libbase",
],
static_libs: [
diff --git a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h
index ee85a17..3ced685 100644
--- a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h
+++ b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h
@@ -17,7 +17,6 @@
#pragma once
#include <aidl/android/hardware/broadcastradio/IdentifierType.h>
-#include <aidl/android/hardware/broadcastradio/Metadata.h>
#include <aidl/android/hardware/broadcastradio/ProgramFilter.h>
#include <aidl/android/hardware/broadcastradio/ProgramIdentifier.h>
#include <aidl/android/hardware/broadcastradio/ProgramInfo.h>
@@ -140,9 +139,18 @@
ProgramSelector makeSelectorAmfm(uint32_t frequency);
ProgramSelector makeSelectorDab(uint64_t sidExt);
ProgramSelector makeSelectorDab(uint64_t sidExt, uint32_t ensemble, uint64_t freq);
+ProgramSelector makeSelectorHd(uint64_t stationId, uint64_t subChannel, uint64_t frequency);
bool satisfies(const ProgramFilter& filter, const ProgramSelector& sel);
+struct ProgramSelectorComparator {
+ bool operator()(const ProgramSelector& lhs, const ProgramSelector& rhs) const;
+};
+
+struct ProgramInfoComparator {
+ bool operator()(const ProgramInfo& lhs, const ProgramInfo& rhs) const;
+};
+
struct ProgramInfoHasher {
size_t operator()(const ProgramInfo& info) const;
};
@@ -159,6 +167,20 @@
ProgramIdentifier makeHdRadioStationName(const std::string& name);
+uint32_t getHdFrequency(const ProgramSelector& sel);
+
+int getHdSubchannel(const ProgramSelector& sel);
+
+uint32_t getDabSId(const ProgramSelector& sel);
+
+int getDabEccCode(const ProgramSelector& sel);
+
+int getDabSCIdS(const ProgramSelector& sel);
+
+bool hasAmFmFrequency(const ProgramSelector& sel);
+
+uint32_t getAmFmFrequency(const ProgramSelector& sel);
+
template <typename aidl_type>
inline std::string vectorToString(const std::vector<aidl_type>& in_values) {
return std::accumulate(std::begin(in_values), std::end(in_values), std::string{},
diff --git a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/UtilsV2.h b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/UtilsV2.h
new file mode 100644
index 0000000..e411aa4
--- /dev/null
+++ b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/UtilsV2.h
@@ -0,0 +1,35 @@
+/*
+ * 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 <aidl/android/hardware/broadcastradio/IdentifierType.h>
+#include <aidl/android/hardware/broadcastradio/Metadata.h>
+#include <aidl/android/hardware/broadcastradio/ProgramIdentifier.h>
+#include <aidl/android/hardware/broadcastradio/ProgramInfo.h>
+#include <aidl/android/hardware/broadcastradio/ProgramSelector.h>
+
+namespace aidl::android::hardware::broadcastradio {
+
+namespace utils {
+
+bool isValidV2(const ProgramIdentifier& id);
+bool isValidV2(const ProgramSelector& sel);
+std::optional<std::string> getMetadataStringV2(const ProgramInfo& info, const Metadata::Tag& tag);
+
+} // namespace utils
+
+} // namespace aidl::android::hardware::broadcastradio
diff --git a/broadcastradio/common/utilsaidl/Utils.cpp b/broadcastradio/common/utilsaidl/src/Utils.cpp
similarity index 76%
rename from broadcastradio/common/utilsaidl/Utils.cpp
rename to broadcastradio/common/utilsaidl/src/Utils.cpp
index de4f529..b647442 100644
--- a/broadcastradio/common/utilsaidl/Utils.cpp
+++ b/broadcastradio/common/utilsaidl/src/Utils.cpp
@@ -31,7 +31,6 @@
namespace {
using ::android::base::EqualsIgnoreCase;
-using ::std::string;
using ::std::vector;
const int64_t kValueForNotFoundIdentifier = 0;
@@ -50,12 +49,6 @@
return getId(a, type) == getId(b, type);
}
-int getHdSubchannel(const ProgramSelector& sel) {
- int64_t hdSidExt = getId(sel, IdentifierType::HD_STATION_ID_EXT, /* defaultValue */ 0);
- hdSidExt >>= 32; // Station ID number
- return hdSidExt & 0xF; // HD Radio subchannel
-}
-
bool maybeGetId(const ProgramSelector& sel, const IdentifierType& type, int64_t* val) {
// iterate through primaryId and secondaryIds
for (auto it = begin(sel); it != end(sel); it++) {
@@ -133,8 +126,13 @@
case IdentifierType::AMFM_FREQUENCY_KHZ:
if (haveEqualIds(a, b, IdentifierType::HD_STATION_ID_EXT)) return true;
if (haveEqualIds(a, b, IdentifierType::RDS_PI)) return true;
- return getHdSubchannel(b) == 0 &&
- haveEqualIds(a, b, IdentifierType::AMFM_FREQUENCY_KHZ);
+ if (getHdSubchannel(b) != 0) { // supplemental program services
+ return false;
+ }
+ return haveEqualIds(a, b, IdentifierType::AMFM_FREQUENCY_KHZ) ||
+ (b.primaryId.type == IdentifierType::HD_STATION_ID_EXT &&
+ static_cast<uint32_t>(getId(a, IdentifierType::AMFM_FREQUENCY_KHZ)) ==
+ getAmFmFrequency(b));
case IdentifierType::DAB_SID_EXT:
if (!haveEqualIds(a, b, IdentifierType::DAB_SID_EXT)) {
return false;
@@ -207,7 +205,7 @@
uint64_t val = static_cast<uint64_t>(id.value);
bool valid = true;
- auto expect = [&valid](bool condition, const string& message) {
+ auto expect = [&valid](bool condition, const std::string& message) {
if (!condition) {
valid = false;
LOG(ERROR) << "identifier not valid, expected " << message;
@@ -278,9 +276,9 @@
case IdentifierType::SXM_CHANNEL:
expect(val < 1000u, "SXM channel < 1000");
break;
- case IdentifierType::VENDOR_START:
- case IdentifierType::VENDOR_END:
- // skip
+ default:
+ expect(id.type >= IdentifierType::VENDOR_START && id.type <= IdentifierType::VENDOR_END,
+ "Undefined identifier type");
break;
}
@@ -317,6 +315,13 @@
return sel;
}
+ProgramSelector makeSelectorHd(uint64_t stationId, uint64_t subChannel, uint64_t frequency) {
+ ProgramSelector sel = {};
+ uint64_t sidExt = stationId | (subChannel << 32) | (frequency << 36);
+ sel.primaryId = makeIdentifier(IdentifierType::HD_STATION_ID_EXT, sidExt);
+ return sel;
+}
+
ProgramSelector makeSelectorDab(uint64_t sidExt, uint32_t ensemble, uint64_t freq) {
ProgramSelector sel = {};
sel.primaryId = makeIdentifier(IdentifierType::DAB_SID_EXT, sidExt);
@@ -350,6 +355,55 @@
return true;
}
+bool ProgramSelectorComparator::operator()(const ProgramSelector& lhs,
+ const ProgramSelector& rhs) const {
+ if ((utils::hasId(lhs, IdentifierType::AMFM_FREQUENCY_KHZ) ||
+ lhs.primaryId.type == IdentifierType::HD_STATION_ID_EXT) &&
+ (utils::hasId(rhs, IdentifierType::AMFM_FREQUENCY_KHZ) ||
+ rhs.primaryId.type == IdentifierType::HD_STATION_ID_EXT)) {
+ uint32_t freq1 = utils::getAmFmFrequency(lhs);
+ int subChannel1 = lhs.primaryId.type == IdentifierType::HD_STATION_ID_EXT
+ ? utils::getHdSubchannel(lhs)
+ : 0;
+ uint32_t freq2 = utils::getAmFmFrequency(rhs);
+ int subChannel2 = rhs.primaryId.type == IdentifierType::HD_STATION_ID_EXT
+ ? utils::getHdSubchannel(rhs)
+ : 0;
+ return freq1 < freq2 || (freq1 == freq2 && (lhs.primaryId.type < rhs.primaryId.type ||
+ subChannel1 < subChannel2));
+ }
+ if (lhs.primaryId.type == IdentifierType::DAB_SID_EXT &&
+ rhs.primaryId.type == IdentifierType::DAB_SID_EXT) {
+ uint64_t dabFreq1 = utils::getId(lhs, IdentifierType::DAB_FREQUENCY_KHZ);
+ uint64_t dabFreq2 = utils::getId(rhs, IdentifierType::DAB_FREQUENCY_KHZ);
+ if (dabFreq1 != dabFreq2) {
+ return dabFreq1 < dabFreq2;
+ }
+ uint32_t ecc1 = utils::getDabEccCode(lhs);
+ uint32_t ecc2 = utils::getDabEccCode(rhs);
+ if (ecc1 != ecc2) {
+ return ecc1 < ecc2;
+ }
+ uint64_t dabEnsemble1 = utils::getId(lhs, IdentifierType::DAB_ENSEMBLE);
+ uint64_t dabEnsemble2 = utils::getId(rhs, IdentifierType::DAB_ENSEMBLE);
+ if (dabEnsemble1 != dabEnsemble2) {
+ return dabEnsemble1 < dabEnsemble2;
+ }
+ uint32_t sId1 = utils::getDabSId(lhs);
+ uint32_t sId2 = utils::getDabSId(rhs);
+ return sId1 < sId2 || (sId1 == sId2 && utils::getDabSCIdS(lhs) < utils::getDabSCIdS(rhs));
+ }
+
+ if (lhs.primaryId.type != rhs.primaryId.type) {
+ return lhs.primaryId.type < rhs.primaryId.type;
+ }
+ return lhs.primaryId.value < rhs.primaryId.value;
+}
+
+bool ProgramInfoComparator::operator()(const ProgramInfo& lhs, const ProgramInfo& rhs) const {
+ return ProgramSelectorComparator()(lhs.selector, rhs.selector);
+}
+
size_t ProgramInfoHasher::operator()(const ProgramInfo& info) const {
const ProgramIdentifier& id = info.selector.primaryId;
@@ -452,10 +506,10 @@
return metadataString;
}
-ProgramIdentifier makeHdRadioStationName(const string& name) {
+ProgramIdentifier makeHdRadioStationName(const std::string& name) {
constexpr size_t maxlen = 8;
- string shortName;
+ std::string shortName;
shortName.reserve(maxlen);
const auto& loc = std::locale::classic();
@@ -484,7 +538,48 @@
return static_cast<IdentifierType>(typeAsInt);
}
-bool parseArgInt(const string& s, int* out) {
+uint32_t getDabSId(const ProgramSelector& sel) {
+ int64_t dabSidExt = getId(sel, IdentifierType::DAB_SID_EXT, /* defaultValue */ 0);
+ return static_cast<uint32_t>(dabSidExt & 0xFFFFFFFF);
+}
+
+int getDabEccCode(const ProgramSelector& sel) {
+ int64_t dabSidExt = getId(sel, IdentifierType::DAB_SID_EXT, /* defaultValue */ 0);
+ return static_cast<uint32_t>((dabSidExt >> 32) & 0xFF);
+}
+
+int getDabSCIdS(const ProgramSelector& sel) {
+ int64_t dabSidExt = getId(sel, IdentifierType::DAB_SID_EXT, /* defaultValue */ 0);
+ return static_cast<uint32_t>((dabSidExt >> 40) & 0xF);
+}
+
+int getHdSubchannel(const ProgramSelector& sel) {
+ int64_t hdSidExt = getId(sel, IdentifierType::HD_STATION_ID_EXT, kValueForNotFoundIdentifier);
+ hdSidExt >>= 32; // Station ID number
+ return hdSidExt & 0xF; // HD Radio subchannel
+}
+
+uint32_t getHdFrequency(const ProgramSelector& sel) {
+ int64_t hdSidExt = getId(sel, IdentifierType::HD_STATION_ID_EXT, kValueForNotFoundIdentifier);
+ if (hdSidExt == kValueForNotFoundIdentifier) {
+ return kValueForNotFoundIdentifier;
+ }
+ return static_cast<uint32_t>((hdSidExt >> 36) & 0x3FFFF); // HD Radio subchannel
+}
+
+bool hasAmFmFrequency(const ProgramSelector& sel) {
+ return hasId(sel, IdentifierType::AMFM_FREQUENCY_KHZ) ||
+ sel.primaryId.type == IdentifierType::HD_STATION_ID_EXT;
+}
+
+uint32_t getAmFmFrequency(const ProgramSelector& sel) {
+ if (hasId(sel, IdentifierType::AMFM_FREQUENCY_KHZ)) {
+ return static_cast<uint32_t>(getId(sel, IdentifierType::AMFM_FREQUENCY_KHZ));
+ }
+ return getHdFrequency(sel);
+}
+
+bool parseArgInt(const std::string& s, int* out) {
return ::android::base::ParseInt(s, out);
}
@@ -492,7 +587,7 @@
return ::android::base::ParseInt(s, out);
}
-bool parseArgBool(const string& s, bool* out) {
+bool parseArgBool(const std::string& s, bool* out) {
if (EqualsIgnoreCase(s, "true")) {
*out = true;
} else if (EqualsIgnoreCase(s, "false")) {
@@ -503,7 +598,7 @@
return true;
}
-bool parseArgDirection(const string& s, bool* out) {
+bool parseArgDirection(const std::string& s, bool* out) {
if (EqualsIgnoreCase(s, "up")) {
*out = true;
} else if (EqualsIgnoreCase(s, "down")) {
@@ -514,8 +609,8 @@
return true;
}
-bool parseArgIdentifierTypeArray(const string& s, vector<IdentifierType>* out) {
- for (const string& val : ::android::base::Split(s, ",")) {
+bool parseArgIdentifierTypeArray(const std::string& s, vector<IdentifierType>* out) {
+ for (const std::string& val : ::android::base::Split(s, ",")) {
int outInt;
if (!parseArgInt(val, &outInt)) {
return false;
@@ -526,8 +621,8 @@
}
bool parseProgramIdentifierList(const std::string& s, vector<ProgramIdentifier>* out) {
- for (const string& idStr : ::android::base::Split(s, ",")) {
- const vector<string> idStrPair = ::android::base::Split(idStr, ":");
+ for (const std::string& idStr : ::android::base::Split(s, ",")) {
+ const vector<std::string> idStrPair = ::android::base::Split(idStr, ":");
if (idStrPair.size() != 2) {
return false;
}
diff --git a/broadcastradio/common/utilsaidl/src/UtilsV2.cpp b/broadcastradio/common/utilsaidl/src/UtilsV2.cpp
new file mode 100644
index 0000000..ef739df
--- /dev/null
+++ b/broadcastradio/common/utilsaidl/src/UtilsV2.cpp
@@ -0,0 +1,240 @@
+/*
+ * 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 "BcRadioAidlDef.utilsV2"
+
+#include "broadcastradio-utils-aidl/UtilsV2.h"
+
+#include <android-base/logging.h>
+#include <android-base/strings.h>
+
+namespace aidl::android::hardware::broadcastradio {
+
+namespace utils {
+
+bool isValidV2(const ProgramIdentifier& id) {
+ uint64_t val = static_cast<uint64_t>(id.value);
+ bool valid = true;
+
+ auto expect = [&valid](bool condition, const std::string& message) {
+ if (!condition) {
+ valid = false;
+ LOG(ERROR) << "identifier not valid, expected " << message;
+ }
+ };
+
+ switch (id.type) {
+ case IdentifierType::INVALID:
+ expect(false, "IdentifierType::INVALID");
+ break;
+ case IdentifierType::DAB_FREQUENCY_KHZ:
+ expect(val > 100000u, "f > 100MHz");
+ [[fallthrough]];
+ case IdentifierType::AMFM_FREQUENCY_KHZ:
+ case IdentifierType::DRMO_FREQUENCY_KHZ:
+ expect(val > 100u, "f > 100kHz");
+ expect(val < 10000000u, "f < 10GHz");
+ break;
+ case IdentifierType::RDS_PI:
+ expect(val != 0u, "RDS PI != 0");
+ expect(val <= 0xFFFFu, "16bit id");
+ break;
+ case IdentifierType::HD_STATION_ID_EXT: {
+ uint64_t stationId = val & 0xFFFFFFFF; // 32bit
+ val >>= 32;
+ uint64_t subchannel = val & 0xF; // 4bit
+ val >>= 4;
+ uint64_t freq = val & 0x3FFFF; // 18bit
+ expect(stationId != 0u, "HD station id != 0");
+ expect(subchannel < 8u, "HD subch < 8");
+ expect(freq > 100u, "f > 100kHz");
+ expect(freq < 10000000u, "f < 10GHz");
+ break;
+ }
+ case IdentifierType::HD_STATION_NAME: {
+ while (val > 0) {
+ char ch = static_cast<char>(val & 0xFF);
+ val >>= 8;
+ expect((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z'),
+ "HD_STATION_NAME does not match [A-Z0-9]+");
+ }
+ break;
+ }
+ case IdentifierType::DAB_SID_EXT: {
+ uint64_t sid = val & 0xFFFFFFFF; // 32bit
+ val >>= 32;
+ uint64_t ecc = val & 0xFF; // 8bit
+ expect(sid != 0u, "DAB SId != 0");
+ expect(ecc >= 0xA0u && ecc <= 0xF6u, "Invalid ECC, see ETSI TS 101 756 V2.1.1");
+ break;
+ }
+ case IdentifierType::DAB_ENSEMBLE:
+ expect(val != 0u, "DAB ensemble != 0");
+ expect(val <= 0xFFFFu, "16bit id");
+ break;
+ case IdentifierType::DAB_SCID:
+ expect(val > 0xFu, "12bit SCId (not 4bit SCIdS)");
+ expect(val <= 0xFFFu, "12bit id");
+ break;
+ case IdentifierType::DRMO_SERVICE_ID:
+ expect(val != 0u, "DRM SId != 0");
+ expect(val <= 0xFFFFFFu, "24bit id");
+ break;
+ case IdentifierType::SXM_SERVICE_ID:
+ expect(val != 0u, "SXM SId != 0");
+ expect(val <= 0xFFFFFFFFu, "32bit id");
+ break;
+ case IdentifierType::SXM_CHANNEL:
+ expect(val < 1000u, "SXM channel < 1000");
+ break;
+ case IdentifierType::HD_STATION_LOCATION: {
+ uint64_t latitudeBit = val & 0x1;
+ expect(latitudeBit == 1u, "Latitude comes first");
+ val >>= 27;
+ uint64_t latitudePad = val & 0x1Fu;
+ expect(latitudePad == 0u, "Latitude padding");
+ val >>= 5;
+ uint64_t longitudeBit = val & 0x1;
+ expect(longitudeBit == 1u, "Longitude comes next");
+ val >>= 27;
+ uint64_t longitudePad = val & 0x1Fu;
+ expect(longitudePad == 0u, "Latitude padding");
+ break;
+ }
+ default:
+ expect(id.type >= IdentifierType::VENDOR_START && id.type <= IdentifierType::VENDOR_END,
+ "Undefined identifier type");
+ break;
+ }
+
+ return valid;
+}
+
+bool isValidV2(const ProgramSelector& sel) {
+ if (sel.primaryId.type != IdentifierType::AMFM_FREQUENCY_KHZ &&
+ sel.primaryId.type != IdentifierType::RDS_PI &&
+ sel.primaryId.type != IdentifierType::HD_STATION_ID_EXT &&
+ sel.primaryId.type != IdentifierType::DAB_SID_EXT &&
+ sel.primaryId.type != IdentifierType::DRMO_SERVICE_ID &&
+ sel.primaryId.type != IdentifierType::SXM_SERVICE_ID &&
+ (sel.primaryId.type < IdentifierType::VENDOR_START ||
+ sel.primaryId.type > IdentifierType::VENDOR_END)) {
+ return false;
+ }
+ return isValidV2(sel.primaryId);
+}
+
+std::optional<std::string> getMetadataStringV2(const ProgramInfo& info, const Metadata::Tag& tag) {
+ auto isRdsPs = [tag](const Metadata& item) { return item.getTag() == tag; };
+
+ auto it = std::find_if(info.metadata.begin(), info.metadata.end(), isRdsPs);
+ if (it == info.metadata.end()) {
+ return std::nullopt;
+ }
+
+ std::string metadataString;
+ switch (it->getTag()) {
+ case Metadata::rdsPs:
+ metadataString = it->get<Metadata::rdsPs>();
+ break;
+ case Metadata::rdsPty:
+ metadataString = std::to_string(it->get<Metadata::rdsPty>());
+ break;
+ case Metadata::rbdsPty:
+ metadataString = std::to_string(it->get<Metadata::rbdsPty>());
+ break;
+ case Metadata::rdsRt:
+ metadataString = it->get<Metadata::rdsRt>();
+ break;
+ case Metadata::songTitle:
+ metadataString = it->get<Metadata::songTitle>();
+ break;
+ case Metadata::songArtist:
+ metadataString = it->get<Metadata::songArtist>();
+ break;
+ case Metadata::songAlbum:
+ metadataString = it->get<Metadata::songAlbum>();
+ break;
+ case Metadata::stationIcon:
+ metadataString = std::to_string(it->get<Metadata::stationIcon>());
+ break;
+ case Metadata::albumArt:
+ metadataString = std::to_string(it->get<Metadata::albumArt>());
+ break;
+ case Metadata::programName:
+ metadataString = it->get<Metadata::programName>();
+ break;
+ case Metadata::dabEnsembleName:
+ metadataString = it->get<Metadata::dabEnsembleName>();
+ break;
+ case Metadata::dabEnsembleNameShort:
+ metadataString = it->get<Metadata::dabEnsembleNameShort>();
+ break;
+ case Metadata::dabServiceName:
+ metadataString = it->get<Metadata::dabServiceName>();
+ break;
+ case Metadata::dabServiceNameShort:
+ metadataString = it->get<Metadata::dabServiceNameShort>();
+ break;
+ case Metadata::dabComponentName:
+ metadataString = it->get<Metadata::dabComponentName>();
+ break;
+ case Metadata::dabComponentNameShort:
+ metadataString = it->get<Metadata::dabComponentNameShort>();
+ break;
+ case Metadata::genre:
+ metadataString = it->get<Metadata::genre>();
+ break;
+ case Metadata::commentShortDescription:
+ metadataString = it->get<Metadata::commentShortDescription>();
+ break;
+ case Metadata::commentActualText:
+ metadataString = it->get<Metadata::commentActualText>();
+ break;
+ case Metadata::commercial:
+ metadataString = it->get<Metadata::commercial>();
+ break;
+ case Metadata::ufids: {
+ auto& ufids = it->get<Metadata::ufids>();
+ metadataString = "[";
+ for (const auto& ufid : ufids) {
+ metadataString += std::string(ufid) + ",";
+ }
+ if (ufids.empty()) {
+ metadataString += "]";
+ } else {
+ metadataString[metadataString.size() - 1] = ']';
+ }
+ } break;
+ case Metadata::hdStationNameShort:
+ metadataString = it->get<Metadata::hdStationNameShort>();
+ break;
+ case Metadata::hdStationNameLong:
+ metadataString = it->get<Metadata::hdStationNameLong>();
+ break;
+ case Metadata::hdSubChannelsAvailable:
+ metadataString = std::to_string(it->get<Metadata::hdSubChannelsAvailable>());
+ break;
+ default:
+ LOG(ERROR) << "Metadata " << it->toString() << " is not converted.";
+ return std::nullopt;
+ }
+ return metadataString;
+}
+
+} // namespace utils
+
+} // namespace aidl::android::hardware::broadcastradio
diff --git a/camera/common/1.0/Android.bp b/camera/common/1.0/Android.bp
index 3eb12b9..5952ac8 100644
--- a/camera/common/1.0/Android.bp
+++ b/camera/common/1.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/common/aidl/Android.bp b/camera/common/aidl/Android.bp
index 4ffcfd9..8f7d19d 100644
--- a/camera/common/aidl/Android.bp
+++ b/camera/common/aidl/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -22,7 +23,7 @@
},
rust: {
enabled: true,
- }
+ },
},
versions_with_info: [
{
diff --git a/camera/common/default/Android.bp b/camera/common/default/Android.bp
index e8c8f9d..ad2c139 100644
--- a/camera/common/default/Android.bp
+++ b/camera/common/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -30,13 +31,12 @@
"libgralloctypes",
"libhardware",
"libcamera_metadata",
- "android.hardware.graphics.mapper@2.0",
- "android.hardware.graphics.mapper@3.0",
- "android.hardware.graphics.mapper@4.0",
"libexif",
+ "libui",
],
include_dirs: ["system/media/private/camera/include"],
export_include_dirs: ["include"],
+ export_shared_lib_headers: ["libui"],
}
// NOTE: Deprecated module kept for compatibility reasons.
diff --git a/camera/common/default/HandleImporter.cpp b/camera/common/default/HandleImporter.cpp
index 1145baa..9c579e5 100644
--- a/camera/common/default/HandleImporter.cpp
+++ b/camera/common/default/HandleImporter.cpp
@@ -17,9 +17,10 @@
#define LOG_TAG "HandleImporter"
#include "HandleImporter.h"
+#include <aidl/android/hardware/graphics/common/Smpte2086.h>
#include <gralloctypes/Gralloc4.h>
#include <log/log.h>
-#include "aidl/android/hardware/graphics/common/Smpte2086.h"
+#include <ui/GraphicBufferMapper.h>
namespace android {
namespace hardware {
@@ -31,12 +32,6 @@
using aidl::android::hardware::graphics::common::PlaneLayoutComponent;
using aidl::android::hardware::graphics::common::PlaneLayoutComponentType;
using aidl::android::hardware::graphics::common::Smpte2086;
-using MetadataType = android::hardware::graphics::mapper::V4_0::IMapper::MetadataType;
-using MapperErrorV2 = android::hardware::graphics::mapper::V2_0::Error;
-using MapperErrorV3 = android::hardware::graphics::mapper::V3_0::Error;
-using MapperErrorV4 = android::hardware::graphics::mapper::V4_0::Error;
-using IMapperV3 = android::hardware::graphics::mapper::V3_0::IMapper;
-using IMapperV4 = android::hardware::graphics::mapper::V4_0::IMapper;
HandleImporter::HandleImporter() : mInitialized(false) {}
@@ -45,51 +40,20 @@
return;
}
- mMapperV4 = IMapperV4::getService();
- if (mMapperV4 != nullptr) {
- mInitialized = true;
- return;
- }
-
- mMapperV3 = IMapperV3::getService();
- if (mMapperV3 != nullptr) {
- mInitialized = true;
- return;
- }
-
- mMapperV2 = IMapper::getService();
- if (mMapperV2 == nullptr) {
- ALOGE("%s: cannnot acccess graphics mapper HAL!", __FUNCTION__);
- return;
- }
-
+ GraphicBufferMapper::preloadHal();
mInitialized = true;
return;
}
void HandleImporter::cleanup() {
- mMapperV4.clear();
- mMapperV3.clear();
- mMapperV2.clear();
mInitialized = false;
}
-template <class M, class E>
-bool HandleImporter::importBufferInternal(const sp<M> mapper, buffer_handle_t& handle) {
- E error;
+bool HandleImporter::importBufferInternal(buffer_handle_t& handle) {
buffer_handle_t importedHandle;
- auto ret = mapper->importBuffer(
- hidl_handle(handle), [&](const auto& tmpError, const auto& tmpBufferHandle) {
- error = tmpError;
- importedHandle = static_cast<buffer_handle_t>(tmpBufferHandle);
- });
-
- if (!ret.isOk()) {
- ALOGE("%s: mapper importBuffer failed: %s", __FUNCTION__, ret.description().c_str());
- return false;
- }
-
- if (error != E::NONE) {
+ auto status = GraphicBufferMapper::get().importBufferNoValidate(handle, &importedHandle);
+ if (status != OK) {
+ ALOGE("%s: mapper importBuffer failed: %d", __FUNCTION__, status);
return false;
}
@@ -97,172 +61,34 @@
return true;
}
-template <class M, class E>
-YCbCrLayout HandleImporter::lockYCbCrInternal(const sp<M> mapper, buffer_handle_t& buf,
- uint64_t cpuUsage,
- const IMapper::Rect& accessRegion) {
- hidl_handle acquireFenceHandle;
- auto buffer = const_cast<native_handle_t*>(buf);
- YCbCrLayout layout = {};
+android_ycbcr HandleImporter::lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage,
+ const android::Rect& accessRegion) {
+ Mutex::Autolock lock(mLock);
- typename M::Rect accessRegionCopy = {accessRegion.left, accessRegion.top, accessRegion.width,
- accessRegion.height};
- mapper->lockYCbCr(buffer, cpuUsage, accessRegionCopy, acquireFenceHandle,
- [&](const auto& tmpError, const auto& tmpLayout) {
- if (tmpError == E::NONE) {
- // Member by member copy from different versions of YCbCrLayout.
- layout.y = tmpLayout.y;
- layout.cb = tmpLayout.cb;
- layout.cr = tmpLayout.cr;
- layout.yStride = tmpLayout.yStride;
- layout.cStride = tmpLayout.cStride;
- layout.chromaStep = tmpLayout.chromaStep;
- } else {
- ALOGE("%s: failed to lockYCbCr error %d!", __FUNCTION__, tmpError);
- }
- });
+ if (!mInitialized) {
+ initializeLocked();
+ }
+ android_ycbcr layout;
+
+ status_t status = GraphicBufferMapper::get().lockYCbCr(buf, cpuUsage, accessRegion, &layout);
+
+ if (status != OK) {
+ ALOGE("%s: failed to lockYCbCr error %d!", __FUNCTION__, status);
+ }
+
return layout;
}
-bool isMetadataPesent(const sp<IMapperV4> mapper, const buffer_handle_t& buf,
- MetadataType metadataType) {
- auto buffer = const_cast<native_handle_t*>(buf);
- bool ret = false;
- hidl_vec<uint8_t> vec;
- mapper->get(buffer, metadataType, [&](const auto& tmpError, const auto& tmpMetadata) {
- if (tmpError == MapperErrorV4::NONE) {
- vec = tmpMetadata;
- } else {
- ALOGE("%s: failed to get metadata %d!", __FUNCTION__, tmpError);
- }
- });
-
- if (vec.size() > 0) {
- if (metadataType == gralloc4::MetadataType_Smpte2086) {
- std::optional<Smpte2086> realSmpte2086;
- gralloc4::decodeSmpte2086(vec, &realSmpte2086);
- ret = realSmpte2086.has_value();
- } else if (metadataType == gralloc4::MetadataType_Smpte2094_10) {
- std::optional<std::vector<uint8_t>> realSmpte2094_10;
- gralloc4::decodeSmpte2094_10(vec, &realSmpte2094_10);
- ret = realSmpte2094_10.has_value();
- } else if (metadataType == gralloc4::MetadataType_Smpte2094_40) {
- std::optional<std::vector<uint8_t>> realSmpte2094_40;
- gralloc4::decodeSmpte2094_40(vec, &realSmpte2094_40);
- ret = realSmpte2094_40.has_value();
- } else {
- ALOGE("%s: Unknown metadata type!", __FUNCTION__);
- }
- }
-
- return ret;
-}
-
-std::vector<PlaneLayout> getPlaneLayouts(const sp<IMapperV4> mapper, buffer_handle_t& buf) {
- auto buffer = const_cast<native_handle_t*>(buf);
+std::vector<PlaneLayout> getPlaneLayouts(buffer_handle_t& buf) {
std::vector<PlaneLayout> planeLayouts;
- hidl_vec<uint8_t> encodedPlaneLayouts;
- mapper->get(buffer, gralloc4::MetadataType_PlaneLayouts,
- [&](const auto& tmpError, const auto& tmpEncodedPlaneLayouts) {
- if (tmpError == MapperErrorV4::NONE) {
- encodedPlaneLayouts = tmpEncodedPlaneLayouts;
- } else {
- ALOGE("%s: failed to get plane layouts %d!", __FUNCTION__, tmpError);
- }
- });
-
- gralloc4::decodePlaneLayouts(encodedPlaneLayouts, &planeLayouts);
+ status_t status = GraphicBufferMapper::get().getPlaneLayouts(buf, &planeLayouts);
+ if (status != OK) {
+ ALOGE("%s: failed to get PlaneLayouts! Status %d", __FUNCTION__, status);
+ }
return planeLayouts;
}
-template <>
-YCbCrLayout HandleImporter::lockYCbCrInternal<IMapperV4, MapperErrorV4>(
- const sp<IMapperV4> mapper, buffer_handle_t& buf, uint64_t cpuUsage,
- const IMapper::Rect& accessRegion) {
- hidl_handle acquireFenceHandle;
- auto buffer = const_cast<native_handle_t*>(buf);
- YCbCrLayout layout = {};
- void* mapped = nullptr;
-
- typename IMapperV4::Rect accessRegionV4 = {accessRegion.left, accessRegion.top,
- accessRegion.width, accessRegion.height};
- mapper->lock(buffer, cpuUsage, accessRegionV4, acquireFenceHandle,
- [&](const auto& tmpError, const auto& tmpPtr) {
- if (tmpError == MapperErrorV4::NONE) {
- mapped = tmpPtr;
- } else {
- ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError);
- }
- });
-
- if (mapped == nullptr) {
- return layout;
- }
-
- std::vector<PlaneLayout> planeLayouts = getPlaneLayouts(mapper, buf);
- for (const auto& planeLayout : planeLayouts) {
- for (const auto& planeLayoutComponent : planeLayout.components) {
- const auto& type = planeLayoutComponent.type;
-
- if (!gralloc4::isStandardPlaneLayoutComponentType(type)) {
- continue;
- }
-
- uint8_t* data = reinterpret_cast<uint8_t*>(mapped);
- data += planeLayout.offsetInBytes;
- data += planeLayoutComponent.offsetInBits / 8;
-
- switch (static_cast<PlaneLayoutComponentType>(type.value)) {
- case PlaneLayoutComponentType::Y:
- layout.y = data;
- layout.yStride = planeLayout.strideInBytes;
- break;
- case PlaneLayoutComponentType::CB:
- layout.cb = data;
- layout.cStride = planeLayout.strideInBytes;
- layout.chromaStep = planeLayout.sampleIncrementInBits / 8;
- break;
- case PlaneLayoutComponentType::CR:
- layout.cr = data;
- layout.cStride = planeLayout.strideInBytes;
- layout.chromaStep = planeLayout.sampleIncrementInBits / 8;
- break;
- default:
- break;
- }
- }
- }
-
- return layout;
-}
-
-template <class M, class E>
-int HandleImporter::unlockInternal(const sp<M> mapper, buffer_handle_t& buf) {
- int releaseFence = -1;
- auto buffer = const_cast<native_handle_t*>(buf);
-
- mapper->unlock(buffer, [&](const auto& tmpError, const auto& tmpReleaseFence) {
- if (tmpError == E::NONE) {
- auto fenceHandle = tmpReleaseFence.getNativeHandle();
- if (fenceHandle) {
- if (fenceHandle->numInts != 0 || fenceHandle->numFds != 1) {
- ALOGE("%s: bad release fence numInts %d numFds %d", __FUNCTION__,
- fenceHandle->numInts, fenceHandle->numFds);
- return;
- }
- releaseFence = dup(fenceHandle->data[0]);
- if (releaseFence < 0) {
- ALOGE("%s: bad release fence FD %d", __FUNCTION__, releaseFence);
- }
- }
- } else {
- ALOGE("%s: failed to unlock error %d!", __FUNCTION__, tmpError);
- }
- });
- return releaseFence;
-}
-
// In IComposer, any buffer_handle_t is owned by the caller and we need to
// make a clone for hwcomposer2. We also need to translate empty handle
// to nullptr. This function does that, in-place.
@@ -277,20 +103,7 @@
initializeLocked();
}
- if (mMapperV4 != nullptr) {
- return importBufferInternal<IMapperV4, MapperErrorV4>(mMapperV4, handle);
- }
-
- if (mMapperV3 != nullptr) {
- return importBufferInternal<IMapperV3, MapperErrorV3>(mMapperV3, handle);
- }
-
- if (mMapperV2 != nullptr) {
- return importBufferInternal<IMapper, MapperErrorV2>(mMapperV2, handle);
- }
-
- ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__);
- return false;
+ return importBufferInternal(handle);
}
void HandleImporter::freeBuffer(buffer_handle_t handle) {
@@ -303,21 +116,9 @@
initializeLocked();
}
- if (mMapperV4 != nullptr) {
- auto ret = mMapperV4->freeBuffer(const_cast<native_handle_t*>(handle));
- if (!ret.isOk()) {
- ALOGE("%s: mapper freeBuffer failed: %s", __FUNCTION__, ret.description().c_str());
- }
- } else if (mMapperV3 != nullptr) {
- auto ret = mMapperV3->freeBuffer(const_cast<native_handle_t*>(handle));
- if (!ret.isOk()) {
- ALOGE("%s: mapper freeBuffer failed: %s", __FUNCTION__, ret.description().c_str());
- }
- } else {
- auto ret = mMapperV2->freeBuffer(const_cast<native_handle_t*>(handle));
- if (!ret.isOk()) {
- ALOGE("%s: mapper freeBuffer failed: %s", __FUNCTION__, ret.description().c_str());
- }
+ status_t status = GraphicBufferMapper::get().freeBuffer(handle);
+ if (status != OK) {
+ ALOGE("%s: mapper freeBuffer failed. Status %d", __FUNCTION__, status);
}
}
@@ -345,12 +146,12 @@
}
void* HandleImporter::lock(buffer_handle_t& buf, uint64_t cpuUsage, size_t size) {
- IMapper::Rect accessRegion{0, 0, static_cast<int>(size), 1};
+ android::Rect accessRegion{0, 0, static_cast<int>(size), 1};
return lock(buf, cpuUsage, accessRegion);
}
void* HandleImporter::lock(buffer_handle_t& buf, uint64_t cpuUsage,
- const IMapper::Rect& accessRegion) {
+ const android::Rect& accessRegion) {
Mutex::Autolock lock(mLock);
if (!mInitialized) {
@@ -358,81 +159,18 @@
}
void* ret = nullptr;
-
- if (mMapperV4 == nullptr && mMapperV3 == nullptr && mMapperV2 == nullptr) {
- ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__);
- return ret;
- }
-
- hidl_handle acquireFenceHandle;
- auto buffer = const_cast<native_handle_t*>(buf);
- if (mMapperV4 != nullptr) {
- IMapperV4::Rect accessRegionV4{accessRegion.left, accessRegion.top, accessRegion.width,
- accessRegion.height};
-
- mMapperV4->lock(buffer, cpuUsage, accessRegionV4, acquireFenceHandle,
- [&](const auto& tmpError, const auto& tmpPtr) {
- if (tmpError == MapperErrorV4::NONE) {
- ret = tmpPtr;
- } else {
- ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError);
- }
- });
- } else if (mMapperV3 != nullptr) {
- IMapperV3::Rect accessRegionV3{accessRegion.left, accessRegion.top, accessRegion.width,
- accessRegion.height};
-
- mMapperV3->lock(buffer, cpuUsage, accessRegionV3, acquireFenceHandle,
- [&](const auto& tmpError, const auto& tmpPtr, const auto& /*bytesPerPixel*/,
- const auto& /*bytesPerStride*/) {
- if (tmpError == MapperErrorV3::NONE) {
- ret = tmpPtr;
- } else {
- ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError);
- }
- });
- } else {
- mMapperV2->lock(buffer, cpuUsage, accessRegion, acquireFenceHandle,
- [&](const auto& tmpError, const auto& tmpPtr) {
- if (tmpError == MapperErrorV2::NONE) {
- ret = tmpPtr;
- } else {
- ALOGE("%s: failed to lock error %d!", __FUNCTION__, tmpError);
- }
- });
+ status_t status = GraphicBufferMapper::get().lock(buf, cpuUsage, accessRegion, &ret);
+ if (status != OK) {
+ ALOGE("%s: failed to lock error %d!", __FUNCTION__, status);
}
ALOGV("%s: ptr %p accessRegion.top: %d accessRegion.left: %d accessRegion.width: %d "
"accessRegion.height: %d",
- __FUNCTION__, ret, accessRegion.top, accessRegion.left, accessRegion.width,
- accessRegion.height);
+ __FUNCTION__, ret, accessRegion.top, accessRegion.left, accessRegion.width(),
+ accessRegion.height());
return ret;
}
-YCbCrLayout HandleImporter::lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage,
- const IMapper::Rect& accessRegion) {
- Mutex::Autolock lock(mLock);
-
- if (!mInitialized) {
- initializeLocked();
- }
-
- if (mMapperV4 != nullptr) {
- return lockYCbCrInternal<IMapperV4, MapperErrorV4>(mMapperV4, buf, cpuUsage, accessRegion);
- }
-
- if (mMapperV3 != nullptr) {
- return lockYCbCrInternal<IMapperV3, MapperErrorV3>(mMapperV3, buf, cpuUsage, accessRegion);
- }
-
- if (mMapperV2 != nullptr) {
- return lockYCbCrInternal<IMapper, MapperErrorV2>(mMapperV2, buf, cpuUsage, accessRegion);
- }
-
- ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__);
- return {};
-}
-
status_t HandleImporter::getMonoPlanarStrideBytes(buffer_handle_t& buf, uint32_t* stride /*out*/) {
if (stride == nullptr) {
return BAD_VALUE;
@@ -444,35 +182,26 @@
initializeLocked();
}
- if (mMapperV4 != nullptr) {
- std::vector<PlaneLayout> planeLayouts = getPlaneLayouts(mMapperV4, buf);
- if (planeLayouts.size() != 1) {
- ALOGE("%s: Unexpected number of planes %zu!", __FUNCTION__, planeLayouts.size());
- return BAD_VALUE;
- }
-
- *stride = planeLayouts[0].strideInBytes;
- } else {
- ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__);
- return NO_INIT;
+ std::vector<PlaneLayout> planeLayouts = getPlaneLayouts(buf);
+ if (planeLayouts.size() != 1) {
+ ALOGE("%s: Unexpected number of planes %zu!", __FUNCTION__, planeLayouts.size());
+ return BAD_VALUE;
}
+ *stride = planeLayouts[0].strideInBytes;
+
return OK;
}
int HandleImporter::unlock(buffer_handle_t& buf) {
- if (mMapperV4 != nullptr) {
- return unlockInternal<IMapperV4, MapperErrorV4>(mMapperV4, buf);
- }
- if (mMapperV3 != nullptr) {
- return unlockInternal<IMapperV3, MapperErrorV3>(mMapperV3, buf);
- }
- if (mMapperV2 != nullptr) {
- return unlockInternal<IMapper, MapperErrorV2>(mMapperV2, buf);
+ int releaseFence = -1;
+
+ status_t status = GraphicBufferMapper::get().unlockAsync(buf, &releaseFence);
+ if (status != OK) {
+ ALOGE("%s: failed to unlock error %d!", __FUNCTION__, status);
}
- ALOGE("%s: mMapperV4, mMapperV3 and mMapperV2 are all null!", __FUNCTION__);
- return -1;
+ return releaseFence;
}
bool HandleImporter::isSmpte2086Present(const buffer_handle_t& buf) {
@@ -481,14 +210,14 @@
if (!mInitialized) {
initializeLocked();
}
-
- if (mMapperV4 != nullptr) {
- return isMetadataPesent(mMapperV4, buf, gralloc4::MetadataType_Smpte2086);
- } else {
- ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__);
+ std::optional<ui::Smpte2086> metadata;
+ status_t status = GraphicBufferMapper::get().getSmpte2086(buf, &metadata);
+ if (status != OK) {
+ ALOGE("%s: Mapper failed to get Smpte2094_40 metadata! Status: %d", __FUNCTION__, status);
+ return false;
}
- return false;
+ return metadata.has_value();
}
bool HandleImporter::isSmpte2094_10Present(const buffer_handle_t& buf) {
@@ -498,13 +227,14 @@
initializeLocked();
}
- if (mMapperV4 != nullptr) {
- return isMetadataPesent(mMapperV4, buf, gralloc4::MetadataType_Smpte2094_10);
- } else {
- ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__);
+ std::optional<std::vector<uint8_t>> metadata;
+ status_t status = GraphicBufferMapper::get().getSmpte2094_10(buf, &metadata);
+ if (status != OK) {
+ ALOGE("%s: Mapper failed to get Smpte2094_40 metadata! Status: %d", __FUNCTION__, status);
+ return false;
}
- return false;
+ return metadata.has_value();
}
bool HandleImporter::isSmpte2094_40Present(const buffer_handle_t& buf) {
@@ -514,13 +244,14 @@
initializeLocked();
}
- if (mMapperV4 != nullptr) {
- return isMetadataPesent(mMapperV4, buf, gralloc4::MetadataType_Smpte2094_40);
- } else {
- ALOGE("%s: mMapperV4 is null! Query not supported!", __FUNCTION__);
+ std::optional<std::vector<uint8_t>> metadata;
+ status_t status = GraphicBufferMapper::get().getSmpte2094_40(buf, &metadata);
+ if (status != OK) {
+ ALOGE("%s: Mapper failed to get Smpte2094_40 metadata! Status: %d", __FUNCTION__, status);
+ return false;
}
- return false;
+ return metadata.has_value();
}
} // namespace helper
diff --git a/camera/common/default/include/HandleImporter.h b/camera/common/default/include/HandleImporter.h
index 5408ba9..df01202 100644
--- a/camera/common/default/include/HandleImporter.h
+++ b/camera/common/default/include/HandleImporter.h
@@ -17,15 +17,11 @@
#ifndef CAMERA_COMMON_1_0_HANDLEIMPORTED_H
#define CAMERA_COMMON_1_0_HANDLEIMPORTED_H
-#include <android/hardware/graphics/mapper/2.0/IMapper.h>
-#include <android/hardware/graphics/mapper/3.0/IMapper.h>
-#include <android/hardware/graphics/mapper/4.0/IMapper.h>
#include <cutils/native_handle.h>
+#include <system/graphics.h>
+#include <ui/Rect.h>
#include <utils/Mutex.h>
-using android::hardware::graphics::mapper::V2_0::IMapper;
-using android::hardware::graphics::mapper::V2_0::YCbCrLayout;
-
namespace android {
namespace hardware {
namespace camera {
@@ -49,11 +45,11 @@
void* lock(buffer_handle_t& buf, uint64_t cpuUsage, size_t size);
// Locks 2-D buffer. Assumes caller has waited for acquire fences.
- void* lock(buffer_handle_t& buf, uint64_t cpuUsage, const IMapper::Rect& accessRegion);
+ void* lock(buffer_handle_t& buf, uint64_t cpuUsage, const android::Rect& accessRegion);
// Assumes caller has waited for acquire fences.
- YCbCrLayout lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage,
- const IMapper::Rect& accessRegion);
+ android_ycbcr lockYCbCr(buffer_handle_t& buf, uint64_t cpuUsage,
+ const android::Rect& accessRegion);
// Query the stride of the first plane in bytes.
status_t getMonoPlanarStrideBytes(buffer_handle_t& buf, uint32_t* stride /*out*/);
@@ -69,19 +65,11 @@
void initializeLocked();
void cleanup();
- template <class M, class E>
- bool importBufferInternal(const sp<M> mapper, buffer_handle_t& handle);
- template <class M, class E>
- YCbCrLayout lockYCbCrInternal(const sp<M> mapper, buffer_handle_t& buf, uint64_t cpuUsage,
- const IMapper::Rect& accessRegion);
- template <class M, class E>
- int unlockInternal(const sp<M> mapper, buffer_handle_t& buf);
+ bool importBufferInternal(buffer_handle_t& handle);
+ int unlockInternal(buffer_handle_t& buf);
Mutex mLock;
bool mInitialized;
- sp<IMapper> mMapperV2;
- sp<graphics::mapper::V3_0::IMapper> mMapperV3;
- sp<graphics::mapper::V4_0::IMapper> mMapperV4;
};
} // namespace helper
diff --git a/camera/device/1.0/Android.bp b/camera/device/1.0/Android.bp
index 6947779..e3a85e0 100644
--- a/camera/device/1.0/Android.bp
+++ b/camera/device/1.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/device/1.0/default/Android.bp b/camera/device/1.0/default/Android.bp
index 9ff6480..65891df 100644
--- a/camera/device/1.0/default/Android.bp
+++ b/camera/device/1.0/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -32,6 +33,7 @@
"libgralloctypes",
"libhardware",
"libcamera_metadata",
+ "libui",
],
static_libs: [
"android.hardware.camera.common@1.0-helper",
diff --git a/camera/device/3.2/Android.bp b/camera/device/3.2/Android.bp
index c80538c..afeba17 100644
--- a/camera/device/3.2/Android.bp
+++ b/camera/device/3.2/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/device/3.2/default/Android.bp b/camera/device/3.2/default/Android.bp
index a196291..00e59ec 100644
--- a/camera/device/3.2/default/Android.bp
+++ b/camera/device/3.2/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -30,6 +31,7 @@
"libhardware",
"libcamera_metadata",
"libfmq",
+ "libui",
],
static_libs: [
"android.hardware.camera.common@1.0-helper",
diff --git a/camera/device/3.3/Android.bp b/camera/device/3.3/Android.bp
index f5e51d6..becc67e 100644
--- a/camera/device/3.3/Android.bp
+++ b/camera/device/3.3/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/device/3.3/default/Android.bp b/camera/device/3.3/default/Android.bp
index cc0dd39..5bc2b51 100644
--- a/camera/device/3.3/default/Android.bp
+++ b/camera/device/3.3/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/device/3.4/Android.bp b/camera/device/3.4/Android.bp
index 2a6faab..bde7c9f 100644
--- a/camera/device/3.4/Android.bp
+++ b/camera/device/3.4/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/device/3.4/default/Android.bp b/camera/device/3.4/default/Android.bp
index 9f0c777..95bc323 100644
--- a/camera/device/3.4/default/Android.bp
+++ b/camera/device/3.4/default/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -106,6 +107,7 @@
"libjpeg",
"libexif",
"libtinyxml2",
+ "libui",
],
static_libs: [
"android.hardware.camera.common@1.0-helper",
diff --git a/camera/device/3.4/default/ExternalCameraDeviceSession.cpp b/camera/device/3.4/default/ExternalCameraDeviceSession.cpp
index ca7186b..01b3d41 100644
--- a/camera/device/3.4/default/ExternalCameraDeviceSession.cpp
+++ b/camera/device/3.4/default/ExternalCameraDeviceSession.cpp
@@ -1574,14 +1574,23 @@
} break;
case PixelFormat::YCBCR_420_888:
case PixelFormat::YV12: {
- IMapper::Rect outRect {0, 0,
- static_cast<int32_t>(halBuf.width),
- static_cast<int32_t>(halBuf.height)};
- YCbCrLayout outLayout = sHandleImporter.lockYCbCr(
- *(halBuf.bufPtr), halBuf.usage, outRect);
- ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d",
- __FUNCTION__, outLayout.y, outLayout.cb, outLayout.cr,
- outLayout.yStride, outLayout.cStride, outLayout.chromaStep);
+ android::Rect outRect{0, 0, static_cast<int32_t>(halBuf.width),
+ static_cast<int32_t>(halBuf.height)};
+ android_ycbcr result =
+ sHandleImporter.lockYCbCr(*(halBuf.bufPtr), halBuf.usage, outRect);
+ ALOGV("%s: outLayout y %p cb %p cr %p y_str %zu c_str %zu c_step %zu", __FUNCTION__,
+ result.y, result.cb, result.cr, result.ystride, result.cstride,
+ result.chroma_step);
+ if (result.ystride > UINT32_MAX || result.cstride > UINT32_MAX ||
+ result.chroma_step > UINT32_MAX) {
+ return onDeviceError("%s: lockYCbCr failed. Unexpected values!", __FUNCTION__);
+ }
+ YCbCrLayout outLayout = {.y = result.y,
+ .cb = result.cb,
+ .cr = result.cr,
+ .yStride = static_cast<uint32_t>(result.ystride),
+ .cStride = static_cast<uint32_t>(result.cstride),
+ .chromaStep = static_cast<uint32_t>(result.chroma_step)};
// Convert to output buffer size/format
uint32_t outputFourcc = getFourCcFromLayout(outLayout);
diff --git a/camera/device/3.5/Android.bp b/camera/device/3.5/Android.bp
index f29f936..6e23ee0 100644
--- a/camera/device/3.5/Android.bp
+++ b/camera/device/3.5/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/device/3.5/default/Android.bp b/camera/device/3.5/default/Android.bp
index 9d27b32..b6dee79 100644
--- a/camera/device/3.5/default/Android.bp
+++ b/camera/device/3.5/default/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -46,6 +47,7 @@
],
shared_libs: [
"libhidlbase",
+ "libui",
"libutils",
"libcutils",
"camera.device@3.2-impl",
@@ -81,6 +83,7 @@
],
shared_libs: [
"libhidlbase",
+ "libui",
"libutils",
"libcutils",
"camera.device@3.2-impl",
diff --git a/camera/device/3.6/Android.bp b/camera/device/3.6/Android.bp
index ff37ca3..4fb56cf 100644
--- a/camera/device/3.6/Android.bp
+++ b/camera/device/3.6/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/device/3.6/default/Android.bp b/camera/device/3.6/default/Android.bp
index 89ee145..5c5f911 100644
--- a/camera/device/3.6/default/Android.bp
+++ b/camera/device/3.6/default/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -41,6 +42,7 @@
],
shared_libs: [
"libhidlbase",
+ "libui",
"libutils",
"libcutils",
"camera.device@3.2-impl",
diff --git a/camera/device/3.6/default/ExternalCameraOfflineSession.cpp b/camera/device/3.6/default/ExternalCameraOfflineSession.cpp
index e606fda..1f1dfee 100644
--- a/camera/device/3.6/default/ExternalCameraOfflineSession.cpp
+++ b/camera/device/3.6/default/ExternalCameraOfflineSession.cpp
@@ -222,14 +222,23 @@
} break;
case PixelFormat::YCBCR_420_888:
case PixelFormat::YV12: {
- IMapper::Rect outRect {0, 0,
- static_cast<int32_t>(halBuf.width),
- static_cast<int32_t>(halBuf.height)};
- YCbCrLayout outLayout = sHandleImporter.lockYCbCr(
- *(halBuf.bufPtr), halBuf.usage, outRect);
- ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d",
- __FUNCTION__, outLayout.y, outLayout.cb, outLayout.cr,
- outLayout.yStride, outLayout.cStride, outLayout.chromaStep);
+ android::Rect outRect{0, 0, static_cast<int32_t>(halBuf.width),
+ static_cast<int32_t>(halBuf.height)};
+ android_ycbcr result =
+ sHandleImporter.lockYCbCr(*(halBuf.bufPtr), halBuf.usage, outRect);
+ ALOGV("%s: outLayout y %p cb %p cr %p y_str %zu c_str %zu c_step %zu", __FUNCTION__,
+ result.y, result.cb, result.cr, result.ystride, result.cstride,
+ result.chroma_step);
+ if (result.ystride > UINT32_MAX || result.cstride > UINT32_MAX ||
+ result.chroma_step > UINT32_MAX) {
+ return onDeviceError("%s: lockYCbCr failed. Unexpected values!", __FUNCTION__);
+ }
+ YCbCrLayout outLayout = {.y = result.y,
+ .cb = result.cb,
+ .cr = result.cr,
+ .yStride = static_cast<uint32_t>(result.ystride),
+ .cStride = static_cast<uint32_t>(result.cstride),
+ .chromaStep = static_cast<uint32_t>(result.chroma_step)};
// Convert to output buffer size/format
uint32_t outputFourcc = V3_4::implementation::getFourCcFromLayout(outLayout);
diff --git a/camera/device/3.7/Android.bp b/camera/device/3.7/Android.bp
index be08e91..4312c04 100644
--- a/camera/device/3.7/Android.bp
+++ b/camera/device/3.7/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/device/aidl/Android.bp b/camera/device/aidl/Android.bp
index 43a3934..a156498 100644
--- a/camera/device/aidl/Android.bp
+++ b/camera/device/aidl/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -11,14 +12,14 @@
name: "android.hardware.camera.device",
vendor_available: true,
srcs: ["android/hardware/camera/device/*.aidl"],
- frozen: true,
+ frozen: false,
stability: "vintf",
imports: [
"android.hardware.common-V2",
"android.hardware.common.fmq-V1",
"android.hardware.camera.common-V1",
"android.hardware.camera.metadata-V2",
- "android.hardware.graphics.common-V4",
+ "android.hardware.graphics.common-V5",
],
backend: {
cpp: {
@@ -37,7 +38,7 @@
"android.hardware.common.fmq-V1",
"android.hardware.camera.common-V1",
"android.hardware.camera.metadata-V1",
- "android.hardware.graphics.common-V4",
+ "android.hardware.graphics.common-V5",
],
},
{
@@ -47,7 +48,7 @@
"android.hardware.common.fmq-V1",
"android.hardware.camera.common-V1",
"android.hardware.camera.metadata-V2",
- "android.hardware.graphics.common-V4",
+ "android.hardware.graphics.common-V5",
],
},
diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ConfigureStreamsRet.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ConfigureStreamsRet.aidl
new file mode 100644
index 0000000..5535a30
--- /dev/null
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ConfigureStreamsRet.aidl
@@ -0,0 +1,39 @@
+/*
+ * 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.camera.device;
+@VintfStability
+parcelable ConfigureStreamsRet {
+ android.hardware.camera.device.HalStream[] halStreams;
+ boolean enableHalBufferManager = false;
+}
diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl
index 51c6067..f73483a 100644
--- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDevice.aidl
@@ -43,4 +43,7 @@
void setTorchMode(boolean on);
void turnOnTorchWithStrengthLevel(int torchStrength);
int getTorchStrengthLevel();
+ android.hardware.camera.device.CameraMetadata constructDefaultRequestSettings(in android.hardware.camera.device.RequestTemplate type);
+ boolean isStreamCombinationWithSettingsSupported(in android.hardware.camera.device.StreamConfiguration streams);
+ android.hardware.camera.device.CameraMetadata getSessionCharacteristics(in android.hardware.camera.device.StreamConfiguration sessionConfig);
}
diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDeviceSession.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDeviceSession.aidl
index 2196d37..b6ae734 100644
--- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDeviceSession.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ICameraDeviceSession.aidl
@@ -45,4 +45,5 @@
oneway void signalStreamFlush(in int[] streamIds, in int streamConfigCounter);
android.hardware.camera.device.ICameraOfflineSession switchToOffline(in int[] streamsToKeep, out android.hardware.camera.device.CameraOfflineSessionInfo offlineSessionInfo);
void repeatingRequestEnd(in int frameNumber, in int[] streamIds);
+ android.hardware.camera.device.ConfigureStreamsRet configureStreamsV2(in android.hardware.camera.device.StreamConfiguration requestedConfiguration);
}
diff --git a/camera/device/aidl/android/hardware/camera/device/ConfigureStreamsRet.aidl b/camera/device/aidl/android/hardware/camera/device/ConfigureStreamsRet.aidl
new file mode 100644
index 0000000..8f462ec
--- /dev/null
+++ b/camera/device/aidl/android/hardware/camera/device/ConfigureStreamsRet.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.
+ */
+
+package android.hardware.camera.device;
+
+import android.hardware.camera.device.HalStream;
+
+/**
+ * ConfigureStreamsRet.
+ *
+ * Parcelable returned by the 'configureStreamsV2' call.
+ * This contains information which informs the camera framework
+ * about properties of each stream configured and also whether the
+ * the hal buffer manager must be used for the session configured.
+ */
+@VintfStability
+parcelable ConfigureStreamsRet {
+ /**
+ * A vector of HalStream Parcelables, which contain information
+ * about the stream parameters desired by the HAL such as usage flags,
+ * overridden format, maximum buffers etc.
+ */
+ HalStream[] halStreams;
+ /**
+ * A boolean informing the camera framework whether the HAL buffer manager
+ * must be used for the session configured.
+ */
+ boolean enableHalBufferManager = false;
+}
diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl
index f940000..3a1d762 100644
--- a/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl
+++ b/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl
@@ -21,6 +21,7 @@
import android.hardware.camera.device.ICameraDeviceCallback;
import android.hardware.camera.device.ICameraDeviceSession;
import android.hardware.camera.device.ICameraInjectionSession;
+import android.hardware.camera.device.RequestTemplate;
import android.hardware.camera.device.StreamConfiguration;
import android.os.ParcelFileDescriptor;
@@ -346,4 +347,122 @@
*
*/
int getTorchStrengthLevel();
+
+ /**
+ * constructDefaultRequestSettings:
+ *
+ * This is the same as ICameraDeviceSession.constructDefaultRequestSettings, with
+ * the exception that it can be called before the ICameraDevice.open call.
+ *
+ * @param type The requested template CaptureRequest type to create the default settings for.
+ *
+ * @return capture settings for the requested use case.
+ *
+ */
+ CameraMetadata constructDefaultRequestSettings(in RequestTemplate type);
+
+ /**
+ * isStreamCombinationWithSettingsSupported:
+ *
+ * This is the same as isStreamCombinationSupported with below exceptions:
+ *
+ * 1. The input StreamConfiguration parameter may contain session parameters
+ * supported by this camera device. When checking if the particular StreamConfiguration
+ * is supported, the camera HAL must take the session parameters into consideration.
+ *
+ * 2. For version 3 of this interface, the camera compliance test will verify that
+ * isStreamCombinationWithSettingsSupported behaves properly for all combinations of
+ * below features. This function must return true for all supported combinations,
+ * and return false for non-supported feature combinations. The list of features
+ * required may grow in future versions.
+ *
+ * - Stream Combinations (a subset of LEGACY device mandatory stream combinations):
+ * {
+ * // 4:3 16:9
+ * // S1440P: 1920 x 1440 2560 x 1440
+ * // S1080P: 1440 x 1080 1920 x 1080
+ * // S720P: 960 x 720 1280 x 720
+ *
+ * // Simple preview, GPU video processing, or no-preview video recording
+ * {PRIV, MAXIMUM},
+ * {PRIV, PREVIEW},
+ * {PRIV, S1440P},
+ * {PRIV, S1080P},
+ * {PRIV, S720P},
+ * // In-application video/image processing
+ * {YUV, MAXIMUM},
+ * {YUV, PREVIEW},
+ * {YUV, S1440P},
+ * {YUV, S1080P},
+ * {YUV, S720P},
+ * // Standard still imaging.
+ * {PRIV, PREVIEW, JPEG, MAXIMUM},
+ * {PRIV, S1440P, JPEG, MAXIMUM},
+ * {PRIV, S1080P, JPEG, MAXIMUM},
+ * {PRIV, S720P, JPEG, MAXIMUM},
+ * {PRIV, S1440P, JPEG, S1440P},
+ * {PRIV, S1080P, JPEG, S1080P},
+ * {PRIV, S720P, JPEG, S1080P},
+ * // In-app processing plus still capture.
+ * {YUV, PREVIEW, JPEG, MAXIMUM},
+ * {YUV, S1440P, JPEG, MAXIMUM},
+ * {YUV, S1080P, JPEG, MAXIMUM},
+ * {YUV, S720P, JPEG, MAXIMUM},
+ * // Standard recording.
+ * {PRIV, PREVIEW, PRIV, PREVIEW},
+ * {PRIV, S1440P, PRIV, S1440P},
+ * {PRIV, S1080P, PRIV, S1080P},
+ * {PRIV, S720P, PRIV, S720P},
+ * // Preview plus in-app processing.
+ * {PRIV, PREVIEW, YUV, PREVIEW},
+ * {PRIV, S1440P, YUV, S1440P},
+ * {PRIV, S1080P, YUV, S1080P},
+ * {PRIV, S720P, YUV, S720P},
+ * }
+ * - VIDEO_STABILIZATION_MODES: {OFF, PREVIEW}
+ * - AE_TARGET_FPS_RANGE: {{*, 30}, {*, 60}}
+ * - DYNAMIC_RANGE_PROFILE: {STANDARD, HLG10}
+ *
+ * Note: If a combination contains a S1440P, S1080P, or S720P stream,
+ * both 4:3 and 16:9 aspect ratio will be considered. For example, for the
+ * stream combination of {PRIV, S1440P, JPEG, MAXIMUM}, and if MAXIMUM ==
+ * 4032 x 3024, the camera compliance test will verify both
+ * {PRIV, 1920 x 1440, JPEG, 4032 x 3024} and {PRIV, 2560 x 1440, JPEG, 4032 x 2268}.
+ *
+ * @param streams The StreamConfiguration to be tested, with optional session parameters.
+ *
+ * @return true in case the stream combination is supported, false otherwise.
+ *
+ */
+ boolean isStreamCombinationWithSettingsSupported(in StreamConfiguration streams);
+
+ /**
+ * getSessionCharacteristics
+ *
+ * Gets the session characteristics associated with a particular session
+ * configuration by the CameraDevice.
+ *
+ * For Android 15, the characteristics which need to be set are:
+ * - ANDROID_CONTROL_ZOOM_RATIO_RANGE
+ *
+ * A service specific error will be returned on the following conditions
+ * INTERNAL_ERROR:
+ * The camera device cannot be opened due to an internal
+ * error.
+ * CAMERA_DISCONNECTED:
+ * An external camera device has been disconnected, and is no longer
+ * available. This camera device interface is now stale, and a new
+ * instance must be acquired if the device is reconnected. All
+ * subsequent calls on this interface must return
+ * CAMERA_DISCONNECTED.
+ * ILLEGAL_ARGUMENT:
+ * If the given session configuration is not supported.
+ *
+ * @param sessionConfig: The session configuration for which the
+ * characteristics are being fetched.
+ *
+ * @return The static metadata for this particular session config, or an
+ * empty metadata structure if a service specific error is returned.
+ */
+ CameraMetadata getSessionCharacteristics(in StreamConfiguration sessionConfig);
}
diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl
index 885c71a..ffc1a11 100644
--- a/camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl
+++ b/camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl
@@ -20,6 +20,7 @@
import android.hardware.camera.device.CameraMetadata;
import android.hardware.camera.device.CameraOfflineSessionInfo;
import android.hardware.camera.device.CaptureRequest;
+import android.hardware.camera.device.ConfigureStreamsRet;
import android.hardware.camera.device.HalStream;
import android.hardware.camera.device.ICameraOfflineSession;
import android.hardware.camera.device.RequestTemplate;
@@ -88,6 +89,13 @@
* with processCaptureResult (and its respective releaseFence has been
* signaled) the framework may free or reuse it at any time.
*
+ * This method wil only be called by the framework if
+ * ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION is either not advertised or is
+ * ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_AIDL. If the value of
+ * ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION is
+ * ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE, configureStreamsV2
+ * will be called instead.
+ *
* ------------------------------------------------------------------------
*
* Preconditions:
@@ -386,8 +394,8 @@
* error.
* @return true in case the stream reconfiguration is required, false otherwise.
*/
- boolean isReconfigurationRequired(in CameraMetadata oldSessionParams,
- in CameraMetadata newSessionParams);
+ boolean isReconfigurationRequired(
+ in CameraMetadata oldSessionParams, in CameraMetadata newSessionParams);
/**
* processCaptureRequest:
@@ -576,4 +584,29 @@
*/
void repeatingRequestEnd(in int frameNumber, in int[] streamIds);
+ /**
+ *
+ * configureStreamsV2:
+ *
+ * Performs the same function as 'configureStreams'. This function returns a
+ * 'ConfigureStreamsRet' Parcelable. This tells the framework about the desired stream
+ * parameters such as usage flags, maximum buffers, overridden format etc. It also informs
+ * camera framework whether the HAL will use the HAL buffer manager APIs 'requestStreamBuffers'
+ * and 'returnStreamBuffers' to request and return buffers to the framework.
+ *
+ * This method is only supported if
+ * ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION is
+ * ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE. It must not be
+ * called by the camera framework if it isn't supported. That is, the framework will only
+ * ever call one of 'configureStreams' or 'configureStreamsV2' depending on the value of
+ * ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION.
+ *
+ * @param requestedConfiguration The stream configuration requested by the camera framework to
+ * be configured by the camera HAL.
+ * @return A ConfigureStreamsRet Parcelable containing a vector of HalStreams and a boolean
+ * specifying whether the HAL buffer manager must be used for this session
+ * configuration.
+ *
+ */
+ ConfigureStreamsRet configureStreamsV2(in StreamConfiguration requestedConfiguration);
}
diff --git a/camera/device/default/Android.bp b/camera/device/default/Android.bp
index b577597..10cee12 100644
--- a/camera/device/default/Android.bp
+++ b/camera/device/default/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -25,7 +26,10 @@
cc_library_shared {
name: "camera.device-external-impl",
- defaults: ["hidl_defaults"],
+ defaults: [
+ "android.hardware.graphics.common-ndk_shared",
+ "hidl_defaults",
+ ],
proprietary: true,
srcs: [
"ExternalCameraDevice.cpp",
@@ -37,8 +41,7 @@
shared_libs: [
"android.hardware.camera.common-V1-ndk",
"android.hardware.camera.device-V1-ndk",
- "android.hardware.graphics.allocator-V1-ndk",
- "android.hardware.graphics.common-V4-ndk",
+ "android.hardware.graphics.allocator-V2-ndk",
"android.hardware.graphics.mapper@2.0",
"android.hardware.graphics.mapper@3.0",
"android.hardware.graphics.mapper@4.0",
@@ -58,6 +61,7 @@
"libsync",
"libtinyxml2",
"libutils",
+ "libui",
"libyuv",
],
static_libs: [
diff --git a/camera/device/default/ExternalCameraDeviceSession.cpp b/camera/device/default/ExternalCameraDeviceSession.cpp
index 88e4b75..91196d4 100644
--- a/camera/device/default/ExternalCameraDeviceSession.cpp
+++ b/camera/device/default/ExternalCameraDeviceSession.cpp
@@ -224,10 +224,6 @@
}
void ExternalCameraDeviceSession::closeOutputThread() {
- closeOutputThreadImpl();
-}
-
-void ExternalCameraDeviceSession::closeOutputThreadImpl() {
if (mOutputThread != nullptr) {
mOutputThread->flush();
mOutputThread->requestExitAndWait();
@@ -235,6 +231,13 @@
}
}
+void ExternalCameraDeviceSession::closeBufferRequestThread() {
+ if (mBufferRequestThread != nullptr) {
+ mBufferRequestThread->requestExitAndWait();
+ mBufferRequestThread.reset();
+ }
+}
+
Status ExternalCameraDeviceSession::initStatus() const {
Mutex::Autolock _l(mLock);
Status status = Status::OK;
@@ -248,7 +251,7 @@
ExternalCameraDeviceSession::~ExternalCameraDeviceSession() {
if (!isClosed()) {
ALOGE("ExternalCameraDeviceSession deleted before close!");
- close(/*callerIsDtor*/ true);
+ closeImpl();
}
}
@@ -535,6 +538,19 @@
return Status::INTERNAL_ERROR;
}
+ if (request.outputBuffers.empty()) {
+ ALOGE("%s: No output buffers provided.", __FUNCTION__);
+ return Status::ILLEGAL_ARGUMENT;
+ }
+
+ for (auto& outputBuf : request.outputBuffers) {
+ if (outputBuf.streamId == -1 || mStreamMap.find(outputBuf.streamId) == mStreamMap.end()) {
+ ALOGE("%s: Invalid streamId in CaptureRequest.outputBuffers: %d", __FUNCTION__,
+ outputBuf.streamId);
+ return Status::ILLEGAL_ARGUMENT;
+ }
+ }
+
const camera_metadata_t* rawSettings = nullptr;
bool converted;
CameraMetadata settingsFmq; // settings from FMQ
@@ -569,8 +585,6 @@
return Status::ILLEGAL_ARGUMENT;
}
- std::vector<buffer_handle_t*> allBufPtrs;
- std::vector<int> allFences;
size_t numOutputBufs = request.outputBuffers.size();
if (numOutputBufs == 0) {
@@ -626,11 +640,6 @@
}
}
- status = importRequestLocked(request, allBufPtrs, allFences);
- if (status != Status::OK) {
- return status;
- }
-
nsecs_t shutterTs = 0;
std::unique_ptr<V4L2Frame> frameIn = dequeueV4l2FrameLocked(&shutterTs);
if (frameIn == nullptr) {
@@ -653,8 +662,8 @@
halBuf.height = stream.height;
halBuf.format = stream.format;
halBuf.usage = stream.usage;
- halBuf.bufPtr = allBufPtrs[i];
- halBuf.acquireFence = allFences[i];
+ halBuf.bufPtr = nullptr; // threadloop will request buffer from cameraservice
+ halBuf.acquireFence = 0; // threadloop will request fence from cameraservice
halBuf.fenceTimeout = false;
}
{
@@ -786,8 +795,10 @@
outputBuffer.bufferId = buffer.bufferId;
outputBuffer.status = BufferStatus::ERROR;
if (buffer.acquireFence >= 0) {
- outputBuffer.releaseFence.fds.resize(1);
- outputBuffer.releaseFence.fds.at(0).set(buffer.acquireFence);
+ native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0);
+ handle->data[0] = buffer.acquireFence;
+ outputBuffer.releaseFence = android::dupToAidl(handle);
+ native_handle_delete(handle);
}
} else {
offlineBuffers.push_back(buffer);
@@ -1346,56 +1357,6 @@
return false;
}
-Status ExternalCameraDeviceSession::importRequestLocked(const CaptureRequest& request,
- std::vector<buffer_handle_t*>& allBufPtrs,
- std::vector<int>& allFences) {
- return importRequestLockedImpl(request, allBufPtrs, allFences);
-}
-
-Status ExternalCameraDeviceSession::importRequestLockedImpl(
- const CaptureRequest& request, std::vector<buffer_handle_t*>& allBufPtrs,
- std::vector<int>& allFences) {
- size_t numOutputBufs = request.outputBuffers.size();
- size_t numBufs = numOutputBufs;
- // Validate all I/O buffers
- std::vector<buffer_handle_t> allBufs;
- std::vector<uint64_t> allBufIds;
- allBufs.resize(numBufs);
- allBufIds.resize(numBufs);
- allBufPtrs.resize(numBufs);
- allFences.resize(numBufs);
- std::vector<int32_t> streamIds(numBufs);
-
- for (size_t i = 0; i < numOutputBufs; i++) {
- allBufs[i] = ::android::makeFromAidl(request.outputBuffers[i].buffer);
- allBufIds[i] = request.outputBuffers[i].bufferId;
- allBufPtrs[i] = &allBufs[i];
- streamIds[i] = request.outputBuffers[i].streamId;
- }
-
- {
- Mutex::Autolock _l(mCbsLock);
- for (size_t i = 0; i < numBufs; i++) {
- Status st = importBufferLocked(streamIds[i], allBufIds[i], allBufs[i], &allBufPtrs[i]);
- if (st != Status::OK) {
- // Detailed error logs printed in importBuffer
- return st;
- }
- }
- }
-
- // All buffers are imported. Now validate output buffer acquire fences
- for (size_t i = 0; i < numOutputBufs; i++) {
- if (!sHandleImporter.importFence(
- ::android::makeFromAidl(request.outputBuffers[i].acquireFence), allFences[i])) {
- ALOGE("%s: output buffer %zu acquire fence is invalid", __FUNCTION__, i);
- cleanupInflightFences(allFences, i);
- return Status::INTERNAL_ERROR;
- }
- }
- return Status::OK;
-}
-
Status ExternalCameraDeviceSession::importBuffer(int32_t streamId, uint64_t bufId,
buffer_handle_t buf,
/*out*/ buffer_handle_t** outBufPtr) {
@@ -1410,19 +1371,16 @@
}
ScopedAStatus ExternalCameraDeviceSession::close() {
- close(false);
+ closeImpl();
return fromStatus(Status::OK);
}
-void ExternalCameraDeviceSession::close(bool callerIsDtor) {
+void ExternalCameraDeviceSession::closeImpl() {
Mutex::Autolock _il(mInterfaceLock);
bool closed = isClosed();
if (!closed) {
- if (callerIsDtor) {
- closeOutputThreadImpl();
- } else {
- closeOutputThread();
- }
+ closeOutputThread();
+ closeBufferRequestThread();
Mutex::Autolock _l(mLock);
// free all buffers
@@ -1768,8 +1726,10 @@
result.outputBuffers[i].bufferId = req->buffers[i].bufferId;
result.outputBuffers[i].status = BufferStatus::ERROR;
if (req->buffers[i].acquireFence >= 0) {
- result.outputBuffers[i].releaseFence.fds.resize(1);
- result.outputBuffers[i].releaseFence.fds.at(0).set(req->buffers[i].acquireFence);
+ // numFds = 0 for error
+ native_handle_t* handle = native_handle_create(/*numFds*/ 0, /*numInts*/ 0);
+ result.outputBuffers[i].releaseFence = android::dupToAidl(handle);
+ native_handle_delete(handle);
}
}
@@ -1813,16 +1773,20 @@
if (req->buffers[i].fenceTimeout) {
result.outputBuffers[i].status = BufferStatus::ERROR;
if (req->buffers[i].acquireFence >= 0) {
- result.outputBuffers[i].releaseFence.fds.resize(1);
- result.outputBuffers[i].releaseFence.fds.at(0).set(req->buffers[i].acquireFence);
+ native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0);
+ handle->data[0] = req->buffers[i].acquireFence;
+ result.outputBuffers[i].releaseFence = android::dupToAidl(handle);
+ native_handle_delete(handle);
}
notifyError(req->frameNumber, req->buffers[i].streamId, ErrorCode::ERROR_BUFFER);
} else {
result.outputBuffers[i].status = BufferStatus::OK;
// TODO: refactor
if (req->buffers[i].acquireFence >= 0) {
- result.outputBuffers[i].releaseFence.fds.resize(1);
- result.outputBuffers[i].releaseFence.fds.at(0).set(req->buffers[i].acquireFence);
+ native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0);
+ handle->data[0] = req->buffers[i].acquireFence;
+ result.outputBuffers[i].releaseFence = android::dupToAidl(handle);
+ native_handle_delete(handle);
}
}
}
@@ -1997,9 +1961,16 @@
std::chrono::milliseconds timeout = std::chrono::milliseconds(kReqProcTimeoutMs);
auto st = mRequestDoneCond.wait_for(lk, timeout);
if (st == std::cv_status::timeout) {
+ mRequestingBuffer = false;
ALOGE("%s: wait for buffer request finish timeout!", __FUNCTION__);
return -1;
}
+
+ if (mPendingReturnBufferReqs.empty()) {
+ mRequestingBuffer = false;
+ ALOGE("%s: cameraservice did not return any buffers!", __FUNCTION__);
+ return -1;
+ }
}
mRequestingBuffer = false;
*outBufReqs = std::move(mPendingReturnBufferReqs);
@@ -2049,6 +2020,8 @@
if (!ret.isOk()) {
ALOGE("%s: Transaction error: %d:%d", __FUNCTION__, ret.getExceptionCode(),
ret.getServiceSpecificError());
+ mBufferReqs.clear();
+ mRequestDoneCond.notify_one();
return false;
}
@@ -2057,17 +2030,24 @@
if (bufRets.size() != mHalBufferReqs.size()) {
ALOGE("%s: expect %zu buffer requests returned, only got %zu", __FUNCTION__,
mHalBufferReqs.size(), bufRets.size());
+ mBufferReqs.clear();
+ lk.unlock();
+ mRequestDoneCond.notify_one();
return false;
}
auto parent = mParent.lock();
if (parent == nullptr) {
ALOGE("%s: session has been disconnected!", __FUNCTION__);
+ mBufferReqs.clear();
+ lk.unlock();
+ mRequestDoneCond.notify_one();
return false;
}
std::vector<int> importedFences;
importedFences.resize(bufRets.size());
+ bool hasError = false;
for (size_t i = 0; i < bufRets.size(); i++) {
int streamId = bufRets[i].streamId;
switch (bufRets[i].val.getTag()) {
@@ -2078,7 +2058,8 @@
bufRets[i].val.get<StreamBuffersVal::Tag::buffers>();
if (hBufs.size() != 1) {
ALOGE("%s: expect 1 buffer returned, got %zu!", __FUNCTION__, hBufs.size());
- return false;
+ hasError = true;
+ break;
}
const StreamBuffer& hBuf = hBufs[0];
@@ -2086,31 +2067,47 @@
// TODO: create a batch import API so we don't need to lock/unlock mCbsLock
// repeatedly?
lk.unlock();
- Status s =
- parent->importBuffer(streamId, hBuf.bufferId, makeFromAidl(hBuf.buffer),
- /*out*/ &mBufferReqs[i].bufPtr);
+ native_handle_t* h = makeFromAidl(hBuf.buffer);
+ Status s = parent->importBuffer(streamId, hBuf.bufferId, h,
+ /*out*/ &mBufferReqs[i].bufPtr);
+ native_handle_delete(h);
lk.lock();
if (s != Status::OK) {
ALOGE("%s: stream %d import buffer failed!", __FUNCTION__, streamId);
cleanupInflightFences(importedFences, i - 1);
- return false;
+ hasError = true;
+ break;
}
- if (!sHandleImporter.importFence(makeFromAidl(hBuf.acquireFence),
- mBufferReqs[i].acquireFence)) {
+ h = makeFromAidl(hBuf.acquireFence);
+ if (!sHandleImporter.importFence(h, mBufferReqs[i].acquireFence)) {
ALOGE("%s: stream %d import fence failed!", __FUNCTION__, streamId);
cleanupInflightFences(importedFences, i - 1);
- return false;
+ native_handle_delete(h);
+ hasError = true;
+ break;
}
+ native_handle_delete(h);
importedFences[i] = mBufferReqs[i].acquireFence;
} break;
default:
ALOGE("%s: Unknown StreamBuffersVal!", __FUNCTION__);
- return false;
+ hasError = true;
+ break;
+ }
+ if (hasError) {
+ mBufferReqs.clear();
+ lk.unlock();
+ mRequestDoneCond.notify_one();
+ return true;
}
}
} else {
ALOGE("%s: requestStreamBuffers call failed!", __FUNCTION__);
+ mBufferReqs.clear();
+ lk.unlock();
+ mRequestDoneCond.notify_one();
+ return true;
}
mPendingReturnBufferReqs = std::move(mBufferReqs);
@@ -2815,6 +2812,11 @@
if (res != 0) {
// For some webcam, the first few V4L2 frames might be malformed...
ALOGE("%s: Convert V4L2 frame to YU12 failed! res %d", __FUNCTION__, res);
+
+ ATRACE_BEGIN("Wait for BufferRequest done");
+ res = waitForBufferRequestDone(&req->buffers);
+ ATRACE_END();
+
lk.unlock();
Status st = parent->processCaptureRequestError(req);
if (st != Status::OK) {
@@ -2830,9 +2832,15 @@
ATRACE_END();
if (res != 0) {
+ // HAL buffer management buffer request can fail
ALOGE("%s: wait for BufferRequest done failed! res %d", __FUNCTION__, res);
lk.unlock();
- return onDeviceError("%s: failed to process buffer request error!", __FUNCTION__);
+ Status st = parent->processCaptureRequestError(req);
+ if (st != Status::OK) {
+ return onDeviceError("%s: failed to process capture request error!", __FUNCTION__);
+ }
+ signalRequestDone();
+ return true;
}
ALOGV("%s processing new request", __FUNCTION__);
@@ -2878,13 +2886,23 @@
} break;
case PixelFormat::YCBCR_420_888:
case PixelFormat::YV12: {
- IMapper::Rect outRect{0, 0, static_cast<int32_t>(halBuf.width),
+ android::Rect outRect{0, 0, static_cast<int32_t>(halBuf.width),
static_cast<int32_t>(halBuf.height)};
- YCbCrLayout outLayout = sHandleImporter.lockYCbCr(
+ android_ycbcr result = sHandleImporter.lockYCbCr(
*(halBuf.bufPtr), static_cast<uint64_t>(halBuf.usage), outRect);
- ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d", __FUNCTION__,
- outLayout.y, outLayout.cb, outLayout.cr, outLayout.yStride, outLayout.cStride,
- outLayout.chromaStep);
+ ALOGV("%s: outLayout y %p cb %p cr %p y_str %zu c_str %zu c_step %zu", __FUNCTION__,
+ result.y, result.cb, result.cr, result.ystride, result.cstride,
+ result.chroma_step);
+ if (result.ystride > UINT32_MAX || result.cstride > UINT32_MAX ||
+ result.chroma_step > UINT32_MAX) {
+ return onDeviceError("%s: lockYCbCr failed. Unexpected values!", __FUNCTION__);
+ }
+ YCbCrLayout outLayout = {.y = result.y,
+ .cb = result.cb,
+ .cr = result.cr,
+ .yStride = static_cast<uint32_t>(result.ystride),
+ .cStride = static_cast<uint32_t>(result.cstride),
+ .chromaStep = static_cast<uint32_t>(result.chroma_step)};
// Convert to output buffer size/format
uint32_t outputFourcc = getFourCcFromLayout(outLayout);
diff --git a/camera/device/default/ExternalCameraDeviceSession.h b/camera/device/default/ExternalCameraDeviceSession.h
index e7eb799..795b589 100644
--- a/camera/device/default/ExternalCameraDeviceSession.h
+++ b/camera/device/default/ExternalCameraDeviceSession.h
@@ -24,6 +24,9 @@
#include <aidl/android/hardware/camera/device/BufferRequest.h>
#include <aidl/android/hardware/camera/device/Stream.h>
#include <android-base/unique_fd.h>
+#include <android/hardware/graphics/mapper/2.0/IMapper.h>
+#include <android/hardware/graphics/mapper/3.0/IMapper.h>
+#include <android/hardware/graphics/mapper/4.0/IMapper.h>
#include <fmq/AidlMessageQueue.h>
#include <utils/Thread.h>
#include <deque>
@@ -55,6 +58,7 @@
using ::android::hardware::camera::common::helper::SimpleThread;
using ::android::hardware::camera::external::common::ExternalCameraConfig;
using ::android::hardware::camera::external::common::SizeHasher;
+using ::android::hardware::graphics::mapper::V2_0::YCbCrLayout;
using ::ndk::ScopedAStatus;
class ExternalCameraDeviceSession : public BnCameraDeviceSession, public OutputThreadInterface {
@@ -240,9 +244,9 @@
// To init/close different version of output thread
void initOutputThread();
void closeOutputThread();
- void closeOutputThreadImpl();
+ void closeBufferRequestThread();
- void close(bool callerIsDtor);
+ void closeImpl();
Status initStatus() const;
status_t initDefaultRequests();
@@ -262,15 +266,6 @@
const std::vector<SupportedV4L2Format>& supportedFormats,
const ExternalCameraConfig& cfg);
- // Validate and import request's output buffers and acquire fence
- Status importRequestLocked(const CaptureRequest& request,
- std::vector<buffer_handle_t*>& allBufPtrs,
- std::vector<int>& allFences);
-
- Status importRequestLockedImpl(const CaptureRequest& request,
- std::vector<buffer_handle_t*>& allBufPtrs,
- std::vector<int>& allFences);
-
Status importBufferLocked(int32_t streamId, uint64_t bufId, buffer_handle_t buf,
/*out*/ buffer_handle_t** outBufPtr);
static void cleanupInflightFences(std::vector<int>& allFences, size_t numFences);
diff --git a/camera/device/default/ExternalCameraOfflineSession.cpp b/camera/device/default/ExternalCameraOfflineSession.cpp
index 4c7f732..2d4e2e0 100644
--- a/camera/device/default/ExternalCameraOfflineSession.cpp
+++ b/camera/device/default/ExternalCameraOfflineSession.cpp
@@ -110,7 +110,8 @@
if (req->buffers[i].acquireFence >= 0) {
native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0);
handle->data[0] = req->buffers[i].acquireFence;
- result.outputBuffers[i].releaseFence = android::makeToAidl(handle);
+ result.outputBuffers[i].releaseFence = android::dupToAidl(handle);
+ native_handle_delete(handle);
}
notifyError(req->frameNumber, req->buffers[i].streamId, ErrorCode::ERROR_BUFFER);
} else {
@@ -119,7 +120,8 @@
if (req->buffers[i].acquireFence >= 0) {
native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0);
handle->data[0] = req->buffers[i].acquireFence;
- outputBuffer.releaseFence = android::makeToAidl(handle);
+ outputBuffer.releaseFence = android::dupToAidl(handle);
+ native_handle_delete(handle);
}
}
}
@@ -247,7 +249,8 @@
if (req->buffers[i].acquireFence >= 0) {
native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0);
handle->data[0] = req->buffers[i].acquireFence;
- outputBuffer.releaseFence = makeToAidl(handle);
+ outputBuffer.releaseFence = dupToAidl(handle);
+ native_handle_delete(handle);
}
}
@@ -486,13 +489,23 @@
} break;
case PixelFormat::YCBCR_420_888:
case PixelFormat::YV12: {
- IMapper::Rect outRect{0, 0, static_cast<int32_t>(halBuf.width),
+ android::Rect outRect{0, 0, static_cast<int32_t>(halBuf.width),
static_cast<int32_t>(halBuf.height)};
- YCbCrLayout outLayout = sHandleImporter.lockYCbCr(
+ android_ycbcr result = sHandleImporter.lockYCbCr(
*(halBuf.bufPtr), static_cast<uint64_t>(halBuf.usage), outRect);
- ALOGV("%s: outLayout y %p cb %p cr %p y_str %d c_str %d c_step %d", __FUNCTION__,
- outLayout.y, outLayout.cb, outLayout.cr, outLayout.yStride, outLayout.cStride,
- outLayout.chromaStep);
+ ALOGV("%s: outLayout y %p cb %p cr %p y_str %zu c_str %zu c_step %zu", __FUNCTION__,
+ result.y, result.cb, result.cr, result.ystride, result.cstride,
+ result.chroma_step);
+ if (result.ystride > UINT32_MAX || result.cstride > UINT32_MAX ||
+ result.chroma_step > UINT32_MAX) {
+ return onDeviceError("%s: lockYCbCr failed. Unexpected values!", __FUNCTION__);
+ }
+ YCbCrLayout outLayout = {.y = result.y,
+ .cb = result.cb,
+ .cr = result.cr,
+ .yStride = static_cast<uint32_t>(result.ystride),
+ .cStride = static_cast<uint32_t>(result.cstride),
+ .chromaStep = static_cast<uint32_t>(result.chroma_step)};
// Convert to output buffer size/format
uint32_t outputFourcc = getFourCcFromLayout(outLayout);
@@ -544,4 +557,4 @@
} // namespace device
} // namespace camera
} // namespace hardware
-} // namespace android
\ No newline at end of file
+} // namespace android
diff --git a/camera/device/default/ExternalCameraUtils.cpp b/camera/device/default/ExternalCameraUtils.cpp
index 30c216f..2dc3c77 100644
--- a/camera/device/default/ExternalCameraUtils.cpp
+++ b/camera/device/default/ExternalCameraUtils.cpp
@@ -750,18 +750,12 @@
void freeReleaseFences(std::vector<CaptureResult>& results) {
for (auto& result : results) {
- native_handle_t* inputReleaseFence =
- ::android::makeFromAidl(result.inputBuffer.releaseFence);
- if (inputReleaseFence != nullptr) {
- native_handle_close(inputReleaseFence);
- native_handle_delete(inputReleaseFence);
- }
+ // NativeHandles free fd's on desctruction. Simply delete the objects!
+ result.inputBuffer.releaseFence.fds.clear(); // Implicitly closes fds
+ result.inputBuffer.releaseFence.ints.clear();
for (auto& buf : result.outputBuffers) {
- native_handle_t* outReleaseFence = ::android::makeFromAidl(buf.releaseFence);
- if (outReleaseFence != nullptr) {
- native_handle_close(outReleaseFence);
- native_handle_delete(outReleaseFence);
- }
+ buf.releaseFence.fds.clear(); // Implicitly closes fds
+ buf.releaseFence.ints.clear();
}
}
}
diff --git a/camera/device/default/ExternalCameraUtils.h b/camera/device/default/ExternalCameraUtils.h
index b37933c..d434905 100644
--- a/camera/device/default/ExternalCameraUtils.h
+++ b/camera/device/default/ExternalCameraUtils.h
@@ -25,7 +25,11 @@
#include <aidl/android/hardware/camera/device/NotifyMsg.h>
#include <aidl/android/hardware/graphics/common/BufferUsage.h>
#include <aidl/android/hardware/graphics/common/PixelFormat.h>
+#include <android/hardware/graphics/mapper/2.0/IMapper.h>
+#include <android/hardware/graphics/mapper/3.0/IMapper.h>
+#include <android/hardware/graphics/mapper/4.0/IMapper.h>
#include <tinyxml2.h>
+#include <map>
#include <unordered_map>
#include <unordered_set>
@@ -37,6 +41,8 @@
using ::aidl::android::hardware::graphics::common::PixelFormat;
using ::android::hardware::camera::common::V1_0::helper::CameraMetadata;
using ::android::hardware::camera::common::V1_0::helper::HandleImporter;
+using ::android::hardware::graphics::mapper::V2_0::IMapper;
+using ::android::hardware::graphics::mapper::V2_0::YCbCrLayout;
namespace android {
namespace hardware {
diff --git a/camera/metadata/3.2/Android.bp b/camera/metadata/3.2/Android.bp
index ec8107e..4602923 100644
--- a/camera/metadata/3.2/Android.bp
+++ b/camera/metadata/3.2/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/metadata/3.3/Android.bp b/camera/metadata/3.3/Android.bp
index 4bed25b..ba0ec80 100644
--- a/camera/metadata/3.3/Android.bp
+++ b/camera/metadata/3.3/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/metadata/3.4/Android.bp b/camera/metadata/3.4/Android.bp
index fdddfdf..893a6aa 100644
--- a/camera/metadata/3.4/Android.bp
+++ b/camera/metadata/3.4/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/metadata/3.5/Android.bp b/camera/metadata/3.5/Android.bp
index 9349d54..df4dddd 100644
--- a/camera/metadata/3.5/Android.bp
+++ b/camera/metadata/3.5/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/metadata/3.6/Android.bp b/camera/metadata/3.6/Android.bp
index 9e2b8a3..40f22fd 100644
--- a/camera/metadata/3.6/Android.bp
+++ b/camera/metadata/3.6/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/metadata/3.7/Android.bp b/camera/metadata/3.7/Android.bp
index 14981b8..70a9d56 100644
--- a/camera/metadata/3.7/Android.bp
+++ b/camera/metadata/3.7/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/metadata/aidl/Android.bp b/camera/metadata/aidl/Android.bp
index 5872a86..374eefc 100644
--- a/camera/metadata/aidl/Android.bp
+++ b/camera/metadata/aidl/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -11,7 +12,7 @@
name: "android.hardware.camera.metadata",
vendor_available: true,
srcs: ["android/hardware/camera/metadata/*.aidl"],
- frozen: true,
+ frozen: false,
stability: "vintf",
backend: {
cpp: {
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl
index 71d4e41..542b296 100644
--- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl
@@ -98,6 +98,8 @@
ANDROID_CONTROL_AUTOFRAMING,
ANDROID_CONTROL_AUTOFRAMING_AVAILABLE,
ANDROID_CONTROL_AUTOFRAMING_STATE,
+ ANDROID_CONTROL_LOW_LIGHT_BOOST_INFO_LUMINANCE_RANGE,
+ ANDROID_CONTROL_LOW_LIGHT_BOOST_STATE,
ANDROID_DEMOSAIC_MODE = android.hardware.camera.metadata.CameraMetadataSectionStart.ANDROID_DEMOSAIC_START /* 131072 */,
ANDROID_EDGE_MODE = android.hardware.camera.metadata.CameraMetadataSectionStart.ANDROID_EDGE_START /* 196608 */,
ANDROID_EDGE_STRENGTH,
@@ -108,6 +110,11 @@
ANDROID_FLASH_COLOR_TEMPERATURE,
ANDROID_FLASH_MAX_ENERGY,
ANDROID_FLASH_STATE,
+ ANDROID_FLASH_STRENGTH_LEVEL,
+ ANDROID_FLASH_SINGLE_STRENGTH_MAX_LEVEL,
+ ANDROID_FLASH_SINGLE_STRENGTH_DEFAULT_LEVEL,
+ ANDROID_FLASH_TORCH_STRENGTH_MAX_LEVEL,
+ ANDROID_FLASH_TORCH_STRENGTH_DEFAULT_LEVEL,
ANDROID_FLASH_INFO_AVAILABLE = android.hardware.camera.metadata.CameraMetadataSectionStart.ANDROID_FLASH_INFO_START /* 327680 */,
ANDROID_FLASH_INFO_CHARGE_DURATION,
ANDROID_FLASH_INFO_STRENGTH_MAXIMUM_LEVEL,
@@ -278,6 +285,8 @@
ANDROID_STATISTICS_OIS_TIMESTAMPS,
ANDROID_STATISTICS_OIS_X_SHIFTS,
ANDROID_STATISTICS_OIS_Y_SHIFTS,
+ ANDROID_STATISTICS_LENS_INTRINSIC_TIMESTAMPS,
+ ANDROID_STATISTICS_LENS_INTRINSIC_SAMPLES,
ANDROID_STATISTICS_INFO_AVAILABLE_FACE_DETECT_MODES = android.hardware.camera.metadata.CameraMetadataSectionStart.ANDROID_STATISTICS_INFO_START /* 1179648 */,
ANDROID_STATISTICS_INFO_HISTOGRAM_BUCKET_COUNT,
ANDROID_STATISTICS_INFO_MAX_FACE_COUNT,
@@ -324,6 +333,7 @@
ANDROID_LOGICAL_MULTI_CAMERA_PHYSICAL_IDS = android.hardware.camera.metadata.CameraMetadataSectionStart.ANDROID_LOGICAL_MULTI_CAMERA_START /* 1703936 */,
ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE,
ANDROID_LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID,
+ ANDROID_LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_SENSOR_CROP_REGION,
ANDROID_DISTORTION_CORRECTION_MODE = android.hardware.camera.metadata.CameraMetadataSectionStart.ANDROID_DISTORTION_CORRECTION_START /* 1769472 */,
ANDROID_DISTORTION_CORRECTION_AVAILABLE_MODES,
ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS = android.hardware.camera.metadata.CameraMetadataSectionStart.ANDROID_HEIC_START /* 1835008 */,
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeMode.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeMode.aidl
index 5e1b871..c1423aa 100644
--- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeMode.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlAeMode.aidl
@@ -44,4 +44,5 @@
ANDROID_CONTROL_AE_MODE_ON_ALWAYS_FLASH,
ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE,
ANDROID_CONTROL_AE_MODE_ON_EXTERNAL_FLASH,
+ ANDROID_CONTROL_AE_MODE_ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY,
}
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlLowLightBoostState.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlLowLightBoostState.aidl
new file mode 100644
index 0000000..f8ae013
--- /dev/null
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/ControlLowLightBoostState.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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+///////////////////////////////////////////////////////////////////////////////
+// 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.camera.metadata;
+@Backing(type="int") @VintfStability
+enum ControlLowLightBoostState {
+ ANDROID_CONTROL_LOW_LIGHT_BOOST_STATE_INACTIVE,
+ ANDROID_CONTROL_LOW_LIGHT_BOOST_STATE_ACTIVE,
+}
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl
index 7303ff5..2c31cff 100644
--- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl
@@ -39,4 +39,5 @@
@Backing(type="int") @VintfStability
enum InfoSupportedBufferManagementVersion {
ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_AIDL_DEVICE,
+ ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE,
}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl
index 56aa690..03cfba1 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl
@@ -490,6 +490,18 @@
*/
ANDROID_CONTROL_AUTOFRAMING_STATE,
/**
+ * android.control.lowLightBoostInfoLuminanceRange [static, float[], public]
+ *
+ * <p>The operating luminance range of low light boost measured in lux (lx).</p>
+ */
+ ANDROID_CONTROL_LOW_LIGHT_BOOST_INFO_LUMINANCE_RANGE,
+ /**
+ * android.control.lowLightBoostState [dynamic, enum, public]
+ *
+ * <p>Current state of the low light boost AE mode.</p>
+ */
+ ANDROID_CONTROL_LOW_LIGHT_BOOST_STATE,
+ /**
* android.demosaic.mode [controls, enum, system]
*
* <p>Controls the quality of the demosaicing
@@ -560,6 +572,36 @@
*/
ANDROID_FLASH_STATE,
/**
+ * android.flash.strengthLevel [dynamic, int32, public]
+ *
+ * <p>Flash strength level to be used when manual flash control is active.</p>
+ */
+ ANDROID_FLASH_STRENGTH_LEVEL,
+ /**
+ * android.flash.singleStrengthMaxLevel [static, int32, public]
+ *
+ * <p>Maximum flash brightness level for manual flash control in SINGLE mode.</p>
+ */
+ ANDROID_FLASH_SINGLE_STRENGTH_MAX_LEVEL,
+ /**
+ * android.flash.singleStrengthDefaultLevel [static, int32, public]
+ *
+ * <p>Default flash brightness level for manual flash control in SINGLE mode.</p>
+ */
+ ANDROID_FLASH_SINGLE_STRENGTH_DEFAULT_LEVEL,
+ /**
+ * android.flash.torchStrengthMaxLevel [static, int32, public]
+ *
+ * <p>Maximum flash brightness level for manual flash control in TORCH mode</p>
+ */
+ ANDROID_FLASH_TORCH_STRENGTH_MAX_LEVEL,
+ /**
+ * android.flash.torchStrengthDefaultLevel [static, int32, public]
+ *
+ * <p>Default flash brightness level for manual flash control in TORCH mode</p>
+ */
+ ANDROID_FLASH_TORCH_STRENGTH_DEFAULT_LEVEL,
+ /**
* android.flash.info.available [static, enum, public]
*
* <p>Whether this camera device has a
@@ -1300,8 +1342,8 @@
/**
* android.sensor.frameDuration [dynamic, int64, public]
*
- * <p>Duration from start of frame exposure to
- * start of next frame exposure.</p>
+ * <p>Duration from start of frame readout to
+ * start of next frame readout.</p>
*/
ANDROID_SENSOR_FRAME_DURATION,
/**
@@ -1838,6 +1880,18 @@
*/
ANDROID_STATISTICS_OIS_Y_SHIFTS,
/**
+ * android.statistics.lensIntrinsicTimestamps [dynamic, int64[], ndk_public]
+ *
+ * <p>An array of timestamps of lens intrinsics samples, in nanoseconds.</p>
+ */
+ ANDROID_STATISTICS_LENS_INTRINSIC_TIMESTAMPS,
+ /**
+ * android.statistics.lensIntrinsicSamples [dynamic, float[], ndk_public]
+ *
+ * <p>An array of intra-frame lens intrinsics.</p>
+ */
+ ANDROID_STATISTICS_LENS_INTRINSIC_SAMPLES,
+ /**
* android.statistics.info.availableFaceDetectModes [static, byte[], public]
*
* <p>List of face detection modes for ANDROID_STATISTICS_FACE_DETECT_MODE that are
@@ -2211,6 +2265,13 @@
*/
ANDROID_LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID,
/**
+ * android.logicalMultiCamera.activePhysicalSensorCropRegion [dynamic, int32[], public]
+ *
+ * <p>The current region of the active physical sensor that will be read out for this
+ * capture.</p>
+ */
+ ANDROID_LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_SENSOR_CROP_REGION,
+ /**
* android.distortionCorrection.mode [dynamic, enum, public]
*
* <p>Mode of operation for the lens distortion correction block.</p>
@@ -2282,7 +2343,8 @@
*
* <p>Whether this camera device can support identical set of stream combinations
* involving HEIC image format, compared to the
- * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice.html#legacy-level-guaranteed-configurations">table of combinations</a> involving JPEG image format required for the device's hardware
+ * <a href="https://developer.android.com/reference/android/hardware/camera2/CameraDevice#legacy-level-guaranteed-configurations">table of combinations</a>
+ * involving JPEG image format required for the device's hardware
* level and capabilities.</p>
*/
ANDROID_HEIC_INFO_SUPPORTED = CameraMetadataSectionStart.ANDROID_HEIC_INFO_START,
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl
index e2f5553..70174be 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl
@@ -35,4 +35,5 @@
ANDROID_CONTROL_AE_MODE_ON_ALWAYS_FLASH,
ANDROID_CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE,
ANDROID_CONTROL_AE_MODE_ON_EXTERNAL_FLASH,
+ ANDROID_CONTROL_AE_MODE_ON_LOW_LIGHT_BOOST_BRIGHTNESS_PRIORITY,
}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlLowLightBoostState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlLowLightBoostState.aidl
new file mode 100644
index 0000000..67591c8
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlLowLightBoostState.aidl
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.control.lowLightBoostState enumeration values
+ * @see ANDROID_CONTROL_LOW_LIGHT_BOOST_STATE
+ */
+@VintfStability
+@Backing(type="int")
+enum ControlLowLightBoostState {
+ ANDROID_CONTROL_LOW_LIGHT_BOOST_STATE_INACTIVE,
+ ANDROID_CONTROL_LOW_LIGHT_BOOST_STATE_ACTIVE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl
index 9522377..964d079 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl
@@ -30,4 +30,5 @@
@Backing(type="int")
enum InfoSupportedBufferManagementVersion {
ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_AIDL_DEVICE,
+ ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE,
}
diff --git a/camera/provider/2.4/Android.bp b/camera/provider/2.4/Android.bp
index a4c0dd2..fbdc763 100644
--- a/camera/provider/2.4/Android.bp
+++ b/camera/provider/2.4/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/provider/2.4/default/Android.bp b/camera/provider/2.4/default/Android.bp
index bccd6cb..db4453d 100644
--- a/camera/provider/2.4/default/Android.bp
+++ b/camera/provider/2.4/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/provider/2.4/default/ExternalCameraProviderImpl_2_4.cpp b/camera/provider/2.4/default/ExternalCameraProviderImpl_2_4.cpp
index 04db7f3..2d919cc 100644
--- a/camera/provider/2.4/default/ExternalCameraProviderImpl_2_4.cpp
+++ b/camera/provider/2.4/default/ExternalCameraProviderImpl_2_4.cpp
@@ -95,13 +95,14 @@
Return<Status> ExternalCameraProviderImpl_2_4::setCallback(
const sp<ICameraProviderCallback>& callback) {
+ if (callback == nullptr) {
+ return Status::ILLEGAL_ARGUMENT;
+ }
+
{
Mutex::Autolock _l(mLock);
mCallbacks = callback;
}
- if (mCallbacks == nullptr) {
- return Status::OK;
- }
// Send a callback for all devices to initialize
{
for (const auto& pair : mCameraStatusMap) {
diff --git a/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp b/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp
index 69318c7..07ed689 100644
--- a/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp
+++ b/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp
@@ -448,11 +448,11 @@
// Methods from ::android::hardware::camera::provider::V2_4::ICameraProvider follow.
Return<Status> LegacyCameraProviderImpl_2_4::setCallback(
const sp<ICameraProviderCallback>& callback) {
+ if (callback == nullptr) {
+ return Status::ILLEGAL_ARGUMENT;
+ }
Mutex::Autolock _l(mCbLock);
mCallbacks = callback;
- if (mCallbacks == nullptr) {
- return Status::OK;
- }
// Add and report all presenting external cameras.
for (auto const& statusPair : mCameraStatusMap) {
int id = std::stoi(statusPair.first);
diff --git a/camera/provider/2.4/vts/functional/Android.bp b/camera/provider/2.4/vts/functional/Android.bp
index 85e69eb..4e59d28 100644
--- a/camera/provider/2.4/vts/functional/Android.bp
+++ b/camera/provider/2.4/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/provider/2.5/Android.bp b/camera/provider/2.5/Android.bp
index e14c0a8..e082442 100644
--- a/camera/provider/2.5/Android.bp
+++ b/camera/provider/2.5/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/provider/2.5/default/Android.bp b/camera/provider/2.5/default/Android.bp
index 2fcb35a..ae0c2f9 100644
--- a/camera/provider/2.5/default/Android.bp
+++ b/camera/provider/2.5/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -84,7 +85,7 @@
header_libs: [
"camera.device@3.4-external-impl_headers",
"camera.device@3.5-external-impl_headers",
- "camera.device@3.6-external-impl_headers"
+ "camera.device@3.6-external-impl_headers",
],
export_include_dirs: ["."],
}
@@ -121,7 +122,7 @@
],
header_libs: [
"camera.device@3.4-impl_headers",
- "camera.device@3.5-impl_headers"
+ "camera.device@3.5-impl_headers",
],
}
diff --git a/camera/provider/2.6/Android.bp b/camera/provider/2.6/Android.bp
index f402a56..9e4a4d6 100644
--- a/camera/provider/2.6/Android.bp
+++ b/camera/provider/2.6/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/provider/2.7/Android.bp b/camera/provider/2.7/Android.bp
index ba59b38..d4369fa 100644
--- a/camera/provider/2.7/Android.bp
+++ b/camera/provider/2.7/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/provider/2.7/default/Android.bp b/camera/provider/2.7/default/Android.bp
index bd5da2d..8d7cd72 100644
--- a/camera/provider/2.7/default/Android.bp
+++ b/camera/provider/2.7/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp b/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp
index 62ce074..eba49a5 100644
--- a/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp
+++ b/camera/provider/2.7/default/ExternalCameraProviderImpl_2_7.cpp
@@ -91,11 +91,11 @@
Return<Status> ExternalCameraProviderImpl_2_7::setCallback(
const sp<ICameraProviderCallback>& callback) {
+ if (callback == nullptr) {
+ return Status::ILLEGAL_ARGUMENT;
+ }
Mutex::Autolock _l(mLock);
mCallbacks = callback;
- if (mCallbacks == nullptr) {
- return Status::OK;
- }
// Send a callback for all devices to initialize
{
for (const auto& pair : mCameraStatusMap) {
diff --git a/camera/provider/aidl/Android.bp b/camera/provider/aidl/Android.bp
index 35ec976..b0bd8d9 100644
--- a/camera/provider/aidl/Android.bp
+++ b/camera/provider/aidl/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -14,10 +15,10 @@
"android/hardware/camera/provider/*.aidl",
],
imports: [
- "android.hardware.camera.device-V2",
+ "android.hardware.camera.device-V3",
"android.hardware.camera.common-V1",
],
- frozen: true,
+ frozen: false,
stability: "vintf",
backend: {
java: {
diff --git a/camera/provider/aidl/vts/Android.bp b/camera/provider/aidl/vts/Android.bp
index 59f6c66..aa553ee 100644
--- a/camera/provider/aidl/vts/Android.bp
+++ b/camera/provider/aidl/vts/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -53,20 +54,22 @@
"android.hardware.graphics.mapper@2.0",
"android.hardware.graphics.mapper@3.0",
"android.hardware.graphics.mapper@4.0",
+ "camera_platform_flags_c_lib",
],
// Statically link to libs not guaranteed to be present on the device.
static_libs: [
"android.hardware.camera.common@1.0-helper",
"android.hardware.camera.common-V1-ndk",
- "android.hardware.camera.device-V2-ndk",
+ "android.hardware.camera.device-V3-ndk",
"android.hardware.camera.metadata-V2-ndk",
- "android.hardware.camera.provider-V2-ndk",
+ "android.hardware.camera.provider-V3-ndk",
"android.hidl.allocator@1.0",
"libgrallocusage",
"libhidlmemory",
"libgralloctypes",
"libaidlcommonsupport",
+ "libgtest",
],
require_root: true,
diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
index b6b5206..e335853 100644
--- a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
+++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#include <gtest/gtest.h>
#include <aidl/Vintf.h>
#include <aidl/android/hardware/camera/common/VendorTagSection.h>
@@ -29,6 +30,7 @@
#include <hidl/GtestPrinter.h>
#include <hidl/HidlSupport.h>
#include <torch_provider_cb.h>
+#include <com_android_internal_camera_flags.h>
#include <list>
using ::aidl::android::hardware::camera::common::CameraDeviceStatus;
@@ -50,6 +52,7 @@
const uint32_t kMaxStillHeight = 1536;
const int64_t kEmptyFlushTimeoutMSec = 200;
+namespace flags = com::android::internal::camera::flags;
const static std::vector<int64_t> kMandatoryUseCases = {
ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT,
@@ -159,6 +162,28 @@
}
}
+// Validate the integrity of manual flash strength control metadata
+TEST_P(CameraAidlTest, validateManualFlashStrengthControlKeys) {
+ if (flags::camera_manual_flash_strength_control()) {
+ std::vector<std::string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+ for (const auto& name : cameraDeviceNames) {
+ ALOGI("validateManualFlashStrengthControlKeys: Testing camera device %s", name.c_str());
+ CameraMetadata meta;
+ std::shared_ptr<ICameraDevice> cameraDevice;
+ openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &meta /*out*/,
+ &cameraDevice /*out*/);
+ ndk::ScopedAStatus ret = cameraDevice->getCameraCharacteristics(&meta);
+ ASSERT_TRUE(ret.isOk());
+ const camera_metadata_t* staticMeta =
+ reinterpret_cast<const camera_metadata_t*>(meta.metadata.data());
+ verifyManualFlashStrengthControlCharacteristics(staticMeta);
+ }
+ } else {
+ ALOGI("validateManualFlashStrengthControlKeys: Test skipped.\n");
+ GTEST_SKIP();
+ }
+}
+
TEST_P(CameraAidlTest, systemCameraTest) {
std::vector<std::string> cameraDeviceNames = getCameraDeviceNames(mProvider);
std::map<std::string, std::vector<SystemCameraKind>> hiddenPhysicalIdToLogicalMap;
@@ -475,6 +500,12 @@
ASSERT_TRUE(ret.isOk());
ASSERT_NE(device, nullptr);
+ int32_t interfaceVersion;
+ ret = device->getInterfaceVersion(&interfaceVersion);
+ ASSERT_TRUE(ret.isOk());
+ bool supportFeatureCombinationQuery =
+ (interfaceVersion >= CAMERA_DEVICE_API_MINOR_VERSION_3);
+
std::shared_ptr<EmptyDeviceCb> cb = ndk::SharedRefBase::make<EmptyDeviceCb>();
ret = device->open(cb, &mSession);
ALOGI("device::open returns status:%d:%d", ret.getExceptionCode(),
@@ -508,6 +539,34 @@
} else {
ASSERT_EQ(0u, rawMetadata.metadata.size());
}
+
+ if (flags::feature_combination_query()) {
+ if (supportFeatureCombinationQuery) {
+ CameraMetadata rawMetadata2;
+ ndk::ScopedAStatus ret2 =
+ device->constructDefaultRequestSettings(reqTemplate, &rawMetadata2);
+
+ // TODO: Do not allow OPERATION_NOT_SUPPORTED once HAL
+ // implementation is in place.
+ if (static_cast<Status>(ret2.getServiceSpecificError()) !=
+ Status::OPERATION_NOT_SUPPORTED) {
+ ASSERT_EQ(ret.isOk(), ret2.isOk());
+ ASSERT_EQ(ret.getStatus(), ret2.getStatus());
+
+ ASSERT_EQ(rawMetadata.metadata.size(), rawMetadata2.metadata.size());
+ if (ret2.isOk()) {
+ const camera_metadata_t* metadata =
+ (camera_metadata_t*)rawMetadata2.metadata.data();
+ size_t expectedSize = rawMetadata2.metadata.size();
+ int result =
+ validate_camera_metadata_structure(metadata, &expectedSize);
+ ASSERT_TRUE((result == 0) ||
+ (result == CAMERA_METADATA_VALIDATION_SHIFTED));
+ verifyRequestTemplate(metadata, reqTemplate);
+ }
+ }
+ }
+ }
}
ret = mSession->close();
mSession = nullptr;
@@ -563,8 +622,7 @@
createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config,
jpegBufferSize);
- bool expectStreamCombQuery = (isLogicalMultiCamera(staticMeta) == Status::OK);
- verifyStreamCombination(device, config, /*expectedStatus*/ true, expectStreamCombQuery);
+ verifyStreamCombination(device, config, /*expectedStatus*/ true);
config.streamConfigCounter = streamConfigCounter++;
std::vector<HalStream> halConfigs;
@@ -662,11 +720,7 @@
// Test the stream can actually be configured
for (auto& cti : cameraTestInfos) {
if (cti.session != nullptr) {
- camera_metadata_t* staticMeta =
- reinterpret_cast<camera_metadata_t*>(cti.staticMeta.metadata.data());
- bool expectStreamCombQuery = (isLogicalMultiCamera(staticMeta) == Status::OK);
- verifyStreamCombination(cti.cameraDevice, cti.config, /*expectedStatus*/ true,
- expectStreamCombQuery);
+ verifyStreamCombination(cti.cameraDevice, cti.config, /*expectedStatus*/ true);
}
if (cti.session != nullptr) {
@@ -727,8 +781,7 @@
createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config,
jpegBufferSize);
- verifyStreamCombination(cameraDevice, config, /*expectedStatus*/ false,
- /*expectStreamCombQuery*/ false);
+ verifyStreamCombination(cameraDevice, config, /*expectedStatus*/ false);
config.streamConfigCounter = streamConfigCounter++;
std::vector<HalStream> halConfigs;
@@ -947,8 +1000,7 @@
createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config,
jpegBufferSize);
- verifyStreamCombination(cameraDevice, config, /*expectedStatus*/ true,
- /*expectStreamCombQuery*/ false);
+ verifyStreamCombination(cameraDevice, config, /*expectedStatus*/ true);
config.streamConfigCounter = streamConfigCounter++;
std::vector<HalStream> halConfigs;
@@ -1166,8 +1218,7 @@
createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config,
jpegBufferSize);
config.streamConfigCounter = streamConfigCounter++;
- verifyStreamCombination(cameraDevice, config, /*expectedStatus*/ true,
- /*expectStreamCombQuery*/ false);
+ verifyStreamCombination(cameraDevice, config, /*expectedStatus*/ true);
std::vector<HalStream> halConfigs;
ndk::ScopedAStatus ret = mSession->configureStreams(config, &halConfigs);
@@ -1231,8 +1282,7 @@
createStreamConfiguration(streams, StreamConfigurationMode::CONSTRAINED_HIGH_SPEED_MODE,
&config);
- verifyStreamCombination(cameraDevice, config, /*expectedStatus*/ true,
- /*expectStreamCombQuery*/ false);
+ verifyStreamCombination(cameraDevice, config, /*expectedStatus*/ true);
config.streamConfigCounter = streamConfigCounter++;
std::vector<HalStream> halConfigs;
@@ -1404,8 +1454,7 @@
createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config,
jpegBufferSize);
- verifyStreamCombination(cameraDevice, config, /*expectedStatus*/ true,
- /*expectStreamCombQuery*/ false);
+ verifyStreamCombination(cameraDevice, config, /*expectedStatus*/ true);
config.streamConfigCounter = streamConfigCounter++;
std::vector<HalStream> halConfigs;
diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp
index bb21620..f70e93c 100644
--- a/camera/provider/aidl/vts/camera_aidl_test.cpp
+++ b/camera/provider/aidl/vts/camera_aidl_test.cpp
@@ -30,6 +30,7 @@
#include <aidlcommonsupport/NativeHandle.h>
#include <android/binder_manager.h>
#include <android/binder_process.h>
+#include <com_android_internal_camera_flags.h>
#include <device_cb.h>
#include <empty_device_cb.h>
#include <grallocusage/GrallocUsageConversion.h>
@@ -39,6 +40,7 @@
#include <ui/GraphicBufferAllocator.h>
#include <regex>
#include <typeinfo>
+#include "utils/Errors.h"
using ::aidl::android::hardware::camera::common::CameraDeviceStatus;
using ::aidl::android::hardware::camera::common::TorchModeStatus;
@@ -56,6 +58,8 @@
using ::ndk::SpAIBinder;
namespace {
+namespace flags = com::android::internal::camera::flags;
+
bool parseProviderName(const std::string& serviceDescriptor, std::string* type /*out*/,
uint32_t* id /*out*/) {
if (!type || !id) {
@@ -101,6 +105,8 @@
return true;
}
+namespace flags = com::android::internal::camera::flags;
+
const std::vector<int64_t> kMandatoryUseCases = {
ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT,
ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_PREVIEW,
@@ -468,6 +474,38 @@
} else {
ADD_FAILURE() << "Get LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_ID failed!";
}
+
+ if (flags::concert_mode()) {
+ auto ret = find_camera_metadata_ro_entry(
+ metadata, ANDROID_LOGICAL_MULTI_CAMERA_ACTIVE_PHYSICAL_SENSOR_CROP_REGION, &entry);
+ if ((ret == android::OK) && (entry.count > 0)) {
+ ASSERT_TRUE(entry.count == 4);
+ ASSERT_GE(entry.data.i32[0], 0); // Top must be non-negative
+ ASSERT_GE(entry.data.i32[1], 0); // Left must be non-negative
+ ASSERT_GT(entry.data.i32[2], 0); // Width must be positive
+ ASSERT_GT(entry.data.i32[3], 0); // Height must be positive
+ }
+ }
+}
+
+void CameraAidlTest::verifyLensIntrinsicsResult(const std::vector<uint8_t>& resultMetadata) {
+ if (flags::concert_mode()) {
+ camera_metadata_t* metadata = (camera_metadata_t*)resultMetadata.data();
+
+ camera_metadata_ro_entry timestampsEntry, intrinsicsEntry;
+ auto tsRet = find_camera_metadata_ro_entry(
+ metadata, ANDROID_STATISTICS_LENS_INTRINSIC_TIMESTAMPS, ×tampsEntry);
+ auto inRet = find_camera_metadata_ro_entry(
+ metadata, ANDROID_STATISTICS_LENS_INTRINSIC_SAMPLES, &intrinsicsEntry);
+ ASSERT_EQ(tsRet, inRet);
+ ASSERT_TRUE((intrinsicsEntry.count % 5) == 0);
+ ASSERT_EQ(timestampsEntry.count, intrinsicsEntry.count / 5);
+ if (timestampsEntry.count > 0) {
+ for (size_t i = 0; i < timestampsEntry.count - 1; i++) {
+ ASSERT_GE(timestampsEntry.data.i64[i + 1], timestampsEntry.data.i64[i]);
+ }
+ }
+ }
}
Status CameraAidlTest::getPhysicalCameraIds(const camera_metadata_t* staticMeta,
@@ -1142,6 +1180,58 @@
}
}
+void CameraAidlTest::verifyManualFlashStrengthControlCharacteristics(
+ const camera_metadata_t* staticMeta) {
+ camera_metadata_ro_entry singleMaxEntry;
+ camera_metadata_ro_entry singleDefEntry;
+ camera_metadata_ro_entry torchMaxEntry;
+ camera_metadata_ro_entry torchDefEntry;
+ bool torch_supported = false;
+ int32_t singleMaxLevel = 0;
+ int32_t singleDefLevel = 0;
+ int32_t torchMaxLevel = 0;
+ int32_t torchDefLevel = 0;
+
+ // determine whether the device supports torch or not
+ torch_supported = isTorchSupported(staticMeta);
+
+ int singleMaxRetCode = find_camera_metadata_ro_entry(staticMeta,
+ ANDROID_FLASH_SINGLE_STRENGTH_MAX_LEVEL, &singleMaxEntry);
+ int singleDefRetCode = find_camera_metadata_ro_entry(staticMeta,
+ ANDROID_FLASH_SINGLE_STRENGTH_DEFAULT_LEVEL, &singleDefEntry);
+ int torchMaxRetCode = find_camera_metadata_ro_entry(staticMeta,
+ ANDROID_FLASH_TORCH_STRENGTH_MAX_LEVEL, &torchMaxEntry);
+ int torchDefRetCode = find_camera_metadata_ro_entry(staticMeta,
+ ANDROID_FLASH_TORCH_STRENGTH_DEFAULT_LEVEL, &torchDefEntry);
+ if (torch_supported) {
+ if(singleMaxRetCode == 0 && singleDefRetCode == 0 && torchMaxRetCode == 0 &&
+ torchDefRetCode == 0) {
+ singleMaxLevel = *singleMaxEntry.data.i32;
+ singleDefLevel = *singleDefEntry.data.i32;
+ torchMaxLevel = *torchMaxEntry.data.i32;
+ torchDefLevel = *torchDefEntry.data.i32;
+ ASSERT_TRUE((singleMaxEntry.count == singleDefEntry.count == torchMaxEntry.count
+ == torchDefEntry.count == 1));
+ } else {
+ ASSERT_TRUE((singleMaxEntry.count == singleDefEntry.count == torchMaxEntry.count
+ == torchDefEntry.count == 0));
+ }
+ // if the device supports this feature default levels should be greater than 0
+ if (singleMaxLevel > 1) {
+ ASSERT_GT(torchMaxLevel, 1);
+ ASSERT_GT(torchDefLevel, 0);
+ ASSERT_GT(singleDefLevel, 0);
+ ASSERT_TRUE(torchDefLevel <= torchMaxLevel); // default levels should be <= max levels
+ ASSERT_TRUE(singleDefLevel <= singleMaxLevel);
+ }
+ } else {
+ ASSERT_TRUE(singleMaxRetCode != 0);
+ ASSERT_TRUE(singleDefRetCode != 0);
+ ASSERT_TRUE(torchMaxRetCode != 0);
+ ASSERT_TRUE(torchDefRetCode != 0);
+ }
+}
+
void CameraAidlTest::verifyRecommendedConfigs(const CameraMetadata& chars) {
size_t CONFIG_ENTRY_SIZE = 5;
size_t CONFIG_ENTRY_TYPE_OFFSET = 3;
@@ -1288,13 +1378,17 @@
bool hasHalBufferManager =
(0 == retcode && 1 == entry.count &&
entry.data.i32[0] == ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5);
+ bool sessionHalBufferManager =
+ (0 == retcode && 1 == entry.count &&
+ entry.data.i32[0] ==
+ ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE);
retcode = find_camera_metadata_ro_entry(
metadata, ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED, &entry);
bool multiResolutionStreamSupported =
(0 == retcode && 1 == entry.count &&
entry.data.u8[0] == ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED_TRUE);
if (multiResolutionStreamSupported) {
- ASSERT_TRUE(hasHalBufferManager);
+ ASSERT_TRUE(hasHalBufferManager || sessionHalBufferManager);
}
std::string version, cameraId;
@@ -1797,17 +1891,32 @@
}
void CameraAidlTest::verifyStreamCombination(const std::shared_ptr<ICameraDevice>& device,
- const StreamConfiguration& config, bool expectedStatus,
- bool expectStreamCombQuery) {
+ const StreamConfiguration& config,
+ bool expectedStatus) {
if (device != nullptr) {
bool streamCombinationSupported;
ScopedAStatus ret =
device->isStreamCombinationSupported(config, &streamCombinationSupported);
- // TODO: Check is unsupported operation is correct.
- ASSERT_TRUE(ret.isOk() ||
- (expectStreamCombQuery && ret.getExceptionCode() == EX_UNSUPPORTED_OPERATION));
- if (ret.isOk()) {
- ASSERT_EQ(expectedStatus, streamCombinationSupported);
+ ASSERT_TRUE(ret.isOk());
+ ASSERT_EQ(expectedStatus, streamCombinationSupported);
+
+ if (flags::feature_combination_query()) {
+ int32_t interfaceVersion;
+ ret = device->getInterfaceVersion(&interfaceVersion);
+ ASSERT_TRUE(ret.isOk());
+ bool supportFeatureCombinationQuery =
+ (interfaceVersion >= CAMERA_DEVICE_API_MINOR_VERSION_3);
+ if (supportFeatureCombinationQuery) {
+ ret = device->isStreamCombinationWithSettingsSupported(config,
+ &streamCombinationSupported);
+ // TODO: Do not allow OPERATION_NOT_SUPPORTED once HAL
+ // implementation is in place.
+ ASSERT_TRUE(ret.isOk() || static_cast<Status>(ret.getServiceSpecificError()) ==
+ Status::OPERATION_NOT_SUPPORTED);
+ if (ret.isOk()) {
+ ASSERT_EQ(expectedStatus, streamCombinationSupported);
+ }
+ }
}
}
}
@@ -2286,18 +2395,20 @@
ASSERT_NE(0u, outputPreviewStreams.size());
// Combine valid and invalid stream use cases
- std::vector<int64_t> useCases(kMandatoryUseCases);
- useCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW + 1);
+ std::vector<int64_t> testedUseCases;
+ testedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW + 1);
std::vector<int64_t> supportedUseCases;
if (threshold.format == static_cast<int32_t>(PixelFormat::RAW16)) {
// If the format is RAW16, supported use case is only CROPPED_RAW.
// All others are unsupported for this format.
- useCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW);
+ testedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW);
supportedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_CROPPED_RAW);
supportedUseCases.push_back(ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES_DEFAULT);
} else {
camera_metadata_ro_entry entry;
+ testedUseCases.insert(testedUseCases.end(), kMandatoryUseCases.begin(),
+ kMandatoryUseCases.end());
auto retcode = find_camera_metadata_ro_entry(
staticMeta, ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES, &entry);
if ((0 == retcode) && (entry.count > 0)) {
@@ -2338,7 +2449,7 @@
ASSERT_TRUE(ret.isOk());
config.sessionParams = req;
- for (int64_t useCase : useCases) {
+ for (int64_t useCase : testedUseCases) {
bool useCaseSupported = std::find(supportedUseCases.begin(), supportedUseCases.end(),
useCase) != supportedUseCases.end();
@@ -2378,6 +2489,28 @@
}
+ndk::ScopedAStatus CameraAidlTest::configureStreams(std::shared_ptr<ICameraDeviceSession>& session,
+ const StreamConfiguration& config,
+ bool sessionHalBufferManager,
+ bool* useHalBufManager,
+ std::vector<HalStream>* halStreams) {
+ auto ret = ndk::ScopedAStatus::ok();
+ ConfigureStreamsRet aidl_return;
+ if (sessionHalBufferManager) {
+ ret = session->configureStreamsV2(config, &aidl_return);
+ } else {
+ ret = session->configureStreams(config, halStreams);
+ }
+ if (!ret.isOk()) {
+ return ret;
+ }
+ if (sessionHalBufferManager) {
+ *useHalBufManager = aidl_return.enableHalBufferManager;
+ *halStreams = std::move(aidl_return.halStreams);
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
void CameraAidlTest::configureSingleStream(
const std::string& name, const std::shared_ptr<ICameraProvider>& provider,
const AvailableStream* previewThreshold, uint64_t bufferUsage, RequestTemplate reqTemplate,
@@ -2432,11 +2565,15 @@
ASSERT_NE(*session, nullptr);
*useHalBufManager = false;
+ bool sessionHalBufferManager = false;
status = find_camera_metadata_ro_entry(
staticMeta, ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION, &entry);
if ((0 == status) && (entry.count == 1)) {
*useHalBufManager = (entry.data.u8[0] ==
ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5);
+ sessionHalBufferManager =
+ (entry.data.u8[0] ==
+ ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE);
}
outputPreviewStreams.clear();
@@ -2495,7 +2632,8 @@
ASSERT_EQ(supported, true);
std::vector<HalStream> halConfigs;
- ret = (*session)->configureStreams(config, &halConfigs);
+ ret = configureStreams(*session, config, sessionHalBufferManager, useHalBufManager,
+ &halConfigs);
ALOGI("configureStreams returns status: %d:%d", ret.getExceptionCode(),
ret.getServiceSpecificError());
ASSERT_TRUE(ret.isOk());
@@ -2791,11 +2929,15 @@
ASSERT_NE(*session, nullptr);
*useHalBufManager = false;
+ bool sessionHalBufferManager = false;
status = find_camera_metadata_ro_entry(
staticMeta, ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION, &entry);
if ((0 == status) && (entry.count == 1)) {
*useHalBufManager = (entry.data.u8[0] ==
ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5);
+ sessionHalBufferManager =
+ (entry.data.u8[0] ==
+ ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE);
}
outputPreviewStreams.clear();
@@ -2850,7 +2992,9 @@
config.streamConfigCounter = streamConfigCounter;
std::vector<HalStream> halConfigs;
- ret = (*session)->configureStreams(config, &halConfigs);
+ ret = configureStreams(*session, config, sessionHalBufferManager, useHalBufManager,
+ &halConfigs);
+
ASSERT_TRUE(ret.isOk());
ASSERT_EQ(physicalIds.size(), halConfigs.size());
*halStreams = halConfigs;
@@ -2930,11 +3074,15 @@
ASSERT_NE(*session, nullptr);
*useHalBufManager = false;
+ bool sessionHalBufferManager = false;
status = find_camera_metadata_ro_entry(
staticMeta, ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION, &entry);
if ((0 == status) && (entry.count == 1)) {
*useHalBufManager = (entry.data.u8[0] ==
ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5);
+ sessionHalBufferManager =
+ (entry.data.u8[0] ==
+ ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE);
}
outputStreams.clear();
@@ -2988,7 +3136,8 @@
ASSERT_TRUE(ret.isOk());
ASSERT_EQ(supported, true);
- ret = (*session)->configureStreams(config, halStreams);
+ ret = configureStreams(*session, config, sessionHalBufferManager, useHalBufManager, halStreams);
+
ASSERT_TRUE(ret.isOk());
if (*useHalBufManager) {
@@ -3387,11 +3536,15 @@
}
*useHalBufManager = false;
+ bool sessionHalBufferManager = false;
status = find_camera_metadata_ro_entry(
staticMeta, ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION, &entry);
if ((0 == status) && (entry.count == 1)) {
*useHalBufManager = (entry.data.u8[0] ==
ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5);
+ sessionHalBufferManager =
+ (entry.data.u8[0] ==
+ ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE);
}
auto st = getJpegBufferSize(staticMeta, jpegBufferSize);
@@ -3444,7 +3597,8 @@
StreamConfiguration config = {streams, StreamConfigurationMode::NORMAL_MODE, CameraMetadata()};
- (*session)->configureStreams(config, halStreams);
+ ret = configureStreams(*session, config, sessionHalBufferManager, useHalBufManager, halStreams);
+
ASSERT_TRUE(ret.isOk());
if (*useHalBufManager) {
diff --git a/camera/provider/aidl/vts/camera_aidl_test.h b/camera/provider/aidl/vts/camera_aidl_test.h
index 36687c2..cbf74a5 100644
--- a/camera/provider/aidl/vts/camera_aidl_test.h
+++ b/camera/provider/aidl/vts/camera_aidl_test.h
@@ -64,6 +64,7 @@
using ::aidl::android::hardware::camera::device::BufferRequestStatus;
using ::aidl::android::hardware::camera::device::CameraMetadata;
using ::aidl::android::hardware::camera::device::CaptureResult;
+using ::aidl::android::hardware::camera::device::ConfigureStreamsRet;
using ::aidl::android::hardware::camera::device::ErrorCode;
using ::aidl::android::hardware::camera::device::HalStream;
using ::aidl::android::hardware::camera::device::ICameraDevice;
@@ -201,6 +202,11 @@
int32_t* partialResultCount /*out*/, std::shared_ptr<DeviceCb>* outCb /*out*/,
int32_t* jpegBufferSize /*out*/, bool* useHalBufManager /*out*/);
+ ndk::ScopedAStatus configureStreams(std::shared_ptr<ICameraDeviceSession>& session,
+ const StreamConfiguration& config,
+ bool sessionHalBufferManager, bool* useHalBufManager,
+ std::vector<HalStream>* halStreams);
+
void configureStreams(
const std::string& name, const std::shared_ptr<ICameraProvider>& provider,
PixelFormat format, std::shared_ptr<ICameraDeviceSession>* session /*out*/,
@@ -262,6 +268,9 @@
static void verifyMonochromeCharacteristics(const CameraMetadata& chars);
+ static void verifyManualFlashStrengthControlCharacteristics(
+ const camera_metadata_t* staticMeta);
+
static void verifyMonochromeCameraResult(
const ::android::hardware::camera::common::V1_0::helper::CameraMetadata& metadata);
@@ -270,12 +279,13 @@
static void verifySettingsOverrideCharacteristics(const camera_metadata_t* metadata);
static void verifyStreamCombination(const std::shared_ptr<ICameraDevice>& device,
- const StreamConfiguration& config, bool expectedStatus,
- bool expectStreamCombQuery);
+ const StreamConfiguration& config, bool expectedStatus);
static void verifyLogicalCameraResult(const camera_metadata_t* staticMetadata,
const std::vector<uint8_t>& resultMetadata);
+ static void verifyLensIntrinsicsResult(const std::vector<uint8_t>& resultMetadata);
+
static void verifyBuffersReturned(const std::shared_ptr<ICameraDeviceSession>& session,
int32_t streamId, const std::shared_ptr<DeviceCb>& cb,
uint32_t streamConfigCounter = 0);
@@ -615,6 +625,7 @@
// device@<major>.<minor>/<type>/id
const char* kDeviceNameRE = "device@([0-9]+\\.[0-9]+)/\\s+/(.+)";
const std::string CAMERA_DEVICE_API_VERSION_1 = "1.1";
+const int32_t CAMERA_DEVICE_API_MINOR_VERSION_3 = 3;
const int32_t kMaxVideoWidth = 4096;
const int32_t kMaxVideoHeight = 2160;
diff --git a/camera/provider/aidl/vts/device_cb.cpp b/camera/provider/aidl/vts/device_cb.cpp
index 7e0969a..2c11d3f 100644
--- a/camera/provider/aidl/vts/device_cb.cpp
+++ b/camera/provider/aidl/vts/device_cb.cpp
@@ -388,15 +388,16 @@
// Verify logical camera result metadata
bool isLogicalCamera =
Status::OK == CameraAidlTest::isLogicalMultiCamera(staticMetadataBuffer);
+ camera_metadata_t* collectedMetadata =
+ const_cast<camera_metadata_t*>(request->collectedResult.getAndLock());
+ uint8_t* rawMetadata = reinterpret_cast<uint8_t*>(collectedMetadata);
+ std::vector metadata =
+ std::vector(rawMetadata, rawMetadata + get_camera_metadata_size(collectedMetadata));
if (isLogicalCamera) {
- camera_metadata_t* collectedMetadata =
- const_cast<camera_metadata_t*>(request->collectedResult.getAndLock());
- uint8_t* rawMetadata = reinterpret_cast<uint8_t*>(collectedMetadata);
- std::vector metadata = std::vector(
- rawMetadata, rawMetadata + get_camera_metadata_size(collectedMetadata));
CameraAidlTest::verifyLogicalCameraResult(staticMetadataBuffer, metadata);
- request->collectedResult.unlock(collectedMetadata);
}
+ CameraAidlTest::verifyLensIntrinsicsResult(metadata);
+ request->collectedResult.unlock(collectedMetadata);
}
uint32_t numBuffersReturned = results.outputBuffers.size();
diff --git a/camera/provider/default/Android.bp b/camera/provider/default/Android.bp
index ed45cbe..9d70c92 100644
--- a/camera/provider/default/Android.bp
+++ b/camera/provider/default/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_camera_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/camera/provider/default/ExternalCameraProvider.cpp b/camera/provider/default/ExternalCameraProvider.cpp
index 4d2c847..54875ab 100644
--- a/camera/provider/default/ExternalCameraProvider.cpp
+++ b/camera/provider/default/ExternalCameraProvider.cpp
@@ -75,15 +75,15 @@
ndk::ScopedAStatus ExternalCameraProvider::setCallback(
const std::shared_ptr<ICameraProviderCallback>& in_callback) {
+ if (in_callback == nullptr) {
+ return fromStatus(Status::ILLEGAL_ARGUMENT);
+ }
+
{
Mutex::Autolock _l(mLock);
mCallback = in_callback;
}
- if (mCallback == nullptr) {
- return fromStatus(Status::OK);
- }
-
for (const auto& pair : mCameraStatusMap) {
mCallback->cameraDeviceStatusChange(pair.first, pair.second);
}
diff --git a/common/aidl/Android.bp b/common/aidl/Android.bp
index 1457b8a..11de087 100644
--- a/common/aidl/Android.bp
+++ b/common/aidl/Android.bp
@@ -11,10 +11,7 @@
name: "android.hardware.common",
host_supported: true,
vendor_available: true,
- vndk: {
- enabled: true,
- support_system_process: true,
- },
+ double_loadable: true,
vndk_use_version: "2",
srcs: [
"android/hardware/common/*.aidl",
diff --git a/common/fmq/aidl/Android.bp b/common/fmq/aidl/Android.bp
index 6c37213..17c11ab 100644
--- a/common/fmq/aidl/Android.bp
+++ b/common/fmq/aidl/Android.bp
@@ -11,10 +11,7 @@
name: "android.hardware.common.fmq",
host_supported: true,
vendor_available: true,
- vndk: {
- enabled: true,
- support_system_process: true,
- },
+ double_loadable: true,
srcs: [
"android/hardware/common/fmq/*.aidl",
],
diff --git a/compatibility_matrices/Android.bp b/compatibility_matrices/Android.bp
index b21fe54..951ca85 100644
--- a/compatibility_matrices/Android.bp
+++ b/compatibility_matrices/Android.bp
@@ -84,9 +84,11 @@
}
vintf_compatibility_matrix {
- name: "framework_compatibility_matrix.tmp.xml",
- stem: "compatibility_matrix.tmp.xml",
- srcs: [
- "compatibility_matrix.tmp.xml",
+ name: "framework_compatibility_matrix.202504.xml",
+ stem: "compatibility_matrix.202504.xml",
+ srcs: ["compatibility_matrix.202504.xml"],
+ kernel_configs: [
+ "kernel_config_w_6.next",
],
+
}
diff --git a/compatibility_matrices/Android.mk b/compatibility_matrices/Android.mk
index 76dbdd6..ab57b8c 100644
--- a/compatibility_matrices/Android.mk
+++ b/compatibility_matrices/Android.mk
@@ -105,14 +105,15 @@
framework_compatibility_matrix.6.xml \
framework_compatibility_matrix.7.xml \
framework_compatibility_matrix.8.xml \
+ framework_compatibility_matrix.202404.xml \
framework_compatibility_matrix.device.xml \
# Only allow the use of the unreleased compatibility matrix when we can use unfrozen
# interfaces (in the `next` release configuration).
ifeq ($(RELEASE_AIDL_USE_UNFROZEN),true)
my_system_matrix_deps += \
- framework_compatibility_matrix.202404.xml \
- framework_compatibility_matrix.tmp.xml
+ framework_compatibility_matrix.202504.xml \
+
endif
my_framework_matrix_deps += \
diff --git a/compatibility_matrices/bump.py b/compatibility_matrices/bump.py
index 88b7a42..a5a453b 100755
--- a/compatibility_matrices/bump.py
+++ b/compatibility_matrices/bump.py
@@ -16,8 +16,6 @@
#
"""
Creates the next compatibility matrix.
-
-Requires libvintf Level.h to be updated before executing this script.
"""
import argparse
@@ -44,44 +42,33 @@
self.top = pathlib.Path(os.environ["ANDROID_BUILD_TOP"])
self.interfaces_dir = self.top / "hardware/interfaces"
- self.current_level = cmdline_args.current
+ self.current_level = cmdline_args.current_level
+ self.current_letter = cmdline_args.current_letter
self.current_module_name = f"framework_compatibility_matrix.{self.current_level}.xml"
self.current_xml = self.interfaces_dir / f"compatibility_matrices/compatibility_matrix.{self.current_level}.xml"
+ self.device_module_name = "framework_compatibility_matrix.device.xml"
- self.next_level = cmdline_args.next
+ self.next_level = cmdline_args.next_level
+ self.next_letter = cmdline_args.next_letter
self.next_module_name = f"framework_compatibility_matrix.{self.next_level}.xml"
self.next_xml = self.interfaces_dir / f"compatibility_matrices/compatibility_matrix.{self.next_level}.xml"
- self.level_to_letter = self.get_level_to_letter_mapping()
- print("Found level mapping in libvintf Level.h:", self.level_to_letter)
-
def run(self):
self.bump_kernel_configs()
self.copy_matrix()
self.edit_android_bp()
self.edit_android_mk()
- def get_level_to_letter_mapping(self):
- levels_file = self.top / "system/libvintf/include/vintf/Level.h"
- with open(levels_file) as f:
- lines = f.readlines()
- pairs = [
- line.split("=", maxsplit=2) for line in lines if "=" in line
- ]
- return {
- level.strip().removesuffix(","): letter.strip()
- for letter, level in pairs
- }
-
def bump_kernel_configs(self):
check_call([
self.top / "kernel/configs/tools/bump.py",
- self.level_to_letter[self.current_level].lower(),
- self.level_to_letter[self.next_level].lower(),
+ self.current_letter,
+ self.next_letter,
])
def copy_matrix(self):
- shutil.copyfile(self.current_xml, self.next_xml)
+ with open(self.current_xml) as f_current, open(self.next_xml, "w") as f_next:
+ f_next.write(f_current.read().replace(f"level=\"{self.current_level}\"", f"level=\"{self.next_level}\""))
def edit_android_bp(self):
android_bp = self.interfaces_dir / "compatibility_matrices/Android.bp"
@@ -100,7 +87,7 @@
next_kernel_configs = check_output(
"""grep -rh name: | sed -E 's/^.*"(.*)".*/\\1/g'""",
cwd=self.top / "kernel/configs" /
- self.level_to_letter[self.next_level].lower(),
+ self.next_letter,
text=True,
shell=True,
).splitlines()
@@ -124,31 +111,38 @@
def edit_android_mk(self):
android_mk = self.interfaces_dir / "compatibility_matrices/Android.mk"
+ lines = []
with open(android_mk) as f:
if self.next_module_name in f.read():
return
f.seek(0)
- lines = f.readlines()
- current_module_line_number = None
- for line_number, line in enumerate(lines):
- if self.current_module_name in line:
- current_module_line_number = line_number
- break
- assert current_module_line_number is not None
- lines.insert(current_module_line_number + 1,
- f" {self.next_module_name} \\\n")
+ for line in f:
+ if f" {self.device_module_name} \\\n" in line:
+ lines.append(f" {self.current_module_name} \\\n")
+
+ if self.current_module_name in line:
+ lines.append(f" {self.next_module_name} \\\n")
+ else:
+ lines.append(line)
+
with open(android_mk, "w") as f:
f.write("".join(lines))
def main():
parser = argparse.ArgumentParser(description=__doc__)
- parser.add_argument("current",
+ parser.add_argument("current_level",
type=str,
help="VINTF level of the current version (e.g. 9)")
- parser.add_argument("next",
+ parser.add_argument("next_level",
type=str,
help="VINTF level of the next version (e.g. 10)")
+ parser.add_argument("current_letter",
+ type=str,
+ help="Letter of the API level of the current version (e.g. v)")
+ parser.add_argument("next_letter",
+ type=str,
+ help="Letter of the API level of the next version (e.g. w)")
cmdline_args = parser.parse_args()
Bump(cmdline_args).run()
diff --git a/compatibility_matrices/compatibility_matrix.202404.xml b/compatibility_matrices/compatibility_matrix.202404.xml
index b34011e..a5e40dd 100644
--- a/compatibility_matrices/compatibility_matrix.202404.xml
+++ b/compatibility_matrices/compatibility_matrix.202404.xml
@@ -67,6 +67,14 @@
</interface>
</hal>
<hal format="aidl">
+ <name>android.hardware.macsec</name>
+ <version>1</version>
+ <interface>
+ <name>IMacsecPskPlugin</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
<name>android.hardware.automotive.occupant_awareness</name>
<version>1</version>
<interface>
@@ -76,7 +84,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.automotive.vehicle</name>
- <version>1-2</version>
+ <version>1-3</version>
<interface>
<name>IVehicle</name>
<instance>default</instance>
@@ -84,6 +92,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.automotive.remoteaccess</name>
+ <version>1-2</version>
<interface>
<name>IRemoteAccess</name>
<instance>default</instance>
@@ -98,15 +107,16 @@
</hal>
<hal format="aidl" updatable-via-apex="true">
<name>android.hardware.biometrics.face</name>
- <version>3</version>
+ <version>3-4</version>
<interface>
<name>IFace</name>
<instance>default</instance>
+ <instance>virtual</instance>
</interface>
</hal>
<hal format="aidl" updatable-via-apex="true">
<name>android.hardware.biometrics.fingerprint</name>
- <version>3</version>
+ <version>3-4</version>
<interface>
<name>IFingerprint</name>
<instance>default</instance>
@@ -161,6 +171,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.broadcastradio</name>
+ <version>1-2</version>
<interface>
<name>IBroadcastRadio</name>
<regex-instance>.*</regex-instance>
@@ -168,7 +179,7 @@
</hal>
<hal format="aidl" updatable-via-apex="true">
<name>android.hardware.camera.provider</name>
- <version>1-2</version>
+ <version>1-3</version>
<interface>
<name>ICameraProvider</name>
<regex-instance>[^/]+/[0-9]+</regex-instance>
@@ -191,7 +202,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.contexthub</name>
- <version>2</version>
+ <version>3</version>
<interface>
<name>IContextHub</name>
<instance>default</instance>
@@ -222,7 +233,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.gnss</name>
- <version>2-3</version>
+ <version>2-4</version>
<interface>
<name>IGnss</name>
<instance>default</instance>
@@ -238,7 +249,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.graphics.composer3</name>
- <version>2</version>
+ <version>3</version>
<interface>
<name>IComposer</name>
<instance>default</instance>
@@ -377,7 +388,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.power</name>
- <version>4</version>
+ <version>5</version>
<interface>
<name>IPower</name>
<instance>default</instance>
@@ -393,7 +404,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.radio.config</name>
- <version>2</version>
+ <version>3</version>
<interface>
<name>IRadioConfig</name>
<instance>default</instance>
@@ -401,7 +412,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.radio.data</name>
- <version>2</version>
+ <version>3</version>
<interface>
<name>IRadioData</name>
<instance>slot1</instance>
@@ -411,7 +422,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.radio.messaging</name>
- <version>2</version>
+ <version>3</version>
<interface>
<name>IRadioMessaging</name>
<instance>slot1</instance>
@@ -421,7 +432,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.radio.modem</name>
- <version>2</version>
+ <version>3</version>
<interface>
<name>IRadioModem</name>
<instance>slot1</instance>
@@ -431,7 +442,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.radio.network</name>
- <version>2</version>
+ <version>3</version>
<interface>
<name>IRadioNetwork</name>
<instance>slot1</instance>
@@ -441,7 +452,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.radio.sim</name>
- <version>2</version>
+ <version>3</version>
<interface>
<name>IRadioSim</name>
<instance>slot1</instance>
@@ -461,7 +472,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.radio.voice</name>
- <version>2</version>
+ <version>3</version>
<interface>
<name>IRadioVoice</name>
<instance>slot1</instance>
@@ -471,7 +482,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.radio.ims</name>
- <version>1</version>
+ <version>2</version>
<interface>
<name>IRadioIms</name>
<instance>slot1</instance>
@@ -481,7 +492,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.radio.ims.media</name>
- <version>1</version>
+ <version>2</version>
<interface>
<name>IImsMedia</name>
<instance>default</instance>
@@ -527,6 +538,7 @@
<name>ISharedSecret</name>
<instance>default</instance>
<instance>strongbox</instance>
+ <regex-instance>.*</regex-instance>
</interface>
</hal>
<hal format="aidl">
@@ -555,7 +567,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.thermal</name>
- <version>1</version>
+ <version>2</version>
<interface>
<name>IThermal</name>
<instance>default</instance>
@@ -611,7 +623,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.tv.input</name>
- <version>1</version>
+ <version>1-2</version>
<interface>
<name>ITvInput</name>
<instance>default</instance>
@@ -619,7 +631,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.usb</name>
- <version>1-2</version>
+ <version>1-3</version>
<interface>
<name>IUsb</name>
<instance>default</instance>
@@ -658,7 +670,7 @@
</hal>
<hal format="aidl" updatable-via-apex="true">
<name>android.hardware.wifi</name>
- <version>1</version>
+ <version>1-2</version>
<interface>
<name>IWifi</name>
<instance>default</instance>
@@ -674,7 +686,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.wifi.hostapd</name>
- <version>1</version>
+ <version>1-2</version>
<interface>
<name>IHostapd</name>
<instance>default</instance>
@@ -682,7 +694,7 @@
</hal>
<hal format="aidl">
<name>android.hardware.wifi.supplicant</name>
- <version>2</version>
+ <version>2-3</version>
<interface>
<name>ISupplicant</name>
<instance>default</instance>
diff --git a/compatibility_matrices/compatibility_matrix.202504.xml b/compatibility_matrices/compatibility_matrix.202504.xml
new file mode 100644
index 0000000..4b438ce
--- /dev/null
+++ b/compatibility_matrices/compatibility_matrix.202504.xml
@@ -0,0 +1,694 @@
+<compatibility-matrix version="1.0" type="framework" level="202504">
+ <hal format="aidl">
+ <name>android.hardware.audio.core</name>
+ <version>1-2</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">
+ <name>android.hardware.audio.effect</name>
+ <version>1-2</version>
+ <interface>
+ <name>IFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.audio.sounddose</name>
+ <version>1-2</version>
+ <interface>
+ <name>ISoundDoseFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" updatable-via-apex="true">
+ <name>android.hardware.authsecret</name>
+ <version>1</version>
+ <interface>
+ <name>IAuthSecret</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.automotive.audiocontrol</name>
+ <version>2-4</version>
+ <interface>
+ <name>IAudioControl</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.automotive.can</name>
+ <version>1</version>
+ <interface>
+ <name>ICanController</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.automotive.evs</name>
+ <version>1-2</version>
+ <interface>
+ <name>IEvsEnumerator</name>
+ <regex-instance>[a-z]+/[0-9]+</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.macsec</name>
+ <version>1</version>
+ <interface>
+ <name>IMacsecPskPlugin</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.automotive.occupant_awareness</name>
+ <version>1</version>
+ <interface>
+ <name>IOccupantAwareness</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.automotive.vehicle</name>
+ <version>1-3</version>
+ <interface>
+ <name>IVehicle</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.automotive.remoteaccess</name>
+ <version>1-2</version>
+ <interface>
+ <name>IRemoteAccess</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.automotive.ivn</name>
+ <interface>
+ <name>IIvnAndroidDevice</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" updatable-via-apex="true">
+ <name>android.hardware.biometrics.face</name>
+ <version>3-4</version>
+ <interface>
+ <name>IFace</name>
+ <instance>default</instance>
+ <instance>virtual</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" updatable-via-apex="true">
+ <name>android.hardware.biometrics.fingerprint</name>
+ <version>3-4</version>
+ <interface>
+ <name>IFingerprint</name>
+ <instance>default</instance>
+ <instance>virtual</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.bluetooth</name>
+ <interface>
+ <name>IBluetoothHci</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.bluetooth.audio</name>
+ <version>3-4</version>
+ <interface>
+ <name>IBluetoothAudioProviderFactory</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.bluetooth.ranging</name>
+ <version>1</version>
+ <interface>
+ <name>IBluetoothChannelSounding</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.bluetooth.finder</name>
+ <version>1</version>
+ <interface>
+ <name>IBluetoothFinder</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.bluetooth.lmp_event</name>
+ <version>1</version>
+ <interface>
+ <name>IBluetoothLmpEvent</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.boot</name>
+ <interface>
+ <name>IBootControl</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.broadcastradio</name>
+ <version>1-2</version>
+ <interface>
+ <name>IBroadcastRadio</name>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl" updatable-via-apex="true">
+ <name>android.hardware.camera.provider</name>
+ <version>1-3</version>
+ <interface>
+ <name>ICameraProvider</name>
+ <regex-instance>[^/]+/[0-9]+</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.cas</name>
+ <interface>
+ <name>IMediaCasService</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.confirmationui</name>
+ <version>1</version>
+ <interface>
+ <name>IConfirmationUI</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.contexthub</name>
+ <version>3</version>
+ <interface>
+ <name>IContextHub</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" updatable-via-apex="true">
+ <name>android.hardware.drm</name>
+ <version>1</version>
+ <interface>
+ <name>IDrmFactory</name>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.dumpstate</name>
+ <interface>
+ <name>IDumpstateDevice</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.gatekeeper</name>
+ <version>1</version>
+ <interface>
+ <name>IGatekeeper</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.gnss</name>
+ <version>2-4</version>
+ <interface>
+ <name>IGnss</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.graphics.allocator</name>
+ <version>1-2</version>
+ <interface>
+ <name>IAllocator</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.graphics.composer3</name>
+ <version>3</version>
+ <interface>
+ <name>IComposer</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.health</name>
+ <version>3</version>
+ <interface>
+ <name>IHealth</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.health.storage</name>
+ <version>1</version>
+ <interface>
+ <name>IStorage</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.identity</name>
+ <version>1-5</version>
+ <interface>
+ <name>IIdentityCredentialStore</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.net.nlinterceptor</name>
+ <interface>
+ <name>IInterceptor</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.oemlock</name>
+ <version>1</version>
+ <interface>
+ <name>IOemLock</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.ir</name>
+ <version>1</version>
+ <interface>
+ <name>IConsumerIr</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.input.processor</name>
+ <version>1</version>
+ <interface>
+ <name>IInputProcessor</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.security.secretkeeper</name>
+ <version>1</version>
+ <interface>
+ <name>ISecretkeeper</name>
+ <instance>default</instance>
+ <instance>nonsecure</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" updatable-via-apex="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" updatable-via-apex="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">
+ <name>android.hardware.light</name>
+ <version>2</version>
+ <interface>
+ <name>ILights</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <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">
+ <name>android.hardware.memtrack</name>
+ <version>1</version>
+ <interface>
+ <name>IMemtrack</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" updatable-via-apex="true">
+ <name>android.hardware.neuralnetworks</name>
+ <version>1-4</version>
+ <interface>
+ <name>IDevice</name>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl" updatable-via-apex="true">
+ <name>android.hardware.nfc</name>
+ <interface>
+ <name>INfc</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.power</name>
+ <version>5</version>
+ <interface>
+ <name>IPower</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.power.stats</name>
+ <version>2</version>
+ <interface>
+ <name>IPowerStats</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.radio.config</name>
+ <version>3</version>
+ <interface>
+ <name>IRadioConfig</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.radio.data</name>
+ <version>3</version>
+ <interface>
+ <name>IRadioData</name>
+ <instance>slot1</instance>
+ <instance>slot2</instance>
+ <instance>slot3</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.radio.messaging</name>
+ <version>3</version>
+ <interface>
+ <name>IRadioMessaging</name>
+ <instance>slot1</instance>
+ <instance>slot2</instance>
+ <instance>slot3</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.radio.modem</name>
+ <version>3</version>
+ <interface>
+ <name>IRadioModem</name>
+ <instance>slot1</instance>
+ <instance>slot2</instance>
+ <instance>slot3</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.radio.network</name>
+ <version>3</version>
+ <interface>
+ <name>IRadioNetwork</name>
+ <instance>slot1</instance>
+ <instance>slot2</instance>
+ <instance>slot3</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.radio.sim</name>
+ <version>3</version>
+ <interface>
+ <name>IRadioSim</name>
+ <instance>slot1</instance>
+ <instance>slot2</instance>
+ <instance>slot3</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <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">
+ <name>android.hardware.radio.voice</name>
+ <version>3</version>
+ <interface>
+ <name>IRadioVoice</name>
+ <instance>slot1</instance>
+ <instance>slot2</instance>
+ <instance>slot3</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.radio.ims</name>
+ <version>2</version>
+ <interface>
+ <name>IRadioIms</name>
+ <instance>slot1</instance>
+ <instance>slot2</instance>
+ <instance>slot3</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.radio.ims.media</name>
+ <version>2</version>
+ <interface>
+ <name>IImsMedia</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.rebootescrow</name>
+ <version>1</version>
+ <interface>
+ <name>IRebootEscrow</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <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" updatable-via-apex="true">
+ <name>android.hardware.security.authgraph</name>
+ <version>1</version>
+ <interface>
+ <name>IAuthGraphKeyExchange</name>
+ <instance>nonsecure</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" updatable-via-apex="true">
+ <name>android.hardware.security.secureclock</name>
+ <version>1</version>
+ <interface>
+ <name>ISecureClock</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" updatable-via-apex="true">
+ <name>android.hardware.security.sharedsecret</name>
+ <version>1</version>
+ <interface>
+ <name>ISharedSecret</name>
+ <instance>default</instance>
+ <instance>strongbox</instance>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.sensors</name>
+ <version>2</version>
+ <interface>
+ <name>ISensors</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.soundtrigger3</name>
+ <version>1-2</version>
+ <interface>
+ <name>ISoundTriggerHw</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.tetheroffload</name>
+ <version>1</version>
+ <interface>
+ <name>IOffload</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.thermal</name>
+ <version>2</version>
+ <interface>
+ <name>IThermal</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" updatable-via-apex="true">
+ <name>android.hardware.threadnetwork</name>
+ <version>1</version>
+ <interface>
+ <name>IThreadChip</name>
+ <regex-instance>chip[0-9]+</regex-instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.tv.hdmi.cec</name>
+ <version>1</version>
+ <interface>
+ <name>IHdmiCec</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.tv.hdmi.earc</name>
+ <version>1</version>
+ <interface>
+ <name>IEArc</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.tv.hdmi.connection</name>
+ <version>1</version>
+ <interface>
+ <name>IHdmiConnection</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.tv.tuner</name>
+ <version>1-2</version>
+ <interface>
+ <name>ITuner</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.tv.input</name>
+ <version>1-2</version>
+ <interface>
+ <name>ITvInput</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.usb</name>
+ <version>1-3</version>
+ <interface>
+ <name>IUsb</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.usb.gadget</name>
+ <interface>
+ <name>IUsbGadget</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.vibrator</name>
+ <version>1-2</version>
+ <interface>
+ <name>IVibrator</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.vibrator</name>
+ <version>1-2</version>
+ <interface>
+ <name>IVibratorManager</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.weaver</name>
+ <version>2</version>
+ <interface>
+ <name>IWeaver</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" updatable-via-apex="true">
+ <name>android.hardware.wifi</name>
+ <version>1-2</version>
+ <interface>
+ <name>IWifi</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl" updatable-via-apex="true">
+ <name>android.hardware.uwb</name>
+ <version>1</version>
+ <interface>
+ <name>IUwb</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.wifi.hostapd</name>
+ <version>1-2</version>
+ <interface>
+ <name>IHostapd</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <hal format="aidl">
+ <name>android.hardware.wifi.supplicant</name>
+ <version>2-3</version>
+ <interface>
+ <name>ISupplicant</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+ <!-- The native mapper HAL must exist on the device -->
+ <hal format="native">
+ <name>mapper</name>
+ <version>5.0</version>
+ <interface>
+ <regex-instance>.*</regex-instance>
+ </interface>
+ </hal>
+</compatibility-matrix>
diff --git a/compatibility_matrices/compatibility_matrix.8.xml b/compatibility_matrices/compatibility_matrix.8.xml
index d8115e1..7054bfa 100644
--- a/compatibility_matrices/compatibility_matrix.8.xml
+++ b/compatibility_matrices/compatibility_matrix.8.xml
@@ -116,7 +116,7 @@
</hal>
<hal format="aidl" updatable-via-apex="true">
<name>android.hardware.biometrics.face</name>
- <version>3</version>
+ <version>3-4</version>
<interface>
<name>IFace</name>
<instance>default</instance>
diff --git a/compatibility_matrices/compatibility_matrix.tmp.xml b/compatibility_matrices/compatibility_matrix.tmp.xml
deleted file mode 100644
index 85e3c4c..0000000
--- a/compatibility_matrices/compatibility_matrix.tmp.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<compatibility-matrix version="1.0" type="framework" level="202404">
- <!-- This file holds the HIDL media.c2 interface while it
- is being deprecated. This will be removed after the flag ramping
- complete. This interface is not allowed in the 202404 vendor interface -->
- <hal format="hidl" optional="true">
- <name>android.hardware.media.c2</name>
- <version>1.0-2</version>
- <interface>
- <name>IComponentStore</name>
- <instance>software</instance>
- <regex-instance>default[0-9]*</regex-instance>
- <regex-instance>vendor[0-9]*_software</regex-instance>
- </interface>
- </hal>
- <hal format="hidl" optional="true">
- <name>android.hardware.media.c2</name>
- <version>1.0</version>
- <interface>
- <name>IConfigurable</name>
- <instance>default</instance>
- <instance>software</instance>
- </interface>
- </hal>
-</compatibility-matrix>
diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp
index 72ead0c..08ef49b 100644
--- a/compatibility_matrices/exclude/fcm_exclude.cpp
+++ b/compatibility_matrices/exclude/fcm_exclude.cpp
@@ -148,6 +148,7 @@
"android.hardware.media.bufferpool2@",
"android.hardware.radio@",
"android.hardware.uwb.fira_android@",
+ "android.hardware.wifi.common@",
// Test packages are exempted.
"android.hardware.tests.",
diff --git a/configstore/1.0/Android.bp b/configstore/1.0/Android.bp
index 51fc44c..ef781d2 100644
--- a/configstore/1.0/Android.bp
+++ b/configstore/1.0/Android.bp
@@ -12,9 +12,6 @@
hidl_interface {
name: "android.hardware.configstore@1.0",
root: "android.hardware",
- vndk: {
- enabled: true,
- },
srcs: [
"types.hal",
"ISurfaceFlingerConfigs.hal",
diff --git a/configstore/1.1/Android.bp b/configstore/1.1/Android.bp
index ec745dd..c8c3f5e 100644
--- a/configstore/1.1/Android.bp
+++ b/configstore/1.1/Android.bp
@@ -12,9 +12,6 @@
hidl_interface {
name: "android.hardware.configstore@1.1",
root: "android.hardware",
- vndk: {
- enabled: true,
- },
srcs: [
"types.hal",
"ISurfaceFlingerConfigs.hal",
diff --git a/configstore/utils/Android.bp b/configstore/utils/Android.bp
index 7ed3f68..b62f1bc 100644
--- a/configstore/utils/Android.bp
+++ b/configstore/utils/Android.bp
@@ -26,13 +26,10 @@
cc_library_shared {
name: "android.hardware.configstore-utils",
vendor_available: true,
- vndk: {
- enabled: true,
- },
double_loadable: true,
defaults: ["hidl_defaults"],
- srcs: [ "ConfigStoreUtils.cpp" ],
+ srcs: ["ConfigStoreUtils.cpp"],
export_include_dirs: ["include"],
@@ -40,12 +37,12 @@
"android.hardware.configstore@1.0",
"android.hardware.configstore@1.1",
"libbase",
- "libhidlbase"
+ "libhidlbase",
],
export_shared_lib_headers: [
"android.hardware.configstore@1.0",
"android.hardware.configstore@1.1",
"libbase",
- "libhidlbase"
+ "libhidlbase",
],
}
diff --git a/confirmationui/support/Android.bp b/confirmationui/support/Android.bp
index 1200115..67cc04b 100644
--- a/confirmationui/support/Android.bp
+++ b/confirmationui/support/Android.bp
@@ -27,9 +27,6 @@
name: "android.hardware.confirmationui-support-lib",
vendor_available: true,
host_supported: true,
- vndk: {
- enabled: true,
- },
srcs: [
"src/cbor.cpp",
"src/confirmationui_utils.cpp",
diff --git a/contexthub/OWNERS b/contexthub/OWNERS
index ee25833..f35961a 100644
--- a/contexthub/OWNERS
+++ b/contexthub/OWNERS
@@ -1,3 +1,2 @@
# Bug component: 156070
-arthuri@google.com
bduddie@google.com
diff --git a/contexthub/aidl/Android.bp b/contexthub/aidl/Android.bp
index a0315d0..5905c8c 100644
--- a/contexthub/aidl/Android.bp
+++ b/contexthub/aidl/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_context_hub",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -49,6 +50,6 @@
},
],
- frozen: true,
+ frozen: false,
}
diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubInfo.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubInfo.aidl
index e573556..c99169e 100644
--- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubInfo.aidl
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubInfo.aidl
@@ -45,4 +45,5 @@
byte chreApiMinorVersion;
char chrePatchVersion;
String[] supportedPermissions;
+ boolean supportsReliableMessages;
}
diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubMessage.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubMessage.aidl
index e38c251..a6951a8 100644
--- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubMessage.aidl
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ContextHubMessage.aidl
@@ -39,4 +39,6 @@
int messageType;
byte[] messageBody;
String[] permissions;
+ boolean isReliable;
+ int messageSequenceNumber;
}
diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ErrorCode.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ErrorCode.aidl
new file mode 100644
index 0000000..8924658
--- /dev/null
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/ErrorCode.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.contexthub;
+@Backing(type="byte") @VintfStability
+enum ErrorCode {
+ OK = 0,
+ TRANSIENT_ERROR,
+ PERMANENT_ERROR,
+ PERMISSION_DENIED,
+ DESTINATION_NOT_FOUND,
+}
diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl
index de8d752..7341e0e 100644
--- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHub.aidl
@@ -48,5 +48,6 @@
long[] getPreloadedNanoappIds(in int contextHubId);
void onNanSessionStateChanged(in android.hardware.contexthub.NanSessionStateUpdate update);
void setTestMode(in boolean enable);
+ void sendMessageDeliveryStatusToHub(in int contextHubId, in android.hardware.contexthub.MessageDeliveryStatus messageDeliveryStatus);
const int EX_CONTEXT_HUB_UNSPECIFIED = (-1) /* -1 */;
}
diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl
index 6163cfc..70f69c6 100644
--- a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/IContextHubCallback.aidl
@@ -39,5 +39,8 @@
void handleContextHubAsyncEvent(in android.hardware.contexthub.AsyncEventType evt);
void handleTransactionResult(in int transactionId, in boolean success);
void handleNanSessionRequest(in android.hardware.contexthub.NanSessionRequest request);
+ void handleMessageDeliveryStatus(in char hostEndpointId, in android.hardware.contexthub.MessageDeliveryStatus messageDeliveryStatus);
+ byte[16] getUuid();
+ String getName();
const int CONTEXTHUB_NAN_TRANSACTION_TIMEOUT_MS = 10000;
}
diff --git a/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/MessageDeliveryStatus.aidl b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/MessageDeliveryStatus.aidl
new file mode 100644
index 0000000..40dac13
--- /dev/null
+++ b/contexthub/aidl/aidl_api/android.hardware.contexthub/current/android/hardware/contexthub/MessageDeliveryStatus.aidl
@@ -0,0 +1,39 @@
+/*
+ * 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.contexthub;
+@VintfStability
+parcelable MessageDeliveryStatus {
+ int messageSequenceNumber;
+ android.hardware.contexthub.ErrorCode errorCode;
+}
diff --git a/contexthub/aidl/android/hardware/contexthub/ContextHubInfo.aidl b/contexthub/aidl/android/hardware/contexthub/ContextHubInfo.aidl
index c0fa702..42dba10 100644
--- a/contexthub/aidl/android/hardware/contexthub/ContextHubInfo.aidl
+++ b/contexthub/aidl/android/hardware/contexthub/ContextHubInfo.aidl
@@ -33,7 +33,9 @@
/** Peak MIPs this platform can deliver */
float peakMips;
- /** The maximum length in bytes of the message that can be sent to the Context Hub. */
+ /**
+ * The maximum length in bytes of a message sent to the Context Hub.
+ */
int maxSupportedMessageLengthBytes;
/**
@@ -61,4 +63,11 @@
* are granted in order to communicate with them.
*/
String[] supportedPermissions;
+
+ /**
+ * True if the Context Hub supports reliable messages. False otherwise, in which case
+ * ContextHubMessage.isReliable must always be set to false. See
+ * ContextHubMessage.isReliable for more information.
+ */
+ boolean supportsReliableMessages;
}
diff --git a/contexthub/aidl/android/hardware/contexthub/ContextHubMessage.aidl b/contexthub/aidl/android/hardware/contexthub/ContextHubMessage.aidl
index 95d478e..3cd20ca 100644
--- a/contexthub/aidl/android/hardware/contexthub/ContextHubMessage.aidl
+++ b/contexthub/aidl/android/hardware/contexthub/ContextHubMessage.aidl
@@ -50,4 +50,35 @@
* of the permissions that the sending nanoapp is using.
*/
String[] permissions;
+
+ /**
+ * Whether the message is reliable.
+ *
+ * For reliable messages, the receiver is expected to acknowledge the reception of
+ * the message by sending a message delivery status back to the sender. Acknowledgment of
+ * the message must be returned within 1 second.
+ *
+ * For reliable messages sent by the host, the Context Hub invokes
+ * IContextHubCallback#handleMessageDeliveryStatus to report the status.
+ *
+ * For reliable messages sent by the Context Hub, the host calls
+ * IContextHub#sendMessageDeliveryStatusToHub to report the status.
+ */
+ boolean isReliable;
+
+ /**
+ * The sequence number for a reliable message. For less than 2^32 messages, each message sent
+ * from a Context Hub will have a unique sequence number generated by the Context Hub, and the
+ * sequence numbers are guaranteed to not be reused for unacknowledged messages. For messages
+ * sent to the Context Hub, sequence numbers are only guaranteed to be unique within the scope
+ * of a given hostEndPoint. The sequence number may be reused if more than 2^32 messages are
+ * sent, due to the size limit of int.
+ *
+ * The sequence number is used only for reliable messages. There is no guarantee of strict
+ * ordering of messages. The recipient may receive messages with gaps between the sequence
+ * numbers. This is not an indication of a missed message.
+ *
+ * See isReliable for more information.
+ */
+ int messageSequenceNumber;
}
diff --git a/contexthub/aidl/android/hardware/contexthub/ErrorCode.aidl b/contexthub/aidl/android/hardware/contexthub/ErrorCode.aidl
new file mode 100644
index 0000000..22e7ea1
--- /dev/null
+++ b/contexthub/aidl/android/hardware/contexthub/ErrorCode.aidl
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+package android.hardware.contexthub;
+
+@VintfStability
+@Backing(type="byte")
+enum ErrorCode {
+ /**
+ * No Error.
+ */
+ OK = 0,
+
+ /**
+ * A generic transient error. The sender may retry the
+ * operation, but there is no guarantee of success.
+ */
+ TRANSIENT_ERROR,
+
+ /**
+ * A generic permanent error. The sender should not retry the operation.
+ */
+ PERMANENT_ERROR,
+
+ /**
+ * The request failed because the sender does not have necessary permissions.
+ * The sender should not retry the operation.
+ */
+ PERMISSION_DENIED,
+
+ /**
+ * The request failed because the destination was not found.
+ * The sender should not retry the operation.
+ */
+ DESTINATION_NOT_FOUND,
+}
diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl
index 9683d2d..b146ff8 100644
--- a/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl
+++ b/contexthub/aidl/android/hardware/contexthub/IContextHub.aidl
@@ -20,6 +20,7 @@
import android.hardware.contexthub.ContextHubMessage;
import android.hardware.contexthub.HostEndpointInfo;
import android.hardware.contexthub.IContextHubCallback;
+import android.hardware.contexthub.MessageDeliveryStatus;
import android.hardware.contexthub.NanSessionStateUpdate;
import android.hardware.contexthub.NanoappBinary;
import android.hardware.contexthub.NanoappInfo;
@@ -147,7 +148,7 @@
/**
* Register a callback for the HAL implementation to send asynchronous messages to the service
- * from a Context hub. There can only be one callback registered for a single Context Hub ID.
+ * from a Context hub. Each HAL client can only have one callback for each Context Hub ID.
*
* A call to this function when a callback has already been registered must override the
* previous registration.
@@ -236,6 +237,21 @@
void setTestMode(in boolean enable);
/**
+ * Sends a message delivery status to the Context Hub in response to receiving a
+ * ContextHubMessage with isReliable=true. Each reliable message should have a
+ * messageDeliveryStatus response. This method sends the message delivery status
+ * back to the Context Hub.
+ *
+ * @param contextHubId The identifier of the Context Hub.
+ * @param messageDeliveryStatus The status to be sent.
+ *
+ * @throws EX_UNSUPPORTED_OPERATION if ContextHubInfo.supportsReliableMessages is false for
+ * this hub.
+ */
+ void sendMessageDeliveryStatusToHub(
+ in int contextHubId, in MessageDeliveryStatus messageDeliveryStatus);
+
+ /**
* Error codes that are used as service specific errors with the AIDL return
* value EX_SERVICE_SPECIFIC.
*/
diff --git a/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl b/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl
index bfcb51e..1aa0776 100644
--- a/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl
+++ b/contexthub/aidl/android/hardware/contexthub/IContextHubCallback.aidl
@@ -18,6 +18,7 @@
import android.hardware.contexthub.AsyncEventType;
import android.hardware.contexthub.ContextHubMessage;
+import android.hardware.contexthub.MessageDeliveryStatus;
import android.hardware.contexthub.NanSessionRequest;
import android.hardware.contexthub.NanoappInfo;
@@ -91,6 +92,35 @@
void handleNanSessionRequest(in NanSessionRequest request);
/**
+ * This callback is passed by the Contexthub service to the HAL
+ * implementation to allow the HAL to send the response for a reliable message.
+ * The response is the message delivery status of a recently sent message. See
+ * sendMessageDeliveryStatusToHub() for more details.
+ *
+ * @param hostEndPointId The ID of the host endpoint associated with this message delivery
+ * status.
+ * @param messageDeliveryStatus The status to be sent.
+ */
+ void handleMessageDeliveryStatus(
+ in char hostEndpointId, in MessageDeliveryStatus messageDeliveryStatus);
+
+ /**
+ * This callback is passed to the HAL implementation to allow the HAL to request a UUID that
+ * uniquely identifies a client.
+ *
+ * @return a byte array representating the UUID
+ */
+ byte[16] getUuid();
+
+ /**
+ * This callback gets the name of a client implementing this IContextHubCallback interface,
+ * which must be a hard-coded string and does not change at runtime.
+ *
+ * <p>The name provides a human-readable way to identify a client for troubleshooting purpose.
+ */
+ String getName();
+
+ /**
* Amount of time, in milliseconds, that a handleNanSessionRequest can be pending before the
* Contexthub service must respond.
*/
diff --git a/contexthub/aidl/android/hardware/contexthub/MessageDeliveryStatus.aidl b/contexthub/aidl/android/hardware/contexthub/MessageDeliveryStatus.aidl
new file mode 100644
index 0000000..ae425b3
--- /dev/null
+++ b/contexthub/aidl/android/hardware/contexthub/MessageDeliveryStatus.aidl
@@ -0,0 +1,32 @@
+/*
+ * 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.
+ */
+
+package android.hardware.contexthub;
+
+import android.hardware.contexthub.ErrorCode;
+
+@VintfStability
+parcelable MessageDeliveryStatus {
+ /**
+ * The messageSequenceNumber of the ContextHubMessage to which this status applies.
+ */
+ int messageSequenceNumber;
+
+ /**
+ * The error code associated with this status.
+ */
+ ErrorCode errorCode;
+}
diff --git a/contexthub/aidl/default/Android.bp b/contexthub/aidl/default/Android.bp
index d293e30..2960746 100644
--- a/contexthub/aidl/default/Android.bp
+++ b/contexthub/aidl/default/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_context_hub",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -29,7 +30,7 @@
shared_libs: [
"libbase",
"libbinder_ndk",
- "android.hardware.contexthub-V2-ndk",
+ "android.hardware.contexthub-V3-ndk",
],
export_include_dirs: ["include"],
srcs: [
@@ -50,7 +51,7 @@
shared_libs: [
"libbase",
"libbinder_ndk",
- "android.hardware.contexthub-V2-ndk",
+ "android.hardware.contexthub-V3-ndk",
],
static_libs: [
"libcontexthubexampleimpl",
diff --git a/contexthub/aidl/default/ContextHub.cpp b/contexthub/aidl/default/ContextHub.cpp
index 5272957..bd483d7 100644
--- a/contexthub/aidl/default/ContextHub.cpp
+++ b/contexthub/aidl/default/ContextHub.cpp
@@ -16,10 +16,7 @@
#include "contexthub-impl/ContextHub.h"
-namespace aidl {
-namespace android {
-namespace hardware {
-namespace contexthub {
+namespace aidl::android::hardware::contexthub {
using ::ndk::ScopedAStatus;
@@ -34,10 +31,11 @@
hub.chrePlatformId = UINT64_C(0x476f6f6754000000);
hub.chreApiMajorVersion = 1;
hub.chreApiMinorVersion = 6;
+ hub.supportsReliableMessages = false;
out_contextHubInfos->push_back(hub);
- return ndk::ScopedAStatus::ok();
+ return ScopedAStatus::ok();
}
// We don't expose any nanoapps for the default impl, therefore all nanoapp-related APIs fail.
@@ -63,14 +61,14 @@
}
ScopedAStatus ContextHub::onSettingChanged(Setting /* in_setting */, bool /*in_enabled */) {
- return ndk::ScopedAStatus::ok();
+ return ScopedAStatus::ok();
}
ScopedAStatus ContextHub::queryNanoapps(int32_t in_contextHubId) {
if (in_contextHubId == kMockHubId && mCallback != nullptr) {
std::vector<NanoappInfo> nanoapps;
mCallback->handleNanoappInfo(nanoapps);
- return ndk::ScopedAStatus::ok();
+ return ScopedAStatus::ok();
} else {
return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
@@ -85,18 +83,18 @@
for (uint64_t i = 0; i < 10; ++i) {
out_preloadedNanoappIds->push_back(i);
}
- return ndk::ScopedAStatus::ok();
+ return ScopedAStatus::ok();
}
ScopedAStatus ContextHub::onNanSessionStateChanged(const NanSessionStateUpdate& /*in_update*/) {
- return ndk::ScopedAStatus::ok();
+ return ScopedAStatus::ok();
}
ScopedAStatus ContextHub::registerCallback(int32_t in_contextHubId,
const std::shared_ptr<IContextHubCallback>& in_cb) {
if (in_contextHubId == kMockHubId) {
mCallback = in_cb;
- return ndk::ScopedAStatus::ok();
+ return ScopedAStatus::ok();
} else {
return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
@@ -108,20 +106,20 @@
// Return true here to indicate that the HAL has accepted the message.
// Successful delivery of the message to a nanoapp should be handled at
// a higher level protocol.
- return ndk::ScopedAStatus::ok();
+ return ScopedAStatus::ok();
} else {
return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
}
ScopedAStatus ContextHub::setTestMode(bool /* enable */) {
- return ndk::ScopedAStatus::ok();
+ return ScopedAStatus::ok();
}
ScopedAStatus ContextHub::onHostEndpointConnected(const HostEndpointInfo& in_info) {
mConnectedHostEndpoints.insert(in_info.hostEndpointId);
- return ndk::ScopedAStatus::ok();
+ return ScopedAStatus::ok();
}
ScopedAStatus ContextHub::onHostEndpointDisconnected(char16_t in_hostEndpointId) {
@@ -129,10 +127,13 @@
mConnectedHostEndpoints.erase(in_hostEndpointId);
}
- return ndk::ScopedAStatus::ok();
+ return ScopedAStatus::ok();
}
-} // namespace contexthub
-} // namespace hardware
-} // namespace android
-} // namespace aidl
+ScopedAStatus ContextHub::sendMessageDeliveryStatusToHub(
+ int32_t /* in_contextHubId */,
+ const MessageDeliveryStatus& /* in_messageDeliveryStatus */) {
+ return ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+}
+
+} // namespace aidl::android::hardware::contexthub
diff --git a/contexthub/aidl/default/contexthub-default.xml b/contexthub/aidl/default/contexthub-default.xml
index 930f672..2f8ddc8 100644
--- a/contexthub/aidl/default/contexthub-default.xml
+++ b/contexthub/aidl/default/contexthub-default.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.contexthub</name>
- <version>2</version>
+ <version>3</version>
<interface>
<name>IContextHub</name>
<instance>default</instance>
diff --git a/contexthub/aidl/default/include/contexthub-impl/ContextHub.h b/contexthub/aidl/default/include/contexthub-impl/ContextHub.h
index 7a2cfd1..72e8b3b 100644
--- a/contexthub/aidl/default/include/contexthub-impl/ContextHub.h
+++ b/contexthub/aidl/default/include/contexthub-impl/ContextHub.h
@@ -49,6 +49,9 @@
::ndk::ScopedAStatus onHostEndpointDisconnected(char16_t in_hostEndpointId) override;
::ndk::ScopedAStatus onNanSessionStateChanged(const NanSessionStateUpdate& in_update) override;
+ ::ndk::ScopedAStatus sendMessageDeliveryStatusToHub(
+ int32_t in_contextHubId,
+ const MessageDeliveryStatus& in_messageDeliveryStatus) override;
private:
static constexpr uint32_t kMockHubId = 0;
diff --git a/contexthub/aidl/vts/Android.bp b/contexthub/aidl/vts/Android.bp
index 1534b40..62a319e 100644
--- a/contexthub/aidl/vts/Android.bp
+++ b/contexthub/aidl/vts/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_context_hub",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -32,7 +33,7 @@
"libbinder",
],
static_libs: [
- "android.hardware.contexthub-V2-cpp",
+ "android.hardware.contexthub-V3-cpp",
"VtsHalContexthubUtils",
],
test_suites: [
diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
index c1cc07c..fd55b80 100644
--- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
+++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
@@ -36,9 +36,11 @@
using ::android::hardware::contexthub::AsyncEventType;
using ::android::hardware::contexthub::ContextHubInfo;
using ::android::hardware::contexthub::ContextHubMessage;
+using ::android::hardware::contexthub::ErrorCode;
using ::android::hardware::contexthub::HostEndpointInfo;
using ::android::hardware::contexthub::IContextHub;
using ::android::hardware::contexthub::IContextHubCallbackDefault;
+using ::android::hardware::contexthub::MessageDeliveryStatus;
using ::android::hardware::contexthub::NanoappBinary;
using ::android::hardware::contexthub::NanoappInfo;
using ::android::hardware::contexthub::NanoappRpcService;
@@ -48,6 +50,11 @@
using ::android::hardware::contexthub::vts_utils::kNonExistentAppId;
using ::android::hardware::contexthub::vts_utils::waitForCallback;
+// 6612b522-b717-41c8-b48d-c0b1cc64e142
+constexpr std::array<uint8_t, 16> kUuid = {0x66, 0x12, 0xb5, 0x22, 0xb7, 0x17, 0x41, 0xc8,
+ 0xb4, 0x8d, 0xc0, 0xb1, 0xcc, 0x64, 0xe1, 0x42};
+const String16 kName{"VtsAidlHalContextHubTargetTest"};
+
class ContextHubAidl : public testing::TestWithParam<std::tuple<std::string, int32_t>> {
public:
virtual void SetUp() override {
@@ -126,6 +133,22 @@
Status handleNanSessionRequest(const NanSessionRequest& /* request */) override {
return Status::ok();
}
+
+ Status handleMessageDeliveryStatus(
+ char16_t /* hostEndPointId */,
+ const MessageDeliveryStatus& /* messageDeliveryStatus */) override {
+ return Status::ok();
+ }
+
+ Status getUuid(std::array<uint8_t, 16>* out_uuid) override {
+ *out_uuid = kUuid;
+ return Status::ok();
+ }
+
+ Status getName(::android::String16* out_name) override {
+ *out_name = kName;
+ return Status::ok();
+ }
};
TEST_P(ContextHubAidl, TestRegisterCallback) {
@@ -157,6 +180,22 @@
return Status::ok();
}
+ Status handleMessageDeliveryStatus(
+ char16_t /* hostEndPointId */,
+ const MessageDeliveryStatus& /* messageDeliveryStatus */) override {
+ return Status::ok();
+ }
+
+ Status getUuid(std::array<uint8_t, 16>* out_uuid) override {
+ *out_uuid = kUuid;
+ return Status::ok();
+ }
+
+ Status getName(::android::String16* out_name) override {
+ *out_name = kName;
+ return Status::ok();
+ }
+
std::promise<std::vector<NanoappInfo>> promise;
};
@@ -223,6 +262,22 @@
return Status::ok();
}
+ Status handleMessageDeliveryStatus(
+ char16_t /* hostEndPointId */,
+ const MessageDeliveryStatus& /* messageDeliveryStatus */) override {
+ return Status::ok();
+ }
+
+ Status getUuid(std::array<uint8_t, 16>* out_uuid) override {
+ *out_uuid = kUuid;
+ return Status::ok();
+ }
+
+ Status getName(::android::String16* out_name) override {
+ *out_name = kName;
+ return Status::ok();
+ }
+
uint32_t expectedTransactionId = 0;
std::promise<bool> promise;
};
@@ -396,6 +451,20 @@
}
}
+TEST_P(ContextHubAidl, TestSendMessageDeliveryStatusToHub) {
+ MessageDeliveryStatus messageDeliveryStatus;
+ messageDeliveryStatus.messageSequenceNumber = 123;
+ messageDeliveryStatus.errorCode = ErrorCode::OK;
+
+ Status status = contextHub->sendMessageDeliveryStatusToHub(getHubId(), messageDeliveryStatus);
+ if (status.exceptionCode() == Status::EX_UNSUPPORTED_OPERATION ||
+ status.transactionError() == android::UNKNOWN_TRANSACTION) {
+ GTEST_SKIP() << "Not supported -> old API; or not implemented";
+ } else {
+ EXPECT_TRUE(status.isOk());
+ }
+}
+
std::string PrintGeneratedTest(const testing::TestParamInfo<ContextHubAidl::ParamType>& info) {
return std::string("CONTEXT_HUB_ID_") + std::to_string(std::get<1>(info.param));
}
diff --git a/drm/aidl/OWNERS b/drm/aidl/OWNERS
deleted file mode 100644
index e69de29..0000000
--- a/drm/aidl/OWNERS
+++ /dev/null
diff --git a/drm/aidl/vts/OWNERS b/drm/aidl/vts/OWNERS
deleted file mode 100644
index e69de29..0000000
--- a/drm/aidl/vts/OWNERS
+++ /dev/null
diff --git a/gatekeeper/aidl/software/Android.bp b/gatekeeper/aidl/software/Android.bp
new file mode 100644
index 0000000..d244461
--- /dev/null
+++ b/gatekeeper/aidl/software/Android.bp
@@ -0,0 +1,71 @@
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_binary {
+ name: "android.hardware.gatekeeper-service.nonsecure",
+ cflags: [
+ "-fvisibility=hidden",
+ "-Wall",
+ "-Werror",
+ ],
+ installable: false, // installed in APEX
+ relative_install_path: "hw",
+ shared_libs: [
+ "android.hardware.gatekeeper-V1-ndk",
+ "android.hardware.security.sharedsecret-V1-ndk",
+ "lib_android_keymaster_keymint_utils",
+ "libbase",
+ "libbinder_ndk",
+ "libcrypto",
+ "libcutils",
+ "libgatekeeper",
+ "libhardware",
+ "libkeymaster_portable",
+ "liblog",
+ "libutils",
+ ],
+ srcs: [
+ "GateKeeper.cpp",
+ "SharedSecret.cpp",
+ "service.cpp",
+ ],
+ static_libs: ["libscrypt_static"],
+ vendor: true,
+}
+
+prebuilt_etc {
+ name: "gatekeeper_nonsecure_vintf",
+ srcs: [
+ "android.hardware.gatekeeper-service.nonsecure.xml",
+ "android.hardware.security.sharedsecret-gatekeeper.xml",
+ ],
+ sub_dir: "vintf",
+ installable: false,
+}
+
+prebuilt_etc {
+ name: "android.hardware.gatekeeper-service.nonsecure.rc",
+ src: "android.hardware.gatekeeper-service.nonsecure.rc",
+ installable: false,
+}
+
+apex {
+ name: "com.android.hardware.gatekeeper.nonsecure",
+ binaries: ["android.hardware.gatekeeper-service.nonsecure"],
+ certificate: ":com.google.cf.apex.certificate",
+ file_contexts: "file_contexts",
+ key: "com.google.cf.apex.key",
+ manifest: "manifest.json",
+ prebuilts: [
+ "gatekeeper_nonsecure_vintf",
+ "android.hardware.gatekeeper-service.nonsecure.rc",
+ ],
+ updatable: false,
+ vendor: true,
+}
diff --git a/gatekeeper/aidl/software/GateKeeper.cpp b/gatekeeper/aidl/software/GateKeeper.cpp
new file mode 100644
index 0000000..1fc3682
--- /dev/null
+++ b/gatekeeper/aidl/software/GateKeeper.cpp
@@ -0,0 +1,149 @@
+/*
+ * Copyright (C) 2016 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 "android.hardware.gatekeeper-service.nonsecure"
+
+#include <endian.h>
+
+#include <android-base/logging.h>
+
+#include "GateKeeper.h"
+
+using ::gatekeeper::EnrollRequest;
+using ::gatekeeper::EnrollResponse;
+using ::gatekeeper::ERROR_NONE;
+using ::gatekeeper::ERROR_RETRY;
+using ::gatekeeper::SizedBuffer;
+using ::gatekeeper::VerifyRequest;
+using ::gatekeeper::VerifyResponse;
+
+namespace aidl::android::hardware::gatekeeper {
+
+SizedBuffer vec2sized_buffer(const std::vector<uint8_t>& vec) {
+ if (vec.size() == 0 || vec.size() > std::numeric_limits<uint32_t>::max()) {
+ return {};
+ }
+ auto unused = new uint8_t[vec.size()];
+ std::copy(vec.begin(), vec.end(), unused);
+ return {unused, static_cast<uint32_t>(vec.size())};
+}
+
+void sizedBuffer2AidlHWToken(SizedBuffer& buffer,
+ android::hardware::security::keymint::HardwareAuthToken* aidlToken) {
+ const hw_auth_token_t* authToken =
+ reinterpret_cast<const hw_auth_token_t*>(buffer.Data<uint8_t>());
+ aidlToken->challenge = authToken->challenge;
+ aidlToken->userId = authToken->user_id;
+ aidlToken->authenticatorId = authToken->authenticator_id;
+ // these are in network order: translate to host
+ aidlToken->authenticatorType =
+ static_cast<android::hardware::security::keymint::HardwareAuthenticatorType>(
+ be32toh(authToken->authenticator_type));
+ aidlToken->timestamp.milliSeconds = be64toh(authToken->timestamp);
+ aidlToken->mac.insert(aidlToken->mac.begin(), std::begin(authToken->hmac),
+ std::end(authToken->hmac));
+}
+
+SoftGateKeeperDevice::SoftGateKeeperDevice(::gatekeeper::SoftGateKeeper& impl) : impl_(impl) {}
+
+::ndk::ScopedAStatus SoftGateKeeperDevice::enroll(int32_t uid,
+ const std::vector<uint8_t>& currentPasswordHandle,
+ const std::vector<uint8_t>& currentPassword,
+ const std::vector<uint8_t>& desiredPassword,
+ GatekeeperEnrollResponse* rsp) {
+ if (desiredPassword.size() == 0) {
+ LOG(ERROR) << "Desired password size is 0";
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(ERROR_GENERAL_FAILURE));
+ }
+
+ if (currentPasswordHandle.size() > 0) {
+ if (currentPasswordHandle.size() != sizeof(::gatekeeper::password_handle_t)) {
+ LOG(ERROR) << "Password handle has wrong length";
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(ERROR_GENERAL_FAILURE));
+ }
+ }
+
+ EnrollRequest request(uid, vec2sized_buffer(currentPasswordHandle),
+ vec2sized_buffer(desiredPassword), vec2sized_buffer(currentPassword));
+ EnrollResponse response;
+ impl_.Enroll(request, &response);
+ if (response.error == ERROR_RETRY) {
+ LOG(ERROR) << "Enroll response has a retry error";
+ *rsp = {ERROR_RETRY_TIMEOUT, static_cast<int32_t>(response.retry_timeout), 0, {}};
+ return ndk::ScopedAStatus::ok();
+ } else if (response.error != ERROR_NONE) {
+ LOG(ERROR) << "Enroll response has an error: " << response.error;
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(ERROR_GENERAL_FAILURE));
+ } else {
+ const ::gatekeeper::password_handle_t* password_handle =
+ response.enrolled_password_handle.Data<::gatekeeper::password_handle_t>();
+ *rsp = {STATUS_OK,
+ 0,
+ static_cast<int64_t>(password_handle->user_id),
+ {response.enrolled_password_handle.Data<uint8_t>(),
+ (response.enrolled_password_handle.Data<uint8_t>() +
+ response.enrolled_password_handle.size())}};
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus SoftGateKeeperDevice::verify(
+ int32_t uid, int64_t challenge, const std::vector<uint8_t>& enrolledPasswordHandle,
+ const std::vector<uint8_t>& providedPassword, GatekeeperVerifyResponse* rsp) {
+ if (enrolledPasswordHandle.size() == 0) {
+ LOG(ERROR) << "Enrolled password size is 0";
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(ERROR_GENERAL_FAILURE));
+ }
+
+ if (enrolledPasswordHandle.size() > 0) {
+ if (enrolledPasswordHandle.size() != sizeof(::gatekeeper::password_handle_t)) {
+ LOG(ERROR) << "Password handle has wrong length";
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(ERROR_GENERAL_FAILURE));
+ }
+ }
+
+ VerifyRequest request(uid, challenge, vec2sized_buffer(enrolledPasswordHandle),
+ vec2sized_buffer(providedPassword));
+ VerifyResponse response;
+ impl_.Verify(request, &response);
+
+ if (response.error == ERROR_RETRY) {
+ LOG(ERROR) << "Verify request response gave retry error";
+ *rsp = {ERROR_RETRY_TIMEOUT, static_cast<int32_t>(response.retry_timeout), {}};
+ return ndk::ScopedAStatus::ok();
+ } else if (response.error != ERROR_NONE) {
+ LOG(ERROR) << "Verify request response gave error: " << response.error;
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(ERROR_GENERAL_FAILURE));
+ } else {
+ // On Success, return GatekeeperVerifyResponse with Success Status, timeout{0} and
+ // valid HardwareAuthToken.
+ *rsp = {response.request_reenroll ? STATUS_REENROLL : STATUS_OK, 0, {}};
+ // Convert the hw_auth_token_t to HardwareAuthToken in the response.
+ sizedBuffer2AidlHWToken(response.auth_token, &rsp->hardwareAuthToken);
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus SoftGateKeeperDevice::deleteUser(int32_t /*uid*/) {
+ LOG(ERROR) << "deleteUser is unimplemented";
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(ERROR_NOT_IMPLEMENTED));
+}
+
+::ndk::ScopedAStatus SoftGateKeeperDevice::deleteAllUsers() {
+ LOG(ERROR) << "deleteAllUsers is unimplemented";
+ return ndk::ScopedAStatus(AStatus_fromServiceSpecificError(ERROR_NOT_IMPLEMENTED));
+}
+
+} // namespace aidl::android::hardware::gatekeeper
diff --git a/gatekeeper/aidl/software/GateKeeper.h b/gatekeeper/aidl/software/GateKeeper.h
new file mode 100644
index 0000000..1327fad
--- /dev/null
+++ b/gatekeeper/aidl/software/GateKeeper.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2014 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 <aidl/android/hardware/gatekeeper/BnGatekeeper.h>
+#include <gatekeeper/gatekeeper_messages.h>
+
+#include "SoftGateKeeper.h"
+
+namespace aidl::android::hardware::gatekeeper {
+
+class SoftGateKeeperDevice : public BnGatekeeper {
+ public:
+ SoftGateKeeperDevice(::gatekeeper::SoftGateKeeper&);
+ /**
+ * Enrolls password_payload, which should be derived from a user selected pin
+ * or password, with the authentication factor private key used only for
+ * enrolling authentication factor data.
+ *
+ * Returns: 0 on success or an error code less than 0 on error.
+ * On error, enrolled_password_handle will not be allocated.
+ */
+ ::ndk::ScopedAStatus enroll(int32_t uid, const std::vector<uint8_t>& currentPasswordHandle,
+ const std::vector<uint8_t>& currentPassword,
+ const std::vector<uint8_t>& desiredPassword,
+ GatekeeperEnrollResponse* _aidl_return) override;
+ /**
+ * Verifies provided_password matches enrolled_password_handle.
+ *
+ * Implementations of this module may retain the result of this call
+ * to attest to the recency of authentication.
+ *
+ * On success, writes the address of a verification token to auth_token,
+ * usable to attest password verification to other trusted services. Clients
+ * may pass NULL for this value.
+ *
+ * Returns: 0 on success or an error code less than 0 on error
+ * On error, verification token will not be allocated
+ */
+ ::ndk::ScopedAStatus verify(int32_t uid, int64_t challenge,
+ const std::vector<uint8_t>& enrolledPasswordHandle,
+ const std::vector<uint8_t>& providedPassword,
+ GatekeeperVerifyResponse* _aidl_return) override;
+
+ ::ndk::ScopedAStatus deleteAllUsers() override;
+
+ ::ndk::ScopedAStatus deleteUser(int32_t uid) override;
+
+ private:
+ ::gatekeeper::SoftGateKeeper& impl_;
+};
+
+} // namespace aidl::android::hardware::gatekeeper
diff --git a/gatekeeper/aidl/software/SharedSecret.cpp b/gatekeeper/aidl/software/SharedSecret.cpp
new file mode 100644
index 0000000..f693700
--- /dev/null
+++ b/gatekeeper/aidl/software/SharedSecret.cpp
@@ -0,0 +1,131 @@
+/*
+ * Copyright 2024, 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 "SharedSecret.h"
+
+#include <algorithm>
+#include <cstring>
+#include <mutex>
+#include <vector>
+
+#include <openssl/rand.h>
+
+#include <KeyMintUtils.h>
+#include <aidl/android/hardware/security/sharedsecret/BnSharedSecret.h>
+#include <aidl/android/hardware/security/sharedsecret/SharedSecretParameters.h>
+#include <android-base/logging.h>
+#include <keymaster/android_keymaster_messages.h>
+#include <keymaster/android_keymaster_utils.h>
+#include <keymaster/km_openssl/ckdf.h>
+#include <keymaster/km_openssl/hmac.h>
+
+namespace aidl::android::hardware::security::sharedsecret {
+
+::ndk::ScopedAStatus SoftSharedSecret::getSharedSecretParameters(
+ SharedSecretParameters* out_params) {
+ std::lock_guard lock(mutex_);
+ if (seed_.empty()) {
+ seed_.resize(32, 0);
+ }
+ out_params->seed = seed_;
+ if (nonce_.empty()) {
+ nonce_.resize(32, 0);
+ RAND_bytes(nonce_.data(), 32);
+ }
+ out_params->nonce = nonce_;
+ LOG(INFO) << "Presented shared secret parameters with seed size " << out_params->seed.size()
+ << " and nonce size " << out_params->nonce.size();
+ return ::ndk::ScopedAStatus::ok();
+}
+
+::ndk::ScopedAStatus SoftSharedSecret::computeSharedSecret(
+ const std::vector<SharedSecretParameters>& params, std::vector<uint8_t>* sharing_check) {
+ std::lock_guard lock(mutex_);
+ LOG(INFO) << "Computing shared secret";
+ // Reimplemented based on SoftKeymasterEnforcement, which does not expose
+ // enough functionality to satisfy the GateKeeper interface
+ keymaster::KeymasterKeyBlob key_agreement_key;
+ if (key_agreement_key.Reset(32) == nullptr) {
+ LOG(ERROR) << "key agreement key memory allocation failed";
+ return keymint::km_utils::kmError2ScopedAStatus(KM_ERROR_MEMORY_ALLOCATION_FAILED);
+ }
+ // Matching:
+ // - kFakeAgreementKey in system/keymaster/km_openssl/soft_keymaster_enforcement.cpp
+ // - Keys::kak in hardware/interfaces/security/keymint/aidl/default/ta/soft.rs
+ std::memset(key_agreement_key.writable_data(), 0, 32);
+ keymaster::KeymasterBlob label((uint8_t*)KEY_AGREEMENT_LABEL, strlen(KEY_AGREEMENT_LABEL));
+ if (label.data == nullptr) {
+ LOG(ERROR) << "label memory allocation failed";
+ return keymint::km_utils::kmError2ScopedAStatus(KM_ERROR_MEMORY_ALLOCATION_FAILED);
+ }
+
+ static_assert(sizeof(keymaster_blob_t) == sizeof(keymaster::KeymasterBlob));
+
+ bool found_mine = false;
+ std::vector<keymaster::KeymasterBlob> context_blobs;
+ for (const auto& param : params) {
+ auto& seed_blob = context_blobs.emplace_back();
+ if (seed_blob.Reset(param.seed.size()) == nullptr) {
+ LOG(ERROR) << "seed memory allocation failed";
+ return keymint::km_utils::kmError2ScopedAStatus(KM_ERROR_MEMORY_ALLOCATION_FAILED);
+ }
+ std::copy(param.seed.begin(), param.seed.end(), seed_blob.writable_data());
+ auto& nonce_blob = context_blobs.emplace_back();
+ if (nonce_blob.Reset(param.nonce.size()) == nullptr) {
+ LOG(ERROR) << "Nonce memory allocation failed";
+ return keymint::km_utils::kmError2ScopedAStatus(KM_ERROR_MEMORY_ALLOCATION_FAILED);
+ }
+ std::copy(param.nonce.begin(), param.nonce.end(), nonce_blob.writable_data());
+ if (param.seed == seed_ && param.nonce == nonce_) {
+ found_mine = true;
+ }
+ }
+ if (!found_mine) {
+ LOG(ERROR) << "Did not receive my own shared secret parameter back";
+ return keymint::km_utils::kmError2ScopedAStatus(KM_ERROR_INVALID_ARGUMENT);
+ }
+ auto context_blobs_ptr = reinterpret_cast<keymaster_blob_t*>(context_blobs.data());
+ if (hmac_key_.Reset(32) == nullptr) {
+ LOG(ERROR) << "hmac key allocation failed";
+ return keymint::km_utils::kmError2ScopedAStatus(KM_ERROR_MEMORY_ALLOCATION_FAILED);
+ }
+ auto error = keymaster::ckdf(key_agreement_key, label, context_blobs_ptr, context_blobs.size(),
+ &hmac_key_);
+ if (error != KM_ERROR_OK) {
+ LOG(ERROR) << "CKDF failed";
+ return keymint::km_utils::kmError2ScopedAStatus(error);
+ }
+
+ keymaster::HmacSha256 hmac_impl;
+ if (!hmac_impl.Init(hmac_key_.key_material, hmac_key_.key_material_size)) {
+ LOG(ERROR) << "hmac initialization failed";
+ return ::ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+ }
+ sharing_check->clear();
+ sharing_check->resize(32, 0);
+ if (!hmac_impl.Sign((const uint8_t*)KEY_CHECK_LABEL, strlen(KEY_CHECK_LABEL),
+ sharing_check->data(), sharing_check->size())) {
+ return ::ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_STATE);
+ }
+ return ::ndk::ScopedAStatus::ok();
+}
+
+keymaster::KeymasterKeyBlob SoftSharedSecret::HmacKey() const {
+ std::lock_guard lock(mutex_);
+ return hmac_key_;
+}
+
+} // namespace aidl::android::hardware::security::sharedsecret
diff --git a/gatekeeper/aidl/software/SharedSecret.h b/gatekeeper/aidl/software/SharedSecret.h
new file mode 100644
index 0000000..1b804e7
--- /dev/null
+++ b/gatekeeper/aidl/software/SharedSecret.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2020, 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 <cstdint>
+#include <mutex>
+
+#include <aidl/android/hardware/security/sharedsecret/BnSharedSecret.h>
+#include <aidl/android/hardware/security/sharedsecret/SharedSecretParameters.h>
+#include <keymaster/km_openssl/soft_keymaster_enforcement.h>
+
+namespace aidl::android::hardware::security::sharedsecret {
+
+class SoftSharedSecret : public BnSharedSecret {
+ public:
+ ::ndk::ScopedAStatus getSharedSecretParameters(SharedSecretParameters* params) override;
+ ::ndk::ScopedAStatus computeSharedSecret(const std::vector<SharedSecretParameters>& params,
+ std::vector<uint8_t>* sharingCheck) override;
+
+ keymaster::KeymasterKeyBlob HmacKey() const;
+
+ private:
+ mutable std::mutex mutex_;
+ std::vector<std::uint8_t> seed_;
+ std::vector<std::uint8_t> nonce_;
+ keymaster::KeymasterKeyBlob hmac_key_;
+};
+
+} // namespace aidl::android::hardware::security::sharedsecret
diff --git a/gatekeeper/aidl/software/SoftGateKeeper.h b/gatekeeper/aidl/software/SoftGateKeeper.h
new file mode 100644
index 0000000..305d997
--- /dev/null
+++ b/gatekeeper/aidl/software/SoftGateKeeper.h
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2015 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 SOFT_GATEKEEPER_H_
+#define SOFT_GATEKEEPER_H_
+
+extern "C" {
+#include <openssl/rand.h>
+#include <openssl/sha.h>
+
+#include <crypto_scrypt.h>
+}
+
+#include <memory>
+#include <unordered_map>
+
+#include <android-base/logging.h>
+#include <android-base/memory.h>
+#include <gatekeeper/gatekeeper.h>
+#include <keymaster/km_openssl/hmac.h>
+
+#include "SharedSecret.h"
+
+namespace gatekeeper {
+
+struct fast_hash_t {
+ uint64_t salt;
+ uint8_t digest[SHA256_DIGEST_LENGTH];
+};
+
+class SoftGateKeeper : public GateKeeper {
+ public:
+ static const uint32_t SIGNATURE_LENGTH_BYTES = 32;
+
+ // scrypt params
+ static const uint64_t N = 16384;
+ static const uint32_t r = 8;
+ static const uint32_t p = 1;
+
+ static const int MAX_UINT_32_CHARS = 11;
+
+ SoftGateKeeper(const ::aidl::android::hardware::security::sharedsecret::SoftSharedSecret&
+ shared_secret)
+ : shared_secret_(shared_secret) {
+ key_.reset(new uint8_t[SIGNATURE_LENGTH_BYTES]);
+ memset(key_.get(), 0, SIGNATURE_LENGTH_BYTES);
+ }
+
+ virtual ~SoftGateKeeper() {}
+
+ virtual bool GetAuthTokenKey(const uint8_t** auth_token_key, uint32_t* length) const {
+ if (auth_token_key == NULL || length == NULL) return false;
+ if (hmac_key_.key_material == nullptr) {
+ hmac_key_ = shared_secret_.HmacKey();
+ }
+ *auth_token_key = hmac_key_.key_material;
+ *length = hmac_key_.key_material_size;
+ return true;
+ }
+
+ virtual void GetPasswordKey(const uint8_t** password_key, uint32_t* length) {
+ if (password_key == NULL || length == NULL) return;
+ *password_key = key_.get();
+ *length = SIGNATURE_LENGTH_BYTES;
+ }
+
+ virtual void ComputePasswordSignature(uint8_t* signature, uint32_t signature_length,
+ const uint8_t*, uint32_t, const uint8_t* password,
+ uint32_t password_length, salt_t salt) const {
+ if (signature == NULL) return;
+ crypto_scrypt(password, password_length, reinterpret_cast<uint8_t*>(&salt), sizeof(salt), N,
+ r, p, signature, signature_length);
+ }
+
+ virtual void GetRandom(void* random, uint32_t requested_length) const {
+ if (random == NULL) return;
+ RAND_pseudo_bytes((uint8_t*)random, requested_length);
+ }
+
+ virtual void ComputeSignature(uint8_t* signature, uint32_t signature_length, const uint8_t* key,
+ uint32_t key_length, const uint8_t* message,
+ const uint32_t message_length) const {
+ if (signature == NULL) return;
+ keymaster::HmacSha256 hmac_calculator;
+ if (!hmac_calculator.Init(key, key_length)) {
+ LOG(ERROR) << "ComputeSignature: Failed to initialize hmac calculator";
+ return;
+ }
+ if (!hmac_calculator.Sign(message, message_length, signature, signature_length)) {
+ LOG(ERROR) << "ComputeSignature: failed to create hmac";
+ }
+ }
+
+ virtual uint64_t GetMillisecondsSinceBoot() const {
+ struct timespec time;
+ int res = clock_gettime(CLOCK_BOOTTIME, &time);
+ if (res < 0) return 0;
+ return (time.tv_sec * 1000) + (time.tv_nsec / 1000 / 1000);
+ }
+
+ virtual bool IsHardwareBacked() const { return false; }
+
+ virtual bool GetFailureRecord(uint32_t uid, secure_id_t user_id, failure_record_t* record,
+ bool /* secure */) {
+ failure_record_t* stored = &failure_map_[uid];
+ if (user_id != stored->secure_user_id) {
+ stored->secure_user_id = user_id;
+ stored->last_checked_timestamp = 0;
+ stored->failure_counter = 0;
+ }
+ memcpy(record, stored, sizeof(*record));
+ return true;
+ }
+
+ virtual bool ClearFailureRecord(uint32_t uid, secure_id_t user_id, bool /* secure */) {
+ failure_record_t* stored = &failure_map_[uid];
+ stored->secure_user_id = user_id;
+ stored->last_checked_timestamp = 0;
+ stored->failure_counter = 0;
+ return true;
+ }
+
+ virtual bool WriteFailureRecord(uint32_t uid, failure_record_t* record, bool /* secure */) {
+ failure_map_[uid] = *record;
+ return true;
+ }
+
+ fast_hash_t ComputeFastHash(const SizedBuffer& password, uint64_t salt) {
+ fast_hash_t fast_hash;
+ size_t digest_size = password.size() + sizeof(salt);
+ std::unique_ptr<uint8_t[]> digest(new uint8_t[digest_size]);
+ memcpy(digest.get(), &salt, sizeof(salt));
+ memcpy(digest.get() + sizeof(salt), password.Data<uint8_t>(), password.size());
+
+ SHA256(digest.get(), digest_size, (uint8_t*)&fast_hash.digest);
+
+ fast_hash.salt = salt;
+ return fast_hash;
+ }
+
+ bool VerifyFast(const fast_hash_t& fast_hash, const SizedBuffer& password) {
+ fast_hash_t computed = ComputeFastHash(password, fast_hash.salt);
+ return memcmp(computed.digest, fast_hash.digest, SHA256_DIGEST_LENGTH) == 0;
+ }
+
+ bool DoVerify(const password_handle_t* expected_handle, const SizedBuffer& password) {
+ uint64_t user_id = android::base::get_unaligned<secure_id_t>(&expected_handle->user_id);
+ FastHashMap::const_iterator it = fast_hash_map_.find(user_id);
+ if (it != fast_hash_map_.end() && VerifyFast(it->second, password)) {
+ return true;
+ } else {
+ if (GateKeeper::DoVerify(expected_handle, password)) {
+ uint64_t salt;
+ GetRandom(&salt, sizeof(salt));
+ fast_hash_map_[user_id] = ComputeFastHash(password, salt);
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ private:
+ typedef std::unordered_map<uint32_t, failure_record_t> FailureRecordMap;
+ typedef std::unordered_map<uint64_t, fast_hash_t> FastHashMap;
+
+ const ::aidl::android::hardware::security::sharedsecret::SoftSharedSecret& shared_secret_;
+ std::unique_ptr<uint8_t[]> key_;
+ FailureRecordMap failure_map_;
+ FastHashMap fast_hash_map_;
+ mutable ::keymaster::KeymasterKeyBlob hmac_key_;
+};
+} // namespace gatekeeper
+
+#endif // SOFT_GATEKEEPER_H_
diff --git a/gatekeeper/aidl/software/android.hardware.gatekeeper-service.nonsecure.rc b/gatekeeper/aidl/software/android.hardware.gatekeeper-service.nonsecure.rc
new file mode 100644
index 0000000..d361730
--- /dev/null
+++ b/gatekeeper/aidl/software/android.hardware.gatekeeper-service.nonsecure.rc
@@ -0,0 +1,4 @@
+service vendor.gatekeeper_nonsecure /apex/com.android.hardware.gatekeeper/bin/hw/android.hardware.gatekeeper-service.nonsecure
+ class early_hal
+ user system
+ group system
diff --git a/gatekeeper/aidl/software/android.hardware.gatekeeper-service.nonsecure.xml b/gatekeeper/aidl/software/android.hardware.gatekeeper-service.nonsecure.xml
new file mode 100644
index 0000000..c35421e
--- /dev/null
+++ b/gatekeeper/aidl/software/android.hardware.gatekeeper-service.nonsecure.xml
@@ -0,0 +1,10 @@
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.gatekeeper</name>
+ <version>1</version>
+ <interface>
+ <name>IGatekeeper</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+</manifest>
diff --git a/gatekeeper/aidl/software/android.hardware.security.sharedsecret-gatekeeper.xml b/gatekeeper/aidl/software/android.hardware.security.sharedsecret-gatekeeper.xml
new file mode 100644
index 0000000..5d94985
--- /dev/null
+++ b/gatekeeper/aidl/software/android.hardware.security.sharedsecret-gatekeeper.xml
@@ -0,0 +1,6 @@
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.security.sharedsecret</name>
+ <fqname>ISharedSecret/gatekeeper</fqname>
+ </hal>
+</manifest>
diff --git a/gatekeeper/aidl/software/file_contexts b/gatekeeper/aidl/software/file_contexts
new file mode 100644
index 0000000..23a62ea
--- /dev/null
+++ b/gatekeeper/aidl/software/file_contexts
@@ -0,0 +1,3 @@
+(/.*)? u:object_r:vendor_file:s0
+/etc(/.*)? u:object_r:vendor_configs_file:s0
+/bin/hw/android\.hardware\.gatekeeper-service\.nonsecure u:object_r:hal_gatekeeper_remote_exec:s0
diff --git a/gatekeeper/aidl/software/manifest.json b/gatekeeper/aidl/software/manifest.json
new file mode 100644
index 0000000..d0def36
--- /dev/null
+++ b/gatekeeper/aidl/software/manifest.json
@@ -0,0 +1,5 @@
+{
+ "name": "com.android.hardware.gatekeeper",
+ "version": 1,
+ "vendorBootstrap": true
+}
diff --git a/gatekeeper/aidl/software/service.cpp b/gatekeeper/aidl/software/service.cpp
new file mode 100644
index 0000000..beef8c4
--- /dev/null
+++ b/gatekeeper/aidl/software/service.cpp
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2016 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 "android.hardware.gatekeeper-service.nonsecure"
+
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <cutils/properties.h>
+
+#include "GateKeeper.h"
+#include "SharedSecret.h"
+#include "SoftGateKeeper.h"
+
+using aidl::android::hardware::gatekeeper::SoftGateKeeperDevice;
+using aidl::android::hardware::security::sharedsecret::SoftSharedSecret;
+
+int main(int, char** argv) {
+ ::android::base::InitLogging(argv, ::android::base::KernelLogger);
+ ABinderProcess_setThreadPoolMaxThreadCount(0);
+
+ auto secret = ndk::SharedRefBase::make<SoftSharedSecret>();
+ std::string secret_instance = SoftSharedSecret::descriptor + std::string("/gatekeeper");
+ auto status = AServiceManager_addService(secret->asBinder().get(), secret_instance.c_str());
+ CHECK_EQ(status, STATUS_OK);
+
+ ::gatekeeper::SoftGateKeeper implementation(*secret);
+ auto gatekeeper = ndk::SharedRefBase::make<SoftGateKeeperDevice>(implementation);
+ const std::string instance = SoftGateKeeperDevice::descriptor + std::string("/default");
+ status = AServiceManager_addService(gatekeeper->asBinder().get(), instance.c_str());
+ CHECK_EQ(status, STATUS_OK);
+
+ ABinderProcess_joinThreadPool();
+ return -1; // Should never get here.
+}
diff --git a/gnss/1.1/default/Android.bp b/gnss/1.1/default/Android.bp
index 300e8de..697cb91 100644
--- a/gnss/1.1/default/Android.bp
+++ b/gnss/1.1/default/Android.bp
@@ -27,7 +27,7 @@
"android.hardware.gnss@2.0",
"android.hardware.gnss@1.1",
"android.hardware.gnss@1.0",
- "android.hardware.gnss-V3-ndk",
+ "android.hardware.gnss-V4-ndk",
],
static_libs: [
"android.hardware.gnss@common-default-lib",
diff --git a/gnss/1.1/vts/functional/Android.bp b/gnss/1.1/vts/functional/Android.bp
index 2414cbc..f9fcbf1 100644
--- a/gnss/1.1/vts/functional/Android.bp
+++ b/gnss/1.1/vts/functional/Android.bp
@@ -36,7 +36,7 @@
"android.hardware.gnss@1.1",
"android.hardware.gnss@2.0",
"android.hardware.gnss@common-vts-lib",
- "android.hardware.gnss-V3-cpp",
+ "android.hardware.gnss-V4-cpp",
],
shared_libs: [
"android.hardware.gnss.measurement_corrections@1.0",
diff --git a/gnss/1.1/vts/functional/gnss_hal_test.cpp b/gnss/1.1/vts/functional/gnss_hal_test.cpp
index 6663a19..5ec9806 100644
--- a/gnss/1.1/vts/functional/gnss_hal_test.cpp
+++ b/gnss/1.1/vts/functional/gnss_hal_test.cpp
@@ -168,8 +168,7 @@
manager->listManifestByInterface(
"android.hardware.gnss@1.1::IGnss",
[&hasGnssHalVersion_1_1](const hidl_vec<hidl_string>& registered) {
- ASSERT_EQ(1, registered.size());
- hasGnssHalVersion_1_1 = true;
+ hasGnssHalVersion_1_1 = registered.size() != 0;
});
bool hasGnssHalVersion_2_0 = false;
diff --git a/gnss/2.0/default/Android.bp b/gnss/2.0/default/Android.bp
index 83bc2cc..35c2e37 100644
--- a/gnss/2.0/default/Android.bp
+++ b/gnss/2.0/default/Android.bp
@@ -50,7 +50,7 @@
"android.hardware.gnss@2.0",
"android.hardware.gnss@1.1",
"android.hardware.gnss@1.0",
- "android.hardware.gnss-V3-ndk",
+ "android.hardware.gnss-V4-ndk",
],
static_libs: [
"android.hardware.gnss@common-default-lib",
diff --git a/gnss/2.0/vts/functional/Android.bp b/gnss/2.0/vts/functional/Android.bp
index e8db886..0b54308 100644
--- a/gnss/2.0/vts/functional/Android.bp
+++ b/gnss/2.0/vts/functional/Android.bp
@@ -39,7 +39,7 @@
"android.hardware.gnss@2.0",
"android.hardware.gnss@2.1",
"android.hardware.gnss@common-vts-lib",
- "android.hardware.gnss-V3-cpp",
+ "android.hardware.gnss-V4-cpp",
],
test_suites: [
"general-tests",
diff --git a/gnss/2.1/default/Android.bp b/gnss/2.1/default/Android.bp
index 4a4ce54..1bb7512 100644
--- a/gnss/2.1/default/Android.bp
+++ b/gnss/2.1/default/Android.bp
@@ -44,7 +44,7 @@
"android.hardware.gnss@1.0",
"android.hardware.gnss@1.1",
"android.hardware.gnss@2.0",
- "android.hardware.gnss-V3-ndk",
+ "android.hardware.gnss-V4-ndk",
],
static_libs: [
"android.hardware.gnss@common-default-lib",
diff --git a/gnss/2.1/vts/functional/Android.bp b/gnss/2.1/vts/functional/Android.bp
index 76f9d07..9906b27 100644
--- a/gnss/2.1/vts/functional/Android.bp
+++ b/gnss/2.1/vts/functional/Android.bp
@@ -40,7 +40,7 @@
"android.hardware.gnss@2.0",
"android.hardware.gnss@2.1",
"android.hardware.gnss@common-vts-lib",
- "android.hardware.gnss-V3-cpp",
+ "android.hardware.gnss-V4-cpp",
],
shared_libs: [
"libvintf",
diff --git a/gnss/aidl/Android.bp b/gnss/aidl/Android.bp
index cb2c001..611c7e0 100644
--- a/gnss/aidl/Android.bp
+++ b/gnss/aidl/Android.bp
@@ -52,6 +52,6 @@
},
],
- frozen: true,
+ frozen: false,
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/ElapsedRealtime.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/ElapsedRealtime.aidl
index 559ed29..5d7f51e 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/ElapsedRealtime.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/ElapsedRealtime.aidl
@@ -38,6 +38,6 @@
int flags;
long timestampNs;
double timeUncertaintyNs;
- const int HAS_TIMESTAMP_NS = 1;
- const int HAS_TIME_UNCERTAINTY_NS = 2;
+ const int HAS_TIMESTAMP_NS = (1 << 0) /* 1 */;
+ const int HAS_TIME_UNCERTAINTY_NS = (1 << 1) /* 2 */;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssClock.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssClock.aidl
index a8454dd..63edd44 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssClock.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssClock.aidl
@@ -46,11 +46,11 @@
double driftUncertaintyNsps;
int hwClockDiscontinuityCount;
android.hardware.gnss.GnssSignalType referenceSignalTypeForIsb;
- const int HAS_LEAP_SECOND = 1;
- const int HAS_TIME_UNCERTAINTY = 2;
- const int HAS_FULL_BIAS = 4;
- const int HAS_BIAS = 8;
- const int HAS_BIAS_UNCERTAINTY = 16;
- const int HAS_DRIFT = 32;
- const int HAS_DRIFT_UNCERTAINTY = 64;
+ const int HAS_LEAP_SECOND = (1 << 0) /* 1 */;
+ const int HAS_TIME_UNCERTAINTY = (1 << 1) /* 2 */;
+ const int HAS_FULL_BIAS = (1 << 2) /* 4 */;
+ const int HAS_BIAS = (1 << 3) /* 8 */;
+ const int HAS_BIAS_UNCERTAINTY = (1 << 4) /* 16 */;
+ const int HAS_DRIFT = (1 << 5) /* 32 */;
+ const int HAS_DRIFT_UNCERTAINTY = (1 << 6) /* 64 */;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssLocation.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssLocation.aidl
index ed9dcfa..e64d98a 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssLocation.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssLocation.aidl
@@ -47,12 +47,12 @@
double bearingAccuracyDegrees;
long timestampMillis;
android.hardware.gnss.ElapsedRealtime elapsedRealtime;
- const int HAS_LAT_LONG = 1;
- const int HAS_ALTITUDE = 2;
- const int HAS_SPEED = 4;
- const int HAS_BEARING = 8;
- const int HAS_HORIZONTAL_ACCURACY = 16;
- const int HAS_VERTICAL_ACCURACY = 32;
- const int HAS_SPEED_ACCURACY = 64;
- const int HAS_BEARING_ACCURACY = 128;
+ const int HAS_LAT_LONG = 0x0001;
+ const int HAS_ALTITUDE = 0x0002;
+ const int HAS_SPEED = 0x0004;
+ const int HAS_BEARING = 0x0008;
+ const int HAS_HORIZONTAL_ACCURACY = 0x0010;
+ const int HAS_VERTICAL_ACCURACY = 0x0020;
+ const int HAS_SPEED_ACCURACY = 0x0040;
+ const int HAS_BEARING_ACCURACY = 0x0080;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssMeasurement.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssMeasurement.aidl
index 8a44887..a2594af 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssMeasurement.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssMeasurement.aidl
@@ -61,39 +61,39 @@
double satelliteInterSignalBiasUncertaintyNs;
android.hardware.gnss.SatellitePvt satellitePvt;
android.hardware.gnss.CorrelationVector[] correlationVectors;
- const int HAS_SNR = 1;
- const int HAS_CARRIER_FREQUENCY = 512;
- const int HAS_CARRIER_CYCLES = 1024;
- const int HAS_CARRIER_PHASE = 2048;
- const int HAS_CARRIER_PHASE_UNCERTAINTY = 4096;
- const int HAS_AUTOMATIC_GAIN_CONTROL = 8192;
- const int HAS_FULL_ISB = 65536;
- const int HAS_FULL_ISB_UNCERTAINTY = 131072;
- const int HAS_SATELLITE_ISB = 262144;
- const int HAS_SATELLITE_ISB_UNCERTAINTY = 524288;
- const int HAS_SATELLITE_PVT = 1048576;
- const int HAS_CORRELATION_VECTOR = 2097152;
+ const int HAS_SNR = (1 << 0) /* 1 */;
+ const int HAS_CARRIER_FREQUENCY = (1 << 9) /* 512 */;
+ const int HAS_CARRIER_CYCLES = (1 << 10) /* 1024 */;
+ const int HAS_CARRIER_PHASE = (1 << 11) /* 2048 */;
+ const int HAS_CARRIER_PHASE_UNCERTAINTY = (1 << 12) /* 4096 */;
+ const int HAS_AUTOMATIC_GAIN_CONTROL = (1 << 13) /* 8192 */;
+ const int HAS_FULL_ISB = (1 << 16) /* 65536 */;
+ const int HAS_FULL_ISB_UNCERTAINTY = (1 << 17) /* 131072 */;
+ const int HAS_SATELLITE_ISB = (1 << 18) /* 262144 */;
+ const int HAS_SATELLITE_ISB_UNCERTAINTY = (1 << 19) /* 524288 */;
+ const int HAS_SATELLITE_PVT = (1 << 20) /* 1048576 */;
+ const int HAS_CORRELATION_VECTOR = (1 << 21) /* 2097152 */;
const int STATE_UNKNOWN = 0;
- const int STATE_CODE_LOCK = 1;
- const int STATE_BIT_SYNC = 2;
- const int STATE_SUBFRAME_SYNC = 4;
- const int STATE_TOW_DECODED = 8;
- const int STATE_MSEC_AMBIGUOUS = 16;
- const int STATE_SYMBOL_SYNC = 32;
- const int STATE_GLO_STRING_SYNC = 64;
- const int STATE_GLO_TOD_DECODED = 128;
- const int STATE_BDS_D2_BIT_SYNC = 256;
- const int STATE_BDS_D2_SUBFRAME_SYNC = 512;
- const int STATE_GAL_E1BC_CODE_LOCK = 1024;
- const int STATE_GAL_E1C_2ND_CODE_LOCK = 2048;
- const int STATE_GAL_E1B_PAGE_SYNC = 4096;
- const int STATE_SBAS_SYNC = 8192;
- const int STATE_TOW_KNOWN = 16384;
- const int STATE_GLO_TOD_KNOWN = 32768;
- const int STATE_2ND_CODE_LOCK = 65536;
+ const int STATE_CODE_LOCK = (1 << 0) /* 1 */;
+ const int STATE_BIT_SYNC = (1 << 1) /* 2 */;
+ const int STATE_SUBFRAME_SYNC = (1 << 2) /* 4 */;
+ const int STATE_TOW_DECODED = (1 << 3) /* 8 */;
+ const int STATE_MSEC_AMBIGUOUS = (1 << 4) /* 16 */;
+ const int STATE_SYMBOL_SYNC = (1 << 5) /* 32 */;
+ const int STATE_GLO_STRING_SYNC = (1 << 6) /* 64 */;
+ const int STATE_GLO_TOD_DECODED = (1 << 7) /* 128 */;
+ const int STATE_BDS_D2_BIT_SYNC = (1 << 8) /* 256 */;
+ const int STATE_BDS_D2_SUBFRAME_SYNC = (1 << 9) /* 512 */;
+ const int STATE_GAL_E1BC_CODE_LOCK = (1 << 10) /* 1024 */;
+ const int STATE_GAL_E1C_2ND_CODE_LOCK = (1 << 11) /* 2048 */;
+ const int STATE_GAL_E1B_PAGE_SYNC = (1 << 12) /* 4096 */;
+ const int STATE_SBAS_SYNC = (1 << 13) /* 8192 */;
+ const int STATE_TOW_KNOWN = (1 << 14) /* 16384 */;
+ const int STATE_GLO_TOD_KNOWN = (1 << 15) /* 32768 */;
+ const int STATE_2ND_CODE_LOCK = (1 << 16) /* 65536 */;
const int ADR_STATE_UNKNOWN = 0;
- const int ADR_STATE_VALID = 1;
- const int ADR_STATE_RESET = 2;
- const int ADR_STATE_CYCLE_SLIP = 4;
- const int ADR_STATE_HALF_CYCLE_RESOLVED = 8;
+ const int ADR_STATE_VALID = (1 << 0) /* 1 */;
+ const int ADR_STATE_RESET = (1 << 1) /* 2 */;
+ const int ADR_STATE_CYCLE_SLIP = (1 << 2) /* 4 */;
+ const int ADR_STATE_HALF_CYCLE_RESOLVED = (1 << 3) /* 8 */;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssSignalType.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssSignalType.aidl
index 4a49547..a17f933 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssSignalType.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssSignalType.aidl
@@ -42,6 +42,7 @@
const @utf8InCpp String CODE_TYPE_B = "B";
const @utf8InCpp String CODE_TYPE_C = "C";
const @utf8InCpp String CODE_TYPE_D = "D";
+ const @utf8InCpp String CODE_TYPE_E = "E";
const @utf8InCpp String CODE_TYPE_I = "I";
const @utf8InCpp String CODE_TYPE_L = "L";
const @utf8InCpp String CODE_TYPE_M = "M";
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl
index c782b6f..c8634ec 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl
@@ -40,8 +40,8 @@
void setSetId(in android.hardware.gnss.IAGnssRil.SetIdType type, in @utf8InCpp String setid);
void updateNetworkState(in android.hardware.gnss.IAGnssRil.NetworkAttributes attributes);
void injectNiSuplMessageData(in byte[] msgData, in int slotIndex);
- const int NETWORK_CAPABILITY_NOT_METERED = 1;
- const int NETWORK_CAPABILITY_NOT_ROAMING = 2;
+ const int NETWORK_CAPABILITY_NOT_METERED = 0x01;
+ const int NETWORK_CAPABILITY_NOT_ROAMING = 0x02;
@Backing(type="int") @VintfStability
enum AGnssRefLocationType {
GSM_CELLID = 1,
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl
index 0e6405e..d1aaf2c 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl
@@ -77,19 +77,19 @@
}
@Backing(type="int") @VintfStability
enum GnssAidingData {
- EPHEMERIS = 1,
- ALMANAC = 2,
- POSITION = 4,
- TIME = 8,
- IONO = 16,
- UTC = 32,
- HEALTH = 64,
- SVDIR = 128,
- SVSTEER = 256,
- SADATA = 512,
- RTI = 1024,
- CELLDB_INFO = 32768,
- ALL = 65535,
+ EPHEMERIS = 0x0001,
+ ALMANAC = 0x0002,
+ POSITION = 0x0004,
+ TIME = 0x0008,
+ IONO = 0x0010,
+ UTC = 0x0020,
+ HEALTH = 0x0040,
+ SVDIR = 0x0080,
+ SVSTEER = 0x0100,
+ SADATA = 0x0200,
+ RTI = 0x0400,
+ CELLDB_INFO = 0x8000,
+ ALL = 0xFFFF,
}
@VintfStability
parcelable PositionModeOptions {
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatching.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatching.aidl
index d82aa1f..a021f55 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatching.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatching.aidl
@@ -41,7 +41,7 @@
void flush();
void stop();
void cleanup();
- const int WAKEUP_ON_FIFO_FULL = 1;
+ const int WAKEUP_ON_FIFO_FULL = 0x01;
@VintfStability
parcelable Options {
long periodNanos;
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssCallback.aidl
index 0247182..61710d3 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssCallback.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssCallback.aidl
@@ -46,22 +46,22 @@
void gnssRequestTimeCb();
void gnssRequestLocationCb(in boolean independentFromGnss, in boolean isUserEmergency);
void gnssSetSignalTypeCapabilitiesCb(in android.hardware.gnss.GnssSignalType[] gnssSignalTypes);
- const int CAPABILITY_SCHEDULING = 1;
- const int CAPABILITY_MSB = 2;
- const int CAPABILITY_MSA = 4;
- const int CAPABILITY_SINGLE_SHOT = 8;
- const int CAPABILITY_ON_DEMAND_TIME = 16;
- const int CAPABILITY_GEOFENCING = 32;
- const int CAPABILITY_MEASUREMENTS = 64;
- const int CAPABILITY_NAV_MESSAGES = 128;
- const int CAPABILITY_LOW_POWER_MODE = 256;
- const int CAPABILITY_SATELLITE_BLOCKLIST = 512;
- const int CAPABILITY_MEASUREMENT_CORRECTIONS = 1024;
- const int CAPABILITY_ANTENNA_INFO = 2048;
- const int CAPABILITY_CORRELATION_VECTOR = 4096;
- const int CAPABILITY_SATELLITE_PVT = 8192;
- const int CAPABILITY_MEASUREMENT_CORRECTIONS_FOR_DRIVING = 16384;
- const int CAPABILITY_ACCUMULATED_DELTA_RANGE = 32768;
+ const int CAPABILITY_SCHEDULING = (1 << 0) /* 1 */;
+ const int CAPABILITY_MSB = (1 << 1) /* 2 */;
+ const int CAPABILITY_MSA = (1 << 2) /* 4 */;
+ const int CAPABILITY_SINGLE_SHOT = (1 << 3) /* 8 */;
+ const int CAPABILITY_ON_DEMAND_TIME = (1 << 4) /* 16 */;
+ const int CAPABILITY_GEOFENCING = (1 << 5) /* 32 */;
+ const int CAPABILITY_MEASUREMENTS = (1 << 6) /* 64 */;
+ const int CAPABILITY_NAV_MESSAGES = (1 << 7) /* 128 */;
+ const int CAPABILITY_LOW_POWER_MODE = (1 << 8) /* 256 */;
+ const int CAPABILITY_SATELLITE_BLOCKLIST = (1 << 9) /* 512 */;
+ const int CAPABILITY_MEASUREMENT_CORRECTIONS = (1 << 10) /* 1024 */;
+ const int CAPABILITY_ANTENNA_INFO = (1 << 11) /* 2048 */;
+ const int CAPABILITY_CORRELATION_VECTOR = (1 << 12) /* 4096 */;
+ const int CAPABILITY_SATELLITE_PVT = (1 << 13) /* 8192 */;
+ const int CAPABILITY_MEASUREMENT_CORRECTIONS_FOR_DRIVING = (1 << 14) /* 16384 */;
+ const int CAPABILITY_ACCUMULATED_DELTA_RANGE = (1 << 15) /* 32768 */;
@Backing(type="int") @VintfStability
enum GnssStatusValue {
NONE = 0,
@@ -73,10 +73,10 @@
@Backing(type="int") @VintfStability
enum GnssSvFlags {
NONE = 0,
- HAS_EPHEMERIS_DATA = 1,
- HAS_ALMANAC_DATA = 2,
- USED_IN_FIX = 4,
- HAS_CARRIER_FREQUENCY = 8,
+ HAS_EPHEMERIS_DATA = (1 << 0) /* 1 */,
+ HAS_ALMANAC_DATA = (1 << 1) /* 2 */,
+ USED_IN_FIX = (1 << 2) /* 4 */,
+ HAS_CARRIER_FREQUENCY = (1 << 3) /* 8 */,
}
@VintfStability
parcelable GnssSvInfo {
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssConfiguration.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssConfiguration.aidl
index 1d6399e..70df11a 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssConfiguration.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssConfiguration.aidl
@@ -42,11 +42,11 @@
void setEmergencySuplPdn(in boolean enable);
void setEsExtensionSec(in int emergencyExtensionSeconds);
void setBlocklist(in android.hardware.gnss.BlocklistedSource[] blocklist);
- const int SUPL_MODE_MSB = 1;
- const int SUPL_MODE_MSA = 2;
- const int LPP_PROFILE_USER_PLANE = 1;
- const int LPP_PROFILE_CONTROL_PLANE = 2;
- const int GLONASS_POS_PROTOCOL_RRC_CPLANE = 1;
- const int GLONASS_POS_PROTOCOL_RRLP_UPLANE = 2;
- const int GLONASS_POS_PROTOCOL_LPP_UPLANE = 4;
+ const int SUPL_MODE_MSB = 0x01;
+ const int SUPL_MODE_MSA = 0x02;
+ const int LPP_PROFILE_USER_PLANE = 0x01;
+ const int LPP_PROFILE_CONTROL_PLANE = 0x02;
+ const int GLONASS_POS_PROTOCOL_RRC_CPLANE = 0x01;
+ const int GLONASS_POS_PROTOCOL_RRLP_UPLANE = 0x02;
+ const int GLONASS_POS_PROTOCOL_LPP_UPLANE = 0x04;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssGeofenceCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssGeofenceCallback.aidl
index df5dc2d..90f9ebc 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssGeofenceCallback.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssGeofenceCallback.aidl
@@ -41,15 +41,15 @@
void gnssGeofenceRemoveCb(in int geofenceId, in int status);
void gnssGeofencePauseCb(in int geofenceId, in int status);
void gnssGeofenceResumeCb(in int geofenceId, in int status);
- const int ENTERED = 1;
- const int EXITED = 2;
- const int UNCERTAIN = 4;
- const int UNAVAILABLE = 1;
- const int AVAILABLE = 2;
+ const int ENTERED = (1 << 0) /* 1 */;
+ const int EXITED = (1 << 1) /* 2 */;
+ const int UNCERTAIN = (1 << 2) /* 4 */;
+ const int UNAVAILABLE = (1 << 0) /* 1 */;
+ const int AVAILABLE = (1 << 1) /* 2 */;
const int OPERATION_SUCCESS = 0;
- const int ERROR_TOO_MANY_GEOFENCES = -100;
- const int ERROR_ID_EXISTS = -101;
- const int ERROR_ID_UNKNOWN = -102;
- const int ERROR_INVALID_TRANSITION = -103;
- const int ERROR_GENERIC = -149;
+ const int ERROR_TOO_MANY_GEOFENCES = (-100) /* -100 */;
+ const int ERROR_ID_EXISTS = (-101) /* -101 */;
+ const int ERROR_ID_UNKNOWN = (-102) /* -102 */;
+ const int ERROR_INVALID_TRANSITION = (-103) /* -103 */;
+ const int ERROR_GENERIC = (-149) /* -149 */;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl
index c65cff2..f6a8fef 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl
@@ -44,26 +44,31 @@
int messageId;
int submessageId;
byte[] data;
- const int STATUS_PARITY_PASSED = 1;
- const int STATUS_PARITY_REBUILT = 2;
+ const int STATUS_PARITY_PASSED = (1 << 0) /* 1 */;
+ const int STATUS_PARITY_REBUILT = (1 << 1) /* 2 */;
const int STATUS_UNKNOWN = 0;
@Backing(type="int") @VintfStability
enum GnssNavigationMessageType {
UNKNOWN = 0,
- GPS_L1CA = 257,
- GPS_L2CNAV = 258,
- GPS_L5CNAV = 259,
- SBS = 513,
- GPS_CNAV2 = 260,
- GLO_L1CA = 769,
- QZS_L1CA = 1025,
- BDS_D1 = 1281,
- BDS_D2 = 1282,
- BDS_CNAV1 = 1283,
- BDS_CNAV2 = 1284,
- GAL_I = 1537,
- GAL_F = 1538,
- IRN_L5CA = 1793,
+ GPS_L1CA = 0x0101,
+ GPS_L2CNAV = 0x0102,
+ GPS_L5CNAV = 0x0103,
+ SBS = 0x0201,
+ GPS_CNAV2 = 0x0104,
+ GLO_L1CA = 0x0301,
+ QZS_L1CA = 0x0401,
+ BDS_D1 = 0x0501,
+ BDS_D2 = 0x0502,
+ BDS_CNAV1 = 0x0503,
+ BDS_CNAV2 = 0x0504,
+ GAL_I = 0x0601,
+ GAL_F = 0x0602,
+ /**
+ * @deprecated Use IRN_L5 instead.
+ */
+ IRN_L5CA = 0x0701,
+ IRN_L5 = 0x0702,
+ IRN_L1 = 0x0703,
}
}
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPowerIndicationCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPowerIndicationCallback.aidl
index d35c77f..07b10ad 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPowerIndicationCallback.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPowerIndicationCallback.aidl
@@ -37,10 +37,10 @@
interface IGnssPowerIndicationCallback {
void setCapabilitiesCb(in int capabilities);
oneway void gnssPowerStatsCb(in android.hardware.gnss.GnssPowerStats gnssPowerStats);
- const int CAPABILITY_TOTAL = 1;
- const int CAPABILITY_SINGLEBAND_TRACKING = 2;
- const int CAPABILITY_MULTIBAND_TRACKING = 4;
- const int CAPABILITY_SINGLEBAND_ACQUISITION = 8;
- const int CAPABILITY_MULTIBAND_ACQUISITION = 16;
- const int CAPABILITY_OTHER_MODES = 32;
+ const int CAPABILITY_TOTAL = (1 << 0) /* 1 */;
+ const int CAPABILITY_SINGLEBAND_TRACKING = (1 << 1) /* 2 */;
+ const int CAPABILITY_MULTIBAND_TRACKING = (1 << 2) /* 4 */;
+ const int CAPABILITY_SINGLEBAND_ACQUISITION = (1 << 3) /* 8 */;
+ const int CAPABILITY_MULTIBAND_ACQUISITION = (1 << 4) /* 16 */;
+ const int CAPABILITY_OTHER_MODES = (1 << 5) /* 32 */;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl
index 5fd411f..ae65f39 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl
@@ -46,9 +46,9 @@
long timeOfEphemerisSeconds;
int issueOfDataEphemeris;
android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource ephemerisSource = android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource.OTHER;
- const int HAS_POSITION_VELOCITY_CLOCK_INFO = 1;
- const int HAS_IONO = 2;
- const int HAS_TROPO = 4;
+ const int HAS_POSITION_VELOCITY_CLOCK_INFO = (1 << 0) /* 1 */;
+ const int HAS_IONO = (1 << 1) /* 2 */;
+ const int HAS_TROPO = (1 << 2) /* 4 */;
@Backing(type="int") @VintfStability
enum SatelliteEphemerisSource {
DEMODULATED = 0,
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl
index 4126702..61909d0 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl
@@ -36,7 +36,7 @@
@VintfStability
interface IMeasurementCorrectionsCallback {
void setCapabilitiesCb(in int capabilities);
- const int CAPABILITY_LOS_SATS = 1;
- const int CAPABILITY_EXCESS_PATH_LENGTH = 2;
- const int CAPABILITY_REFLECTING_PLANE = 4;
+ const int CAPABILITY_LOS_SATS = (1 << 0) /* 1 */;
+ const int CAPABILITY_EXCESS_PATH_LENGTH = (1 << 1) /* 2 */;
+ const int CAPABILITY_REFLECTING_PLANE = (1 << 2) /* 4 */;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl
index ebbe684..72d32e4 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl
@@ -44,10 +44,10 @@
float combinedExcessPathLengthUncertaintyMeters;
float combinedAttenuationDb;
android.hardware.gnss.measurement_corrections.SingleSatCorrection.ExcessPathInfo[] excessPathInfos;
- const int SINGLE_SAT_CORRECTION_HAS_SAT_IS_LOS_PROBABILITY = 1;
- const int SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH = 2;
- const int SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH_UNC = 4;
- const int SINGLE_SAT_CORRECTION_HAS_COMBINED_ATTENUATION = 16;
+ const int SINGLE_SAT_CORRECTION_HAS_SAT_IS_LOS_PROBABILITY = 0x0001;
+ const int SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH = 0x0002;
+ const int SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH_UNC = 0x0004;
+ const int SINGLE_SAT_CORRECTION_HAS_COMBINED_ATTENUATION = 0x0010;
@VintfStability
parcelable ExcessPathInfo {
int excessPathInfoFlags;
@@ -55,9 +55,9 @@
float excessPathLengthUncertaintyMeters;
android.hardware.gnss.measurement_corrections.ReflectingPlane reflectingPlane;
float attenuationDb;
- const int EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH = 1;
- const int EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH_UNC = 2;
- const int EXCESS_PATH_INFO_HAS_REFLECTING_PLANE = 4;
- const int EXCESS_PATH_INFO_HAS_ATTENUATION = 8;
+ const int EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH = 0x0001;
+ const int EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH_UNC = 0x0002;
+ const int EXCESS_PATH_INFO_HAS_REFLECTING_PLANE = 0x0004;
+ const int EXCESS_PATH_INFO_HAS_ATTENUATION = 0x0008;
}
}
diff --git a/gnss/aidl/android/hardware/gnss/GnssSignalType.aidl b/gnss/aidl/android/hardware/gnss/GnssSignalType.aidl
index 241971f..69de750 100644
--- a/gnss/aidl/android/hardware/gnss/GnssSignalType.aidl
+++ b/gnss/aidl/android/hardware/gnss/GnssSignalType.aidl
@@ -46,27 +46,37 @@
double carrierFrequencyHz;
/**
- * GNSS signal code type "A" representing GALILEO E1A, GALILEO E6A, IRNSS L5A, IRNSS SA.
+ * GNSS signal code type "A" representing GALILEO E1A, GALILEO E6A, NavIC L5A SPS, NavIC SA SPS,
+ * GLONASS G1a L1OCd, GLONASS G2a L2CSI.
*/
const @utf8InCpp String CODE_TYPE_A = "A";
/**
- * GNSS signal code type "B" representing GALILEO E1B, GALILEO E6B, IRNSS L5B, IRNSS SB.
+ * GNSS signal code type "B" representing GALILEO E1B, GALILEO E6B, NavIC L5B RS (D),
+ * NavIC SB RS (D), GLONASS G1a L1OCp, GLONASS G2a L2OCp, QZSS L1Sb.
*/
const @utf8InCpp String CODE_TYPE_B = "B";
/**
* GNSS signal code type "C" representing GPS L1 C/A, GPS L2 C/A, GLONASS G1 C/A,
- * GLONASS G2 C/A, GALILEO E1C, GALILEO E6C, SBAS L1 C/A, QZSS L1 C/A, IRNSS L5C.
+ * GLONASS G2 C/A, GALILEO E1C, GALILEO E6C, SBAS L1 C/A, QZSS L1 C/A, NavIC L5C RS (P),
+ * NavIC SC RS (P).
*/
const @utf8InCpp String CODE_TYPE_C = "C";
/**
- * GNSS signal code type "D" representing BDS B1C D.
+ * GNSS signal code type "D" representing GPS L2 (L1(C/A) + (P2-P1) (semi-codeless)),
+ * QZSS L5S(I), BDS B1C Data, BDS B2a Data, BDS B2b Data, BDS B2 (B2a+B2b) Data, BDS B3a Data,
+ * NavIC L1 Data.
*/
const @utf8InCpp String CODE_TYPE_D = "D";
/**
+ * GNSS signal code type "E" representing QZSS L1 C/B, QZSS L6E.
+ */
+ const @utf8InCpp String CODE_TYPE_E = "E";
+
+ /**
* GNSS signal code type "I" representing GPS L5 I, GLONASS G3 I, GALILEO E5a I, GALILEO E5b I,
* GALILEO E5a+b I, SBAS L5 I, QZSS L5 I, BDS B1 I, BDS B2 I, BDS B3 I.
*/
@@ -74,7 +84,7 @@
/**
* GNSS signal code type "L" representing GPS L1C (P), GPS L2C (L), QZSS L1C (P), QZSS L2C (L),
- * LEX(6) L.
+ * QZSS L6P, BDS B1a Pilot.
*/
const @utf8InCpp String CODE_TYPE_L = "L";
@@ -89,7 +99,9 @@
const @utf8InCpp String CODE_TYPE_N = "N";
/**
- * GNSS signal code type "P" representing GPS L1P, GPS L2P, GLONASS G1P, GLONASS G2P, BDS B1C P.
+ * GNSS signal code type "P" representing GPS L1P, GPS L2P, GLONASS G1P, GLONASS G2P,
+ * BDS B1C Pilot, BDS B2a Pilot, BDS B2b Pilot, BDS B2 (B2a+B2b) Pilot, BDS B3a Pilot,
+ * QZSS L5S(Q), NavIC L1 Pilot.
*/
const @utf8InCpp String CODE_TYPE_P = "P";
@@ -101,7 +113,7 @@
/**
* GNSS signal code type "S" represents GPS L1C (D), GPS L2C (M), QZSS L1C (D), QZSS L2C (M),
- * LEX(6) S.
+ * QZSS L6D, BDS B1a Data.
*/
const @utf8InCpp String CODE_TYPE_S = "S";
@@ -112,9 +124,11 @@
/**
* GNSS signal code type "X" representing GPS L1C (D+P), GPS L2C (M+L), GPS L5 (I+Q),
- * GLONASS G3 (I+Q), GALILEO E1 (B+C), GALILEO E5a (I+Q), GALILEO E5b (I+Q), GALILEO E5a+b(I+Q),
- * GALILEO E6 (B+C), SBAS L5 (I+Q), QZSS L1C (D+P), QZSS L2C (M+L), QZSS L5 (I+Q),
- * LEX(6) (S+L), BDS B1 (I+Q), BDS B1C (D+P), BDS B2 (I+Q), BDS B3 (I+Q), IRNSS L5 (B+C).
+ * GLONASS G1a L1OCd+L1OCp, GLONASS G2a L2CSI+L2OCp, GLONASS G3 (I+Q), GALILEO E1 (B+C),
+ * GALILEO E5a (I+Q), GALILEO E5b (I+Q), GALILEO E5a+b (I+Q), GALILEO E6 (B+C), SBAS L5 (I+Q),
+ * QZSS L1C (D+P), QZSS L2C (M+L), QZSS L5 (I+Q), QZSS L6 (D+P), BDS B1 (I+Q),
+ * BDS B1C Data+Pilot, BDS B2a Data+Pilot, BDS B2 (I+Q), BDS B2 (B2a+B2b) Data+Pilot,
+ * BDS B3 (I+Q), NavIC L5 (B+C), NavIC S (B+C), NavIC L1 Data+Pilot.
*/
const @utf8InCpp String CODE_TYPE_X = "X";
@@ -124,7 +138,9 @@
const @utf8InCpp String CODE_TYPE_Y = "Y";
/**
- * GNSS signal code type "Z" representing GALILEO E1 (A+B+C), GALILEO E6 (A+B+C), QZSS L1-SAIF.
+ * GNSS signal code type "Z" representing GALILEO E1 (A+B+C), GALILEO E6 (A+B+C),
+ * QZSS L1S/L1-SAIF, QZSS L5S (I+Q), QZSS L6 (D+E), BDS B1A Data+Pilot, BDS B2b Data+Pilot,
+ * BDS B3a Data+Pilot.
*/
const @utf8InCpp String CODE_TYPE_Z = "Z";
@@ -142,10 +158,11 @@
* The value is one of the constant Strings with prefix CODE_TYPE_ defined in this parcelable.
*
* This is used to specify the observation descriptor defined in GNSS Observation Data File
- * Header Section Description in the RINEX standard (Version 3.XX). In RINEX Version 3.03,
- * in Appendix Table A2 Attributes are listed as uppercase letters (for instance, "A" for
- * "A channel"). In the future, if for instance a code "G" was added in the official RINEX
- * standard, "G" could be specified here.
+ * Header Section Description in the RINEX standard (Version 4.00) e.g., in Tables 9-16 (see
+ * https://igs.org/wg/rinex/#documents-formats). In cases where the code type does not align
+ * with the above listed values, the code type from the most recent version of RINEX should be
+ * used. In the future, if for instance a code "G" was added in the official RINEX standard,
+ * "G" could be specified here.
*/
@utf8InCpp String codeType;
}
diff --git a/gnss/aidl/android/hardware/gnss/IGnss.aidl b/gnss/aidl/android/hardware/gnss/IGnss.aidl
index aaafe7f..8a22d6e 100644
--- a/gnss/aidl/android/hardware/gnss/IGnss.aidl
+++ b/gnss/aidl/android/hardware/gnss/IGnss.aidl
@@ -217,6 +217,10 @@
* Starts a location output stream using the IGnssCallback gnssLocationCb(), following the
* settings from the most recent call to setPositionMode().
*
+ * When a location output stream is in progress, calling setPositionMode() does not change the
+ * settings of the current location output stream. stop() and start() must be called to make the
+ * new settings effective.
+ *
* This output must operate independently of any GNSS location batching operations,
* see the IGnssBatching for details.
*/
@@ -306,6 +310,10 @@
/**
* Sets the GnssPositionMode parameter, its associated recurrence value, the time between fixes,
* requested fix accuracy, time to first fix.
+ *
+ * If a location output stream is in progress, calling this method does not affect the settings
+ * of current location output stream. stop() and start() must be called to make the new settings
+ * effective.
*/
void setPositionMode(in PositionModeOptions options);
diff --git a/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageCallback.aidl
index 6990e19..b224b0b 100644
--- a/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageCallback.aidl
+++ b/gnss/aidl/android/hardware/gnss/IGnssNavigationMessageCallback.aidl
@@ -100,8 +100,17 @@
/** Galileo F/NAV message contained in the structure. */
GAL_F = 0x0602,
- /** IRNSS L5 C/A message contained in the structure. */
+ /**
+ * NavIC L5 C/A message contained in the structure.
+ * @deprecated Use IRN_L5 instead.
+ */
IRN_L5CA = 0x0701,
+
+ /** NavIC L5 message contained in the structure. */
+ IRN_L5 = 0x0702,
+
+ /** NavIC L1 message contained in the structure. */
+ IRN_L1 = 0x0703,
}
/**
@@ -156,9 +165,12 @@
*
* - For Beidou CNAV1 this refers to the page type number in the range of 1-63.
*
- * - For IRNSS L5 C/A subframe 3 and 4, this value corresponds to the Message Id of the
+ * - For NavIC L5 subframe 3 and 4, this value corresponds to the Message Id of the
* navigation message, in the range of 1-63. (Subframe 1 and 2 does not contain a message
* type id and this value can be set to -1.)
+ * - For NavIC L1 subframe 3, this value corresponds to the Message Id of the navigation
+ * message, in the range of 1-63. (Subframe 1 and 2 does not contain a message type id and
+ * this value can be set to -1.)
*/
int messageId;
@@ -187,8 +199,10 @@
*
* - For Beidou CNAV2, the submessage id corresponds to the message type, in the range 1-63.
*
- * - For IRNSS L5 C/A, the submessage id corresponds to the subframe number of the
- * navigation message, in the range of 1-4.
+ * - For NavIC L5, the submessage id corresponds to the subframe number of the navigation
+ * message, in the range of 1-4.
+ * - For NavIC L1, the submessage id corresponds to the subframe number of the navigation
+ * message, in the range of 1-3.
*/
int submessageId;
@@ -196,7 +210,7 @@
* The data of the reported GNSS message. The bytes (or words) are specified
* using big endian format (MSB first).
*
- * - For GNSS L1 C/A, Beidou D1 & Beidou D2, each subframe contains 10 30-bit
+ * - For GNSS L1 C/A, NavIC L5, Beidou D1 & Beidou D2, each subframe contains 10 30-bit
* words. Each word (30 bits) must fit into the last 30 bits in a
* 4-byte word (skip B31 and B32), with MSB first, for a total of 40
* bytes, covering a time period of 6, 6, and 0.6 seconds, respectively.
@@ -228,6 +242,10 @@
* - For Beidou CNAV2, each subframe consists of 288 data bits, that should be fit into 36
* bytes.
*
+ * - For NavIC L1, subframe #1 consists of 9 data bits that should be fit into 2 bytes (skip
+ * B10-B16). subframe #2 consists of 600 bits that should be fit into 75 bytes. subframe
+ * #3 consists of 274 data bits that should be fit into 35 bytes (skip B275-B280).
+ *
* The data reported here must be the raw data as demodulated by the GNSS receiver, not data
* received from an external source (i.e. not from a server download.)
*/
diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp
index 7310922..822e8fc 100644
--- a/gnss/aidl/default/Android.bp
+++ b/gnss/aidl/default/Android.bp
@@ -45,7 +45,7 @@
"android.hardware.gnss.measurement_corrections@1.1",
"android.hardware.gnss.measurement_corrections@1.0",
"android.hardware.gnss.visibility_control@1.0",
- "android.hardware.gnss-V3-ndk",
+ "android.hardware.gnss-V4-ndk",
],
srcs: [
"AGnssRil.cpp",
diff --git a/gnss/aidl/default/Gnss.cpp b/gnss/aidl/default/Gnss.cpp
index f1b9cbf..c31f991 100644
--- a/gnss/aidl/default/Gnss.cpp
+++ b/gnss/aidl/default/Gnss.cpp
@@ -115,7 +115,9 @@
mGnssMeasurementInterface->setLocationEnabled(true);
this->reportGnssStatusValue(IGnssCallback::GnssStatusValue::SESSION_BEGIN);
mThread = std::thread([this]() {
- this->reportSvStatus();
+ if (!mGnssMeasurementEnabled || mMinIntervalMs <= mGnssMeasurementIntervalMs) {
+ this->reportSvStatus();
+ }
if (!mFirstFixReceived) {
std::this_thread::sleep_for(std::chrono::milliseconds(TTFF_MILLIS));
mFirstFixReceived = true;
@@ -124,7 +126,9 @@
if (!mIsActive) {
break;
}
- this->reportSvStatus();
+ if (!mGnssMeasurementEnabled || mMinIntervalMs <= mGnssMeasurementIntervalMs) {
+ this->reportSvStatus();
+ }
this->reportNmea();
auto currentLocation = getLocationFromHW();
@@ -386,4 +390,12 @@
return ndk::ScopedAStatus::ok();
}
+void Gnss::setGnssMeasurementEnabled(const bool enabled) {
+ mGnssMeasurementEnabled = enabled;
+}
+
+void Gnss::setGnssMeasurementInterval(const long intervalMs) {
+ mGnssMeasurementIntervalMs = intervalMs;
+}
+
} // namespace aidl::android::hardware::gnss
diff --git a/gnss/aidl/default/Gnss.h b/gnss/aidl/default/Gnss.h
index 00540cd..245d607 100644
--- a/gnss/aidl/default/Gnss.h
+++ b/gnss/aidl/default/Gnss.h
@@ -85,6 +85,8 @@
override;
void reportSvStatus() const;
+ void setGnssMeasurementEnabled(const bool enabled);
+ void setGnssMeasurementInterval(const long intervalMs);
std::shared_ptr<GnssConfiguration> mGnssConfiguration;
std::shared_ptr<GnssPowerIndication> mGnssPowerIndication;
std::shared_ptr<GnssMeasurementInterface> mGnssMeasurementInterface;
@@ -101,10 +103,12 @@
static std::shared_ptr<IGnssCallback> sGnssCallback;
std::atomic<long> mMinIntervalMs;
+ std::atomic<long> mGnssMeasurementIntervalMs;
std::atomic<bool> mIsActive;
std::atomic<bool> mIsSvStatusActive;
std::atomic<bool> mIsNmeaActive;
std::atomic<bool> mFirstFixReceived;
+ std::atomic<bool> mGnssMeasurementEnabled;
std::thread mThread;
::android::hardware::gnss::common::ThreadBlocker mThreadBlocker;
diff --git a/gnss/aidl/default/GnssMeasurementInterface.cpp b/gnss/aidl/default/GnssMeasurementInterface.cpp
index aab9e03..f324213 100644
--- a/gnss/aidl/default/GnssMeasurementInterface.cpp
+++ b/gnss/aidl/default/GnssMeasurementInterface.cpp
@@ -35,7 +35,9 @@
std::shared_ptr<IGnssMeasurementCallback> GnssMeasurementInterface::sCallback = nullptr;
GnssMeasurementInterface::GnssMeasurementInterface()
- : mIntervalMs(1000), mLocationIntervalMs(1000), mFutures(std::vector<std::future<void>>()) {}
+ : mIntervalMs(1000), mLocationIntervalMs(1000) {
+ mThreads.reserve(2);
+}
GnssMeasurementInterface::~GnssMeasurementInterface() {
waitForStoppingThreads();
@@ -74,6 +76,7 @@
stop();
}
mIntervalMs = std::max(options.intervalMs, 1000);
+ mGnss->setGnssMeasurementInterval(mIntervalMs);
start(options.enableCorrVecOutputs, options.enableFullTracking);
return ndk::ScopedAStatus::ok();
@@ -100,12 +103,13 @@
ALOGD("restarting since measurement has started");
stop();
}
- // Wait for stopping previous thread.
- waitForStoppingThreads();
mIsActive = true;
- mThreadBlocker.reset();
- mThread = std::thread([this, enableCorrVecOutputs, enableFullTracking]() {
+ mGnss->setGnssMeasurementEnabled(true);
+ mThreads.emplace_back(std::thread([this, enableCorrVecOutputs, enableFullTracking]() {
+ waitForStoppingThreads();
+ mThreadBlocker.reset();
+
int intervalMs;
do {
if (!mIsActive) {
@@ -127,22 +131,30 @@
auto measurement =
Utils::getMockMeasurement(enableCorrVecOutputs, enableFullTracking);
this->reportMeasurement(measurement);
- if (!mLocationEnabled) {
+ if (!mLocationEnabled || mLocationIntervalMs > mIntervalMs) {
mGnss->reportSvStatus();
}
}
intervalMs =
(mLocationEnabled) ? std::min(mLocationIntervalMs, mIntervalMs) : mIntervalMs;
} while (mIsActive && mThreadBlocker.wait_for(std::chrono::milliseconds(intervalMs)));
- });
+ }));
}
void GnssMeasurementInterface::stop() {
ALOGD("stop");
mIsActive = false;
+ mGnss->setGnssMeasurementEnabled(false);
mThreadBlocker.notify();
- if (mThread.joinable()) {
- mFutures.push_back(std::async(std::launch::async, [this] { mThread.join(); }));
+ for (auto iter = mThreads.begin(); iter != mThreads.end(); ++iter) {
+ if (iter->joinable()) {
+ mFutures.push_back(std::async(std::launch::async, [this, iter] {
+ iter->join();
+ mThreads.erase(iter);
+ }));
+ } else {
+ mThreads.erase(iter);
+ }
}
}
diff --git a/gnss/aidl/default/GnssMeasurementInterface.h b/gnss/aidl/default/GnssMeasurementInterface.h
index 926a4e7..ea07c9a 100644
--- a/gnss/aidl/default/GnssMeasurementInterface.h
+++ b/gnss/aidl/default/GnssMeasurementInterface.h
@@ -52,7 +52,7 @@
std::atomic<long> mLocationIntervalMs;
std::atomic<bool> mIsActive;
std::atomic<bool> mLocationEnabled;
- std::thread mThread;
+ std::vector<std::thread> mThreads;
std::vector<std::future<void>> mFutures;
::android::hardware::gnss::common::ThreadBlocker mThreadBlocker;
diff --git a/gnss/aidl/default/GnssNavigationMessageInterface.cpp b/gnss/aidl/default/GnssNavigationMessageInterface.cpp
index 75b9624..c262dc6 100644
--- a/gnss/aidl/default/GnssNavigationMessageInterface.cpp
+++ b/gnss/aidl/default/GnssNavigationMessageInterface.cpp
@@ -29,7 +29,9 @@
std::shared_ptr<IGnssNavigationMessageCallback> GnssNavigationMessageInterface::sCallback = nullptr;
-GnssNavigationMessageInterface::GnssNavigationMessageInterface() : mMinIntervalMillis(1000) {}
+GnssNavigationMessageInterface::GnssNavigationMessageInterface() : mMinIntervalMillis(1000) {
+ mThreads.reserve(2);
+}
GnssNavigationMessageInterface::~GnssNavigationMessageInterface() {
waitForStoppingThreads();
@@ -61,11 +63,11 @@
ALOGD("restarting since nav msg has started");
stop();
}
- // Wait for stopping previous thread.
- waitForStoppingThreads();
mIsActive = true;
- mThread = std::thread([this]() {
+ mThreads.emplace_back(std::thread([this]() {
+ waitForStoppingThreads();
+ mThreadBlocker.reset();
do {
if (!mIsActive) {
break;
@@ -81,15 +83,22 @@
this->reportMessage(message);
} while (mIsActive &&
mThreadBlocker.wait_for(std::chrono::milliseconds(mMinIntervalMillis)));
- });
+ }));
}
void GnssNavigationMessageInterface::stop() {
ALOGD("stop");
mIsActive = false;
mThreadBlocker.notify();
- if (mThread.joinable()) {
- mFutures.push_back(std::async(std::launch::async, [this] { mThread.join(); }));
+ for (auto iter = mThreads.begin(); iter != mThreads.end(); ++iter) {
+ if (iter->joinable()) {
+ mFutures.push_back(std::async(std::launch::async, [this, iter] {
+ iter->join();
+ mThreads.erase(iter);
+ }));
+ } else {
+ mThreads.erase(iter);
+ }
}
}
diff --git a/gnss/aidl/default/GnssNavigationMessageInterface.h b/gnss/aidl/default/GnssNavigationMessageInterface.h
index b335348..e9a7536 100644
--- a/gnss/aidl/default/GnssNavigationMessageInterface.h
+++ b/gnss/aidl/default/GnssNavigationMessageInterface.h
@@ -40,7 +40,7 @@
std::atomic<long> mMinIntervalMillis;
std::atomic<bool> mIsActive;
- std::thread mThread;
+ std::vector<std::thread> mThreads;
std::vector<std::future<void>> mFutures;
::android::hardware::gnss::common::ThreadBlocker mThreadBlocker;
diff --git a/gnss/aidl/default/gnss-default.xml b/gnss/aidl/default/gnss-default.xml
index 73b841e..c01069e 100644
--- a/gnss/aidl/default/gnss-default.xml
+++ b/gnss/aidl/default/gnss-default.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.gnss</name>
- <version>3</version>
+ <version>4</version>
<interface>
<name>IGnss</name>
<instance>default</instance>
diff --git a/gnss/aidl/vts/Android.bp b/gnss/aidl/vts/Android.bp
index 2a09a56..fd1d853 100644
--- a/gnss/aidl/vts/Android.bp
+++ b/gnss/aidl/vts/Android.bp
@@ -51,7 +51,7 @@
"libbinder",
],
static_libs: [
- "android.hardware.gnss-V3-cpp",
+ "android.hardware.gnss-V4-cpp",
"android.hardware.gnss@common-vts-lib",
],
test_suites: [
diff --git a/gnss/aidl/vts/gnss_hal_test_cases.cpp b/gnss/aidl/vts/gnss_hal_test_cases.cpp
index aa8bdfd..9381a0a 100644
--- a/gnss/aidl/vts/gnss_hal_test_cases.cpp
+++ b/gnss/aidl/vts/gnss_hal_test_cases.cpp
@@ -1430,13 +1430,13 @@
startMeasurementWithInterval(intervals[i], iGnssMeasurement, callback);
std::vector<int> measurementDeltas;
- std::vector<int> svInfoListTimestampsDeltas;
+ std::vector<int> svInfoListDeltas;
collectMeasurementIntervals(callback, numEvents[i], /* timeoutSeconds= */ 10,
measurementDeltas);
if (aidl_gnss_hal_->getInterfaceVersion() >= 3) {
- collectSvInfoListTimestamps(numEvents[i], /* timeoutSeconds= */ 10,
- svInfoListTimestampsDeltas);
+ collectSvInfoListTimestamps(numEvents[i], /* timeoutSeconds= */ 10, svInfoListDeltas);
+ EXPECT_TRUE(aidl_gnss_cb_->sv_info_list_cbq_.size() > 0);
}
status = iGnssMeasurement->close();
ASSERT_TRUE(status.isOk());
@@ -1444,8 +1444,7 @@
assertMeanAndStdev(intervals[i], measurementDeltas);
if (aidl_gnss_hal_->getInterfaceVersion() >= 3) {
- assertMeanAndStdev(intervals[i], svInfoListTimestampsDeltas);
- EXPECT_TRUE(aidl_gnss_cb_->sv_info_list_cbq_.size() > 0);
+ assertMeanAndStdev(intervals[i], svInfoListDeltas);
}
}
}
@@ -1477,13 +1476,25 @@
auto callback = sp<GnssMeasurementCallbackAidl>::make();
startMeasurementWithInterval(intervalMs, iGnssMeasurement, callback);
- std::vector<int> deltas;
- collectMeasurementIntervals(callback, /*numEvents=*/10, /*timeoutSeconds=*/10, deltas);
+ std::vector<int> measurementDeltas;
+ std::vector<int> svInfoListDeltas;
+
+ collectMeasurementIntervals(callback, /*numEvents=*/10, /*timeoutSeconds=*/10,
+ measurementDeltas);
+ if (aidl_gnss_hal_->getInterfaceVersion() >= 3) {
+ collectSvInfoListTimestamps(/*numEvents=*/10, /* timeoutSeconds= */ 10,
+ svInfoListDeltas);
+ EXPECT_TRUE(aidl_gnss_cb_->sv_info_list_cbq_.size() > 0);
+ }
status = iGnssMeasurement->close();
ASSERT_TRUE(status.isOk());
- assertMeanAndStdev(locationIntervalMs, deltas);
+ assertMeanAndStdev(locationIntervalMs, measurementDeltas);
+ if (aidl_gnss_hal_->getInterfaceVersion() >= 3) {
+ // Verify the SvStatus interval is 1s (not 2s)
+ assertMeanAndStdev(locationIntervalMs, svInfoListDeltas);
+ }
}
StopAndClearLocations();
}
@@ -1516,16 +1527,37 @@
// Start location and verify the measurements are received at 1Hz
StartAndCheckFirstLocation(locationIntervalMs, /* lowPowerMode= */ false);
- std::vector<int> deltas;
- collectMeasurementIntervals(callback, /*numEvents=*/10, kFirstMeasTimeoutSec, deltas);
- assertMeanAndStdev(locationIntervalMs, deltas);
+ std::vector<int> measurementDeltas;
+ std::vector<int> svInfoListDeltas;
+ collectMeasurementIntervals(callback, /*numEvents=*/10, kFirstMeasTimeoutSec,
+ measurementDeltas);
+ assertMeanAndStdev(locationIntervalMs, measurementDeltas);
+ if (aidl_gnss_hal_->getInterfaceVersion() >= 3) {
+ collectSvInfoListTimestamps(/*numEvents=*/10, /* timeoutSeconds= */ 10,
+ svInfoListDeltas);
+ EXPECT_TRUE(aidl_gnss_cb_->sv_info_list_cbq_.size() > 0);
+ // Verify the SvStatus intervals are at 1s interval
+ assertMeanAndStdev(locationIntervalMs, svInfoListDeltas);
+ }
// Stop location request and verify the measurements are received at 2s intervals
StopAndClearLocations();
- callback->gnss_data_cbq_.reset();
- deltas.clear();
- collectMeasurementIntervals(callback, /*numEvents=*/5, kFirstMeasTimeoutSec, deltas);
- assertMeanAndStdev(intervalMs, deltas);
+ measurementDeltas.clear();
+ collectMeasurementIntervals(callback, /*numEvents=*/5, kFirstMeasTimeoutSec,
+ measurementDeltas);
+ assertMeanAndStdev(intervalMs, measurementDeltas);
+
+ if (aidl_gnss_hal_->getInterfaceVersion() >= 3) {
+ svInfoListDeltas.clear();
+ collectSvInfoListTimestamps(/*numEvents=*/5, /* timeoutSeconds= */ 10,
+ svInfoListDeltas);
+ EXPECT_TRUE(aidl_gnss_cb_->sv_info_list_cbq_.size() > 0);
+ // Verify the SvStatus intervals are at 2s interval
+ for (const int& delta : svInfoListDeltas) {
+ ALOGD("svInfoListDelta: %d", delta);
+ }
+ assertMeanAndStdev(intervalMs, svInfoListDeltas);
+ }
status = iGnssMeasurement->close();
ASSERT_TRUE(status.isOk());
@@ -1587,8 +1619,7 @@
* TestGnssMeasurementIsFullTracking
* 1. Start measurement with enableFullTracking=true. Verify the received measurements have
* isFullTracking=true.
- * 2. Start measurement with enableFullTracking = false. Verify the received measurements have
- * isFullTracking=false.
+ * 2. Start measurement with enableFullTracking = false.
* 3. Do step 1 again.
*/
TEST_P(GnssHalTest, TestGnssMeasurementIsFullTracking) {
@@ -1675,4 +1706,59 @@
ASSERT_TRUE(accumulatedDeltaRangeFound);
status = iGnssMeasurement->close();
ASSERT_TRUE(status.isOk());
-}
\ No newline at end of file
+}
+
+/*
+ * TestSvStatusIntervals:
+ * 1. start measurement and location with various intervals
+ * 2. verify the SvStatus are received at expected interval
+ */
+TEST_P(GnssHalTest, TestSvStatusIntervals) {
+ if (aidl_gnss_hal_->getInterfaceVersion() <= 2) {
+ return;
+ }
+ ALOGD("TestSvStatusIntervals");
+ sp<IGnssMeasurementInterface> iGnssMeasurement;
+ auto status = aidl_gnss_hal_->getExtensionGnssMeasurement(&iGnssMeasurement);
+ ASSERT_TRUE(status.isOk());
+ ASSERT_TRUE(iGnssMeasurement != nullptr);
+
+ std::vector<int> locationIntervals{1000, 2000, INT_MAX};
+ std::vector<int> measurementIntervals{1000, 2000, INT_MAX};
+
+ for (auto& locationIntervalMs : locationIntervals) {
+ for (auto& measurementIntervalMs : measurementIntervals) {
+ if (locationIntervalMs == INT_MAX && measurementIntervalMs == INT_MAX) {
+ continue;
+ }
+ auto measurementCallback = sp<GnssMeasurementCallbackAidl>::make();
+ // Start measurement
+ if (measurementIntervalMs < INT_MAX) {
+ startMeasurementWithInterval(measurementIntervalMs, iGnssMeasurement,
+ measurementCallback);
+ }
+ // Start location
+ if (locationIntervalMs < INT_MAX) {
+ StartAndCheckFirstLocation(locationIntervalMs, /* lowPowerMode= */ false);
+ }
+ ALOGD("location@%d(ms), measurement@%d(ms)", locationIntervalMs, measurementIntervalMs);
+ std::vector<int> svInfoListDeltas;
+ collectSvInfoListTimestamps(/*numEvents=*/5, /* timeoutSeconds= */ 10,
+ svInfoListDeltas);
+ EXPECT_TRUE(aidl_gnss_cb_->sv_info_list_cbq_.size() > 0);
+
+ int svStatusInterval = std::min(locationIntervalMs, measurementIntervalMs);
+ assertMeanAndStdev(svStatusInterval, svInfoListDeltas);
+
+ if (locationIntervalMs < INT_MAX) {
+ // Stop location request
+ StopAndClearLocations();
+ }
+ if (measurementIntervalMs < INT_MAX) {
+ // Stop measurement request
+ status = iGnssMeasurement->close();
+ ASSERT_TRUE(status.isOk());
+ }
+ }
+ }
+}
diff --git a/gnss/common/utils/default/Android.bp b/gnss/common/utils/default/Android.bp
index 4cf17a6..208bc59 100644
--- a/gnss/common/utils/default/Android.bp
+++ b/gnss/common/utils/default/Android.bp
@@ -57,6 +57,6 @@
"android.hardware.gnss@2.1",
"android.hardware.gnss.measurement_corrections@1.1",
"android.hardware.gnss.measurement_corrections@1.0",
- "android.hardware.gnss-V3-ndk",
+ "android.hardware.gnss-V4-ndk",
],
}
diff --git a/gnss/common/utils/vts/Android.bp b/gnss/common/utils/vts/Android.bp
index b5325b2..ed5674c 100644
--- a/gnss/common/utils/vts/Android.bp
+++ b/gnss/common/utils/vts/Android.bp
@@ -44,7 +44,7 @@
"android.hardware.gnss@2.1",
"android.hardware.gnss.measurement_corrections@1.0",
"android.hardware.gnss.measurement_corrections@1.1",
- "android.hardware.gnss-V3-cpp",
+ "android.hardware.gnss-V4-cpp",
],
static_libs: [
"libgtest",
diff --git a/graphics/Android.bp b/graphics/Android.bp
index 2fbcb41..cae5292 100644
--- a/graphics/Android.bp
+++ b/graphics/Android.bp
@@ -39,27 +39,27 @@
cc_defaults {
name: "android.hardware.graphics.common-ndk_static",
static_libs: [
- "android.hardware.graphics.common-V4-ndk",
+ "android.hardware.graphics.common-V5-ndk",
],
}
cc_defaults {
name: "android.hardware.graphics.common-ndk_shared",
shared_libs: [
- "android.hardware.graphics.common-V4-ndk",
+ "android.hardware.graphics.common-V5-ndk",
],
}
cc_defaults {
name: "android.hardware.graphics.composer3-ndk_static",
static_libs: [
- "android.hardware.graphics.composer3-V2-ndk",
+ "android.hardware.graphics.composer3-V3-ndk",
],
}
cc_defaults {
name: "android.hardware.graphics.composer3-ndk_shared",
shared_libs: [
- "android.hardware.graphics.composer3-V2-ndk",
+ "android.hardware.graphics.composer3-V3-ndk",
],
}
diff --git a/graphics/allocator/2.0/Android.bp b/graphics/allocator/2.0/Android.bp
index 40db81d..5d3f883 100644
--- a/graphics/allocator/2.0/Android.bp
+++ b/graphics/allocator/2.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -12,9 +13,6 @@
hidl_interface {
name: "android.hardware.graphics.allocator@2.0",
root: "android.hardware",
- vndk: {
- enabled: true,
- },
srcs: [
"IAllocator.hal",
],
diff --git a/graphics/allocator/2.0/default/Android.bp b/graphics/allocator/2.0/default/Android.bp
index 4d17dc3..2ca9c86 100644
--- a/graphics/allocator/2.0/default/Android.bp
+++ b/graphics/allocator/2.0/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/graphics/allocator/2.0/utils/gralloc1-adapter/Android.bp b/graphics/allocator/2.0/utils/gralloc1-adapter/Android.bp
index bc42099..1ef32ef 100644
--- a/graphics/allocator/2.0/utils/gralloc1-adapter/Android.bp
+++ b/graphics/allocator/2.0/utils/gralloc1-adapter/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -11,9 +12,15 @@
name: "libgralloc1-adapter",
defaults: ["hidl_defaults"],
vendor: true,
- srcs: ["gralloc1-adapter.cpp", "Gralloc1On0Adapter.cpp"],
+ srcs: [
+ "gralloc1-adapter.cpp",
+ "Gralloc1On0Adapter.cpp",
+ ],
include_dirs: ["system/core/libsync/include"],
export_include_dirs: ["."],
whole_static_libs: ["libgrallocusage"],
- shared_libs: ["libhardware", "liblog"],
+ shared_libs: [
+ "libhardware",
+ "liblog",
+ ],
}
diff --git a/graphics/allocator/2.0/utils/hal/Android.bp b/graphics/allocator/2.0/utils/hal/Android.bp
index 6bb9a0f..a2ddafd 100644
--- a/graphics/allocator/2.0/utils/hal/Android.bp
+++ b/graphics/allocator/2.0/utils/hal/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/graphics/allocator/2.0/utils/passthrough/Android.bp b/graphics/allocator/2.0/utils/passthrough/Android.bp
index f5ac5a6..fe00518 100644
--- a/graphics/allocator/2.0/utils/passthrough/Android.bp
+++ b/graphics/allocator/2.0/utils/passthrough/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/graphics/allocator/3.0/Android.bp b/graphics/allocator/3.0/Android.bp
index 800632c..767a79f 100644
--- a/graphics/allocator/3.0/Android.bp
+++ b/graphics/allocator/3.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -12,9 +13,6 @@
hidl_interface {
name: "android.hardware.graphics.allocator@3.0",
root: "android.hardware",
- vndk: {
- enabled: true,
- },
srcs: [
"IAllocator.hal",
],
diff --git a/graphics/allocator/4.0/Android.bp b/graphics/allocator/4.0/Android.bp
index 5c5fb37..590ecf4 100644
--- a/graphics/allocator/4.0/Android.bp
+++ b/graphics/allocator/4.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -12,9 +13,6 @@
hidl_interface {
name: "android.hardware.graphics.allocator@4.0",
root: "android.hardware",
- vndk: {
- enabled: true,
- },
srcs: [
"IAllocator.hal",
],
diff --git a/graphics/allocator/aidl/Android.bp b/graphics/allocator/aidl/Android.bp
index a3a2c55..0b916bf 100644
--- a/graphics/allocator/aidl/Android.bp
+++ b/graphics/allocator/aidl/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -10,15 +11,12 @@
aidl_interface {
name: "android.hardware.graphics.allocator",
vendor_available: true,
- vndk: {
- enabled: true,
- support_system_process: true,
- },
+ double_loadable: true,
vndk_use_version: "2",
srcs: ["android/hardware/graphics/allocator/*.aidl"],
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V4",
+ "android.hardware.graphics.common-V5",
],
stability: "vintf",
backend: {
@@ -33,9 +31,6 @@
"//apex_available:platform",
"com.android.media.swcodec",
],
- vndk: {
- enabled: true,
- },
min_sdk_version: "29",
},
},
@@ -49,7 +44,7 @@
version: "2",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V4",
+ "android.hardware.graphics.common-V5",
],
},
diff --git a/graphics/allocator/aidl/vts/Android.bp b/graphics/allocator/aidl/vts/Android.bp
index 630ab2a..b2ed821 100644
--- a/graphics/allocator/aidl/vts/Android.bp
+++ b/graphics/allocator/aidl/vts/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp b/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp
index 4778020..0430ea7 100644
--- a/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp
+++ b/graphics/allocator/aidl/vts/VtsHalGraphicsAllocatorAidl_TargetTest.cpp
@@ -144,7 +144,8 @@
auto status = mAllocator->getIMapperLibrarySuffix(&mapperSuffix);
ASSERT_TRUE(status.isOk());
std::string lib_name = "mapper." + mapperSuffix + ".so";
- void* so = android_load_sphal_library(lib_name.c_str(), RTLD_LOCAL | RTLD_NOW);
+ void* so = AServiceManager_openDeclaredPassthroughHal("mapper", mapperSuffix.c_str(),
+ RTLD_LOCAL | RTLD_NOW);
ASSERT_NE(nullptr, so) << "Failed to load " << lib_name;
auto loadIMapper = (AIMapper_loadIMapperFn)dlsym(so, "AIMapper_loadIMapper");
ASSERT_NE(nullptr, loadIMapper) << "AIMapper_locaIMapper missing from " << lib_name;
diff --git a/graphics/bufferqueue/1.0/Android.bp b/graphics/bufferqueue/1.0/Android.bp
index 82c71f1..c7c6453 100644
--- a/graphics/bufferqueue/1.0/Android.bp
+++ b/graphics/bufferqueue/1.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -12,9 +13,6 @@
hidl_interface {
name: "android.hardware.graphics.bufferqueue@1.0",
root: "android.hardware",
- vndk: {
- enabled: true,
- },
srcs: [
"IGraphicBufferProducer.hal",
"IProducerListener.hal",
diff --git a/graphics/bufferqueue/2.0/Android.bp b/graphics/bufferqueue/2.0/Android.bp
index 3067e24..e9f75c1 100644
--- a/graphics/bufferqueue/2.0/Android.bp
+++ b/graphics/bufferqueue/2.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -12,9 +13,6 @@
hidl_interface {
name: "android.hardware.graphics.bufferqueue@2.0",
root: "android.hardware",
- vndk: {
- enabled: true,
- },
srcs: [
"types.hal",
"IGraphicBufferProducer.hal",
diff --git a/graphics/common/1.0/Android.bp b/graphics/common/1.0/Android.bp
index 3288583..b876bf3 100644
--- a/graphics/common/1.0/Android.bp
+++ b/graphics/common/1.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -12,10 +13,6 @@
hidl_interface {
name: "android.hardware.graphics.common@1.0",
root: "android.hardware",
- vndk: {
- enabled: true,
- support_system_process: true,
- },
srcs: [
"types.hal",
],
diff --git a/graphics/common/1.1/Android.bp b/graphics/common/1.1/Android.bp
index 5d07eae..ff6c9b7 100644
--- a/graphics/common/1.1/Android.bp
+++ b/graphics/common/1.1/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -12,10 +13,6 @@
hidl_interface {
name: "android.hardware.graphics.common@1.1",
root: "android.hardware",
- vndk: {
- enabled: true,
- support_system_process: true,
- },
srcs: [
"types.hal",
],
diff --git a/graphics/common/1.2/Android.bp b/graphics/common/1.2/Android.bp
index 4aa4af5..b4663e5 100644
--- a/graphics/common/1.2/Android.bp
+++ b/graphics/common/1.2/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -12,10 +13,6 @@
hidl_interface {
name: "android.hardware.graphics.common@1.2",
root: "android.hardware",
- vndk: {
- enabled: true,
- support_system_process: true,
- },
srcs: [
"types.hal",
],
diff --git a/graphics/common/aidl/Android.bp b/graphics/common/aidl/Android.bp
index 02334e8..c1bb1ef 100644
--- a/graphics/common/aidl/Android.bp
+++ b/graphics/common/aidl/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -11,11 +12,8 @@
name: "android.hardware.graphics.common",
host_supported: true,
vendor_available: true,
- vndk: {
- enabled: true,
- support_system_process: true,
- },
- vndk_use_version: "4",
+ double_loadable: true,
+ vndk_use_version: "5",
srcs: [
"android/hardware/graphics/common/*.aidl",
],
@@ -43,7 +41,7 @@
enabled: true,
},
},
- frozen: true,
+ frozen: false,
versions_with_info: [
{
version: "1",
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BufferUsage.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BufferUsage.aidl
index d3ab44f..d42a6d5 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BufferUsage.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/BufferUsage.aidl
@@ -35,31 +35,31 @@
/* @hide */
@Backing(type="long") @VintfStability
enum BufferUsage {
- CPU_READ_MASK = 15,
+ CPU_READ_MASK = 0xf,
CPU_READ_NEVER = 0,
CPU_READ_RARELY = 2,
CPU_READ_OFTEN = 3,
- CPU_WRITE_MASK = 240,
- CPU_WRITE_NEVER = 0,
- CPU_WRITE_RARELY = 32,
- CPU_WRITE_OFTEN = 48,
- GPU_TEXTURE = 256,
- GPU_RENDER_TARGET = 512,
- COMPOSER_OVERLAY = 2048,
- COMPOSER_CLIENT_TARGET = 4096,
- PROTECTED = 16384,
- COMPOSER_CURSOR = 32768,
- VIDEO_ENCODER = 65536,
- CAMERA_OUTPUT = 131072,
- CAMERA_INPUT = 262144,
- RENDERSCRIPT = 1048576,
- VIDEO_DECODER = 4194304,
- SENSOR_DIRECT_DATA = 8388608,
- GPU_DATA_BUFFER = 16777216,
- GPU_CUBE_MAP = 33554432,
- GPU_MIPMAP_COMPLETE = 67108864,
- HW_IMAGE_ENCODER = 134217728,
- FRONT_BUFFER = 4294967296,
- VENDOR_MASK = -268435456,
- VENDOR_MASK_HI = -281474976710656,
+ CPU_WRITE_MASK = (0xf << 4) /* 240 */,
+ CPU_WRITE_NEVER = (0 << 4) /* 0 */,
+ CPU_WRITE_RARELY = (2 << 4) /* 32 */,
+ CPU_WRITE_OFTEN = (3 << 4) /* 48 */,
+ GPU_TEXTURE = (1 << 8) /* 256 */,
+ GPU_RENDER_TARGET = (1 << 9) /* 512 */,
+ COMPOSER_OVERLAY = (1 << 11) /* 2048 */,
+ COMPOSER_CLIENT_TARGET = (1 << 12) /* 4096 */,
+ PROTECTED = (1 << 14) /* 16384 */,
+ COMPOSER_CURSOR = (1 << 15) /* 32768 */,
+ VIDEO_ENCODER = (1 << 16) /* 65536 */,
+ CAMERA_OUTPUT = (1 << 17) /* 131072 */,
+ CAMERA_INPUT = (1 << 18) /* 262144 */,
+ RENDERSCRIPT = (1 << 20) /* 1048576 */,
+ VIDEO_DECODER = (1 << 22) /* 4194304 */,
+ SENSOR_DIRECT_DATA = (1 << 23) /* 8388608 */,
+ GPU_DATA_BUFFER = (1 << 24) /* 16777216 */,
+ GPU_CUBE_MAP = (1 << 25) /* 33554432 */,
+ GPU_MIPMAP_COMPLETE = (1 << 26) /* 67108864 */,
+ HW_IMAGE_ENCODER = (1 << 27) /* 134217728 */,
+ FRONT_BUFFER = (1L << 32) /* 4294967296 */,
+ VENDOR_MASK = (0xf << 28) /* -268435456 */,
+ VENDOR_MASK_HI = ((1L * 0xffff) << 48) /* -281474976710656 */,
}
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ChromaSiting.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ChromaSiting.aidl
index b8af644..784fc17 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ChromaSiting.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/ChromaSiting.aidl
@@ -39,4 +39,6 @@
UNKNOWN = 1,
SITED_INTERSTITIAL = 2,
COSITED_HORIZONTAL = 3,
+ COSITED_VERTICAL = 4,
+ COSITED_BOTH = 5,
}
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl
index 563b6c1..6ed5bb2 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Dataspace.aidl
@@ -35,65 +35,67 @@
/* @hide */
@Backing(type="int") @VintfStability
enum Dataspace {
- UNKNOWN = 0,
- ARBITRARY = 1,
+ UNKNOWN = 0x0,
+ ARBITRARY = 0x1,
STANDARD_SHIFT = 16,
- STANDARD_MASK = 4128768,
- STANDARD_UNSPECIFIED = 0,
- STANDARD_BT709 = 65536,
- STANDARD_BT601_625 = 131072,
- STANDARD_BT601_625_UNADJUSTED = 196608,
- STANDARD_BT601_525 = 262144,
- STANDARD_BT601_525_UNADJUSTED = 327680,
- STANDARD_BT2020 = 393216,
- STANDARD_BT2020_CONSTANT_LUMINANCE = 458752,
- STANDARD_BT470M = 524288,
- STANDARD_FILM = 589824,
- STANDARD_DCI_P3 = 655360,
- STANDARD_ADOBE_RGB = 720896,
+ STANDARD_MASK = (63 << 16) /* 4128768 */,
+ STANDARD_UNSPECIFIED = (0 << 16) /* 0 */,
+ STANDARD_BT709 = (1 << 16) /* 65536 */,
+ STANDARD_BT601_625 = (2 << 16) /* 131072 */,
+ STANDARD_BT601_625_UNADJUSTED = (3 << 16) /* 196608 */,
+ STANDARD_BT601_525 = (4 << 16) /* 262144 */,
+ STANDARD_BT601_525_UNADJUSTED = (5 << 16) /* 327680 */,
+ STANDARD_BT2020 = (6 << 16) /* 393216 */,
+ STANDARD_BT2020_CONSTANT_LUMINANCE = (7 << 16) /* 458752 */,
+ STANDARD_BT470M = (8 << 16) /* 524288 */,
+ STANDARD_FILM = (9 << 16) /* 589824 */,
+ STANDARD_DCI_P3 = (10 << 16) /* 655360 */,
+ STANDARD_ADOBE_RGB = (11 << 16) /* 720896 */,
TRANSFER_SHIFT = 22,
- TRANSFER_MASK = 130023424,
- TRANSFER_UNSPECIFIED = 0,
- TRANSFER_LINEAR = 4194304,
- TRANSFER_SRGB = 8388608,
- TRANSFER_SMPTE_170M = 12582912,
- TRANSFER_GAMMA2_2 = 16777216,
- TRANSFER_GAMMA2_6 = 20971520,
- TRANSFER_GAMMA2_8 = 25165824,
- TRANSFER_ST2084 = 29360128,
- TRANSFER_HLG = 33554432,
+ TRANSFER_MASK = (31 << 22) /* 130023424 */,
+ TRANSFER_UNSPECIFIED = (0 << 22) /* 0 */,
+ TRANSFER_LINEAR = (1 << 22) /* 4194304 */,
+ TRANSFER_SRGB = (2 << 22) /* 8388608 */,
+ TRANSFER_SMPTE_170M = (3 << 22) /* 12582912 */,
+ TRANSFER_GAMMA2_2 = (4 << 22) /* 16777216 */,
+ TRANSFER_GAMMA2_6 = (5 << 22) /* 20971520 */,
+ TRANSFER_GAMMA2_8 = (6 << 22) /* 25165824 */,
+ TRANSFER_ST2084 = (7 << 22) /* 29360128 */,
+ TRANSFER_HLG = (8 << 22) /* 33554432 */,
RANGE_SHIFT = 27,
- RANGE_MASK = 939524096,
- RANGE_UNSPECIFIED = 0,
- RANGE_FULL = 134217728,
- RANGE_LIMITED = 268435456,
- RANGE_EXTENDED = 402653184,
- SRGB_LINEAR = 138477568,
- SCRGB_LINEAR = 406913024,
- SRGB = 142671872,
- SCRGB = 411107328,
- JFIF = 146931712,
- BT601_625 = 281149440,
- BT601_525 = 281280512,
- BT709 = 281083904,
- DCI_P3_LINEAR = 139067392,
- DCI_P3 = 155844608,
- DISPLAY_P3_LINEAR = 139067392,
- DISPLAY_P3 = 143261696,
- ADOBE_RGB = 151715840,
- BT2020_LINEAR = 138805248,
- BT2020 = 147193856,
- BT2020_PQ = 163971072,
- DEPTH = 4096,
- SENSOR = 4097,
- BT2020_ITU = 281411584,
- BT2020_ITU_PQ = 298188800,
- BT2020_ITU_HLG = 302383104,
- BT2020_HLG = 168165376,
- DISPLAY_BT2020 = 142999552,
- DYNAMIC_DEPTH = 4098,
- JPEG_APP_SEGMENTS = 4099,
- HEIF = 4100,
- JPEG_R = 4101,
- BT709_FULL_RANGE = 146866176,
+ RANGE_MASK = (7 << 27) /* 939524096 */,
+ RANGE_UNSPECIFIED = (0 << 27) /* 0 */,
+ RANGE_FULL = (1 << 27) /* 134217728 */,
+ RANGE_LIMITED = (2 << 27) /* 268435456 */,
+ RANGE_EXTENDED = (3 << 27) /* 402653184 */,
+ SRGB_LINEAR = (((1 << 16) | (1 << 22)) | (1 << 27)) /* 138477568 */,
+ SCRGB_LINEAR = (((1 << 16) | (1 << 22)) | (3 << 27)) /* 406913024 */,
+ SRGB = (((1 << 16) | (2 << 22)) | (1 << 27)) /* 142671872 */,
+ SCRGB = (((1 << 16) | (2 << 22)) | (3 << 27)) /* 411107328 */,
+ JFIF = (((2 << 16) | (3 << 22)) | (1 << 27)) /* 146931712 */,
+ BT601_625 = (((2 << 16) | (3 << 22)) | (2 << 27)) /* 281149440 */,
+ BT601_525 = (((4 << 16) | (3 << 22)) | (2 << 27)) /* 281280512 */,
+ BT709 = (((1 << 16) | (3 << 22)) | (2 << 27)) /* 281083904 */,
+ DCI_P3_LINEAR = (((10 << 16) | (1 << 22)) | (1 << 27)) /* 139067392 */,
+ DCI_P3 = (((10 << 16) | (5 << 22)) | (1 << 27)) /* 155844608 */,
+ DISPLAY_P3_LINEAR = (((10 << 16) | (1 << 22)) | (1 << 27)) /* 139067392 */,
+ DISPLAY_P3 = (((10 << 16) | (2 << 22)) | (1 << 27)) /* 143261696 */,
+ ADOBE_RGB = (((11 << 16) | (4 << 22)) | (1 << 27)) /* 151715840 */,
+ ADOBE_RGB_LINEAR = (((11 << 16) | (1 << 22)) | (1 << 27)) /* 139132928 */,
+ BT2020_LINEAR = (((6 << 16) | (1 << 22)) | (1 << 27)) /* 138805248 */,
+ BT2020 = (((6 << 16) | (3 << 22)) | (1 << 27)) /* 147193856 */,
+ BT2020_PQ = (((6 << 16) | (7 << 22)) | (1 << 27)) /* 163971072 */,
+ BT2020_LINEAR_EXTENDED = (((6 << 16) | (1 << 22)) | (3 << 27)) /* 407240704 */,
+ DEPTH = 0x1000,
+ SENSOR = 0x1001,
+ BT2020_ITU = (((6 << 16) | (3 << 22)) | (2 << 27)) /* 281411584 */,
+ BT2020_ITU_PQ = (((6 << 16) | (7 << 22)) | (2 << 27)) /* 298188800 */,
+ BT2020_ITU_HLG = (((6 << 16) | (8 << 22)) | (2 << 27)) /* 302383104 */,
+ BT2020_HLG = (((6 << 16) | (8 << 22)) | (1 << 27)) /* 168165376 */,
+ DISPLAY_BT2020 = (((6 << 16) | (2 << 22)) | (1 << 27)) /* 142999552 */,
+ DYNAMIC_DEPTH = 0x1002,
+ JPEG_APP_SEGMENTS = 0x1003,
+ HEIF = 0x1004,
+ JPEG_R = 0x1005,
+ BT709_FULL_RANGE = (((1 << 16) | (3 << 22)) | (1 << 27)) /* 146866176 */,
}
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/DisplayHotplugEvent.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/DisplayHotplugEvent.aidl
new file mode 100644
index 0000000..63dca0a
--- /dev/null
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/DisplayHotplugEvent.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.graphics.common;
+@Backing(type="int") @VintfStability
+enum DisplayHotplugEvent {
+ CONNECTED = 0,
+ DISCONNECTED = 1,
+ ERROR_UNKNOWN = (-1) /* -1 */,
+ ERROR_INCOMPATIBLE_CABLE = (-2) /* -2 */,
+ ERROR_TOO_MANY_DISPLAYS = (-3) /* -3 */,
+}
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBuffer.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBuffer.aidl
index 1817769..0fe9493 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBuffer.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/HardwareBuffer.aidl
@@ -32,7 +32,10 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.graphics.common;
-/* @hide */
+/**
+ * @hide
+ * @deprecated : Use instead android.hardware.HardwareBuffer in frameworks/base
+ */
@VintfStability
parcelable HardwareBuffer {
android.hardware.graphics.common.HardwareBufferDescription description;
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PixelFormat.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PixelFormat.aidl
index 68857e8..ed84a44 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PixelFormat.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PixelFormat.aidl
@@ -36,36 +36,36 @@
@Backing(type="int") @VintfStability
enum PixelFormat {
UNSPECIFIED = 0,
- RGBA_8888 = 1,
- RGBX_8888 = 2,
- RGB_888 = 3,
- RGB_565 = 4,
- BGRA_8888 = 5,
- YCBCR_422_SP = 16,
- YCRCB_420_SP = 17,
- YCBCR_422_I = 20,
- RGBA_FP16 = 22,
- RAW16 = 32,
- BLOB = 33,
- IMPLEMENTATION_DEFINED = 34,
- YCBCR_420_888 = 35,
- RAW_OPAQUE = 36,
- RAW10 = 37,
- RAW12 = 38,
- RGBA_1010102 = 43,
- Y8 = 538982489,
- Y16 = 540422489,
- YV12 = 842094169,
- DEPTH_16 = 48,
- DEPTH_24 = 49,
- DEPTH_24_STENCIL_8 = 50,
- DEPTH_32F = 51,
- DEPTH_32F_STENCIL_8 = 52,
- STENCIL_8 = 53,
- YCBCR_P010 = 54,
- HSV_888 = 55,
- R_8 = 56,
- R_16_UINT = 57,
- RG_1616_UINT = 58,
- RGBA_10101010 = 59,
+ RGBA_8888 = 0x1,
+ RGBX_8888 = 0x2,
+ RGB_888 = 0x3,
+ RGB_565 = 0x4,
+ BGRA_8888 = 0x5,
+ YCBCR_422_SP = 0x10,
+ YCRCB_420_SP = 0x11,
+ YCBCR_422_I = 0x14,
+ RGBA_FP16 = 0x16,
+ RAW16 = 0x20,
+ BLOB = 0x21,
+ IMPLEMENTATION_DEFINED = 0x22,
+ YCBCR_420_888 = 0x23,
+ RAW_OPAQUE = 0x24,
+ RAW10 = 0x25,
+ RAW12 = 0x26,
+ RGBA_1010102 = 0x2B,
+ Y8 = 0x20203859,
+ Y16 = 0x20363159,
+ YV12 = 0x32315659,
+ DEPTH_16 = 0x30,
+ DEPTH_24 = 0x31,
+ DEPTH_24_STENCIL_8 = 0x32,
+ DEPTH_32F = 0x33,
+ DEPTH_32F_STENCIL_8 = 0x34,
+ STENCIL_8 = 0x35,
+ YCBCR_P010 = 0x36,
+ HSV_888 = 0x37,
+ R_8 = 0x38,
+ R_16_UINT = 0x39,
+ RG_1616_UINT = 0x3a,
+ RGBA_10101010 = 0x3b,
}
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponentType.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponentType.aidl
index 8ba9381..e306751 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponentType.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/PlaneLayoutComponentType.aidl
@@ -35,12 +35,12 @@
/* @hide */
@Backing(type="long") @VintfStability
enum PlaneLayoutComponentType {
- Y = 1,
- CB = 2,
- CR = 4,
- R = 1024,
- G = 2048,
- B = 4096,
- RAW = 1048576,
- A = 1073741824,
+ Y = (1 << 0) /* 1 */,
+ CB = (1 << 1) /* 2 */,
+ CR = (1 << 2) /* 4 */,
+ R = (1 << 10) /* 1024 */,
+ G = (1 << 11) /* 2048 */,
+ B = (1 << 12) /* 4096 */,
+ RAW = (1 << 20) /* 1048576 */,
+ A = (1 << 30) /* 1073741824 */,
}
diff --git a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl
index 986d089..dbed57d 100644
--- a/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl
+++ b/graphics/common/aidl/aidl_api/android.hardware.graphics.common/current/android/hardware/graphics/common/Transform.aidl
@@ -36,9 +36,9 @@
@Backing(type="int") @VintfStability
enum Transform {
NONE = 0,
- FLIP_H = 1,
- FLIP_V = 2,
- ROT_90 = 4,
- ROT_180 = 3,
- ROT_270 = 7,
+ FLIP_H = (1 << 0) /* 1 */,
+ FLIP_V = (1 << 1) /* 2 */,
+ ROT_90 = (1 << 2) /* 4 */,
+ ROT_180 = (FLIP_H | FLIP_V) /* 3 */,
+ ROT_270 = ((FLIP_H | FLIP_V) | ROT_90) /* 7 */,
}
diff --git a/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl b/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl
index 12bc441..0d1a094 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/BufferUsage.aidl
@@ -24,35 +24,47 @@
@Backing(type="long")
enum BufferUsage {
/** bit 0-3 is an enum */
- CPU_READ_MASK = 0xf,
+ CPU_READ_MASK = 0xf,
/** buffer is never read by CPU */
- CPU_READ_NEVER = 0,
+ CPU_READ_NEVER = 0,
/** buffer is rarely read by CPU */
- CPU_READ_RARELY = 2,
+ CPU_READ_RARELY = 2,
/** buffer is often read by CPU */
- CPU_READ_OFTEN = 3,
+ CPU_READ_OFTEN = 3,
/** bit 4-7 is an enum */
- CPU_WRITE_MASK = 0xf << 4,
+ CPU_WRITE_MASK = 0xf << 4,
/** buffer is never written by CPU */
- CPU_WRITE_NEVER = 0 << 4,
+ CPU_WRITE_NEVER = 0 << 4,
/** buffer is rarely written by CPU */
- CPU_WRITE_RARELY = 2 << 4,
+ CPU_WRITE_RARELY = 2 << 4,
/** buffer is often written by CPU */
- CPU_WRITE_OFTEN = 3 << 4,
+ CPU_WRITE_OFTEN = 3 << 4,
- /** buffer is used as a GPU texture */
- GPU_TEXTURE = 1 << 8,
+ /**
+ * Buffer may be used as a GPU texture
+ *
+ * Buffers allocated with this flag must be
+ * texturable both in EGL/GL & Vulkan via
+ * their respective external memory extensions
+ */
+ GPU_TEXTURE = 1 << 8,
- /** buffer is used as a GPU render target */
- GPU_RENDER_TARGET = 1 << 9,
+ /**
+ * Buffer may be used as a GPU render target
+ *
+ * Buffers allocated with this flag must be
+ * renderable both in EGL/GL & Vulkan via
+ * their respective external memory extensions
+ */
+ GPU_RENDER_TARGET = 1 << 9,
/** bit 10 must be zero */
/** buffer is used as a composer HAL overlay layer */
- COMPOSER_OVERLAY = 1 << 11,
+ COMPOSER_OVERLAY = 1 << 11,
/** buffer is used as a composer HAL client target */
- COMPOSER_CLIENT_TARGET = 1 << 12,
+ COMPOSER_CLIENT_TARGET = 1 << 12,
/** bit 13 must be zero */
@@ -61,86 +73,86 @@
* contents (or information derived from the contents) into unprotected
* memory.
*/
- PROTECTED = 1 << 14,
+ PROTECTED = 1 << 14,
/** buffer is used as a hwcomposer HAL cursor layer */
- COMPOSER_CURSOR = 1 << 15,
+ COMPOSER_CURSOR = 1 << 15,
/** buffer is used as a video encoder input */
- VIDEO_ENCODER = 1 << 16,
+ VIDEO_ENCODER = 1 << 16,
/** buffer is used as a camera HAL output */
- CAMERA_OUTPUT = 1 << 17,
+ CAMERA_OUTPUT = 1 << 17,
/** buffer is used as a camera HAL input */
- CAMERA_INPUT = 1 << 18,
+ CAMERA_INPUT = 1 << 18,
/** bit 19 must be zero */
/** buffer is used as a renderscript allocation */
- RENDERSCRIPT = 1 << 20,
+ RENDERSCRIPT = 1 << 20,
/** bit 21 must be zero */
/** buffer is used as a video decoder output */
- VIDEO_DECODER = 1 << 22,
+ VIDEO_DECODER = 1 << 22,
/** buffer is used as a sensor direct report output */
- SENSOR_DIRECT_DATA = 1 << 23,
+ SENSOR_DIRECT_DATA = 1 << 23,
/**
* buffer is used as as an OpenGL shader storage or uniform
* buffer object
*/
- GPU_DATA_BUFFER = 1 << 24,
+ GPU_DATA_BUFFER = 1 << 24,
/** buffer is used as a cube map texture */
- GPU_CUBE_MAP = 1 << 25,
+ GPU_CUBE_MAP = 1 << 25,
/** buffer contains a complete mipmap hierarchy */
- GPU_MIPMAP_COMPLETE = 1 << 26,
+ GPU_MIPMAP_COMPLETE = 1 << 26,
/**
* Buffer is used as input for HEIC encoder.
*/
- HW_IMAGE_ENCODER = 1 << 27,
+ HW_IMAGE_ENCODER = 1 << 27,
/* Bits 28-31 are reserved for vendor usage */
/**
- * Buffer is used for front-buffer rendering.
- *
- * To satisfy an allocation with this usage, the resulting buffer
- * must operate as equivalent to shared memory for all targets.
- *
- * For CPU_USAGE_* other than NEVER, this means the buffer must
- * "lock in place". The buffers must be directly accessible via mapping.
- *
- * For GPU_RENDER_TARGET the buffer must behave equivalent to a
- * single-buffered EGL surface. For example glFlush must perform
- * a flush, same as if the default framebuffer was single-buffered.
- *
- * For COMPOSER_* the HWC must not perform any caching for this buffer
- * when submitted for composition. HWCs do not need to do any form
- * of auto-refresh, and they are allowed to cache composition results between
- * presents from SF (such as for panel self-refresh), but for any given
- * present the buffer must be composited from even if it otherwise appears
- * to be the same as a previous composition.
- *
- * If the GPU & HWC supports EGL_SINGLE_BUFFER, then it is recommended that
- * FRONT_BUFFER usage is supported for the same formats as supported by
- * EGL_SINGLE_BUFFER. In particular, it is recommended that the following
- * combination is supported when possible:
- * Format = RGBA_8888
- * Usage = FRONT_BUFFER | GPU_RENDER_TARGET | COMPOSER_OVERLAY
- *
- */
- FRONT_BUFFER = 1L << 32,
+ * Buffer is used for front-buffer rendering.
+ *
+ * To satisfy an allocation with this usage, the resulting buffer
+ * must operate as equivalent to shared memory for all targets.
+ *
+ * For CPU_USAGE_* other than NEVER, this means the buffer must
+ * "lock in place". The buffers must be directly accessible via mapping.
+ *
+ * For GPU_RENDER_TARGET the buffer must behave equivalent to a
+ * single-buffered EGL surface. For example glFlush must perform
+ * a flush, same as if the default framebuffer was single-buffered.
+ *
+ * For COMPOSER_* the HWC must not perform any caching for this buffer
+ * when submitted for composition. HWCs do not need to do any form
+ * of auto-refresh, and they are allowed to cache composition results between
+ * presents from SF (such as for panel self-refresh), but for any given
+ * present the buffer must be composited from even if it otherwise appears
+ * to be the same as a previous composition.
+ *
+ * If the GPU & HWC supports EGL_SINGLE_BUFFER, then it is recommended that
+ * FRONT_BUFFER usage is supported for the same formats as supported by
+ * EGL_SINGLE_BUFFER. In particular, it is recommended that the following
+ * combination is supported when possible:
+ * Format = RGBA_8888
+ * Usage = FRONT_BUFFER | GPU_RENDER_TARGET | COMPOSER_OVERLAY
+ *
+ */
+ FRONT_BUFFER = 1L << 32,
/** bits 28-31 are reserved for vendor extensions */
- VENDOR_MASK = 0xf << 28,
+ VENDOR_MASK = 0xf << 28,
/** bits 33-47 must be zero and are reserved for future versions */
/** bits 48-63 are reserved for vendor extensions */
- VENDOR_MASK_HI = (1L * 0xffff) << 48,
+ VENDOR_MASK_HI = (1L * 0xffff) << 48,
}
diff --git a/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl b/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl
index ac44853..7da45da 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/ChromaSiting.aidl
@@ -37,4 +37,12 @@
* Cb and Cr are vertically sited interstitially.
* This is used by 4:2:0 for MPEG-2 frame pictures. */
COSITED_HORIZONTAL = 3,
+
+ /* Cb and Cr are horizontally sited interstitially with a luma sample.
+ * Cb and Cr are vertically sited coincident. */
+ COSITED_VERTICAL = 4,
+
+ /* Cb and Cr are both horizontally & vertically sited coincident
+ * with a luma sample. */
+ COSITED_BOTH = 5,
}
diff --git a/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl b/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl
index 3ff0a65..79737eb 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/Dataspace.aidl
@@ -23,11 +23,26 @@
/**
* Default-assumption data space, when not explicitly specified.
*
- * It is safest to assume the buffer is an image with sRGB primaries and
- * encoding ranges, but the consumer and/or the producer of the data may
- * simply be using defaults. No automatic gamma transform should be
- * expected, except for a possible display gamma transform when drawn to a
- * screen.
+ * IAllocator implementations must not assume a particular dataspace interpretation when
+ * allocating a buffer. That is, the dataspace stored on a buffer's metadata must
+ * explicitly be UNKNOWN at the time of allocation. All other vendor implementations (for
+ * example, IComposer) are suggested to assume that the buffer is an image that conforms
+ * to the recommendations outlined by STANDARD_UNSPECIFIED, TRANSFER_UNSPECIFIED, and
+ * RANGE_UNSPECIFIED in order to avoid obviously-broken behavior.
+ *
+ * This means:
+ * - RGB buffers may be assumed to follow sRGB (IEC 61966-2.1)
+ * - YCbCr buffers smaller than 720p may be assumed to follow BT. 601-7
+ * - YCbCr buffers at least 720p may be assumed to follow BT. 709-6
+ * - Y buffers are full range with an undefined transfer and primaries
+ * - All other buffer formats may be treated in an implementation-defined manner
+ *
+ * It is the framework's - and application's - responsibility to communicate
+ * an accurate dataspace for any buffers throughout the system to guarantee
+ * well-defined behavior. For the framework, this means translating UNKNOWN
+ * dataspaces to a chosen default, and setting gralloc metadata on the buffer
+ * accordingly. For the application, this means signaling a defined dataspace
+ * to any framework apis.
*/
UNKNOWN = 0x0,
@@ -544,6 +559,13 @@
ADOBE_RGB = 11 << 16 | 4 << 22 | 1 << 27, // STANDARD_ADOBE_RGB | TRANSFER_GAMMA2_2 | RANGE_FULL
/**
+ * Adobe RGB LINEAR
+ *
+ * Use full range, linear transfer and Adobe RGB primaries
+ */
+ ADOBE_RGB_LINEAR = 11 << 16 | 1 << 22 | 1 << 27, // STANDARD_ADOBE_RGB | TRANSFER_LINEAR | RANGE_FULL
+
+ /**
* ITU-R Recommendation 2020 (BT.2020)
*
* Ultra High-definition television
@@ -571,6 +593,15 @@
BT2020_PQ = 6 << 16 | 7 << 22 | 1 << 27, // STANDARD_BT2020 | TRANSFER_ST2084 | RANGE_FULL
/**
+ * ITU-R Recommendation 2020 (BT.2020)
+ *
+ * Ultra High-definition television
+ *
+ * Use extended range, linear transfer and BT2020 standard
+ */
+ BT2020_LINEAR_EXTENDED = 6 << 16 | 1 << 22 | 3 << 27, // STANDARD_BT2020 | TRANSFER_LINEAR | RANGE_EXTENDED
+
+ /**
* Data spaces for non-color formats
*/
diff --git a/graphics/common/aidl/android/hardware/graphics/common/DisplayHotplugEvent.aidl b/graphics/common/aidl/android/hardware/graphics/common/DisplayHotplugEvent.aidl
new file mode 100644
index 0000000..b35ada5
--- /dev/null
+++ b/graphics/common/aidl/android/hardware/graphics/common/DisplayHotplugEvent.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.
+ */
+
+package android.hardware.graphics.common;
+
+/**
+ * Display hotplug events through onHotplugEvent callback.
+ */
+@VintfStability
+@Backing(type="int")
+enum DisplayHotplugEvent {
+ /**
+ * Display is successfully connected.
+ * Connected may be called more than once and the behavior of subsequent
+ * calls is that SurfaceFlinger queries the display properties again.
+ */
+ CONNECTED = 0,
+
+ /** Display is successfully disconnected */
+ DISCONNECTED = 1,
+
+ /** Display is plugged in, but an unknown error occurred */
+ ERROR_UNKNOWN = -1,
+
+ /** Display is plugged in, but incompatible cable error detected */
+ ERROR_INCOMPATIBLE_CABLE = -2,
+
+ /**
+ * Display is plugged in, but exceeds the max number of
+ * displays that can be simultaneously connected
+ */
+ ERROR_TOO_MANY_DISPLAYS = -3,
+}
diff --git a/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl b/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl
index 50306dc..ac95b1c 100644
--- a/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl
+++ b/graphics/common/aidl/android/hardware/graphics/common/HardwareBuffer.aidl
@@ -20,11 +20,13 @@
import android.hardware.graphics.common.HardwareBufferDescription;
/**
- * Stable AIDL counterpart of AHardwareBuffer.
+ * [Deprecated] Stable AIDL counterpart of AHardwareBuffer.
*
- * @note This is different from the public HardwareBuffer.
- * @sa +ndk libnativewindow#AHardwareBuffer
+ * @note This is different from the public HardwareBuffer. As the public
+ HardwareBuffer now supports being used in stable-aidl interfaces,
+ that is strongly preferred for new usages.
* @hide
+ * @deprecated: Use instead android.hardware.HardwareBuffer in frameworks/base
*/
@VintfStability
parcelable HardwareBuffer {
diff --git a/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h b/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h
index 499d3b9..336d15d 100644
--- a/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h
+++ b/graphics/composer/2.1/utils/command-buffer/include/composer-command-buffer/2.1/ComposerCommandBuffer.h
@@ -679,6 +679,10 @@
uint32_t read() { return mData[mDataRead++]; }
+ bool isReadSizeValid(uint32_t size) const {
+ return mDataRead * sizeof(uint32_t) + size <= mDataSize;
+ }
+
int32_t readSigned() {
int32_t val;
memcpy(&val, &mData[mDataRead++], sizeof(val));
@@ -760,7 +764,7 @@
std::unique_ptr<uint32_t[]> mData;
uint32_t mDataRead;
- private:
+ private:
std::unique_ptr<CommandQueueType> mQueue;
uint32_t mDataMaxSize;
diff --git a/graphics/composer/2.1/utils/resources/Android.bp b/graphics/composer/2.1/utils/resources/Android.bp
index 8705dee..776bf28 100644
--- a/graphics/composer/2.1/utils/resources/Android.bp
+++ b/graphics/composer/2.1/utils/resources/Android.bp
@@ -30,20 +30,15 @@
vendor_available: true,
shared_libs: [
"android.hardware.graphics.composer@2.1",
- "android.hardware.graphics.mapper@2.0",
- "android.hardware.graphics.mapper@3.0",
- "android.hardware.graphics.mapper@4.0",
"libcutils",
"libhardware", // TODO remove hwcomposer2.h dependency
"libhidlbase",
"liblog",
+ "libui",
"libutils",
],
export_shared_lib_headers: [
"android.hardware.graphics.composer@2.1",
- "android.hardware.graphics.mapper@2.0",
- "android.hardware.graphics.mapper@3.0",
- "android.hardware.graphics.mapper@4.0",
"libhardware",
"libhidlbase",
"liblog",
diff --git a/graphics/composer/2.1/utils/resources/ComposerResources.cpp b/graphics/composer/2.1/utils/resources/ComposerResources.cpp
index e52bf71..80bfb7a 100644
--- a/graphics/composer/2.1/utils/resources/ComposerResources.cpp
+++ b/graphics/composer/2.1/utils/resources/ComposerResources.cpp
@@ -18,6 +18,8 @@
#include "composer-resources/2.1/ComposerResources.h"
+#include <ui/GraphicBufferMapper.h>
+
namespace android {
namespace hardware {
namespace graphics {
@@ -25,23 +27,10 @@
namespace V2_1 {
namespace hal {
+ComposerHandleImporter::ComposerHandleImporter() : mMapper{GraphicBufferMapper::get()} {}
+
bool ComposerHandleImporter::init() {
- mMapper4 = mapper::V4_0::IMapper::getService();
- if (mMapper4) {
- return true;
- }
- ALOGI_IF(!mMapper4, "failed to get mapper 4.0 service, falling back to mapper 3.0");
-
- mMapper3 = mapper::V3_0::IMapper::getService();
- if (mMapper3) {
- return true;
- }
- ALOGI_IF(!mMapper3, "failed to get mapper 3.0 service, falling back to mapper 2.0");
-
- mMapper2 = mapper::V2_0::IMapper::getService();
- ALOGE_IF(!mMapper2, "failed to get mapper 2.0 service");
-
- return mMapper2 != nullptr;
+ return true;
}
Error ComposerHandleImporter::importBuffer(const native_handle_t* rawHandle,
@@ -51,51 +40,17 @@
return Error::NONE;
}
- const native_handle_t* bufferHandle;
- if (mMapper2) {
- mapper::V2_0::Error error;
- mMapper2->importBuffer(rawHandle, [&](const auto& tmpError, const auto& tmpBufferHandle) {
- error = tmpError;
- bufferHandle = static_cast<const native_handle_t*>(tmpBufferHandle);
- });
- if (error != mapper::V2_0::Error::NONE) {
- return Error::NO_RESOURCES;
- }
+ status_t status = mMapper.importBufferNoValidate(rawHandle, outBufferHandle);
+ if (status == STATUS_OK) {
+ return Error::NONE;
+ } else {
+ return Error::NO_RESOURCES;
}
- if (mMapper3) {
- mapper::V3_0::Error error;
- mMapper3->importBuffer(rawHandle, [&](const auto& tmpError, const auto& tmpBufferHandle) {
- error = tmpError;
- bufferHandle = static_cast<const native_handle_t*>(tmpBufferHandle);
- });
- if (error != mapper::V3_0::Error::NONE) {
- return Error::NO_RESOURCES;
- }
- }
- if (mMapper4) {
- mapper::V4_0::Error error;
- mMapper4->importBuffer(rawHandle, [&](const auto& tmpError, const auto& tmpBufferHandle) {
- error = tmpError;
- bufferHandle = static_cast<const native_handle_t*>(tmpBufferHandle);
- });
- if (error != mapper::V4_0::Error::NONE) {
- return Error::NO_RESOURCES;
- }
- }
-
- *outBufferHandle = bufferHandle;
- return Error::NONE;
}
void ComposerHandleImporter::freeBuffer(const native_handle_t* bufferHandle) {
if (bufferHandle) {
- if (mMapper2) {
- mMapper2->freeBuffer(static_cast<void*>(const_cast<native_handle_t*>(bufferHandle)));
- } else if (mMapper3) {
- mMapper3->freeBuffer(static_cast<void*>(const_cast<native_handle_t*>(bufferHandle)));
- } else if (mMapper4) {
- mMapper4->freeBuffer(static_cast<void*>(const_cast<native_handle_t*>(bufferHandle)));
- }
+ mMapper.freeBuffer(bufferHandle);
}
}
diff --git a/graphics/composer/2.1/utils/resources/include/composer-resources/2.1/ComposerResources.h b/graphics/composer/2.1/utils/resources/include/composer-resources/2.1/ComposerResources.h
index de78a59..9838118 100644
--- a/graphics/composer/2.1/utils/resources/include/composer-resources/2.1/ComposerResources.h
+++ b/graphics/composer/2.1/utils/resources/include/composer-resources/2.1/ComposerResources.h
@@ -27,12 +27,10 @@
#include <android/hardware/graphics/composer/2.1/types.h>
-#include <android/hardware/graphics/mapper/2.0/IMapper.h>
-#include <android/hardware/graphics/mapper/3.0/IMapper.h>
-#include <android/hardware/graphics/mapper/4.0/IMapper.h>
#include <log/log.h>
namespace android {
+class GraphicBufferMapper;
namespace hardware {
namespace graphics {
namespace composer {
@@ -42,6 +40,7 @@
// wrapper for IMapper to import buffers and sideband streams
class ComposerHandleImporter {
public:
+ ComposerHandleImporter();
bool init();
Error importBuffer(const native_handle_t* rawHandle, const native_handle_t** outBufferHandle);
@@ -50,9 +49,7 @@
void freeStream(const native_handle_t* streamHandle);
private:
- sp<mapper::V2_0::IMapper> mMapper2;
- sp<mapper::V3_0::IMapper> mMapper3;
- sp<mapper::V4_0::IMapper> mMapper4;
+ GraphicBufferMapper& mMapper;
};
class ComposerHandleCache {
diff --git a/graphics/composer/2.1/utils/vts/Android.bp b/graphics/composer/2.1/utils/vts/Android.bp
index c457df2..9064475 100644
--- a/graphics/composer/2.1/utils/vts/Android.bp
+++ b/graphics/composer/2.1/utils/vts/Android.bp
@@ -27,7 +27,6 @@
cc_library_static {
name: "android.hardware.graphics.composer@2.1-vts",
defaults: [
- "android.hardware.graphics.allocator-ndk_static",
"hidl_defaults",
],
srcs: [
@@ -35,18 +34,15 @@
"GraphicsComposerCallback.cpp",
"TestCommandReader.cpp",
],
+ shared_libs: [
+ "libui",
+ ],
static_libs: [
"android.hardware.graphics.composer@2.1",
- "android.hardware.graphics.mapper@2.0-vts",
- "android.hardware.graphics.mapper@3.0-vts",
- "android.hardware.graphics.mapper@4.0-vts",
"libgtest",
],
export_static_lib_headers: [
"android.hardware.graphics.composer@2.1",
- "android.hardware.graphics.mapper@2.0-vts",
- "android.hardware.graphics.mapper@3.0-vts",
- "android.hardware.graphics.mapper@4.0-vts",
],
header_libs: [
"android.hardware.graphics.composer@2.1-command-buffer",
diff --git a/graphics/composer/2.1/utils/vts/ComposerVts.cpp b/graphics/composer/2.1/utils/vts/ComposerVts.cpp
index 4603dd1..8b89784 100644
--- a/graphics/composer/2.1/utils/vts/ComposerVts.cpp
+++ b/graphics/composer/2.1/utils/vts/ComposerVts.cpp
@@ -308,113 +308,6 @@
writer->reset();
}
-NativeHandleWrapper::~NativeHandleWrapper() {
- if (mHandle) {
- mGralloc.freeBuffer(mHandle);
- }
-}
-
-Gralloc::Gralloc() {
- [this] {
- ASSERT_NO_FATAL_FAILURE(mGralloc4 = std::make_shared<Gralloc4>(
- /*aidlAllocatorServiceName*/ IAllocator::descriptor +
- std::string("/default"),
- /*hidlAllocatorServiceName*/ "default",
- /*mapperServiceName*/ "default",
- /*errOnFailure=*/false));
- if (!mGralloc4->hasAllocator() || mGralloc4->getMapper() == nullptr) {
- mGralloc4 = nullptr;
- ASSERT_NO_FATAL_FAILURE(mGralloc3 = std::make_shared<Gralloc3>("default", "default",
- /*errOnFailure=*/false));
- if (mGralloc3->getAllocator() == nullptr || mGralloc3->getMapper() == nullptr) {
- mGralloc3 = nullptr;
- ASSERT_NO_FATAL_FAILURE(mGralloc2 = std::make_shared<Gralloc2>());
- }
- }
- }();
-}
-
-const NativeHandleWrapper Gralloc::allocate(uint32_t width, uint32_t height, uint32_t layerCount,
- PixelFormat format, uint64_t usage, bool import,
- uint32_t* outStride) {
- const native_handle_t* handle;
- if (mGralloc4) {
- IMapper4::BufferDescriptorInfo info{};
- info.width = width;
- info.height = height;
- info.layerCount = layerCount;
- info.format = static_cast<android::hardware::graphics::common::V1_2::PixelFormat>(format);
- info.usage = usage;
- handle = mGralloc4->allocate(info, import, outStride);
- } else if (mGralloc3) {
- IMapper3::BufferDescriptorInfo info{};
- info.width = width;
- info.height = height;
- info.layerCount = layerCount;
- info.format = static_cast<android::hardware::graphics::common::V1_2::PixelFormat>(format);
- info.usage = usage;
- handle = mGralloc3->allocate(info, import, outStride);
- } else {
- IMapper2::BufferDescriptorInfo info{};
- info.width = width;
- info.height = height;
- info.layerCount = layerCount;
- info.format = format;
- info.usage = usage;
- handle = mGralloc2->allocate(info, import, outStride);
- }
- return NativeHandleWrapper(*this, handle);
-}
-
-void* Gralloc::lock(const native_handle_t* bufferHandle, uint64_t cpuUsage,
- const AccessRegion& accessRegionRect, int acquireFence) {
- if (mGralloc4) {
- IMapper4::Rect accessRegion;
- accessRegion.left = accessRegionRect.left;
- accessRegion.top = accessRegionRect.top;
- accessRegion.width = accessRegionRect.width;
- accessRegion.height = accessRegionRect.height;
- return mGralloc4->lock(bufferHandle, cpuUsage, accessRegion, acquireFence);
- } else if (mGralloc3) {
- IMapper3::Rect accessRegion;
- accessRegion.left = accessRegionRect.left;
- accessRegion.top = accessRegionRect.top;
- accessRegion.width = accessRegionRect.width;
- accessRegion.height = accessRegionRect.height;
- int32_t bytesPerPixel;
- int32_t bytesPerStride;
- return mGralloc3->lock(bufferHandle, cpuUsage, accessRegion, acquireFence, &bytesPerPixel,
- &bytesPerStride);
- } else {
- IMapper2::Rect accessRegion;
- accessRegion.left = accessRegionRect.left;
- accessRegion.top = accessRegionRect.top;
- accessRegion.width = accessRegionRect.width;
- accessRegion.height = accessRegionRect.height;
- return mGralloc2->lock(bufferHandle, cpuUsage, accessRegion, acquireFence);
- }
-}
-
-int Gralloc::unlock(const native_handle_t* bufferHandle) {
- if (mGralloc4) {
- return mGralloc4->unlock(bufferHandle);
- } else if (mGralloc3) {
- return mGralloc3->unlock(bufferHandle);
- } else {
- return mGralloc2->unlock(bufferHandle);
- }
-}
-
-void Gralloc::freeBuffer(const native_handle_t* bufferHandle) {
- if (mGralloc4) {
- mGralloc4->freeBuffer(bufferHandle);
- } else if (mGralloc3) {
- mGralloc3->freeBuffer(bufferHandle);
- } else {
- mGralloc2->freeBuffer(bufferHandle);
- }
-}
-
} // namespace vts
} // namespace V2_1
} // namespace composer
diff --git a/graphics/composer/2.1/utils/vts/include/composer-vts/2.1/ComposerVts.h b/graphics/composer/2.1/utils/vts/include/composer-vts/2.1/ComposerVts.h
index f8ea661..c0aacb5 100644
--- a/graphics/composer/2.1/utils/vts/include/composer-vts/2.1/ComposerVts.h
+++ b/graphics/composer/2.1/utils/vts/include/composer-vts/2.1/ComposerVts.h
@@ -25,9 +25,6 @@
#include <android/hardware/graphics/composer/2.1/IComposer.h>
#include <composer-command-buffer/2.1/ComposerCommandBuffer.h>
#include <composer-vts/2.1/TestCommandReader.h>
-#include <mapper-vts/2.0/MapperVts.h>
-#include <mapper-vts/3.0/MapperVts.h>
-#include <mapper-vts/4.0/MapperVts.h>
#include <utils/StrongPointer.h>
#include "gtest/gtest.h"
@@ -43,13 +40,6 @@
using android::hardware::graphics::common::V1_0::Dataspace;
using android::hardware::graphics::common::V1_0::Hdr;
using android::hardware::graphics::common::V1_0::PixelFormat;
-using IMapper2 = android::hardware::graphics::mapper::V2_0::IMapper;
-using IMapper3 = android::hardware::graphics::mapper::V3_0::IMapper;
-using IMapper4 = android::hardware::graphics::mapper::V4_0::IMapper;
-using Gralloc2 = android::hardware::graphics::mapper::V2_0::vts::Gralloc;
-using Gralloc3 = android::hardware::graphics::mapper::V3_0::vts::Gralloc;
-using Gralloc4 = android::hardware::graphics::mapper::V4_0::vts::Gralloc;
-using IAllocator = aidl::android::hardware::graphics::allocator::IAllocator;
class ComposerClient;
@@ -129,52 +119,6 @@
const sp<IComposerClient> mClient;
};
-class AccessRegion {
- public:
- int32_t left;
- int32_t top;
- int32_t width;
- int32_t height;
-};
-
-class Gralloc;
-
-// RAII wrapper around native_handle_t*
-class NativeHandleWrapper {
- public:
- NativeHandleWrapper(Gralloc& gralloc, const native_handle_t* handle)
- : mGralloc(gralloc), mHandle(handle) {}
-
- ~NativeHandleWrapper();
-
- const native_handle_t* get() { return mHandle; }
-
- private:
- Gralloc& mGralloc;
- const native_handle_t* mHandle;
-};
-
-class Gralloc {
- public:
- explicit Gralloc();
-
- const NativeHandleWrapper allocate(uint32_t width, uint32_t height, uint32_t layerCount,
- PixelFormat format, uint64_t usage, bool import = true,
- uint32_t* outStride = nullptr);
-
- void* lock(const native_handle_t* bufferHandle, uint64_t cpuUsage,
- const AccessRegion& accessRegionRect, int acquireFence);
-
- int unlock(const native_handle_t* bufferHandle);
-
- void freeBuffer(const native_handle_t* bufferHandle);
-
- protected:
- std::shared_ptr<Gralloc2> mGralloc2 = nullptr;
- std::shared_ptr<Gralloc3> mGralloc3 = nullptr;
- std::shared_ptr<Gralloc4> mGralloc4 = nullptr;
-};
-
} // namespace vts
} // namespace V2_1
} // namespace composer
diff --git a/graphics/composer/2.1/vts/functional/Android.bp b/graphics/composer/2.1/vts/functional/Android.bp
index 62dfda3..57a85d6 100644
--- a/graphics/composer/2.1/vts/functional/Android.bp
+++ b/graphics/composer/2.1/vts/functional/Android.bp
@@ -28,7 +28,6 @@
name: "VtsHalGraphicsComposerV2_1TargetTest",
defaults: [
"VtsHalTargetTestDefaults",
- "android.hardware.graphics.allocator-ndk_static",
],
tidy_timeout_srcs: ["VtsHalGraphicsComposerV2_1TargetTest.cpp"],
srcs: ["VtsHalGraphicsComposerV2_1TargetTest.cpp"],
@@ -39,22 +38,12 @@
"libbinder_ndk",
"libfmq",
"libsync",
+ "libui",
"android.hardware.common-V2-ndk",
- "android.hardware.graphics.mapper@2.0",
- "android.hardware.graphics.mapper@2.1",
- "android.hardware.graphics.mapper@3.0",
- "android.hardware.graphics.mapper@4.0",
],
static_libs: [
- "android.hardware.graphics.allocator@2.0",
- "android.hardware.graphics.allocator@3.0",
- "android.hardware.graphics.allocator@4.0",
"android.hardware.graphics.composer@2.1",
"android.hardware.graphics.composer@2.1-vts",
- "android.hardware.graphics.mapper@2.0-vts",
- "android.hardware.graphics.mapper@2.1-vts",
- "android.hardware.graphics.mapper@3.0-vts",
- "android.hardware.graphics.mapper@4.0-vts",
"libaidlcommonsupport",
],
header_libs: [
diff --git a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp
index 9444d89..b67cfc2 100644
--- a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp
+++ b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp
@@ -25,9 +25,7 @@
#include <hardware/hwcomposer2.h>
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>
-#include <mapper-vts/2.0/MapperVts.h>
-#include <mapper-vts/3.0/MapperVts.h>
-#include <mapper-vts/4.0/MapperVts.h>
+#include <ui/GraphicBuffer.h>
#include <unistd.h>
@@ -52,7 +50,6 @@
using android::hardware::graphics::common::V1_0::Dataspace;
using android::hardware::graphics::common::V1_0::PixelFormat;
using android::hardware::graphics::common::V1_0::Transform;
-using GrallocError = android::hardware::graphics::mapper::V2_0::Error;
class GraphicsComposerHidlTest : public ::testing::TestWithParam<std::string> {
protected:
@@ -651,7 +648,6 @@
void SetUp() override {
ASSERT_NO_FATAL_FAILURE(GraphicsComposerHidlTest::SetUp());
- ASSERT_NO_FATAL_FAILURE(mGralloc = std::make_unique<Gralloc>());
Config activeConfig = mComposerClient->getActiveConfig(mPrimaryDisplay);
mDisplayWidth = mComposerClient->getDisplayAttribute(mPrimaryDisplay, activeConfig,
IComposerClient::Attribute::WIDTH);
@@ -666,13 +662,17 @@
ASSERT_NO_FATAL_FAILURE(GraphicsComposerHidlTest::TearDown());
}
- NativeHandleWrapper allocate() { return allocate(mDisplayWidth, mDisplayHeight); }
+ sp<GraphicBuffer> allocate() { return allocate(mDisplayWidth, mDisplayHeight); }
- NativeHandleWrapper allocate(uint32_t width, uint32_t height) {
- uint64_t usage =
+ sp<GraphicBuffer> allocate(int32_t width, int32_t height) {
+ auto result = sp<GraphicBuffer>::make(
+ width, height, static_cast<int32_t>(PixelFormat::RGBA_8888), /*layerCount*/ 1,
static_cast<uint64_t>(BufferUsage::CPU_WRITE_OFTEN | BufferUsage::CPU_READ_OFTEN |
- BufferUsage::COMPOSER_OVERLAY);
- return mGralloc->allocate(width, height, 1, PixelFormat::RGBA_8888, usage);
+ BufferUsage::COMPOSER_OVERLAY));
+ if (result->initCheck() != STATUS_OK) {
+ return nullptr;
+ }
+ return result;
}
void execute() { mComposerClient->execute(mReader.get(), mWriter.get()); }
@@ -681,9 +681,6 @@
std::unique_ptr<TestCommandReader> mReader;
int32_t mDisplayWidth;
int32_t mDisplayHeight;
-
- private:
- std::unique_ptr<Gralloc> mGralloc;
};
/**
@@ -729,11 +726,11 @@
display = mComposerClient->createVirtualDisplay(64, 64, PixelFormat::IMPLEMENTATION_DEFINED,
kBufferSlotCount, &format));
- std::unique_ptr<NativeHandleWrapper> handle;
- ASSERT_NO_FATAL_FAILURE(handle.reset(new NativeHandleWrapper(allocate())));
+ auto handle = allocate();
+ ASSERT_TRUE(handle);
mWriter->selectDisplay(display);
- mWriter->setOutputBuffer(0, handle->get(), -1);
+ mWriter->setOutputBuffer(0, handle->handle, -1);
execute();
}
@@ -802,7 +799,7 @@
mWriter->setLayerZOrder(10);
mWriter->setLayerBlendMode(IComposerClient::BlendMode::NONE);
mWriter->setLayerSurfaceDamage(std::vector<IComposerClient::Rect>(1, displayFrame));
- mWriter->setLayerBuffer(0, handle.get(), -1);
+ mWriter->setLayerBuffer(0, handle->handle, -1);
mWriter->setLayerDataspace(Dataspace::UNKNOWN);
mWriter->validateDisplay();
@@ -820,7 +817,7 @@
mWriter->selectLayer(layer);
auto handle2 = allocate();
ASSERT_NE(nullptr, handle2.get());
- mWriter->setLayerBuffer(0, handle2.get(), -1);
+ mWriter->setLayerBuffer(0, handle2->handle, -1);
mWriter->setLayerSurfaceDamage(std::vector<IComposerClient::Rect>(1, {0, 0, 10, 10}));
mWriter->presentDisplay();
execute();
@@ -840,7 +837,7 @@
mWriter->selectDisplay(mPrimaryDisplay);
mWriter->selectLayer(layer);
- mWriter->setLayerBuffer(0, handle.get(), -1);
+ mWriter->setLayerBuffer(0, handle->handle, -1);
mWriter->setLayerCompositionType(IComposerClient::Composition::CURSOR);
mWriter->setLayerDisplayFrame(displayFrame);
mWriter->setLayerPlaneAlpha(1);
@@ -881,7 +878,7 @@
mWriter->selectDisplay(mPrimaryDisplay);
mWriter->selectLayer(layer);
- mWriter->setLayerBuffer(0, handle.get(), -1);
+ mWriter->setLayerBuffer(0, handle->handle, -1);
execute();
}
@@ -905,7 +902,7 @@
mWriter->selectLayer(layer);
mWriter->setLayerCompositionType(IComposerClient::Composition::DEVICE);
mWriter->setLayerDisplayFrame(displayFrame);
- mWriter->setLayerBuffer(0, handle1.get(), -1);
+ mWriter->setLayerBuffer(0, handle1->handle, -1);
mWriter->setLayerDataspace(Dataspace::UNKNOWN);
mWriter->validateDisplay();
execute();
@@ -928,7 +925,7 @@
mWriter->selectLayer(layer);
mWriter->setLayerCompositionType(IComposerClient::Composition::DEVICE);
mWriter->setLayerDisplayFrame(displayFrame);
- mWriter->setLayerBuffer(1, handle2.get(), -1);
+ mWriter->setLayerBuffer(1, handle2->handle, -1);
mWriter->setLayerDataspace(Dataspace::UNKNOWN);
mWriter->validateDisplay();
execute();
@@ -951,7 +948,7 @@
mWriter->selectLayer(layer);
mWriter->setLayerCompositionType(IComposerClient::Composition::DEVICE);
mWriter->setLayerDisplayFrame(displayFrame);
- mWriter->setLayerBuffer(2, handle3.get(), -1);
+ mWriter->setLayerBuffer(2, handle3->handle, -1);
mWriter->setLayerDataspace(Dataspace::UNKNOWN);
mWriter->validateDisplay();
execute();
@@ -968,10 +965,10 @@
// Ensure we can clear multiple buffer slots and then restore the active buffer at the end
mWriter->selectDisplay(mPrimaryDisplay);
mWriter->selectLayer(layer);
- mWriter->setLayerBuffer(0, clearSlotBuffer.get(), -1);
+ mWriter->setLayerBuffer(0, clearSlotBuffer->handle, -1);
mWriter->selectDisplay(mPrimaryDisplay);
mWriter->selectLayer(layer);
- mWriter->setLayerBuffer(1, clearSlotBuffer.get(), -1);
+ mWriter->setLayerBuffer(1, clearSlotBuffer->handle, -1);
mWriter->selectDisplay(mPrimaryDisplay);
mWriter->selectLayer(layer);
mWriter->setLayerBuffer(2, nullptr, -1);
@@ -1113,7 +1110,7 @@
mWriter->selectDisplay(mPrimaryDisplay);
mWriter->selectLayer(layer);
- mWriter->setLayerSidebandStream(handle.get());
+ mWriter->setLayerSidebandStream(handle->handle);
execute();
}
diff --git a/graphics/composer/2.2/utils/vts/Android.bp b/graphics/composer/2.2/utils/vts/Android.bp
index 6647bf3..2bd2419 100644
--- a/graphics/composer/2.2/utils/vts/Android.bp
+++ b/graphics/composer/2.2/utils/vts/Android.bp
@@ -27,7 +27,6 @@
cc_library_static {
name: "android.hardware.graphics.composer@2.2-vts",
defaults: [
- "android.hardware.graphics.allocator-ndk_static",
"android.hardware.graphics.composer3-ndk_static",
"hidl_defaults",
"librenderengine_deps",
@@ -43,7 +42,6 @@
static_libs: [
"android.hardware.graphics.composer@2.1-vts",
"android.hardware.graphics.composer@2.2",
- "android.hardware.graphics.mapper@2.1-vts",
"libarect",
"libgtest",
"libmath",
@@ -51,15 +49,10 @@
"librenderengine",
"libshaders",
"libtonemap",
- "android.hardware.graphics.mapper@3.0",
- "android.hardware.graphics.mapper@3.0-vts",
- "android.hardware.graphics.mapper@4.0",
- "android.hardware.graphics.mapper@4.0-vts",
],
export_static_lib_headers: [
"android.hardware.graphics.composer@2.1-vts",
"android.hardware.graphics.composer@2.2",
- "android.hardware.graphics.mapper@2.1-vts",
],
header_libs: [
"android.hardware.graphics.composer@2.2-command-buffer",
diff --git a/graphics/composer/2.2/utils/vts/ComposerVts.cpp b/graphics/composer/2.2/utils/vts/ComposerVts.cpp
index d4f0281..d041064 100644
--- a/graphics/composer/2.2/utils/vts/ComposerVts.cpp
+++ b/graphics/composer/2.2/utils/vts/ComposerVts.cpp
@@ -179,66 +179,6 @@
return matrix;
}
-Gralloc::Gralloc() {
- [this] {
- ALOGD("Attempting to initialize gralloc4");
- ASSERT_NO_FATAL_FAILURE(mGralloc4 = std::make_shared<Gralloc4>(
- /*aidlAllocatorServiceName*/ IAllocator::descriptor +
- std::string("/default"),
- /*hidlAllocatorServiceName*/ "default",
- /*mapperServiceName*/ "default",
- /*errOnFailure=*/false));
- if (mGralloc4->getMapper() == nullptr || !mGralloc4->hasAllocator()) {
- mGralloc4 = nullptr;
- ALOGD("Failed to initialize gralloc4, initializing gralloc3");
- ASSERT_NO_FATAL_FAILURE(mGralloc3 = std::make_shared<Gralloc3>("default", "default",
- /*errOnFailure=*/false));
- if (mGralloc3->getMapper() == nullptr || mGralloc3->getAllocator() == nullptr) {
- mGralloc3 = nullptr;
- ALOGD("Failed to initialize gralloc3, initializing gralloc2_1");
- mGralloc2_1 = std::make_shared<Gralloc2_1>(/*errOnFailure*/ false);
- if (!mGralloc2_1->getMapper()) {
- mGralloc2_1 = nullptr;
- ALOGD("Failed to initialize gralloc2_1, initializing gralloc2");
- ASSERT_NO_FATAL_FAILURE(mGralloc2 = std::make_shared<Gralloc2>());
- }
- }
- }
- }();
-}
-
-bool Gralloc::validateBufferSize(const native_handle_t* bufferHandle, uint32_t width,
- uint32_t height, uint32_t layerCount, PixelFormat format,
- uint64_t usage, uint32_t stride) {
- if (mGralloc4) {
- IMapper4::BufferDescriptorInfo info{};
- info.width = width;
- info.height = height;
- info.layerCount = layerCount;
- info.format = static_cast<android::hardware::graphics::common::V1_2::PixelFormat>(format);
- info.usage = usage;
- return mGralloc4->validateBufferSize(bufferHandle, info, stride);
- } else if (mGralloc3) {
- IMapper3::BufferDescriptorInfo info{};
- info.width = width;
- info.height = height;
- info.layerCount = layerCount;
- info.format = static_cast<android::hardware::graphics::common::V1_2::PixelFormat>(format);
- info.usage = usage;
- return mGralloc3->validateBufferSize(bufferHandle, info, stride);
- } else if (mGralloc2_1) {
- IMapper2_1::BufferDescriptorInfo info{};
- info.width = width;
- info.height = height;
- info.layerCount = layerCount;
- info.format = static_cast<android::hardware::graphics::common::V1_1::PixelFormat>(format);
- info.usage = usage;
- return mGralloc2_1->validateBufferSize(bufferHandle, info, stride);
- } else {
- return true;
- }
-}
-
} // namespace vts
} // namespace V2_2
} // namespace composer
diff --git a/graphics/composer/2.2/utils/vts/ReadbackVts.cpp b/graphics/composer/2.2/utils/vts/ReadbackVts.cpp
index a1794af..9ba34f1 100644
--- a/graphics/composer/2.2/utils/vts/ReadbackVts.cpp
+++ b/graphics/composer/2.2/utils/vts/ReadbackVts.cpp
@@ -187,12 +187,11 @@
}
ReadbackBuffer::ReadbackBuffer(Display display, const std::shared_ptr<ComposerClient>& client,
- const std::shared_ptr<Gralloc>& gralloc, uint32_t width,
- uint32_t height, PixelFormat pixelFormat, Dataspace dataspace) {
+ uint32_t width, uint32_t height, PixelFormat pixelFormat,
+ Dataspace dataspace) {
mDisplay = display;
mComposerClient = client;
- mGralloc = gralloc;
mPixelFormat = pixelFormat;
mDataspace = dataspace;
@@ -202,20 +201,12 @@
mLayerCount = 1;
mFormat = mPixelFormat;
mUsage = static_cast<uint64_t>(BufferUsage::CPU_READ_OFTEN | BufferUsage::GPU_TEXTURE);
-
- mAccessRegion.top = 0;
- mAccessRegion.left = 0;
- mAccessRegion.width = width;
- mAccessRegion.height = height;
}
void ReadbackBuffer::setReadbackBuffer() {
- mBufferHandle.reset(new Gralloc::NativeHandleWrapper(
- mGralloc->allocate(mWidth, mHeight, mLayerCount, mFormat, mUsage,
- /*import*/ true, &mStride)));
- ASSERT_NE(false, mGralloc->validateBufferSize(mBufferHandle->get(), mWidth, mHeight,
- mLayerCount, mFormat, mUsage, mStride));
- ASSERT_NO_FATAL_FAILURE(mComposerClient->setReadbackBuffer(mDisplay, mBufferHandle->get(), -1));
+ mBuffer = sp<GraphicBuffer>::make(mWidth, mHeight, (int32_t)mFormat, mLayerCount, mUsage);
+ ASSERT_EQ(STATUS_OK, mBuffer->initCheck());
+ ASSERT_NO_FATAL_FAILURE(mComposerClient->setReadbackBuffer(mDisplay, mBuffer->handle, -1));
}
void ReadbackBuffer::checkReadbackBuffer(std::vector<IComposerClient::Color> expectedColors) {
@@ -223,15 +214,14 @@
int32_t fenceHandle;
ASSERT_NO_FATAL_FAILURE(mComposerClient->getReadbackBufferFence(mDisplay, &fenceHandle));
- void* bufData = mGralloc->lock(mBufferHandle->get(), mUsage, mAccessRegion, fenceHandle);
+ void* bufData = nullptr;
+ int32_t stride = mBuffer->stride;
+ status_t status = mBuffer->lockAsync(mUsage, &bufData, fenceHandle);
+ ASSERT_EQ(STATUS_OK, status);
ASSERT_TRUE(mPixelFormat == PixelFormat::RGB_888 || mPixelFormat == PixelFormat::RGBA_8888);
- ReadbackHelper::compareColorBuffers(expectedColors, bufData, mStride, mWidth, mHeight,
+ ReadbackHelper::compareColorBuffers(expectedColors, bufData, stride, mWidth, mHeight,
mPixelFormat);
- int32_t unlockFence = mGralloc->unlock(mBufferHandle->get());
- if (unlockFence != -1) {
- sync_wait(unlockFence, -1);
- close(unlockFence);
- }
+ EXPECT_EQ(STATUS_OK, mBuffer->unlock());
}
void TestColorLayer::write(const std::shared_ptr<CommandWriterBase>& writer) {
@@ -251,12 +241,10 @@
}
TestBufferLayer::TestBufferLayer(const std::shared_ptr<ComposerClient>& client,
- const std::shared_ptr<Gralloc>& gralloc,
TestRenderEngine& renderEngine, Display display, int32_t width,
int32_t height, PixelFormat format,
IComposerClient::Composition composition)
: TestLayer{client, display}, mRenderEngine(renderEngine) {
- mGralloc = gralloc;
mComposition = composition;
mWidth = width;
mHeight = height;
@@ -265,11 +253,6 @@
mUsage = static_cast<uint64_t>(BufferUsage::CPU_READ_OFTEN | BufferUsage::CPU_WRITE_OFTEN |
BufferUsage::COMPOSER_OVERLAY | BufferUsage::GPU_TEXTURE);
- mAccessRegion.top = 0;
- mAccessRegion.left = 0;
- mAccessRegion.width = width;
- mAccessRegion.height = height;
-
setSourceCrop({0, 0, (float)width, (float)height});
}
@@ -277,15 +260,13 @@
TestLayer::write(writer);
writer->setLayerCompositionType(mComposition);
writer->setLayerVisibleRegion(std::vector<IComposerClient::Rect>(1, mDisplayFrame));
- if (mBufferHandle != nullptr) writer->setLayerBuffer(0, mBufferHandle->get(), mFillFence);
+ if (mBuffer) writer->setLayerBuffer(0, mBuffer->handle, -1);
}
LayerSettings TestBufferLayer::toRenderEngineLayerSettings() {
LayerSettings layerSettings = TestLayer::toRenderEngineLayerSettings();
layerSettings.source.buffer.buffer = std::make_shared<renderengine::impl::ExternalTexture>(
- new GraphicBuffer(mBufferHandle->get(), GraphicBuffer::CLONE_HANDLE, mWidth, mHeight,
- static_cast<int32_t>(mFormat), 1, mUsage, mStride),
- mRenderEngine.getInternalRenderEngine(),
+ mBuffer, mRenderEngine.getInternalRenderEngine(),
renderengine::impl::ExternalTexture::Usage::READABLE);
layerSettings.source.buffer.usePremultipliedAlpha =
@@ -304,24 +285,18 @@
}
void TestBufferLayer::fillBuffer(std::vector<IComposerClient::Color> expectedColors) {
- void* bufData = mGralloc->lock(mBufferHandle->get(), mUsage, mAccessRegion, -1);
- ASSERT_NO_FATAL_FAILURE(
- ReadbackHelper::fillBuffer(mWidth, mHeight, mStride, bufData, mFormat, expectedColors));
- mFillFence = mGralloc->unlock(mBufferHandle->get());
- if (mFillFence != -1) {
- sync_wait(mFillFence, -1);
- close(mFillFence);
- }
+ void* bufData = nullptr;
+ status_t status = mBuffer->lock(mUsage, &bufData);
+ ASSERT_EQ(STATUS_OK, status);
+ ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer(mWidth, mHeight, mBuffer->stride, bufData,
+ mFormat, expectedColors));
+ EXPECT_EQ(STATUS_OK, mBuffer->unlock());
}
void TestBufferLayer::setBuffer(std::vector<IComposerClient::Color> colors) {
- mBufferHandle.reset(new Gralloc::NativeHandleWrapper(
- mGralloc->allocate(mWidth, mHeight, mLayerCount, mFormat, mUsage,
- /*import*/ true, &mStride)));
- ASSERT_NE(nullptr, mBufferHandle->get());
+ mBuffer = sp<GraphicBuffer>::make(mWidth, mHeight, (int32_t)mFormat, mLayerCount, mUsage);
+ ASSERT_EQ(STATUS_OK, mBuffer->initCheck());
ASSERT_NO_FATAL_FAILURE(fillBuffer(colors));
- ASSERT_NE(false, mGralloc->validateBufferSize(mBufferHandle->get(), mWidth, mHeight,
- mLayerCount, mFormat, mUsage, mStride));
}
void TestBufferLayer::setDataspace(Dataspace dataspace,
diff --git a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp
index 1700b2a..6960d06 100644
--- a/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp
+++ b/graphics/composer/2.2/utils/vts/RenderEngineVts.cpp
@@ -24,7 +24,6 @@
namespace V2_2 {
namespace vts {
-using mapper::V2_1::IMapper;
using renderengine::DisplaySettings;
using renderengine::LayerSettings;
using renderengine::RenderEngineCreationArgs;
@@ -72,7 +71,7 @@
auto texture = std::make_shared<renderengine::impl::ExternalTexture>(
mGraphicBuffer, *mRenderEngine, renderengine::impl::ExternalTexture::Usage::WRITEABLE);
auto result = mRenderEngine
- ->drawLayers(mDisplaySettings, compositionLayers, texture, true,
+ ->drawLayers(mDisplaySettings, compositionLayers, texture,
std::move(bufferFence))
.get();
if (result.ok()) {
diff --git a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ComposerVts.h b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ComposerVts.h
index 02d7bdb..3e26d94 100644
--- a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ComposerVts.h
+++ b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ComposerVts.h
@@ -26,7 +26,6 @@
#include <android/hardware/graphics/composer/2.2/IComposerClient.h>
#include <composer-command-buffer/2.2/ComposerCommandBuffer.h>
#include <composer-vts/2.1/ComposerVts.h>
-#include <mapper-vts/2.1/MapperVts.h>
#include <utils/StrongPointer.h>
namespace android {
@@ -41,14 +40,6 @@
using common::V1_1::Dataspace;
using common::V1_1::PixelFormat;
using common::V1_1::RenderIntent;
-using IMapper2_1 = android::hardware::graphics::mapper::V2_1::IMapper;
-using IMapper3 = android::hardware::graphics::mapper::V3_0::IMapper;
-using IMapper4 = android::hardware::graphics::mapper::V4_0::IMapper;
-using Gralloc2 = android::hardware::graphics::mapper::V2_0::vts::Gralloc;
-using Gralloc2_1 = android::hardware::graphics::mapper::V2_1::vts::Gralloc;
-using Gralloc3 = android::hardware::graphics::mapper::V3_0::vts::Gralloc;
-using Gralloc4 = android::hardware::graphics::mapper::V4_0::vts::Gralloc;
-using IAllocator = aidl::android::hardware::graphics::allocator::IAllocator;
class ComposerClient;
@@ -92,28 +83,6 @@
const sp<IComposerClient> mClient;
};
-class Gralloc : public V2_1::vts::Gralloc {
- public:
- using NativeHandleWrapper = V2_1::vts::NativeHandleWrapper;
-
- Gralloc();
- const NativeHandleWrapper allocate(uint32_t width, uint32_t height, uint32_t layerCount,
- PixelFormat format, uint64_t usage, bool import = true,
- uint32_t* outStride = nullptr) {
- return V2_1::vts::Gralloc::allocate(
- width, height, layerCount,
- static_cast<android::hardware::graphics::common::V1_0::PixelFormat>(format), usage,
- import, outStride);
- }
-
- bool validateBufferSize(const native_handle_t* bufferHandle, uint32_t width, uint32_t height,
- uint32_t layerCount, PixelFormat format, uint64_t usage,
- uint32_t stride);
-
- protected:
- std::shared_ptr<Gralloc2_1> mGralloc2_1 = nullptr;
-};
-
} // namespace vts
} // namespace V2_2
} // namespace composer
diff --git a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ReadbackVts.h b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ReadbackVts.h
index 58efde9..aa6932a 100644
--- a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ReadbackVts.h
+++ b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/ReadbackVts.h
@@ -22,7 +22,6 @@
#include <composer-vts/2.1/GraphicsComposerCallback.h>
#include <composer-vts/2.1/TestCommandReader.h>
#include <composer-vts/2.2/ComposerVts.h>
-#include <mapper-vts/2.1/MapperVts.h>
#include <renderengine/RenderEngine.h>
#include <memory>
@@ -38,12 +37,9 @@
using common::V1_1::BufferUsage;
using common::V1_1::Dataspace;
using common::V1_1::PixelFormat;
-using IMapper2_1 = mapper::V2_1::IMapper;
-using Gralloc2_1 = mapper::V2_1::vts::Gralloc;
using renderengine::LayerSettings;
using V2_1::Display;
using V2_1::Layer;
-using V2_1::vts::AccessRegion;
using V2_1::vts::TestCommandReader;
static const IComposerClient::Color BLACK = {0, 0, 0, 0xff};
@@ -113,9 +109,8 @@
class TestBufferLayer : public TestLayer {
public:
TestBufferLayer(
- const std::shared_ptr<ComposerClient>& client, const std::shared_ptr<Gralloc>& gralloc,
- TestRenderEngine& renderEngine, Display display, int32_t width, int32_t height,
- PixelFormat format,
+ const std::shared_ptr<ComposerClient>& client, TestRenderEngine& renderEngine,
+ Display display, int32_t width, int32_t height, PixelFormat format,
IComposerClient::Composition composition = IComposerClient::Composition::DEVICE);
void write(const std::shared_ptr<CommandWriterBase>& writer) override;
@@ -135,15 +130,11 @@
uint32_t mLayerCount;
PixelFormat mFormat;
uint64_t mUsage;
- AccessRegion mAccessRegion;
- uint32_t mStride;
protected:
IComposerClient::Composition mComposition;
- std::shared_ptr<Gralloc> mGralloc;
TestRenderEngine& mRenderEngine;
- int32_t mFillFence;
- std::unique_ptr<Gralloc::NativeHandleWrapper> mBufferHandle;
+ sp<GraphicBuffer> mBuffer;
};
class ReadbackHelper {
@@ -179,9 +170,8 @@
class ReadbackBuffer {
public:
- ReadbackBuffer(Display display, const std::shared_ptr<ComposerClient>& client,
- const std::shared_ptr<Gralloc>& gralloc, uint32_t width, uint32_t height,
- PixelFormat pixelFormat, Dataspace dataspace);
+ ReadbackBuffer(Display display, const std::shared_ptr<ComposerClient>& client, uint32_t width,
+ uint32_t height, PixelFormat pixelFormat, Dataspace dataspace);
void setReadbackBuffer();
@@ -193,13 +183,10 @@
uint32_t mLayerCount;
PixelFormat mFormat;
uint64_t mUsage;
- AccessRegion mAccessRegion;
- uint32_t mStride;
- std::unique_ptr<Gralloc::NativeHandleWrapper> mBufferHandle = nullptr;
+ sp<GraphicBuffer> mBuffer;
PixelFormat mPixelFormat;
Dataspace mDataspace;
Display mDisplay;
- std::shared_ptr<Gralloc> mGralloc;
std::shared_ptr<ComposerClient> mComposerClient;
};
diff --git a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h
index 26027d3..09b89ff 100644
--- a/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h
+++ b/graphics/composer/2.2/utils/vts/include/composer-vts/2.2/RenderEngineVts.h
@@ -22,7 +22,6 @@
#include <renderengine/ExternalTexture.h>
#include <renderengine/RenderEngine.h>
#include <ui/GraphicBuffer.h>
-#include <ui/GraphicBufferAllocator.h>
#include <ui/PixelFormat.h>
#include <ui/Rect.h>
#include <ui/Region.h>
@@ -34,10 +33,8 @@
namespace V2_2 {
namespace vts {
-using mapper::V2_1::IMapper;
using renderengine::DisplaySettings;
using renderengine::RenderEngineCreationArgs;
-using vts::Gralloc;
class TestRenderEngine {
public:
diff --git a/graphics/composer/2.2/vts/functional/Android.bp b/graphics/composer/2.2/vts/functional/Android.bp
index fc89763..dec60df 100644
--- a/graphics/composer/2.2/vts/functional/Android.bp
+++ b/graphics/composer/2.2/vts/functional/Android.bp
@@ -28,7 +28,6 @@
name: "VtsHalGraphicsComposerV2_2TargetTest",
defaults: [
"VtsHalTargetTestDefaults",
- "android.hardware.graphics.allocator-ndk_static",
"android.hardware.graphics.composer3-ndk_static",
"librenderengine_deps",
],
@@ -55,24 +54,13 @@
"libsync",
"libui",
"android.hardware.common-V2-ndk",
- "android.hardware.graphics.mapper@2.0",
- "android.hardware.graphics.mapper@2.1",
- "android.hardware.graphics.mapper@3.0",
- "android.hardware.graphics.mapper@4.0",
],
static_libs: [
- "android.hardware.graphics.allocator@2.0",
- "android.hardware.graphics.allocator@3.0",
- "android.hardware.graphics.allocator@4.0",
"android.hardware.graphics.common@1.1",
"android.hardware.graphics.composer@2.1",
"android.hardware.graphics.composer@2.1-vts",
"android.hardware.graphics.composer@2.2",
"android.hardware.graphics.composer@2.2-vts",
- "android.hardware.graphics.mapper@2.0-vts",
- "android.hardware.graphics.mapper@2.1-vts",
- "android.hardware.graphics.mapper@3.0-vts",
- "android.hardware.graphics.mapper@4.0-vts",
"libaidlcommonsupport",
"libgtest",
"librenderengine",
diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp
index e2a0f4d..74d2f03 100644
--- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp
+++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2ReadbackTest.cpp
@@ -26,7 +26,6 @@
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>
#include <ui/GraphicBuffer.h>
-#include <ui/GraphicBufferAllocator.h>
#include <ui/PixelFormat.h>
#include <ui/Rect.h>
#include <ui/Region.h>
@@ -45,9 +44,7 @@
using common::V1_1::PixelFormat;
using V2_1::Config;
using V2_1::Display;
-using V2_1::vts::NativeHandleWrapper;
using V2_1::vts::TestCommandReader;
-using vts::Gralloc;
class GraphicsCompositionTestBase : public ::testing::Test {
protected:
@@ -79,20 +76,19 @@
// set up command writer/reader and gralloc
mWriter = std::make_shared<CommandWriterBase>(1024);
mReader = std::make_unique<TestCommandReader>();
- mGralloc = std::make_shared<Gralloc>();
ASSERT_NO_FATAL_FAILURE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON));
ASSERT_NO_FATAL_FAILURE(
mTestRenderEngine = std::unique_ptr<TestRenderEngine>(new TestRenderEngine(
renderengine::RenderEngineCreationArgs::Builder()
- .setPixelFormat(static_cast<int>(ui::PixelFormat::RGBA_8888))
- .setImageCacheSize(TestRenderEngine::sMaxFrameBufferAcquireBuffers)
- .setUseColorManagerment(true)
- .setEnableProtectedContext(false)
- .setPrecacheToneMapperShaderOnly(false)
- .setContextPriority(renderengine::RenderEngine::ContextPriority::HIGH)
- .build())));
+ .setPixelFormat(static_cast<int>(ui::PixelFormat::RGBA_8888))
+ .setImageCacheSize(TestRenderEngine::sMaxFrameBufferAcquireBuffers)
+ .setEnableProtectedContext(false)
+ .setPrecacheToneMapperShaderOnly(false)
+ .setContextPriority(
+ renderengine::RenderEngine::ContextPriority::HIGH)
+ .build())));
renderengine::DisplaySettings clientCompositionDisplay;
clientCompositionDisplay.physicalDisplay = Rect(mDisplayWidth, mDisplayHeight);
@@ -143,7 +139,6 @@
std::vector<ColorMode> mTestColorModes;
std::shared_ptr<CommandWriterBase> mWriter;
std::unique_ptr<TestCommandReader> mReader;
- std::shared_ptr<Gralloc> mGralloc;
std::unique_ptr<TestRenderEngine> mTestRenderEngine;
bool mHasReadbackBuffer;
@@ -220,7 +215,7 @@
std::vector<IComposerClient::Color> expectedColors(mDisplayWidth * mDisplayHeight);
ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, coloredSquare, BLUE);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+ ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
@@ -272,7 +267,7 @@
mWriter->selectDisplay(mPrimaryDisplay);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+ ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
std::vector<IComposerClient::Color> expectedColors(mDisplayWidth * mDisplayHeight);
@@ -285,9 +280,9 @@
{0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight},
BLUE);
- auto layer = std::make_shared<TestBufferLayer>(
- mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth,
- mDisplayHeight, PixelFormat::RGBA_8888);
+ auto layer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
+ mPrimaryDisplay, mDisplayWidth,
+ mDisplayHeight, PixelFormat::RGBA_8888);
layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight});
layer->setZOrder(10);
layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter);
@@ -352,15 +347,16 @@
// This following buffer call should have no effect
uint64_t usage =
static_cast<uint64_t>(BufferUsage::CPU_READ_OFTEN | BufferUsage::CPU_WRITE_OFTEN);
- NativeHandleWrapper bufferHandle =
- mGralloc->allocate(mDisplayWidth, mDisplayHeight, 1, PixelFormat::RGBA_8888, usage);
- mWriter->setLayerBuffer(0, bufferHandle.get(), -1);
+ sp<GraphicBuffer> buffer = sp<GraphicBuffer>::make(
+ mDisplayWidth, mDisplayHeight, (int32_t)PixelFormat::RGBA_8888, 1, usage);
+ ASSERT_EQ(STATUS_OK, buffer->initCheck());
+ mWriter->setLayerBuffer(0, buffer->handle, -1);
// expected color for each pixel
std::vector<IComposerClient::Color> expectedColors(mDisplayWidth * mDisplayHeight);
ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, coloredSquare, BLUE);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+ ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
@@ -419,16 +415,16 @@
{0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight},
BLUE);
- auto layer = std::make_shared<TestBufferLayer>(
- mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth,
- mDisplayHeight, PixelFormat::RGBA_FP16);
+ auto layer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
+ mPrimaryDisplay, mDisplayWidth,
+ mDisplayHeight, PixelFormat::RGBA_FP16);
layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight});
layer->setZOrder(10);
layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter);
std::vector<std::shared_ptr<TestLayer>> layers = {layer};
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+ ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
@@ -462,25 +458,20 @@
}
// create client target buffer
- uint32_t clientStride;
- NativeHandleWrapper clientBufferHandle =
- mGralloc->allocate(layer->mWidth, layer->mHeight, layer->mLayerCount,
- clientFormat, clientUsage, /*import*/ true, &clientStride);
- ASSERT_NE(nullptr, clientBufferHandle.get());
+ sp<GraphicBuffer> clientBuffer =
+ sp<GraphicBuffer>::make(layer->mWidth, layer->mHeight, (int32_t)clientFormat,
+ layer->mLayerCount, clientUsage);
+ ASSERT_EQ(STATUS_OK, clientBuffer->initCheck());
- void* clientBufData =
- mGralloc->lock(clientBufferHandle.get(), clientUsage, layer->mAccessRegion, -1);
+ void* clientBufData = nullptr;
+ ASSERT_EQ(STATUS_OK, clientBuffer->lock(clientUsage, &clientBufData));
ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer(layer->mWidth, layer->mHeight,
- clientStride, clientBufData,
+ clientBuffer->stride, clientBufData,
clientFormat, expectedColors));
- int clientFence = mGralloc->unlock(clientBufferHandle.get());
- if (clientFence != -1) {
- sync_wait(clientFence, -1);
- close(clientFence);
- }
+ clientBuffer->unlock();
- mWriter->setClientTarget(0, clientBufferHandle.get(), clientFence, clientDataspace,
+ mWriter->setClientTarget(0, clientBuffer->handle, -1, clientDataspace,
std::vector<IComposerClient::Rect>(1, damage));
layer->setToClientComposition(mWriter);
@@ -531,12 +522,12 @@
ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
{0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight}, RED);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+ ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
auto deviceLayer = std::make_shared<TestBufferLayer>(
- mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth,
+ mComposerClient, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth,
mDisplayHeight / 2, PixelFormat::RGBA_8888);
std::vector<IComposerClient::Color> deviceColors(deviceLayer->mWidth *
deviceLayer->mHeight);
@@ -573,8 +564,8 @@
}
auto clientLayer = std::make_shared<TestBufferLayer>(
- mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, clientWidth,
- clientHeight, PixelFormat::RGBA_FP16, IComposerClient::Composition::DEVICE);
+ mComposerClient, *mTestRenderEngine, mPrimaryDisplay, clientWidth, clientHeight,
+ PixelFormat::RGBA_FP16, IComposerClient::Composition::DEVICE);
IComposerClient::Rect clientFrame = {0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight};
clientLayer->setDisplayFrame(clientFrame);
clientLayer->setZOrder(0);
@@ -590,27 +581,22 @@
}
// create client target buffer
ASSERT_EQ(1, mReader->mCompositionChanges[0].second);
- uint32_t clientStride;
- NativeHandleWrapper clientBufferHandle =
- mGralloc->allocate(mDisplayWidth, mDisplayHeight, clientLayer->mLayerCount,
- clientFormat, clientUsage, /*import*/ true, &clientStride);
- ASSERT_NE(nullptr, clientBufferHandle.get());
+ sp<GraphicBuffer> clientBuffer =
+ sp<GraphicBuffer>::make(mDisplayWidth, mDisplayHeight, (int32_t)clientFormat,
+ clientLayer->mLayerCount, clientUsage);
+ ASSERT_EQ(STATUS_OK, clientBuffer->initCheck());
- void* clientBufData = mGralloc->lock(clientBufferHandle.get(), clientUsage,
- {0, 0, mDisplayWidth, mDisplayHeight}, -1);
+ void* clientBufData = nullptr;
+ ASSERT_EQ(STATUS_OK, clientBuffer->lock(clientUsage, &clientBufData));
std::vector<IComposerClient::Color> clientColors(mDisplayWidth * mDisplayHeight);
ReadbackHelper::fillColorsArea(clientColors, mDisplayWidth, clientFrame, RED);
ASSERT_NO_FATAL_FAILURE(ReadbackHelper::fillBuffer(mDisplayWidth, mDisplayHeight,
- clientStride, clientBufData,
+ clientBuffer->stride, clientBufData,
clientFormat, clientColors));
- int clientFence = mGralloc->unlock(clientBufferHandle.get());
- if (clientFence != -1) {
- sync_wait(clientFence, -1);
- close(clientFence);
- }
+ EXPECT_EQ(STATUS_OK, clientBuffer->unlock());
- mWriter->setClientTarget(0, clientBufferHandle.get(), clientFence, clientDataspace,
+ mWriter->setClientTarget(0, clientBuffer->handle, -1, clientDataspace,
std::vector<IComposerClient::Rect>(1, clientFrame));
clientLayer->setToClientComposition(mWriter);
mWriter->validateDisplay();
@@ -655,9 +641,9 @@
std::vector<IComposerClient::Color> expectedColors(mDisplayWidth * mDisplayHeight);
ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED);
- auto layer = std::make_shared<TestBufferLayer>(
- mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth,
- mDisplayHeight, PixelFormat::RGBA_8888);
+ auto layer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
+ mPrimaryDisplay, mDisplayWidth,
+ mDisplayHeight, PixelFormat::RGBA_8888);
layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight});
layer->setZOrder(10);
layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter);
@@ -665,7 +651,7 @@
std::vector<std::shared_ptr<TestLayer>> layers = {layer};
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+ ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
@@ -742,7 +728,7 @@
std::vector<std::shared_ptr<TestLayer>> layers = {layer};
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+ ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
@@ -803,9 +789,9 @@
{0, mDisplayHeight / 2, mDisplayWidth, mDisplayHeight},
BLUE);
- auto layer = std::make_shared<TestBufferLayer>(
- mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth,
- mDisplayHeight, PixelFormat::RGBA_8888);
+ auto layer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
+ mPrimaryDisplay, mDisplayWidth,
+ mDisplayHeight, PixelFormat::RGBA_8888);
layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight});
layer->setZOrder(10);
layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), mWriter);
@@ -819,7 +805,7 @@
// update expected colors to match crop
ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth,
{0, 0, mDisplayWidth, mDisplayHeight}, BLUE);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+ ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
@@ -886,7 +872,7 @@
ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, blueRect, BLUE);
ReadbackHelper::fillColorsArea(expectedColors, mDisplayWidth, redRect, RED);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+ ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
@@ -955,9 +941,9 @@
backgroundLayer->setZOrder(0);
backgroundLayer->setColor(mBackgroundColor);
- auto layer = std::make_shared<TestBufferLayer>(
- mComposerClient, mGralloc, *mTestRenderEngine, mPrimaryDisplay, mDisplayWidth,
- mDisplayHeight, PixelFormat::RGBA_8888);
+ auto layer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
+ mPrimaryDisplay, mDisplayWidth,
+ mDisplayHeight, PixelFormat::RGBA_8888);
layer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight});
layer->setZOrder(10);
layer->setDataspace(Dataspace::UNKNOWN, mWriter);
@@ -1043,7 +1029,7 @@
setUpLayers(IComposerClient::BlendMode::NONE);
setExpectedColors(expectedColors);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+ ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(mLayers);
@@ -1102,7 +1088,7 @@
setUpLayers(IComposerClient::BlendMode::COVERAGE);
setExpectedColors(expectedColors);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+ ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(mLayers);
@@ -1153,7 +1139,7 @@
setUpLayers(IComposerClient::BlendMode::PREMULTIPLIED);
setExpectedColors(expectedColors);
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+ ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(mLayers);
@@ -1193,7 +1179,7 @@
IComposerClient::Rect blueRect = {mSideLength / 2, mSideLength / 2, mSideLength,
mSideLength};
- mLayer = std::make_shared<TestBufferLayer>(mComposerClient, mGralloc, *mTestRenderEngine,
+ mLayer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
mPrimaryDisplay, mSideLength, mSideLength,
PixelFormat::RGBA_8888);
mLayer->setDisplayFrame({0, 0, mSideLength, mSideLength});
@@ -1236,7 +1222,7 @@
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+ ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
mLayer->setTransform(Transform::FLIP_H);
@@ -1291,7 +1277,7 @@
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+ ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
@@ -1346,7 +1332,7 @@
GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
return;
}
- ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mGralloc, mDisplayWidth,
+ ReadbackBuffer readbackBuffer(mPrimaryDisplay, mComposerClient, mDisplayWidth,
mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp
index 13ae089..2bd287b 100644
--- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp
+++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp
@@ -18,14 +18,13 @@
#include <android-base/logging.h>
#include <android-base/properties.h>
-#include <android/hardware/graphics/mapper/2.0/IMapper.h>
#include <composer-vts/2.1/GraphicsComposerCallback.h>
#include <composer-vts/2.1/TestCommandReader.h>
#include <composer-vts/2.2/ComposerVts.h>
#include <gtest/gtest.h>
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>
-#include <mapper-vts/2.0/MapperVts.h>
+#include <ui/GraphicBuffer.h>
namespace android {
namespace hardware {
@@ -40,7 +39,6 @@
using common::V1_1::Dataspace;
using common::V1_1::PixelFormat;
using common::V1_1::RenderIntent;
-using V2_1::vts::NativeHandleWrapper;
class GraphicsComposerHidlTest : public ::testing::TestWithParam<std::string> {
protected:
@@ -141,8 +139,6 @@
void SetUp() override {
ASSERT_NO_FATAL_FAILURE(GraphicsComposerHidlTest::SetUp());
- ASSERT_NO_FATAL_FAILURE(mGralloc = std::make_unique<Gralloc>());
-
mWriter = std::make_unique<CommandWriterBase>(1024);
mReader = std::make_unique<V2_1::vts::TestCommandReader>();
}
@@ -152,20 +148,10 @@
ASSERT_NO_FATAL_FAILURE(GraphicsComposerHidlTest::TearDown());
}
- NativeHandleWrapper allocate() {
- uint64_t usage =
- static_cast<uint64_t>(BufferUsage::CPU_WRITE_OFTEN | BufferUsage::CPU_READ_OFTEN);
- return mGralloc->allocate(/*width*/ 64, /*height*/ 64, /*layerCount*/ 1,
- PixelFormat::RGBA_8888, usage);
- }
-
void execute() { mComposerClient->execute(mReader.get(), mWriter.get()); }
std::unique_ptr<CommandWriterBase> mWriter;
std::unique_ptr<V2_1::vts::TestCommandReader> mReader;
-
- private:
- std::unique_ptr<Gralloc> mGralloc;
};
/**
@@ -437,13 +423,11 @@
uint64_t usage =
static_cast<uint64_t>(BufferUsage::COMPOSER_OVERLAY | BufferUsage::CPU_READ_OFTEN);
- std::unique_ptr<Gralloc> gralloc;
- std::unique_ptr<NativeHandleWrapper> buffer;
- ASSERT_NO_FATAL_FAILURE(gralloc = std::make_unique<Gralloc>());
- ASSERT_NO_FATAL_FAILURE(buffer.reset(new NativeHandleWrapper(
- gralloc->allocate(mDisplayWidth, mDisplayHeight, 1, mReadbackPixelFormat, usage))));
+ sp<GraphicBuffer> buffer = sp<GraphicBuffer>::make(mDisplayWidth, mDisplayHeight,
+ (int32_t)mReadbackPixelFormat, 1, usage);
+ ASSERT_EQ(STATUS_OK, buffer->initCheck());
- mComposerClient->setReadbackBuffer(mPrimaryDisplay, buffer->get(), -1);
+ mComposerClient->setReadbackBuffer(mPrimaryDisplay, buffer->handle, -1);
}
/**
@@ -460,14 +444,12 @@
uint64_t usage =
static_cast<uint64_t>(BufferUsage::COMPOSER_OVERLAY | BufferUsage::CPU_READ_OFTEN);
- std::unique_ptr<Gralloc> gralloc;
- std::unique_ptr<NativeHandleWrapper> buffer;
- ASSERT_NO_FATAL_FAILURE(gralloc = std::make_unique<Gralloc>());
- ASSERT_NO_FATAL_FAILURE(buffer.reset(new NativeHandleWrapper(
- gralloc->allocate(mDisplayWidth, mDisplayHeight, 1, mReadbackPixelFormat, usage))));
+ sp<GraphicBuffer> buffer = sp<GraphicBuffer>::make(mDisplayWidth, mDisplayHeight,
+ (int32_t)mReadbackPixelFormat, 1, usage);
+ ASSERT_EQ(STATUS_OK, buffer->initCheck());
- Error error =
- mComposerClient->getRaw()->setReadbackBuffer(mInvalidDisplayId, buffer->get(), nullptr);
+ Error error = mComposerClient->getRaw()->setReadbackBuffer(mInvalidDisplayId, buffer->handle,
+ nullptr);
ASSERT_EQ(Error::BAD_DISPLAY, error);
}
diff --git a/graphics/composer/2.3/utils/vts/Android.bp b/graphics/composer/2.3/utils/vts/Android.bp
index dd56633..7695523 100644
--- a/graphics/composer/2.3/utils/vts/Android.bp
+++ b/graphics/composer/2.3/utils/vts/Android.bp
@@ -27,7 +27,6 @@
cc_library_static {
name: "android.hardware.graphics.composer@2.3-vts",
defaults: [
- "android.hardware.graphics.allocator-ndk_static",
"hidl_defaults",
],
srcs: [
diff --git a/graphics/composer/2.3/vts/functional/Android.bp b/graphics/composer/2.3/vts/functional/Android.bp
index e0c1d4e..db0326e 100644
--- a/graphics/composer/2.3/vts/functional/Android.bp
+++ b/graphics/composer/2.3/vts/functional/Android.bp
@@ -28,7 +28,6 @@
name: "VtsHalGraphicsComposerV2_3TargetTest",
defaults: [
"VtsHalTargetTestDefaults",
- "android.hardware.graphics.allocator-ndk_static",
],
tidy_timeout_srcs: ["VtsHalGraphicsComposerV2_3TargetTest.cpp"],
srcs: ["VtsHalGraphicsComposerV2_3TargetTest.cpp"],
@@ -41,25 +40,14 @@
"libhidlbase",
"libsync",
"android.hardware.common-V2-ndk",
- "android.hardware.graphics.mapper@2.0",
- "android.hardware.graphics.mapper@2.1",
- "android.hardware.graphics.mapper@3.0",
- "android.hardware.graphics.mapper@4.0",
],
static_libs: [
- "android.hardware.graphics.allocator@2.0",
- "android.hardware.graphics.allocator@3.0",
- "android.hardware.graphics.allocator@4.0",
"android.hardware.graphics.composer@2.1",
"android.hardware.graphics.composer@2.1-vts",
"android.hardware.graphics.composer@2.2",
"android.hardware.graphics.composer@2.2-vts",
"android.hardware.graphics.composer@2.3",
"android.hardware.graphics.composer@2.3-vts",
- "android.hardware.graphics.mapper@2.0-vts",
- "android.hardware.graphics.mapper@2.1-vts",
- "android.hardware.graphics.mapper@3.0-vts",
- "android.hardware.graphics.mapper@4.0-vts",
"libaidlcommonsupport",
],
header_libs: [
diff --git a/graphics/composer/2.3/vts/functional/VtsHalGraphicsComposerV2_3TargetTest.cpp b/graphics/composer/2.3/vts/functional/VtsHalGraphicsComposerV2_3TargetTest.cpp
index ecfe66c..c072ef0 100644
--- a/graphics/composer/2.3/vts/functional/VtsHalGraphicsComposerV2_3TargetTest.cpp
+++ b/graphics/composer/2.3/vts/functional/VtsHalGraphicsComposerV2_3TargetTest.cpp
@@ -21,7 +21,6 @@
#include <android-base/logging.h>
#include <android-base/properties.h>
-#include <android/hardware/graphics/mapper/2.0/IMapper.h>
#include <composer-command-buffer/2.3/ComposerCommandBuffer.h>
#include <composer-vts/2.1/GraphicsComposerCallback.h>
#include <composer-vts/2.1/TestCommandReader.h>
@@ -29,7 +28,6 @@
#include <gtest/gtest.h>
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>
-#include <mapper-vts/2.0/MapperVts.h>
namespace android {
namespace hardware {
@@ -43,7 +41,6 @@
using common::V1_2::ColorMode;
using common::V1_2::Dataspace;
using common::V1_2::PixelFormat;
-using V2_2::vts::Gralloc;
class GraphicsComposerHidlTest : public ::testing::TestWithParam<std::string> {
protected:
@@ -128,8 +125,6 @@
void SetUp() override {
ASSERT_NO_FATAL_FAILURE(GraphicsComposerHidlTest::SetUp());
- ASSERT_NO_FATAL_FAILURE(mGralloc = std::make_unique<Gralloc>());
-
mWriter = std::make_unique<CommandWriterBase>(1024);
mReader = std::make_unique<V2_1::vts::TestCommandReader>();
}
@@ -143,9 +138,6 @@
std::unique_ptr<CommandWriterBase> mWriter;
std::unique_ptr<V2_1::vts::TestCommandReader> mReader;
-
- private:
- std::unique_ptr<Gralloc> mGralloc;
};
/**
diff --git a/graphics/composer/2.4/utils/hal/include/composer-hal/2.4/ComposerCommandEngine.h b/graphics/composer/2.4/utils/hal/include/composer-hal/2.4/ComposerCommandEngine.h
index 697d6b8..3b5ce5a 100644
--- a/graphics/composer/2.4/utils/hal/include/composer-hal/2.4/ComposerCommandEngine.h
+++ b/graphics/composer/2.4/utils/hal/include/composer-hal/2.4/ComposerCommandEngine.h
@@ -90,6 +90,9 @@
}
const uint32_t keySize = read();
+ if (!isReadSizeValid(keySize)) {
+ return false;
+ }
std::string key;
key.resize(keySize);
readBlob(keySize, key.data());
@@ -97,6 +100,9 @@
const bool mandatory = read();
const uint32_t valueSize = read();
+ if (!isReadSizeValid(valueSize)) {
+ return false;
+ }
std::vector<uint8_t> value(valueSize);
readBlob(valueSize, value.data());
diff --git a/graphics/composer/2.4/utils/vts/Android.bp b/graphics/composer/2.4/utils/vts/Android.bp
index 3a80c9a..d2f4297 100644
--- a/graphics/composer/2.4/utils/vts/Android.bp
+++ b/graphics/composer/2.4/utils/vts/Android.bp
@@ -27,7 +27,6 @@
cc_library_static {
name: "android.hardware.graphics.composer@2.4-vts",
defaults: [
- "android.hardware.graphics.allocator-ndk_static",
"hidl_defaults",
],
srcs: [
diff --git a/graphics/composer/2.4/vts/functional/Android.bp b/graphics/composer/2.4/vts/functional/Android.bp
index 637482d..225c73b 100644
--- a/graphics/composer/2.4/vts/functional/Android.bp
+++ b/graphics/composer/2.4/vts/functional/Android.bp
@@ -28,7 +28,6 @@
name: "VtsHalGraphicsComposerV2_4TargetTest",
defaults: [
"VtsHalTargetTestDefaults",
- "android.hardware.graphics.allocator-ndk_static",
],
tidy_timeout_srcs: ["VtsHalGraphicsComposerV2_4TargetTest.cpp"],
srcs: ["VtsHalGraphicsComposerV2_4TargetTest.cpp"],
@@ -39,16 +38,10 @@
"libbinder_ndk",
"libfmq",
"libsync",
+ "libui",
"android.hardware.common-V2-ndk",
- "android.hardware.graphics.mapper@2.0",
- "android.hardware.graphics.mapper@2.1",
- "android.hardware.graphics.mapper@3.0",
- "android.hardware.graphics.mapper@4.0",
],
static_libs: [
- "android.hardware.graphics.allocator@2.0",
- "android.hardware.graphics.allocator@3.0",
- "android.hardware.graphics.allocator@4.0",
"android.hardware.graphics.composer@2.1",
"android.hardware.graphics.composer@2.1-vts",
"android.hardware.graphics.composer@2.2",
@@ -57,10 +50,6 @@
"android.hardware.graphics.composer@2.3-vts",
"android.hardware.graphics.composer@2.4",
"android.hardware.graphics.composer@2.4-vts",
- "android.hardware.graphics.mapper@2.0-vts",
- "android.hardware.graphics.mapper@2.1-vts",
- "android.hardware.graphics.mapper@3.0-vts",
- "android.hardware.graphics.mapper@4.0-vts",
"libaidlcommonsupport",
],
header_libs: [
diff --git a/graphics/composer/2.4/vts/functional/AndroidTest.xml b/graphics/composer/2.4/vts/functional/AndroidTest.xml
index 773db93..7626995 100644
--- a/graphics/composer/2.4/vts/functional/AndroidTest.xml
+++ b/graphics/composer/2.4/vts/functional/AndroidTest.xml
@@ -31,6 +31,6 @@
<test class="com.android.tradefed.testtype.GTest" >
<option name="native-test-device-path" value="/data/local/tmp" />
<option name="module-name" value="VtsHalGraphicsComposerV2_4TargetTest" />
- <option name="native-test-timeout" value="900000"/>
+ <option name="native-test-timeout" value="1800000"/>
</test>
</configuration>
diff --git a/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp b/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp
index 35225d9..7ae917b 100644
--- a/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp
+++ b/graphics/composer/2.4/vts/functional/VtsHalGraphicsComposerV2_4TargetTest.cpp
@@ -22,7 +22,6 @@
#include <android-base/logging.h>
#include <android-base/properties.h>
-#include <android/hardware/graphics/mapper/2.0/IMapper.h>
#include <composer-command-buffer/2.4/ComposerCommandBuffer.h>
#include <composer-vts/2.4/ComposerVts.h>
#include <composer-vts/2.4/GraphicsComposerCallback.h>
@@ -30,9 +29,7 @@
#include <gtest/gtest.h>
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>
-#include <mapper-vts/2.0/MapperVts.h>
-#include <mapper-vts/3.0/MapperVts.h>
-#include <mapper-vts/4.0/MapperVts.h>
+#include <ui/GraphicBuffer.h>
#include <utils/Timers.h>
namespace android {
@@ -51,9 +48,7 @@
using common::V1_2::Dataspace;
using common::V1_2::PixelFormat;
using V2_1::Layer;
-using V2_1::vts::NativeHandleWrapper;
using V2_2::Transform;
-using V2_2::vts::Gralloc;
using ContentType = IComposerClient::ContentType;
using DisplayCapability = IComposerClient::DisplayCapability;
@@ -103,8 +98,6 @@
}
mComposerCallback->setVsyncAllowed(false);
- ASSERT_NO_FATAL_FAILURE(mGralloc = std::make_unique<Gralloc>());
-
mWriter = std::make_unique<CommandWriterBase>(1024);
mReader = std::make_unique<TestCommandReader>();
}
@@ -157,12 +150,15 @@
void execute() { mComposerClient->execute(mReader.get(), mWriter.get()); }
- NativeHandleWrapper allocate(int32_t width, int32_t height) {
- return mGralloc->allocate(
- width, height, /*layerCount*/ 1,
- static_cast<common::V1_1::PixelFormat>(PixelFormat::RGBA_8888),
+ sp<GraphicBuffer> allocate(int32_t width, int32_t height) {
+ auto result = sp<GraphicBuffer>::make(
+ width, height, static_cast<int32_t>(PixelFormat::RGBA_8888), /*layerCount*/ 1,
static_cast<uint64_t>(BufferUsage::CPU_WRITE_OFTEN | BufferUsage::CPU_READ_OFTEN |
BufferUsage::COMPOSER_OVERLAY));
+ if (result->initCheck() != STATUS_OK) {
+ return nullptr;
+ }
+ return result;
}
struct TestParameters {
@@ -256,7 +252,6 @@
std::unique_ptr<CommandWriterBase> mWriter;
std::unique_ptr<TestCommandReader> mReader;
sp<GraphicsComposerCallback> mComposerCallback;
- std::unique_ptr<Gralloc> mGralloc;
};
TEST_P(GraphicsComposerHidlTest, getDisplayCapabilitiesBadDisplay) {
@@ -458,7 +453,7 @@
mWriter->setLayerBlendMode(IComposerClient::BlendMode::NONE);
mWriter->setLayerSurfaceDamage(
std::vector<IComposerClient::Rect>(1, display.getFrameRect()));
- mWriter->setLayerBuffer(0, handle.get(), -1);
+ mWriter->setLayerBuffer(0, handle->handle, -1);
mWriter->setLayerDataspace(Dataspace::UNKNOWN);
mWriter->validateDisplay();
@@ -476,7 +471,7 @@
ASSERT_NE(nullptr, handle.get());
mWriter->selectLayer(layer);
- mWriter->setLayerBuffer(0, handle.get(), -1);
+ mWriter->setLayerBuffer(0, handle->handle, -1);
mWriter->setLayerSurfaceDamage(std::vector<IComposerClient::Rect>(1, {0, 0, 10, 10}));
mWriter->validateDisplay();
execute();
@@ -544,10 +539,12 @@
setActiveConfigWithConstraints(display, config2, constraints, &timeline));
EXPECT_TRUE(timeline.newVsyncAppliedTimeNanos >= constraints.desiredTimeNanos);
- // Refresh rate should change within a reasonable time
- constexpr std::chrono::nanoseconds kReasonableTimeForChange = 1s; // 1 second
- EXPECT_TRUE(timeline.newVsyncAppliedTimeNanos - constraints.desiredTimeNanos <=
- kReasonableTimeForChange.count());
+ if (configGroup1 == configGroup2) {
+ // Refresh rate should change within a reasonable time
+ constexpr std::chrono::nanoseconds kReasonableTimeForChange = 1s;
+ EXPECT_TRUE(timeline.newVsyncAppliedTimeNanos - constraints.desiredTimeNanos <=
+ kReasonableTimeForChange.count());
+ }
if (timeline.refreshRequired) {
if (params.refreshMiss) {
diff --git a/graphics/composer/aidl/Android.bp b/graphics/composer/aidl/Android.bp
index 5e4c23e..9b6b196 100644
--- a/graphics/composer/aidl/Android.bp
+++ b/graphics/composer/aidl/Android.bp
@@ -28,18 +28,15 @@
name: "android.hardware.graphics.composer3",
host_supported: true,
vendor_available: true,
- vndk: {
- enabled: true,
- support_system_process: true,
- },
- frozen: true,
+ double_loadable: true,
+ frozen: false,
vndk_use_version: "1",
srcs: [
"android/hardware/graphics/composer3/*.aidl",
],
stability: "vintf",
imports: [
- "android.hardware.graphics.common-V4",
+ "android.hardware.graphics.common-V5",
"android.hardware.common-V2",
],
backend: {
@@ -50,24 +47,22 @@
sdk_version: "module_current",
enabled: false,
},
- ndk: {
- vndk: {
- enabled: true,
- },
+ rust: {
+ enabled: true,
},
},
versions_with_info: [
{
version: "1",
imports: [
- "android.hardware.graphics.common-V4",
+ "android.hardware.graphics.common-V5",
"android.hardware.common-V2",
],
},
{
version: "2",
imports: [
- "android.hardware.graphics.common-V4",
+ "android.hardware.graphics.common-V5",
"android.hardware.common-V2",
],
},
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl
index f02f8aa..ee004d6 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Capability.aidl
@@ -45,4 +45,5 @@
BOOT_DISPLAY_CONFIG = 5,
HDR_OUTPUT_CONVERSION_CONFIG = 6,
REFRESH_RATE_CHANGED_CALLBACK_DEBUG = 7,
+ LAYER_LIFECYCLE_BATCH_COMMAND = 8,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTarget.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTarget.aidl
index 7632707..06ed922 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTarget.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClientTarget.aidl
@@ -37,4 +37,5 @@
android.hardware.graphics.composer3.Buffer buffer;
android.hardware.graphics.common.Dataspace dataspace;
android.hardware.graphics.common.Rect[] damage;
+ float hdrSdrRatio = 1.0f;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl
index 6eba887..0e2d72b 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCapability.aidl
@@ -42,4 +42,5 @@
AUTO_LOW_LATENCY_MODE = 5,
SUSPEND = 6,
DISPLAY_IDLE_TIMER = 7,
+ MULTI_THREADED_PRESENT = 8,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl
index 662240e..cce35e7 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl
@@ -45,4 +45,5 @@
boolean acceptDisplayChanges;
boolean presentDisplay;
boolean presentOrValidateDisplay;
+ int frameIntervalNs;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl
new file mode 100644
index 0000000..040afd7
--- /dev/null
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayConfiguration.aidl
@@ -0,0 +1,48 @@
+/**
+ * Copyright 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.graphics.composer3;
+@VintfStability
+parcelable DisplayConfiguration {
+ int configId;
+ int width;
+ int height;
+ @nullable android.hardware.graphics.composer3.DisplayConfiguration.Dpi dpi;
+ int configGroup;
+ int vsyncPeriod;
+ @nullable android.hardware.graphics.composer3.VrrConfig vrrConfig;
+ parcelable Dpi {
+ float x;
+ float y;
+ }
+}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl
index 00598eb..e6db116 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayRequest.aidl
@@ -37,12 +37,12 @@
long display;
int mask;
android.hardware.graphics.composer3.DisplayRequest.LayerRequest[] layerRequests;
- const int FLIP_CLIENT_TARGET = (1 << 0);
- const int WRITE_CLIENT_TARGET_TO_OUTPUT = (1 << 1);
+ const int FLIP_CLIENT_TARGET = (1 << 0) /* 1 */;
+ const int WRITE_CLIENT_TARGET_TO_OUTPUT = (1 << 1) /* 2 */;
@VintfStability
parcelable LayerRequest {
long layer;
int mask;
- const int CLEAR_CLIENT_TARGET = (1 << 0);
+ const int CLEAR_CLIENT_TARGET = (1 << 0) /* 1 */;
}
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FormatColorComponent.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FormatColorComponent.aidl
index 1990350..89dae83 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FormatColorComponent.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FormatColorComponent.aidl
@@ -34,8 +34,8 @@
package android.hardware.graphics.composer3;
@Backing(type="byte") @VintfStability
enum FormatColorComponent {
- FORMAT_COMPONENT_0 = (1 << 0),
- FORMAT_COMPONENT_1 = (1 << 1),
- FORMAT_COMPONENT_2 = (1 << 2),
- FORMAT_COMPONENT_3 = (1 << 3),
+ FORMAT_COMPONENT_0 = (1 << 0) /* 1 */,
+ FORMAT_COMPONENT_1 = (1 << 1) /* 2 */,
+ FORMAT_COMPONENT_2 = (1 << 2) /* 4 */,
+ FORMAT_COMPONENT_3 = (1 << 3) /* 8 */,
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerCallback.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerCallback.aidl
index 2c08cbe..e64bd52 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerCallback.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerCallback.aidl
@@ -34,6 +34,9 @@
package android.hardware.graphics.composer3;
@VintfStability
interface IComposerCallback {
+ /**
+ * @deprecated : Use instead onHotplugEvent
+ */
void onHotplug(long display, boolean connected);
oneway void onRefresh(long display);
oneway void onSeamlessPossible(long display);
@@ -41,4 +44,5 @@
oneway void onVsyncPeriodTimingChanged(long display, in android.hardware.graphics.composer3.VsyncPeriodChangeTimeline updatedTimeline);
oneway void onVsyncIdle(long display);
oneway void onRefreshRateChangedDebug(in android.hardware.graphics.composer3.RefreshRateChangedDebugData data);
+ void onHotplugEvent(long display, android.hardware.graphics.common.DisplayHotplugEvent event);
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
index cb85a88..bc27cc7 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -42,8 +42,14 @@
int getActiveConfig(long display);
android.hardware.graphics.composer3.ColorMode[] getColorModes(long display);
float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace);
+ /**
+ * @deprecated use getDisplayConfigurations instead. Returns a display attribute value for a particular display configuration. For legacy support getDisplayAttribute should return valid values for any requested DisplayAttribute, and for all of the configs obtained either through getDisplayConfigs or getDisplayConfigurations.
+ */
int getDisplayAttribute(long display, int config, android.hardware.graphics.composer3.DisplayAttribute attribute);
android.hardware.graphics.composer3.DisplayCapability[] getDisplayCapabilities(long display);
+ /**
+ * @deprecated use getDisplayConfigurations instead. For legacy support getDisplayConfigs should return at least one valid config. All the configs returned from the getDisplayConfigs should also be returned from getDisplayConfigurations.
+ */
int[] getDisplayConfigs(long display);
android.hardware.graphics.composer3.DisplayConnectionType getDisplayConnectionType(long display);
android.hardware.graphics.composer3.DisplayIdentification getDisplayIdentificationData(long display);
@@ -79,6 +85,8 @@
android.hardware.graphics.common.HdrConversionCapability[] getHdrConversionCapabilities();
android.hardware.graphics.common.Hdr setHdrConversionStrategy(in android.hardware.graphics.common.HdrConversionStrategy conversionStrategy);
void setRefreshRateChangedCallbackDebugEnabled(long display, boolean enabled);
+ android.hardware.graphics.composer3.DisplayConfiguration[] getDisplayConfigurations(long display, int maxFrameIntervalNs);
+ oneway void notifyExpectedPresent(long display, in android.hardware.graphics.composer3.ClockMonotonicTimestamp expectedPresentTime, int frameIntervalNs);
const int EX_BAD_CONFIG = 1;
const int EX_BAD_DISPLAY = 2;
const int EX_BAD_LAYER = 3;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
index 6d32218..87c8c18 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
@@ -55,4 +55,6 @@
@nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob;
@nullable android.hardware.graphics.common.Rect[] blockingRegion;
@nullable int[] bufferSlotsToClear;
+ android.hardware.graphics.composer3.LayerLifecycleBatchCommandType layerLifecycleBatchCommandType;
+ int newBufferSlotCount;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl
new file mode 100644
index 0000000..ac78cd5
--- /dev/null
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl
@@ -0,0 +1,40 @@
+/**
+ * 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.graphics.composer3;
+@Backing(type="int") @VintfStability
+enum LayerLifecycleBatchCommandType {
+ MODIFY = 0,
+ CREATE = 1,
+ DESTROY = 2,
+}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl
index 2b9801a..e9305e1 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl
@@ -36,4 +36,5 @@
parcelable RefreshRateChangedDebugData {
long display;
int vsyncPeriodNanos;
+ int refreshPeriodNanos;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl
new file mode 100644
index 0000000..bb2569f
--- /dev/null
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl
@@ -0,0 +1,48 @@
+/**
+ * Copyright 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.graphics.composer3;
+@VintfStability
+parcelable VrrConfig {
+ int minFrameIntervalNs;
+ @nullable android.hardware.graphics.composer3.VrrConfig.FrameIntervalPowerHint[] frameIntervalPowerHints;
+ @nullable android.hardware.graphics.composer3.VrrConfig.NotifyExpectedPresentConfig notifyExpectedPresentConfig;
+ parcelable FrameIntervalPowerHint {
+ int frameIntervalNs;
+ int averageRefreshPeriodNs;
+ }
+ parcelable NotifyExpectedPresentConfig {
+ int notifyExpectedPresentHeadsUpNs;
+ int notifyExpectedPresentTimeoutNs;
+ }
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl
index 4638610..1dfc074 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Capability.aidl
@@ -86,4 +86,14 @@
* @see IComposerCallback.onRefreshRateChangedDebug
*/
REFRESH_RATE_CHANGED_CALLBACK_DEBUG = 7,
+
+ /**
+ * Specifies that the device HAL supports the batching of layer creation and destruction
+ * for better performance.
+ *
+ * @see IComposerClient.executeCommands
+ * @see LayerCommand.layerLifecycleBatchCommandType
+ * @see LayerCommand.newBufferSlotCount
+ */
+ LAYER_LIFECYCLE_BATCH_COMMAND = 8,
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTarget.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTarget.aidl
index 56488d5..bc9f63a 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTarget.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClientTarget.aidl
@@ -36,4 +36,14 @@
* The surface damage regions.
*/
Rect[] damage;
+
+ /**
+ * The HDR/SDR ratio.
+ * Only meaningful for extended_range client targets to communicate the amount of HDR heaedroom
+ * inside the client target. For floating point client targets, this means that for each color
+ * channel the maximum SDR luminance is 1.0, and the maximum display relative luminance is
+ * the hdrSdrRatio.
+ * Note that this ratio is meant to be >= 1.0.
+ */
+ float hdrSdrRatio = 1.0f;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl
index f4b2984..7154d74 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCapability.aidl
@@ -80,4 +80,20 @@
* IComposerCallback.onVsyncIdle.
*/
DISPLAY_IDLE_TIMER = 7,
+ /**
+ * Indicates that both the composer HAL implementation and the given display
+ * support calling executeCommands concurrently from separate threads.
+ * executeCommands for a particular display will never run concurrently to
+ * any other executeCommands for the same display. In addition, the
+ * CommandResultPayload must only reference displays included in the
+ * DisplayCommands passed to executeCommands. Displays referenced from
+ * separate threads must have minimal interference with one another. If a
+ * HWC-managed display has this capability, SurfaceFlinger can run
+ * executeCommands for this display concurrently with other displays with the
+ * same capability.
+ * @see IComposerClient.executeCommands
+ * @see DisplayCommand.presentDisplay
+ * @see DisplayCommand.validateDisplay
+ */
+ MULTI_THREADED_PRESENT = 8,
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl
index 4f69aee..02c1389 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl
@@ -174,4 +174,15 @@
* or perform a VALIDATE_DISPLAY action instead.
*/
boolean presentOrValidateDisplay;
+
+ /**
+ * If a value greater than 0 is set, it provides a hint about the next frame(s)
+ * cadence. This parameter represents the time in nanoseconds of when to expect the
+ * next frames to arrive. For example. frameIntervalNs=33333333 indicates that the
+ * cadence of the next frames is 30Hz.
+ *
+ * The implementation should take the necessary steps to present the next frames as
+ * close as possible to the cadence.
+ */
+ int frameIntervalNs;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl
new file mode 100644
index 0000000..09c42dc
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayConfiguration.aidl
@@ -0,0 +1,70 @@
+/**
+ * Copyright 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.
+ */
+
+package android.hardware.graphics.composer3;
+import android.hardware.graphics.composer3.VrrConfig;
+
+@VintfStability
+parcelable DisplayConfiguration {
+ /**
+ * The config id, to be used with IComposerClient.setActiveConfig.
+ */
+ int configId;
+
+ /**
+ * Dimensions in pixels
+ */
+ int width;
+ int height;
+
+ /**
+ * Dots per inch.
+ * If the DPI for a configuration is unavailable or is
+ * considered unreliable, the device may set null instead.
+ */
+ parcelable Dpi {
+ float x;
+ float y;
+ }
+ @nullable Dpi dpi;
+
+ /**
+ * The configuration group ID this config is associated to.
+ * Switching between configurations within the same group may be
+ * done seamlessly in some conditions via
+ * setActiveConfigWithConstraints. Configurations which share the
+ * same config group are similar in all attributes except for the
+ * vsync period.
+ */
+ int configGroup;
+
+ /**
+ * Vsync period in nanoseconds. This period represents the internal
+ * frequency of the display. IComposerCallback.onVsync is expected
+ * to be called on each vsync event. For non-VRR configurations, a
+ * frame can be presented on each vsync event.
+ *
+ * A present fence, retrieved from CommandResultPayload.presentFence
+ * must be signaled on a vsync boundary.
+ */
+ int vsyncPeriod;
+
+ /**
+ * Represents the specific configurations for VRR (Variable Refresh Rate) display modes.
+ * Non-VRR modes should set this to null.
+ */
+ @nullable VrrConfig vrrConfig;
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl
index f4384b7..96eccd7 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerCallback.aidl
@@ -16,6 +16,7 @@
package android.hardware.graphics.composer3;
+import android.hardware.graphics.common.DisplayHotplugEvent;
import android.hardware.graphics.composer3.RefreshRateChangedDebugData;
import android.hardware.graphics.composer3.VsyncPeriodChangeTimeline;
@@ -38,6 +39,7 @@
* @param display is the display that triggers the hotplug event.
* @param connected indicates whether the display is connected or
* disconnected.
+ * @deprecated: Use instead onHotplugEvent
*/
void onHotplug(long display, boolean connected);
@@ -118,4 +120,23 @@
* @param data is the data for the callback when refresh rate changed.
*/
oneway void onRefreshRateChangedDebug(in RefreshRateChangedDebugData data);
+
+ /**
+ * Notifies the client that a DisplayHotplugEvent has occurred for the
+ * given display. Every active display (even a built-in physical display)
+ * must trigger at least one hotplug notification, even if it only occurs
+ * immediately after callback registration.
+ *
+ * Displays which have been connected are assumed to be in PowerMode.OFF,
+ * and the onVsync callback should not be called for a display until vsync
+ * has been enabled with setVsyncEnabled.
+ *
+ * The client may call back into the device while the callback is in
+ * progress. The device must serialize calls to this callback such that
+ * only one thread is calling it at a time.
+ *
+ * @param display is the display that triggers the hotplug event.
+ * @param event is the type of event that occurred.
+ */
+ void onHotplugEvent(long display, DisplayHotplugEvent event);
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
index 4e77f86..725c947 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -22,12 +22,14 @@
import android.hardware.graphics.common.HdrConversionStrategy;
import android.hardware.graphics.common.Transform;
import android.hardware.graphics.composer3.ClientTargetProperty;
+import android.hardware.graphics.composer3.ClockMonotonicTimestamp;
import android.hardware.graphics.composer3.ColorMode;
import android.hardware.graphics.composer3.CommandResultPayload;
import android.hardware.graphics.composer3.ContentType;
import android.hardware.graphics.composer3.DisplayAttribute;
import android.hardware.graphics.composer3.DisplayCapability;
import android.hardware.graphics.composer3.DisplayCommand;
+import android.hardware.graphics.composer3.DisplayConfiguration;
import android.hardware.graphics.composer3.DisplayConnectionType;
import android.hardware.graphics.composer3.DisplayContentSample;
import android.hardware.graphics.composer3.DisplayContentSamplingAttributes;
@@ -234,9 +236,18 @@
float[] getDataspaceSaturationMatrix(android.hardware.graphics.common.Dataspace dataspace);
/**
+ * @deprecated use getDisplayConfigurations instead.
+ *
* Returns a display attribute value for a particular display
* configuration.
*
+ * For legacy support getDisplayAttribute should return valid values for any requested
+ * DisplayAttribute, and for all of the configs obtained either through getDisplayConfigs
+ * or getDisplayConfigurations.
+ *
+ * @see getDisplayConfigurations
+ * @see getDisplayConfigs
+ *
* @param display is the display to query.
* @param config is the display configuration for which to return
* attribute values.
@@ -263,15 +274,12 @@
DisplayCapability[] getDisplayCapabilities(long display);
/**
- * Returns handles for all of the valid display configurations on this
- * display.
- * This should never return INVALID_CONFIGURATION as a valid value.
+ * @deprecated use getDisplayConfigurations instead.
+ * For legacy support getDisplayConfigs should return at least one valid config.
+ * All the configs returned from the getDisplayConfigs should also be returned
+ * from getDisplayConfigurations.
*
- * @param display is the display to query.
- *
- * @return is an array of configuration handles.
- *
- * @exception EX_BAD_DISPLAY when an invalid display handle was passed in.
+ * @see getDisplayConfigurations
*/
int[] getDisplayConfigs(long display);
@@ -864,4 +872,45 @@
* false when refresh rate callback is disabled.
*/
void setRefreshRateChangedCallbackDebugEnabled(long display, boolean enabled);
+
+ /**
+ * Returns all of the valid display configurations.
+ * getDisplayConfigurations is the superset of getDisplayConfigs and
+ * getDisplayConfigs should return at least one config.
+ *
+ * @param display is the display for which the configurations are requested.
+ * @param maxFrameIntervalNs refers to the largest frameInterval to be set for
+ * VrrConfig.frameIntervalPowerHints in nanoseconds
+ *
+ * @see getDisplayConfigs
+ */
+ DisplayConfiguration[] getDisplayConfigurations(long display, int maxFrameIntervalNs);
+
+ /**
+ * Provides an early hint for a frame that is likely to be presented.
+ * This is used for the implementation to take the necessary steps to ensure that
+ * the next frame(s) could be presented as close as possible to the expectedPresentTime and
+ * according to the frameIntervalNs cadence.
+ * See DisplayCommand.expectedPresentTime and DisplayCommand.frameIntervalNs.
+ *
+ * The framework will call this function based on the parameters specified in
+ * DisplayConfiguration.VrrConfig:
+ * - notifyExpectedPresentTimeoutNs specifies the idle time from the previous present command
+ * where the framework must send the early hint for the next frame.
+ * - notifyExpectedPresentHeadsUpNs specifies minimal time that framework must send
+ * the early hint before the next frame.
+ *
+ * The framework can omit calling this API when the next present command matches
+ * the cadence of the previous present command frameIntervalNs.
+ *
+ * If DisplayConfiguration.notifyExpectedPresentConfig is null, this function will never be
+ * called.
+ *
+ * @param display is the display for which the notifyExpectedPresent is called.
+ * @param expectedPresentTime is the expectedPresentTime that will be provided in the next
+ * present command
+ * @param frameIntervalNs is a hint about the cadence of the next frames in nanoseconds.
+ */
+ oneway void notifyExpectedPresent(
+ long display, in ClockMonotonicTimestamp expectedPresentTime, int frameIntervalNs);
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
index fd50be9..e961c48 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
@@ -23,6 +23,7 @@
import android.hardware.graphics.composer3.Buffer;
import android.hardware.graphics.composer3.Color;
import android.hardware.graphics.composer3.LayerBrightness;
+import android.hardware.graphics.composer3.LayerLifecycleBatchCommandType;
import android.hardware.graphics.composer3.ParcelableBlendMode;
import android.hardware.graphics.composer3.ParcelableComposition;
import android.hardware.graphics.composer3.ParcelableDataspace;
@@ -265,4 +266,17 @@
* be freed.
*/
@nullable int[] bufferSlotsToClear;
+
+ /**
+ * Specifies if this layer command is on type modify, create or destroy.
+ * This command is replacing the older IComposerClient.createLayer and destroyLayer
+ * and making it more efficient with reduced aidls to the HAL.
+ * The HAL will report the errors by setting CommandResultPayload::CommandError.
+ */
+ LayerLifecycleBatchCommandType layerLifecycleBatchCommandType;
+
+ /**
+ * Specifies the number of buffer slot to be reserved.
+ */
+ int newBufferSlotCount;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl
new file mode 100644
index 0000000..ec2d55f
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl
@@ -0,0 +1,39 @@
+/**
+ * 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.
+ */
+
+package android.hardware.graphics.composer3;
+
+/**
+ * Possible batch command types for a given layer.
+ */
+@VintfStability
+@Backing(type="int")
+enum LayerLifecycleBatchCommandType {
+ /**
+ * Layer attributes are being modified for already created layer.
+ */
+ MODIFY = 0,
+ /**
+ * This indicates that the current LayerCommand should also create the layer,
+ * before processing the other attributes in the LayerCommand.
+ */
+ CREATE = 1,
+ /**
+ * This indicates that the current LayerCommand should also destroyes the layer,
+ * after processing the other attributes in the LayerCommand.
+ */
+ DESTROY = 2,
+}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl
index c1f78d6..11c0112 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/RefreshRateChangedDebugData.aidl
@@ -27,4 +27,15 @@
* The display vsync period in nanoseconds.
*/
int vsyncPeriodNanos;
+
+ /**
+ * The refresh period of the display in nanoseconds.
+ * On VRR (Variable Refresh Rate) displays, refreshPeriodNanos can be different from the
+ * vsyncPeriodNanos because not every vsync cycle of the display is a refresh cycle.
+ * This should be set to the current refresh period.
+ * On non-VRR displays this value should be equal to vsyncPeriodNanos
+ *
+ * @see vsyncPeriodNanos
+ */
+ int refreshPeriodNanos;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl
new file mode 100644
index 0000000..3b241ba
--- /dev/null
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl
@@ -0,0 +1,65 @@
+/**
+ * Copyright 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.
+ */
+
+package android.hardware.graphics.composer3;
+
+@VintfStability
+parcelable VrrConfig {
+ /**
+ * The minimal time (in nanoseconds) that needs to pass between the previously presented frame
+ * and when the next frame can be presented.
+ */
+ int minFrameIntervalNs;
+
+ /**
+ * An optional mapping between frame intervals, and the physical display refresh period on
+ * average. This provides useful information to the framework when picking a specific frame rate
+ * (which is a divisor of the vsync rate) about the real display refresh rate, which could be
+ * used for power optimizations. The implementation should populate this map for frame rates
+ * that requires the display to run at a higher refresh rate due to self refresh frames. The
+ * lowest frame rate provided should be according to the parameter `maxFrameIntervalNs`
+ * specified in IComposerClient.getDisplayConfigurations, as the framework would generally not
+ * try to run at a lower frame rate.
+ */
+ parcelable FrameIntervalPowerHint {
+ int frameIntervalNs;
+ int averageRefreshPeriodNs;
+ }
+ @nullable FrameIntervalPowerHint[] frameIntervalPowerHints;
+
+ parcelable NotifyExpectedPresentConfig {
+ /**
+ * The minimal time in nanoseconds that IComposerClient.notifyExpectedPresent needs to be
+ * called ahead of an expectedPresentTime provided on a presentDisplay command.
+ */
+ int notifyExpectedPresentHeadsUpNs;
+
+ /**
+ * The time in nanoseconds that represents a timeout from the previous presentDisplay, which
+ * after this point the display needs a call to IComposerClient.notifyExpectedPresent before
+ * sending the next frame. If set to 0, there is no need to call
+ * IComposerClient.notifyExpectedPresent for timeout.
+ */
+ int notifyExpectedPresentTimeoutNs;
+ }
+
+ /**
+ * Parameters for when to call IComposerClient.notifyExpectedPresent.
+ *
+ * When set to null, the framework will not call IComposerClient.notifyExpectedPresent.
+ */
+ @nullable NotifyExpectedPresentConfig notifyExpectedPresentConfig;
+}
diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
index 2e902e5..a1ccbfe 100644
--- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
+++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
@@ -29,6 +29,7 @@
#include <aidl/android/hardware/graphics/composer3/Composition.h>
#include <aidl/android/hardware/graphics/composer3/DisplayBrightness.h>
#include <aidl/android/hardware/graphics/composer3/LayerBrightness.h>
+#include <aidl/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.h>
#include <aidl/android/hardware/graphics/composer3/PerFrameMetadata.h>
#include <aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h>
@@ -83,11 +84,13 @@
}
void setClientTarget(int64_t display, uint32_t slot, const native_handle_t* target,
- int acquireFence, Dataspace dataspace, const std::vector<Rect>& damage) {
+ int acquireFence, Dataspace dataspace, const std::vector<Rect>& damage,
+ float hdrSdrRatio) {
ClientTarget clientTargetCommand;
clientTargetCommand.buffer = getBufferCommand(slot, target, acquireFence);
clientTargetCommand.dataspace = dataspace;
clientTargetCommand.damage.assign(damage.begin(), damage.end());
+ clientTargetCommand.hdrSdrRatio = hdrSdrRatio;
getDisplayCommand(display).clientTarget.emplace(std::move(clientTargetCommand));
}
@@ -97,18 +100,31 @@
getBufferCommand(slot, buffer, releaseFence));
}
+ void setLayerLifecycleBatchCommandType(int64_t display, int64_t layer,
+ LayerLifecycleBatchCommandType cmd) {
+ getLayerCommand(display, layer).layerLifecycleBatchCommandType = cmd;
+ }
+
+ void setNewBufferSlotCount(int64_t display, int64_t layer, int32_t newBufferSlotToCount) {
+ getLayerCommand(display, layer).newBufferSlotCount = newBufferSlotToCount;
+ }
+
void validateDisplay(int64_t display,
- std::optional<ClockMonotonicTimestamp> expectedPresentTime) {
+ std::optional<ClockMonotonicTimestamp> expectedPresentTime,
+ int32_t frameIntervalNs) {
auto& command = getDisplayCommand(display);
command.expectedPresentTime = expectedPresentTime;
command.validateDisplay = true;
+ command.frameIntervalNs = frameIntervalNs;
}
void presentOrvalidateDisplay(int64_t display,
- std::optional<ClockMonotonicTimestamp> expectedPresentTime) {
+ std::optional<ClockMonotonicTimestamp> expectedPresentTime,
+ int32_t frameIntervalNs) {
auto& command = getDisplayCommand(display);
command.expectedPresentTime = expectedPresentTime;
command.presentOrValidateDisplay = true;
+ command.frameIntervalNs = frameIntervalNs;
}
void acceptDisplayChanges(int64_t display) {
diff --git a/graphics/composer/aidl/vts/Android.bp b/graphics/composer/aidl/vts/Android.bp
index 5bae7b5..658e0d5 100644
--- a/graphics/composer/aidl/vts/Android.bp
+++ b/graphics/composer/aidl/vts/Android.bp
@@ -55,13 +55,6 @@
"libgui",
"libhidlbase",
"libprocessgroup",
- "android.hardware.graphics.mapper@2.0",
- "android.hardware.graphics.mapper@2.1",
- "android.hardware.graphics.mapper@3.0",
- "android.hardware.graphics.mapper@4.0",
- "android.hardware.graphics.allocator@2.0",
- "android.hardware.graphics.allocator@3.0",
- "android.hardware.graphics.allocator@4.0",
"libvndksupport",
],
header_libs: [
@@ -71,13 +64,6 @@
"android.hardware.graphics.common@1.2",
"android.hardware.common-V2-ndk",
"android.hardware.common.fmq-V1-ndk",
- "android.hardware.graphics.allocator@2.0",
- "android.hardware.graphics.allocator@3.0",
- "android.hardware.graphics.allocator@4.0",
- "android.hardware.graphics.mapper@2.0-vts",
- "android.hardware.graphics.mapper@2.1-vts",
- "android.hardware.graphics.mapper@3.0-vts",
- "android.hardware.graphics.mapper@4.0-vts",
"libaidlcommonsupport",
"libarect",
"libbase",
diff --git a/graphics/composer/aidl/vts/GraphicsComposerCallback.cpp b/graphics/composer/aidl/vts/GraphicsComposerCallback.cpp
index 7b3a2b4..544f692 100644
--- a/graphics/composer/aidl/vts/GraphicsComposerCallback.cpp
+++ b/graphics/composer/aidl/vts/GraphicsComposerCallback.cpp
@@ -17,6 +17,7 @@
#include "GraphicsComposerCallback.h"
#include <log/log_main.h>
#include <utils/Timers.h>
+#include <cinttypes>
#pragma push_macro("LOG_TAG")
#undef LOG_TAG
@@ -193,4 +194,18 @@
return ::ndk::ScopedAStatus::ok();
}
+::ndk::ScopedAStatus GraphicsComposerCallback::onHotplugEvent(int64_t in_display,
+ common::DisplayHotplugEvent event) {
+ switch (event) {
+ case common::DisplayHotplugEvent::CONNECTED:
+ return onHotplug(in_display, true);
+ case common::DisplayHotplugEvent::DISCONNECTED:
+ return onHotplug(in_display, false);
+ default:
+ ALOGE("%s(): display:%" PRIu64 ", event:%d", __func__, in_display,
+ static_cast<int32_t>(event));
+ return ::ndk::ScopedAStatus::ok();
+ }
+}
+
} // namespace aidl::android::hardware::graphics::composer3::vts
diff --git a/graphics/composer/aidl/vts/GraphicsComposerCallback.h b/graphics/composer/aidl/vts/GraphicsComposerCallback.h
index 13e992a..7a8d4a3 100644
--- a/graphics/composer/aidl/vts/GraphicsComposerCallback.h
+++ b/graphics/composer/aidl/vts/GraphicsComposerCallback.h
@@ -63,6 +63,8 @@
virtual ::ndk::ScopedAStatus onVsyncIdle(int64_t in_display) override;
virtual ::ndk::ScopedAStatus onRefreshRateChangedDebug(
const RefreshRateChangedDebugData&) override;
+ virtual ::ndk::ScopedAStatus onHotplugEvent(int64_t in_display,
+ common::DisplayHotplugEvent) override;
mutable std::mutex mMutex;
// the set of all currently connected displays
diff --git a/graphics/composer/aidl/vts/ReadbackVts.cpp b/graphics/composer/aidl/vts/ReadbackVts.cpp
index abb58e2..c72ec69 100644
--- a/graphics/composer/aidl/vts/ReadbackVts.cpp
+++ b/graphics/composer/aidl/vts/ReadbackVts.cpp
@@ -35,6 +35,7 @@
writer.setLayerPlaneAlpha(mDisplay, mLayer, mAlpha);
writer.setLayerBlendMode(mDisplay, mLayer, mBlendMode);
writer.setLayerBrightness(mDisplay, mLayer, mBrightness);
+ writer.setLayerDataspace(mDisplay, mLayer, mDataspace);
}
std::string ReadbackHelper::getColorModeString(ColorMode mode) {
@@ -99,6 +100,7 @@
layerSettings.geometry.positionTransform = scale * translation;
layerSettings.whitePointNits = mWhitePointNits;
+ layerSettings.sourceDataspace = static_cast<::android::ui::Dataspace>(mDataspace);
return layerSettings;
}
@@ -189,6 +191,23 @@
}
}
+void ReadbackHelper::compareColorBuffers(void* expectedBuffer, void* actualBuffer,
+ const uint32_t stride, const uint32_t width,
+ const uint32_t height, common::PixelFormat pixelFormat) {
+ const int32_t bytesPerPixel = ReadbackHelper::GetBytesPerPixel(pixelFormat);
+ ASSERT_NE(-1, bytesPerPixel);
+ for (int row = 0; row < height; row++) {
+ for (int col = 0; col < width; col++) {
+ int offset = (row * static_cast<int32_t>(stride) + col) * bytesPerPixel;
+ uint8_t* expectedColor = (uint8_t*)expectedBuffer + offset;
+ uint8_t* actualColor = (uint8_t*)actualBuffer + offset;
+ ASSERT_EQ(expectedColor[0], actualColor[0]);
+ ASSERT_EQ(expectedColor[1], actualColor[1]);
+ ASSERT_EQ(expectedColor[2], actualColor[2]);
+ }
+ }
+}
+
ReadbackBuffer::ReadbackBuffer(int64_t display, const std::shared_ptr<VtsComposerClient>& client,
int32_t width, int32_t height, common::PixelFormat pixelFormat,
common::Dataspace dataspace)
@@ -248,6 +267,15 @@
EXPECT_EQ(::android::OK, status);
}
+::android::sp<::android::GraphicBuffer> ReadbackBuffer::getBuffer() {
+ const auto& [fenceStatus, bufferFence] = mComposerClient->getReadbackBufferFence(mDisplay);
+ EXPECT_TRUE(fenceStatus.isOk());
+ if (bufferFence.get() != -1) {
+ sync_wait(bufferFence.get(), -1);
+ }
+ return mGraphicBuffer;
+}
+
void TestColorLayer::write(ComposerClientWriter& writer) {
TestLayer::write(writer);
writer.setLayerCompositionType(mDisplay, mLayer, Composition::SOLID_COLOR);
@@ -265,8 +293,8 @@
TestBufferLayer::TestBufferLayer(const std::shared_ptr<VtsComposerClient>& client,
TestRenderEngine& renderEngine, int64_t display, uint32_t width,
uint32_t height, common::PixelFormat format,
- Composition composition)
- : TestLayer{client, display}, mRenderEngine(renderEngine) {
+ ComposerClientWriter& writer, Composition composition)
+ : TestLayer{client, display, writer}, mRenderEngine(renderEngine) {
mComposition = composition;
mWidth = width;
mHeight = height;
@@ -344,10 +372,6 @@
"TestBufferLayer");
}
-void TestBufferLayer::setDataspace(common::Dataspace dataspace, ComposerClientWriter& writer) {
- writer.setLayerDataspace(mDisplay, mLayer, dataspace);
-}
-
void TestBufferLayer::setToClientComposition(ComposerClientWriter& writer) {
writer.setLayerCompositionType(mDisplay, mLayer, Composition::CLIENT);
}
diff --git a/graphics/composer/aidl/vts/ReadbackVts.h b/graphics/composer/aidl/vts/ReadbackVts.h
index ee9f0d5..8ac0f4b 100644
--- a/graphics/composer/aidl/vts/ReadbackVts.h
+++ b/graphics/composer/aidl/vts/ReadbackVts.h
@@ -20,7 +20,6 @@
#include <android-base/unique_fd.h>
#include <android/hardware/graphics/composer3/ComposerClientReader.h>
#include <android/hardware/graphics/composer3/ComposerClientWriter.h>
-#include <mapper-vts/2.1/MapperVts.h>
#include <renderengine/RenderEngine.h>
#include <ui/GraphicBuffer.h>
#include <memory>
@@ -32,7 +31,6 @@
using ::android::renderengine::LayerSettings;
using common::Dataspace;
using common::PixelFormat;
-using IMapper2_1 = ::android::hardware::graphics::mapper::V2_1::IMapper;
static const Color BLACK = {0.0f, 0.0f, 0.0f, 1.0f};
static const Color RED = {1.0f, 0.0f, 0.0f, 1.0f};
@@ -44,14 +42,18 @@
static const Color GREEN = {0.0f, 1.0f, 0.0f, 1.0f};
static const Color BLUE = {0.0f, 0.0f, 1.0f, 1.0f};
static const Color WHITE = {1.0f, 1.0f, 1.0f, 1.0f};
+static const Color LIGHT_RED = {0.5f, 0.0f, 0.0f, 1.0f};
+static const Color LIGHT_GREEN = {0.0f, 0.5f, 0.0f, 1.0f};
+static const Color LIGHT_BLUE = {0.0f, 0.0f, 0.5f, 1.0f};
class TestRenderEngine;
class TestLayer {
public:
- TestLayer(const std::shared_ptr<VtsComposerClient>& client, int64_t display)
+ TestLayer(const std::shared_ptr<VtsComposerClient>& client, int64_t display,
+ ComposerClientWriter& writer)
: mDisplay(display) {
- const auto& [status, layer] = client->createLayer(display, kBufferSlotCount);
+ const auto& [status, layer] = client->createLayer(display, kBufferSlotCount, &writer);
EXPECT_TRUE(status.isOk());
mLayer = layer;
}
@@ -73,6 +75,8 @@
mSurfaceDamage = std::move(surfaceDamage);
}
+ void setDataspace(Dataspace dataspace) { mDataspace = dataspace; }
+
void setTransform(Transform transform) { mTransform = transform; }
void setAlpha(float alpha) { mAlpha = alpha; }
void setBlendMode(BlendMode blendMode) { mBlendMode = blendMode; }
@@ -100,12 +104,14 @@
float mAlpha = 1.0;
BlendMode mBlendMode = BlendMode::NONE;
uint32_t mZOrder = 0;
+ Dataspace mDataspace = Dataspace::UNKNOWN;
};
class TestColorLayer : public TestLayer {
public:
- TestColorLayer(const std::shared_ptr<VtsComposerClient>& client, int64_t display)
- : TestLayer{client, display} {}
+ TestColorLayer(const std::shared_ptr<VtsComposerClient>& client, int64_t display,
+ ComposerClientWriter& writer)
+ : TestLayer{client, display, writer} {}
void write(ComposerClientWriter& writer) override;
@@ -121,7 +127,7 @@
public:
TestBufferLayer(const std::shared_ptr<VtsComposerClient>& client,
TestRenderEngine& renderEngine, int64_t display, uint32_t width,
- uint32_t height, common::PixelFormat format,
+ uint32_t height, common::PixelFormat format, ComposerClientWriter& writer,
Composition composition = Composition::DEVICE);
void write(ComposerClientWriter& writer) override;
@@ -132,8 +138,6 @@
void setBuffer(std::vector<Color> colors);
- void setDataspace(Dataspace dataspace, ComposerClientWriter& writer);
-
void setToClientComposition(ComposerClientWriter& writer);
uint32_t getWidth() const { return mWidth; }
@@ -187,6 +191,9 @@
static void compareColorBuffers(const std::vector<Color>& expectedColors, void* bufferData,
const uint32_t stride, const uint32_t width,
const uint32_t height, PixelFormat pixelFormat);
+ static void compareColorBuffers(void* expectedBuffer, void* actualBuffer, const uint32_t stride,
+ const uint32_t width, const uint32_t height,
+ PixelFormat pixelFormat);
};
class ReadbackBuffer {
@@ -198,6 +205,8 @@
void checkReadbackBuffer(const std::vector<Color>& expectedColors);
+ ::android::sp<::android::GraphicBuffer> getBuffer();
+
protected:
uint32_t mWidth;
uint32_t mHeight;
diff --git a/graphics/composer/aidl/vts/RenderEngineVts.cpp b/graphics/composer/aidl/vts/RenderEngineVts.cpp
index 66779c8..4e7f773 100644
--- a/graphics/composer/aidl/vts/RenderEngineVts.cpp
+++ b/graphics/composer/aidl/vts/RenderEngineVts.cpp
@@ -19,7 +19,6 @@
namespace aidl::android::hardware::graphics::composer3::vts {
-using ::android::hardware::graphics::mapper::V2_1::IMapper;
using ::android::renderengine::DisplaySettings;
using ::android::renderengine::LayerSettings;
using ::android::renderengine::RenderEngineCreationArgs;
@@ -67,7 +66,7 @@
mGraphicBuffer, *mRenderEngine,
::android::renderengine::impl::ExternalTexture::Usage::WRITEABLE);
auto result = mRenderEngine
- ->drawLayers(mDisplaySettings, compositionLayers, texture, true,
+ ->drawLayers(mDisplaySettings, compositionLayers, texture,
std::move(bufferFence))
.get();
if (result.ok()) {
@@ -90,4 +89,32 @@
ASSERT_EQ(::android::OK, mGraphicBuffer->unlock());
}
+void TestRenderEngine::checkColorBuffer(const ::android::sp<::android::GraphicBuffer>& buffer) {
+ ASSERT_EQ(mGraphicBuffer->getWidth(), buffer->getWidth());
+ ASSERT_EQ(mGraphicBuffer->getHeight(), buffer->getHeight());
+ void* renderedBufferData;
+ int32_t bytesPerPixel = -1;
+ int32_t bytesPerStride = -1;
+ ASSERT_EQ(0, mGraphicBuffer->lock(static_cast<uint32_t>(mGraphicBuffer->getUsage()),
+ &renderedBufferData, &bytesPerPixel, &bytesPerStride));
+ const uint32_t renderedStride = (bytesPerPixel > 0 && bytesPerStride > 0)
+ ? static_cast<uint32_t>(bytesPerStride / bytesPerPixel)
+ : mGraphicBuffer->getStride();
+
+ void* bufferData;
+ ASSERT_EQ(0, buffer->lock(static_cast<uint32_t>(buffer->getUsage()), &bufferData,
+ &bytesPerPixel, &bytesPerStride));
+ const uint32_t bufferStride = (bytesPerPixel > 0 && bytesPerStride > 0)
+ ? static_cast<uint32_t>(bytesPerStride / bytesPerPixel)
+ : buffer->getStride();
+
+ ASSERT_EQ(renderedStride, bufferStride);
+
+ ReadbackHelper::compareColorBuffers(renderedBufferData, bufferData, bufferStride,
+ mGraphicBuffer->getWidth(), mGraphicBuffer->getHeight(),
+ mFormat);
+ ASSERT_EQ(::android::OK, buffer->unlock());
+ ASSERT_EQ(::android::OK, mGraphicBuffer->unlock());
+}
+
} // namespace aidl::android::hardware::graphics::composer3::vts
diff --git a/graphics/composer/aidl/vts/RenderEngineVts.h b/graphics/composer/aidl/vts/RenderEngineVts.h
index 43d3a42..bbe508f 100644
--- a/graphics/composer/aidl/vts/RenderEngineVts.h
+++ b/graphics/composer/aidl/vts/RenderEngineVts.h
@@ -15,13 +15,11 @@
*/
#pragma once
-#include <mapper-vts/2.1/MapperVts.h>
#include <math/half.h>
#include <math/vec3.h>
#include <renderengine/ExternalTexture.h>
#include <renderengine/RenderEngine.h>
#include <ui/GraphicBuffer.h>
-#include <ui/GraphicBufferAllocator.h>
#include <ui/PixelFormat.h>
#include <ui/Rect.h>
#include <ui/Region.h>
@@ -29,7 +27,6 @@
namespace aidl::android::hardware::graphics::composer3::vts {
-using ::android::hardware::graphics::mapper::V2_1::IMapper;
using ::android::renderengine::DisplaySettings;
using ::android::renderengine::ExternalTexture;
using ::android::renderengine::RenderEngineCreationArgs;
@@ -48,6 +45,7 @@
};
void drawLayers();
void checkColorBuffer(const std::vector<Color>& expectedColors);
+ void checkColorBuffer(const ::android::sp<::android::GraphicBuffer>& buffer);
::android::renderengine::RenderEngine& getInternalRenderEngine() { return *mRenderEngine; }
diff --git a/graphics/composer/aidl/vts/VtsComposerClient.cpp b/graphics/composer/aidl/vts/VtsComposerClient.cpp
index 25b0ca0..2c24bfb 100644
--- a/graphics/composer/aidl/vts/VtsComposerClient.cpp
+++ b/graphics/composer/aidl/vts/VtsComposerClient.cpp
@@ -33,6 +33,14 @@
mComposer = IComposer::fromBinder(binder);
ALOGE_IF(mComposer == nullptr, "Failed to acquire the composer from the binder");
}
+
+ const auto& [status, capabilities] = getCapabilities();
+ EXPECT_TRUE(status.isOk());
+ if (std::any_of(capabilities.begin(), capabilities.end(), [&](const Capability& cap) {
+ return cap == Capability::LAYER_LIFECYCLE_BATCH_COMMAND;
+ })) {
+ mSupportsBatchedCreateLayer = true;
+ }
}
ScopedAStatus VtsComposerClient::createClient() {
@@ -54,11 +62,11 @@
return mComposerClient->registerCallback(mComposerCallback);
}
-bool VtsComposerClient::tearDown() {
- return verifyComposerCallbackParams() && destroyAllLayers();
+bool VtsComposerClient::tearDown(ComposerClientWriter* writer) {
+ return verifyComposerCallbackParams() && destroyAllLayers(writer);
}
-std::pair<ScopedAStatus, int32_t> VtsComposerClient::getInterfaceVersion() {
+std::pair<ScopedAStatus, int32_t> VtsComposerClient::getInterfaceVersion() const {
int32_t version = 1;
auto status = mComposerClient->getInterfaceVersion(&version);
return {std::move(status), version};
@@ -86,7 +94,16 @@
}
std::pair<ScopedAStatus, int64_t> VtsComposerClient::createLayer(int64_t display,
- int32_t bufferSlotCount) {
+ int32_t bufferSlotCount,
+ ComposerClientWriter* writer) {
+ if (mSupportsBatchedCreateLayer) {
+ int64_t layer = mNextLayerHandle++;
+ writer->setLayerLifecycleBatchCommandType(display, layer,
+ LayerLifecycleBatchCommandType::CREATE);
+ writer->setNewBufferSlotCount(display, layer, bufferSlotCount);
+ return {addLayerToDisplayResources(display, layer), layer};
+ }
+
int64_t outLayer;
auto status = mComposerClient->createLayer(display, bufferSlotCount, &outLayer);
@@ -96,14 +113,20 @@
return {addLayerToDisplayResources(display, outLayer), outLayer};
}
-ScopedAStatus VtsComposerClient::destroyLayer(int64_t display, int64_t layer) {
- auto status = mComposerClient->destroyLayer(display, layer);
-
- if (!status.isOk()) {
- return status;
+ScopedAStatus VtsComposerClient::destroyLayer(int64_t display, int64_t layer,
+ ComposerClientWriter* writer) {
+ if (mSupportsBatchedCreateLayer) {
+ writer->setLayerLifecycleBatchCommandType(display, layer,
+ LayerLifecycleBatchCommandType::DESTROY);
+ } else {
+ auto status = mComposerClient->destroyLayer(display, layer);
+ if (!status.isOk()) {
+ return status;
+ }
}
+
removeLayerFromDisplayResources(display, layer);
- return status;
+ return ScopedAStatus::ok();
}
std::pair<ScopedAStatus, int32_t> VtsComposerClient::getActiveConfig(int64_t display) {
@@ -295,7 +318,31 @@
std::pair<ScopedAStatus, std::vector<int32_t>> VtsComposerClient::getDisplayConfigs(
int64_t display) {
std::vector<int32_t> outConfigs;
- return {mComposerClient->getDisplayConfigs(display, &outConfigs), outConfigs};
+ if (!getDisplayConfigurationSupported()) {
+ return {mComposerClient->getDisplayConfigs(display, &outConfigs), outConfigs};
+ }
+
+ auto [status, configs] = getDisplayConfigurations(display);
+ if (!status.isOk()) {
+ return {std::move(status), outConfigs};
+ }
+ for (const auto& config : configs) {
+ outConfigs.emplace_back(config.configId);
+ }
+ return {std::move(status), outConfigs};
+}
+
+std::pair<ScopedAStatus, std::vector<DisplayConfiguration>>
+VtsComposerClient::getDisplayConfigurations(int64_t display) {
+ std::vector<DisplayConfiguration> outConfigs;
+ return {mComposerClient->getDisplayConfigurations(display, kMaxFrameIntervalNs, &outConfigs),
+ outConfigs};
+}
+
+ScopedAStatus VtsComposerClient::notifyExpectedPresent(int64_t display,
+ ClockMonotonicTimestamp expectedPresentTime,
+ int frameIntervalNs) {
+ return mComposerClient->notifyExpectedPresent(display, expectedPresentTime, frameIntervalNs);
}
std::pair<ScopedAStatus, int32_t> VtsComposerClient::getDisplayVsyncPeriod(int64_t display) {
@@ -439,31 +486,41 @@
vtsDisplays.reserve(displays.size());
for (int64_t display : displays) {
auto vtsDisplay = VtsDisplay{display};
- auto configs = getDisplayConfigs(display);
- if (!configs.first.isOk()) {
- ALOGE("Unable to get the displays for test, failed to get the configs "
- "for display %" PRId64,
- display);
- return {std::move(configs.first), vtsDisplays};
- }
- for (int config : configs.second) {
- auto status = addDisplayConfig(&vtsDisplay, config);
+ if (getDisplayConfigurationSupported()) {
+ auto [status, configs] = getDisplayConfigurations(display);
if (!status.isOk()) {
- ALOGE("Unable to get the displays for test, failed to add config "
+ ALOGE("Unable to get the displays for test, failed to get the DisplayConfigs "
"for display %" PRId64,
display);
return {std::move(status), vtsDisplays};
}
+ addDisplayConfigs(&vtsDisplay, configs);
+ } else {
+ auto [status, configs] = getDisplayConfigs(display);
+ if (!status.isOk()) {
+ ALOGE("Unable to get the displays for test, failed to get the configs "
+ "for display %" PRId64,
+ display);
+ return {std::move(status), vtsDisplays};
+ }
+ for (int config : configs) {
+ status = addDisplayConfigLegacy(&vtsDisplay, config);
+ if (!status.isOk()) {
+ ALOGE("Unable to get the displays for test, failed to add config "
+ "for display %" PRId64,
+ display);
+ return {std::move(status), vtsDisplays};
+ }
+ }
}
-
- auto config = getActiveConfig(display);
- if (!config.first.isOk()) {
+ auto activeConfig = getActiveConfig(display);
+ if (!activeConfig.first.isOk()) {
ALOGE("Unable to get the displays for test, failed to get active config "
- "for display %" PRId64, display);
- return {std::move(config.first), vtsDisplays};
+ "for display %" PRId64,
+ display);
+ return {std::move(activeConfig.first), vtsDisplays};
}
-
- auto status = updateDisplayProperties(&vtsDisplay, config.second);
+ auto status = updateDisplayProperties(&vtsDisplay, activeConfig.second);
if (!status.isOk()) {
ALOGE("Unable to get the displays for test, "
"failed to update the properties "
@@ -480,39 +537,54 @@
}
}
-ScopedAStatus VtsComposerClient::addDisplayConfig(VtsDisplay* vtsDisplay, int32_t config) {
- const auto width =
- getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::WIDTH);
- const auto height =
- getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::HEIGHT);
+void VtsComposerClient::addDisplayConfigs(VtsDisplay* vtsDisplay,
+ const std::vector<DisplayConfiguration>& configs) {
+ for (const auto& config : configs) {
+ vtsDisplay->addDisplayConfig(config.configId,
+ {config.vsyncPeriod, config.configGroup, config.vrrConfig});
+ }
+}
+
+ScopedAStatus VtsComposerClient::addDisplayConfigLegacy(VtsDisplay* vtsDisplay, int32_t config) {
const auto vsyncPeriod =
getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::VSYNC_PERIOD);
const auto configGroup =
getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::CONFIG_GROUP);
- if (width.first.isOk() && height.first.isOk() && vsyncPeriod.first.isOk() &&
- configGroup.first.isOk()) {
+ if (vsyncPeriod.first.isOk() && configGroup.first.isOk()) {
vtsDisplay->addDisplayConfig(config, {vsyncPeriod.second, configGroup.second});
return ScopedAStatus::ok();
}
- LOG(ERROR) << "Failed to update display property for width: " << width.first.isOk()
- << ", height: " << height.first.isOk() << ", vsync: " << vsyncPeriod.first.isOk()
+ LOG(ERROR) << "Failed to update display property vsync: " << vsyncPeriod.first.isOk()
<< ", config: " << configGroup.first.isOk();
return ScopedAStatus::fromServiceSpecificError(IComposerClient::EX_BAD_CONFIG);
}
ScopedAStatus VtsComposerClient::updateDisplayProperties(VtsDisplay* vtsDisplay, int32_t config) {
- const auto width =
- getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::WIDTH);
- const auto height =
- getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::HEIGHT);
- if (width.first.isOk() && height.first.isOk()) {
- vtsDisplay->setDimensions(width.second, height.second);
- return ScopedAStatus::ok();
- }
+ if (getDisplayConfigurationSupported()) {
+ auto [status, configs] = getDisplayConfigurations(vtsDisplay->getDisplayId());
+ if (status.isOk()) {
+ for (const auto& displayConfig : configs) {
+ if (displayConfig.configId == config) {
+ vtsDisplay->setDimensions(displayConfig.width, displayConfig.height);
+ return ScopedAStatus::ok();
+ }
+ }
+ }
+ LOG(ERROR) << "Failed to update display property with DisplayConfig";
+ } else {
+ const auto width =
+ getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::WIDTH);
+ const auto height =
+ getDisplayAttribute(vtsDisplay->getDisplayId(), config, DisplayAttribute::HEIGHT);
+ if (width.first.isOk() && height.first.isOk()) {
+ vtsDisplay->setDimensions(width.second, height.second);
+ return ScopedAStatus::ok();
+ }
- LOG(ERROR) << "Failed to update display property for width: " << width.first.isOk()
- << ", height: " << height.first.isOk();
+ LOG(ERROR) << "Failed to update display property for width: " << width.first.isOk()
+ << ", height: " << height.first.isOk();
+ }
return ScopedAStatus::fromServiceSpecificError(IComposerClient::EX_BAD_CONFIG);
}
@@ -576,7 +648,14 @@
return isValid;
}
-bool VtsComposerClient::destroyAllLayers() {
+bool VtsComposerClient::getDisplayConfigurationSupported() const {
+ auto [status, interfaceVersion] = getInterfaceVersion();
+ EXPECT_TRUE(status.isOk());
+ // getDisplayConfigurations api is supported starting interface version 3
+ return interfaceVersion >= 3;
+}
+
+bool VtsComposerClient::destroyAllLayers(ComposerClientWriter* writer) {
std::unordered_map<int64_t, DisplayResource> physicalDisplays;
while (!mDisplayResources.empty()) {
const auto& it = mDisplayResources.begin();
@@ -584,7 +663,7 @@
while (!resource.layers.empty()) {
auto layer = *resource.layers.begin();
- const auto status = destroyLayer(display, layer);
+ const auto status = destroyLayer(display, layer, writer);
if (!status.isOk()) {
ALOGE("Unable to destroy all the layers, failed at layer %" PRId64 " with error %s",
layer, status.getDescription().c_str());
diff --git a/graphics/composer/aidl/vts/VtsComposerClient.h b/graphics/composer/aidl/vts/VtsComposerClient.h
index ea3318c..fabc82a 100644
--- a/graphics/composer/aidl/vts/VtsComposerClient.h
+++ b/graphics/composer/aidl/vts/VtsComposerClient.h
@@ -25,6 +25,7 @@
#include <android/binder_manager.h>
#include <android/binder_process.h>
#include <android/hardware/graphics/composer3/ComposerClientReader.h>
+#include <android/hardware/graphics/composer3/ComposerClientWriter.h>
#include <binder/ProcessState.h>
#include <gtest/gtest.h>
#include <ui/Fence.h>
@@ -59,9 +60,9 @@
ScopedAStatus createClient();
- bool tearDown();
+ bool tearDown(ComposerClientWriter*);
- std::pair<ScopedAStatus, int32_t> getInterfaceVersion();
+ std::pair<ScopedAStatus, int32_t> getInterfaceVersion() const;
std::pair<ScopedAStatus, VirtualDisplay> createVirtualDisplay(int32_t width, int32_t height,
PixelFormat pixelFormat,
@@ -69,9 +70,10 @@
ScopedAStatus destroyVirtualDisplay(int64_t display);
- std::pair<ScopedAStatus, int64_t> createLayer(int64_t display, int32_t bufferSlotCount);
+ std::pair<ScopedAStatus, int64_t> createLayer(int64_t display, int32_t bufferSlotCount,
+ ComposerClientWriter*);
- ScopedAStatus destroyLayer(int64_t display, int64_t layer);
+ ScopedAStatus destroyLayer(int64_t display, int64_t layer, ComposerClientWriter*);
std::pair<ScopedAStatus, int32_t> getActiveConfig(int64_t display);
@@ -142,6 +144,13 @@
std::pair<ScopedAStatus, std::vector<int32_t>> getDisplayConfigs(int64_t display);
+ std::pair<ScopedAStatus, std::vector<DisplayConfiguration>> getDisplayConfigurations(
+ int64_t display);
+
+ ScopedAStatus notifyExpectedPresent(int64_t display,
+ ClockMonotonicTimestamp expectedPresentTime,
+ int frameIntervalNs);
+
std::pair<ScopedAStatus, int32_t> getDisplayVsyncPeriod(int64_t display);
ScopedAStatus setAutoLowLatencyMode(int64_t display, bool isEnabled);
@@ -189,8 +198,13 @@
std::vector<RefreshRateChangedDebugData> takeListOfRefreshRateChangedDebugData();
+ static constexpr int32_t kMaxFrameIntervalNs = 50000000; // 20fps
+ static constexpr int32_t kNoFrameIntervalNs = 0;
+
private:
- ScopedAStatus addDisplayConfig(VtsDisplay* vtsDisplay, int32_t config);
+ void addDisplayConfigs(VtsDisplay*, const std::vector<DisplayConfiguration>&);
+ ScopedAStatus addDisplayConfigLegacy(VtsDisplay*, int32_t config);
+ bool getDisplayConfigurationSupported() const;
ScopedAStatus updateDisplayProperties(VtsDisplay* vtsDisplay, int32_t config);
ScopedAStatus addDisplayToDisplayResources(int64_t display, bool isVirtual);
@@ -199,7 +213,7 @@
void removeLayerFromDisplayResources(int64_t display, int64_t layer);
- bool destroyAllLayers();
+ bool destroyAllLayers(ComposerClientWriter*);
bool verifyComposerCallbackParams();
@@ -217,6 +231,8 @@
std::shared_ptr<IComposerClient> mComposerClient;
std::shared_ptr<GraphicsComposerCallback> mComposerCallback;
std::unordered_map<int64_t, DisplayResource> mDisplayResources;
+ bool mSupportsBatchedCreateLayer = false;
+ std::atomic<int64_t> mNextLayerHandle = 1;
};
class VtsDisplay {
@@ -241,10 +257,14 @@
int32_t getDisplayHeight() const { return mDisplayHeight; }
struct DisplayConfig {
- DisplayConfig(int32_t vsyncPeriod_, int32_t configGroup_)
- : vsyncPeriod(vsyncPeriod_), configGroup(configGroup_) {}
+ DisplayConfig(int32_t vsyncPeriod_, int32_t configGroup_,
+ std::optional<VrrConfig> vrrConfig_ = {})
+ : vsyncPeriod(vsyncPeriod_),
+ configGroup(configGroup_),
+ vrrConfig(std::move(vrrConfig_)) {}
int32_t vsyncPeriod;
int32_t configGroup;
+ std::optional<VrrConfig> vrrConfig;
};
void addDisplayConfig(int32_t config, DisplayConfig displayConfig) {
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp
index 9b849cc..164e6d5 100644
--- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp
@@ -64,16 +64,15 @@
::android::renderengine::RenderEngineCreationArgs::Builder()
.setPixelFormat(static_cast<int>(common::PixelFormat::RGBA_8888))
.setImageCacheSize(TestRenderEngine::sMaxFrameBufferAcquireBuffers)
- .setUseColorManagerment(true)
.setEnableProtectedContext(false)
.setPrecacheToneMapperShaderOnly(false)
.setContextPriority(::android::renderengine::RenderEngine::
ContextPriority::HIGH)
.build())));
- ::android::renderengine::DisplaySettings clientCompositionDisplay;
- clientCompositionDisplay.physicalDisplay = Rect(getDisplayWidth(), getDisplayHeight());
- clientCompositionDisplay.clip = clientCompositionDisplay.physicalDisplay;
+ mClientCompositionDisplaySettings.physicalDisplay =
+ Rect(getDisplayWidth(), getDisplayHeight());
+ mClientCompositionDisplaySettings.clip = mClientCompositionDisplaySettings.physicalDisplay;
mTestRenderEngine->initGraphicBuffer(
static_cast<uint32_t>(getDisplayWidth()), static_cast<uint32_t>(getDisplayHeight()),
@@ -82,12 +81,12 @@
static_cast<uint64_t>(common::BufferUsage::CPU_READ_OFTEN) |
static_cast<uint64_t>(common::BufferUsage::CPU_WRITE_OFTEN) |
static_cast<uint64_t>(common::BufferUsage::GPU_RENDER_TARGET)));
- mTestRenderEngine->setDisplaySettings(clientCompositionDisplay);
+ mTestRenderEngine->setDisplaySettings(mClientCompositionDisplaySettings);
}
void TearDown() override {
ASSERT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk());
- ASSERT_TRUE(mComposerClient->tearDown());
+ ASSERT_TRUE(mComposerClient->tearDown(mWriter.get()));
mComposerClient.reset();
const auto errors = mReader.takeErrors();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -164,6 +163,7 @@
std::unique_ptr<TestRenderEngine> mTestRenderEngine;
common::PixelFormat mPixelFormat;
common::Dataspace mDataspace;
+ ::android::renderengine::DisplaySettings mClientCompositionDisplaySettings;
static constexpr uint32_t kClientTargetSlotCount = 64;
@@ -201,7 +201,8 @@
return;
}
- auto layer = std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ auto layer =
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
common::Rect coloredSquare({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setColor(BLUE);
layer->setDisplayFrame(coloredSquare);
@@ -220,7 +221,8 @@
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
// if hwc cannot handle and asks for composition change,
// just succeed the test
@@ -269,17 +271,18 @@
auto layer = std::make_shared<TestBufferLayer>(
mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), common::PixelFormat::RGBA_8888);
+ getDisplayHeight(), common::PixelFormat::RGBA_8888, *mWriter);
layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
- layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter);
+ layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors));
std::vector<std::shared_ptr<TestLayer>> layers = {layer};
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
@@ -313,7 +316,8 @@
return;
}
- auto layer = std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ auto layer =
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
common::Rect coloredSquare({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setColor(BLUE);
layer->setDisplayFrame(coloredSquare);
@@ -338,7 +342,8 @@
getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
@@ -451,12 +456,12 @@
expectedColors, getDisplayWidth(),
{0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, BLUE);
- auto layer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
- getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), PixelFormat::RGBA_FP16);
+ auto layer = std::make_shared<TestBufferLayer>(
+ mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
+ getDisplayHeight(), PixelFormat::RGBA_FP16, *mWriter);
layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
- layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter);
+ layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
std::vector<std::shared_ptr<TestLayer>> layers = {layer};
@@ -465,7 +470,8 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
auto changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
@@ -496,9 +502,10 @@
const auto unlockStatus = graphicBuffer->unlockAsync(&clientFence);
ASSERT_EQ(::android::OK, unlockStatus);
mWriter->setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, clientFence,
- clientDataspace, std::vector<common::Rect>(1, damage));
+ clientDataspace, std::vector<common::Rect>(1, damage), 1.f);
layer->setToClientComposition(*mWriter);
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
ASSERT_TRUE(changedCompositionTypes.empty());
@@ -545,7 +552,7 @@
auto deviceLayer = std::make_shared<TestBufferLayer>(
mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight() / 2, PixelFormat::RGBA_8888);
+ getDisplayHeight() / 2, PixelFormat::RGBA_8888, *mWriter);
std::vector<Color> deviceColors(deviceLayer->getWidth() * deviceLayer->getHeight());
ReadbackHelper::fillColorsArea(deviceColors, static_cast<int32_t>(deviceLayer->getWidth()),
{0, 0, static_cast<int32_t>(deviceLayer->getWidth()),
@@ -554,7 +561,7 @@
deviceLayer->setDisplayFrame({0, 0, static_cast<int32_t>(deviceLayer->getWidth()),
static_cast<int32_t>(deviceLayer->getHeight())});
deviceLayer->setZOrder(10);
- deviceLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter);
+ deviceLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
ASSERT_NO_FATAL_FAILURE(deviceLayer->setBuffer(deviceColors));
deviceLayer->write(*mWriter);
@@ -569,13 +576,14 @@
auto clientLayer = std::make_shared<TestBufferLayer>(
mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), clientWidth,
- clientHeight, PixelFormat::RGBA_FP16, Composition::DEVICE);
+ clientHeight, PixelFormat::RGBA_FP16, *mWriter, Composition::DEVICE);
common::Rect clientFrame = {0, getDisplayHeight() / 2, getDisplayWidth(),
getDisplayHeight()};
clientLayer->setDisplayFrame(clientFrame);
clientLayer->setZOrder(0);
clientLayer->write(*mWriter);
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
auto changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
@@ -602,9 +610,10 @@
const auto unlockStatus = graphicBuffer->unlockAsync(&clientFence);
ASSERT_EQ(::android::OK, unlockStatus);
mWriter->setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, buffer, clientFence,
- clientDataspace, std::vector<common::Rect>(1, clientFrame));
+ clientDataspace, std::vector<common::Rect>(1, clientFrame), 1.f);
clientLayer->setToClientComposition(*mWriter);
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
changedCompositionTypes = mReader.takeChangedCompositionTypes(getPrimaryDisplayId());
ASSERT_TRUE(changedCompositionTypes.empty());
@@ -636,12 +645,12 @@
static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED);
- auto layer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
- getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), PixelFormat::RGBA_8888);
+ auto layer = std::make_shared<TestBufferLayer>(
+ mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
+ getDisplayHeight(), PixelFormat::RGBA_8888, *mWriter);
layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
- layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter);
+ layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
ASSERT_NO_FATAL_FAILURE(layer->setBuffer(expectedColors));
std::vector<std::shared_ptr<TestLayer>> layers = {layer};
@@ -652,7 +661,8 @@
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
@@ -680,7 +690,8 @@
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty());
@@ -705,7 +716,8 @@
return;
}
- auto layer = std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ auto layer =
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
layer->setColor(RED);
layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
@@ -721,7 +733,8 @@
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
@@ -764,12 +777,12 @@
expectedColors, getDisplayWidth(),
{0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, BLUE);
- auto layer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
- getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), PixelFormat::RGBA_8888);
+ auto layer = std::make_shared<TestBufferLayer>(
+ mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
+ getDisplayHeight(), PixelFormat::RGBA_8888, *mWriter);
layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
- layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter);
+ layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
layer->setSourceCrop({0, static_cast<float>(getDisplayHeight() / 2),
static_cast<float>(getDisplayWidth()),
static_cast<float>(getDisplayHeight())});
@@ -785,7 +798,8 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
@@ -817,11 +831,13 @@
common::Rect redRect = {0, 0, getDisplayWidth(), getDisplayHeight() / 2};
common::Rect blueRect = {0, getDisplayHeight() / 4, getDisplayWidth(), getDisplayHeight()};
- auto redLayer = std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ auto redLayer =
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
redLayer->setColor(RED);
redLayer->setDisplayFrame(redRect);
- auto blueLayer = std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ auto blueLayer =
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
blueLayer->setColor(BLUE);
blueLayer->setDisplayFrame(blueRect);
blueLayer->setZOrder(5);
@@ -843,7 +859,8 @@
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
@@ -865,7 +882,8 @@
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty());
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -901,14 +919,14 @@
static constexpr float kMaxBrightnessNits = 300.f;
const auto redLayer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
redLayer->setColor(RED);
redLayer->setDisplayFrame(redRect);
redLayer->setWhitePointNits(kMaxBrightnessNits);
redLayer->setBrightness(1.f);
const auto dimmerRedLayer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
dimmerRedLayer->setColor(RED);
dimmerRedLayer->setDisplayFrame(dimmerRedRect);
// Intentionally use a small dimming ratio as some implementations may be more likely to
@@ -930,7 +948,8 @@
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED()
@@ -978,17 +997,17 @@
mTopLayerColor);
auto backgroundLayer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
backgroundLayer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
backgroundLayer->setZOrder(0);
backgroundLayer->setColor(mBackgroundColor);
- auto layer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
- getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), PixelFormat::RGBA_8888);
+ auto layer = std::make_shared<TestBufferLayer>(
+ mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
+ getDisplayHeight(), PixelFormat::RGBA_8888, *mWriter);
layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
- layer->setDataspace(Dataspace::UNKNOWN, *mWriter);
+ layer->setDataspace(Dataspace::UNKNOWN);
ASSERT_NO_FATAL_FAILURE(layer->setBuffer(topLayerPixelColors));
layer->setBlendMode(blendMode);
@@ -1065,7 +1084,8 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
@@ -1110,7 +1130,8 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
@@ -1150,7 +1171,8 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
@@ -1173,7 +1195,7 @@
GraphicsCompositionTest::SetUp();
auto backgroundLayer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
backgroundLayer->setColor({0.0f, 0.0f, 0.0f, 0.0f});
backgroundLayer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
backgroundLayer->setZOrder(0);
@@ -1185,7 +1207,7 @@
mLayer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
getPrimaryDisplayId(), mSideLength, mSideLength,
- PixelFormat::RGBA_8888);
+ PixelFormat::RGBA_8888, *mWriter);
mLayer->setDisplayFrame({0, 0, mSideLength, mSideLength});
mLayer->setZOrder(10);
@@ -1223,7 +1245,7 @@
getDisplayHeight(), mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
mLayer->setTransform(Transform::FLIP_H);
- mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter);
+ mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
std::vector<Color> expectedColors(
static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
@@ -1234,7 +1256,8 @@
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
@@ -1269,7 +1292,7 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
mLayer->setTransform(Transform::FLIP_V);
- mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter);
+ mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
std::vector<Color> expectedColors(
static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
@@ -1280,7 +1303,8 @@
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
@@ -1314,7 +1338,7 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
mLayer->setTransform(Transform::ROT_180);
- mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode), *mWriter);
+ mLayer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
std::vector<Color> expectedColors(
static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
@@ -1326,7 +1350,8 @@
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED();
@@ -1343,6 +1368,101 @@
}
}
+class GraphicsColorManagementCompositionTest
+ : public GraphicsCompositionTestBase,
+ public testing::WithParamInterface<std::tuple<std::string, Dataspace, Dataspace, Dataspace>> {
+ public:
+ void SetUp() override {
+ SetUpBase(std::get<0>(GetParam()));
+ // for some reason only sRGB reliably works
+ mTestColorModes.erase(
+ std::remove_if(mTestColorModes.begin(), mTestColorModes.end(),
+ [](ColorMode mode) { return mode != ColorMode::SRGB; }),
+ mTestColorModes.end());
+ auto standard = std::get<1>(GetParam());
+ auto transfer = std::get<2>(GetParam());
+ auto range = std::get<3>(GetParam());
+
+ mLayerDataspace = static_cast<Dataspace>(static_cast<int32_t>(standard) |
+ static_cast<int32_t>(transfer) |
+ static_cast<int32_t>(range));
+ ALOGD("Invoking test for dataspace: {%s, %s, %s}", toString(standard).c_str(),
+ toString(transfer).c_str(), toString(range).c_str());
+ }
+
+ void makeLayer() {
+ mLayer = std::make_shared<TestBufferLayer>(
+ mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
+ getDisplayHeight(), common::PixelFormat::RGBA_8888, *mWriter);
+ mLayer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
+ mLayer->setZOrder(10);
+ mLayer->setAlpha(1.f);
+ mLayer->setDataspace(mLayerDataspace);
+ }
+
+ void fillColor(Color color) {
+ std::vector<Color> baseColors(static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
+ ReadbackHelper::fillColorsArea(baseColors, getDisplayWidth(),
+ common::Rect{.left = 0,
+ .top = 0,
+ .right = getDisplayWidth(),
+ .bottom = getDisplayHeight()},
+ color);
+ ASSERT_NO_FATAL_FAILURE(mLayer->setBuffer(baseColors));
+ }
+
+ Dataspace mLayerDataspace;
+ std::shared_ptr<TestBufferLayer> mLayer;
+};
+
+TEST_P(GraphicsColorManagementCompositionTest, ColorConversion) {
+ for (ColorMode mode : mTestColorModes) {
+ EXPECT_TRUE(mComposerClient
+ ->setColorMode(getPrimaryDisplayId(), mode, RenderIntent::COLORIMETRIC)
+ .isOk());
+
+ bool isSupported;
+ ASSERT_NO_FATAL_FAILURE(isSupported = getHasReadbackBuffer());
+ if (!isSupported) {
+ GTEST_SUCCEED() << "Readback not supported or unsupported pixelFormat/dataspace";
+ return;
+ }
+
+ mClientCompositionDisplaySettings.outputDataspace =
+ static_cast<::android::ui::Dataspace>(mDataspace);
+ mTestRenderEngine->setDisplaySettings(mClientCompositionDisplaySettings);
+
+ makeLayer();
+ for (auto color : {LIGHT_RED, LIGHT_GREEN, LIGHT_BLUE}) {
+ ALOGD("Testing color: %f, %f, %f, %f with color mode: %d", color.r, color.g, color.b,
+ color.a, mode);
+ ReadbackBuffer readbackBuffer(getPrimaryDisplayId(), mComposerClient, getDisplayWidth(),
+ getDisplayHeight(), mPixelFormat, mDataspace);
+ ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
+ fillColor(color);
+ writeLayers({mLayer});
+ EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk());
+
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter->validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
+ execute();
+ if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
+ continue;
+ }
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ mWriter->presentDisplay(getPrimaryDisplayId());
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ mTestRenderEngine->setRenderLayers({mLayer});
+ ASSERT_NO_FATAL_FAILURE(mTestRenderEngine->drawLayers());
+ ASSERT_NO_FATAL_FAILURE(
+ mTestRenderEngine->checkColorBuffer(readbackBuffer.getBuffer()));
+ }
+ }
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsCompositionTest);
INSTANTIATE_TEST_SUITE_P(
PerInstance, GraphicsCompositionTest,
@@ -1361,5 +1481,17 @@
testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)),
::android::PrintInstanceNameToString);
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsColorManagementCompositionTest);
+INSTANTIATE_TEST_SUITE_P(PerInstance, GraphicsColorManagementCompositionTest,
+ testing::Combine(testing::ValuesIn(::android::getAidlHalInstanceNames(
+ IComposer::descriptor)),
+ // Only check sRGB, but verify that extended range
+ // doesn't trigger any gamma shifts
+ testing::Values(Dataspace::STANDARD_BT709),
+ testing::Values(Dataspace::TRANSFER_SRGB),
+ // Don't test limited range until we send YUV overlays
+ testing::Values(Dataspace::RANGE_FULL,
+ Dataspace::RANGE_EXTENDED)));
+
} // namespace
} // namespace aidl::android::hardware::graphics::composer3::vts
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
index 323e358..d250562 100644
--- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -34,6 +34,7 @@
#include <ui/PixelFormat.h>
#include <algorithm>
#include <iterator>
+#include <mutex>
#include <numeric>
#include <string>
#include <thread>
@@ -45,7 +46,6 @@
#define LOG_TAG "VtsHalGraphicsComposer3_TargetTest"
namespace aidl::android::hardware::graphics::composer3::vts {
-namespace {
using namespace std::chrono_literals;
@@ -70,7 +70,7 @@
}
void TearDown() override {
- ASSERT_TRUE(mComposerClient->tearDown());
+ ASSERT_TRUE(mComposerClient->tearDown(nullptr));
mComposerClient.reset();
}
@@ -832,36 +832,58 @@
}
TEST_P(GraphicsComposerAidlTest, CreateLayer) {
+ if (hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "Create layer will be tested in GraphicsComposerAidlBatchedCommandTest";
+ return;
+ }
+
const auto& [status, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, nullptr);
EXPECT_TRUE(status.isOk());
- EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk());
+ EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer, nullptr).isOk());
}
TEST_P(GraphicsComposerAidlTest, CreateLayer_BadDisplay) {
- const auto& [status, _] = mComposerClient->createLayer(getInvalidDisplayId(), kBufferSlotCount);
+ if (hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "Create layer will be tested in GraphicsComposerAidlBatchedCommandTest";
+ return;
+ }
+
+ const auto& [status, _] =
+ mComposerClient->createLayer(getInvalidDisplayId(), kBufferSlotCount, nullptr);
EXPECT_FALSE(status.isOk());
EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY));
}
TEST_P(GraphicsComposerAidlTest, DestroyLayer_BadDisplay) {
+ if (hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "Destroy layer will be tested in GraphicsComposerAidlBatchedCommandTest";
+ return;
+ }
+
const auto& [status, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, nullptr);
EXPECT_TRUE(status.isOk());
- const auto& destroyStatus = mComposerClient->destroyLayer(getInvalidDisplayId(), layer);
+ const auto& destroyStatus =
+ mComposerClient->destroyLayer(getInvalidDisplayId(), layer, nullptr);
EXPECT_FALSE(destroyStatus.isOk());
EXPECT_NO_FATAL_FAILURE(
assertServiceSpecificError(destroyStatus, IComposerClient::EX_BAD_DISPLAY));
- ASSERT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk());
+ ASSERT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer, nullptr).isOk());
}
TEST_P(GraphicsComposerAidlTest, DestroyLayer_BadLayerError) {
+ if (hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "Destroy layer will be tested in GraphicsComposerAidlBatchedCommandTest";
+ return;
+ }
+
// We haven't created any layers yet, so any id should be invalid
- const auto& status = mComposerClient->destroyLayer(getPrimaryDisplayId(), /*layer*/ 1);
+ const auto& status = mComposerClient->destroyLayer(getPrimaryDisplayId(), /*layer*/ 1, nullptr);
EXPECT_FALSE(status.isOk());
EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_LAYER));
@@ -891,39 +913,6 @@
EXPECT_TRUE(status.isOk());
}
-TEST_P(GraphicsComposerAidlTest, GetOverlaySupport) {
- if (getInterfaceVersion() <= 1) {
- GTEST_SUCCEED() << "Device does not support the new API for overlay support";
- return;
- }
-
- const auto& [status, properties] = mComposerClient->getOverlaySupport();
- if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC &&
- status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
- GTEST_SUCCEED() << "getOverlaySupport is not supported";
- return;
- }
-
- ASSERT_TRUE(status.isOk());
- for (const auto& i : properties.combinations) {
- for (const auto standard : i.standards) {
- const auto val = static_cast<int32_t>(standard) &
- static_cast<int32_t>(common::Dataspace::STANDARD_MASK);
- ASSERT_TRUE(val == static_cast<int32_t>(standard));
- }
- for (const auto transfer : i.transfers) {
- const auto val = static_cast<int32_t>(transfer) &
- static_cast<int32_t>(common::Dataspace::TRANSFER_MASK);
- ASSERT_TRUE(val == static_cast<int32_t>(transfer));
- }
- for (const auto range : i.ranges) {
- const auto val = static_cast<int32_t>(range) &
- static_cast<int32_t>(common::Dataspace::RANGE_MASK);
- ASSERT_TRUE(val == static_cast<int32_t>(range));
- }
- }
-}
-
TEST_P(GraphicsComposerAidlTest, GetDisplayPhysicalOrientation_BadDisplay) {
const auto& [status, _] = mComposerClient->getDisplayPhysicalOrientation(getInvalidDisplayId());
@@ -1169,6 +1158,244 @@
EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_PARAMETER));
}
+/*
+ * Test that no two display configs are exactly the same.
+ */
+TEST_P(GraphicsComposerAidlTest, GetDisplayConfigNoRepetitions) {
+ for (const auto& display : mDisplays) {
+ const auto& [status, configs] = mComposerClient->getDisplayConfigs(display.getDisplayId());
+ for (std::vector<int>::size_type i = 0; i < configs.size(); i++) {
+ for (std::vector<int>::size_type j = i + 1; j < configs.size(); j++) {
+ const auto& [widthStatus1, width1] = mComposerClient->getDisplayAttribute(
+ display.getDisplayId(), configs[i], DisplayAttribute::WIDTH);
+ const auto& [heightStatus1, height1] = mComposerClient->getDisplayAttribute(
+ display.getDisplayId(), configs[i], DisplayAttribute::HEIGHT);
+ const auto& [vsyncPeriodStatus1, vsyncPeriod1] =
+ mComposerClient->getDisplayAttribute(display.getDisplayId(), configs[i],
+ DisplayAttribute::VSYNC_PERIOD);
+ const auto& [groupStatus1, group1] = mComposerClient->getDisplayAttribute(
+ display.getDisplayId(), configs[i], DisplayAttribute::CONFIG_GROUP);
+
+ const auto& [widthStatus2, width2] = mComposerClient->getDisplayAttribute(
+ display.getDisplayId(), configs[j], DisplayAttribute::WIDTH);
+ const auto& [heightStatus2, height2] = mComposerClient->getDisplayAttribute(
+ display.getDisplayId(), configs[j], DisplayAttribute::HEIGHT);
+ const auto& [vsyncPeriodStatus2, vsyncPeriod2] =
+ mComposerClient->getDisplayAttribute(display.getDisplayId(), configs[j],
+ DisplayAttribute::VSYNC_PERIOD);
+ const auto& [groupStatus2, group2] = mComposerClient->getDisplayAttribute(
+ display.getDisplayId(), configs[j], DisplayAttribute::CONFIG_GROUP);
+
+ ASSERT_FALSE(width1 == width2 && height1 == height2 &&
+ vsyncPeriod1 == vsyncPeriod2 && group1 == group2);
+ }
+ }
+ }
+}
+
+TEST_P(GraphicsComposerAidlTest, LayerLifecycleCapabilityNotSupportedOnOldVersions) {
+ if (hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ EXPECT_GE(getInterfaceVersion(), 3);
+ }
+}
+
+class GraphicsComposerAidlV2Test : public GraphicsComposerAidlTest {
+ protected:
+ void SetUp() override {
+ GraphicsComposerAidlTest::SetUp();
+ if (getInterfaceVersion() <= 1) {
+ GTEST_SKIP() << "Device interface version is expected to be >= 2";
+ }
+ }
+};
+
+TEST_P(GraphicsComposerAidlV2Test, GetOverlaySupport) {
+ const auto& [status, properties] = mComposerClient->getOverlaySupport();
+ if (!status.isOk() && status.getExceptionCode() == EX_SERVICE_SPECIFIC &&
+ status.getServiceSpecificError() == IComposerClient::EX_UNSUPPORTED) {
+ GTEST_SUCCEED() << "getOverlaySupport is not supported";
+ return;
+ }
+
+ ASSERT_TRUE(status.isOk());
+ for (const auto& i : properties.combinations) {
+ for (const auto standard : i.standards) {
+ const auto val = static_cast<int32_t>(standard) &
+ static_cast<int32_t>(common::Dataspace::STANDARD_MASK);
+ ASSERT_TRUE(val == static_cast<int32_t>(standard));
+ }
+ for (const auto transfer : i.transfers) {
+ const auto val = static_cast<int32_t>(transfer) &
+ static_cast<int32_t>(common::Dataspace::TRANSFER_MASK);
+ ASSERT_TRUE(val == static_cast<int32_t>(transfer));
+ }
+ for (const auto range : i.ranges) {
+ const auto val = static_cast<int32_t>(range) &
+ static_cast<int32_t>(common::Dataspace::RANGE_MASK);
+ ASSERT_TRUE(val == static_cast<int32_t>(range));
+ }
+ }
+}
+
+class GraphicsComposerAidlV3Test : public GraphicsComposerAidlTest {
+ protected:
+ void SetUp() override {
+ GraphicsComposerAidlTest::SetUp();
+ if (getInterfaceVersion() <= 2) {
+ GTEST_SKIP() << "Device interface version is expected to be >= 3";
+ }
+ }
+};
+
+TEST_P(GraphicsComposerAidlV3Test, GetDisplayConfigurations) {
+ for (const auto& display : mDisplays) {
+ const auto& [status, displayConfigurations] =
+ mComposerClient->getDisplayConfigurations(display.getDisplayId());
+ EXPECT_TRUE(status.isOk());
+ EXPECT_FALSE(displayConfigurations.empty());
+
+ for (const auto& displayConfig : displayConfigurations) {
+ EXPECT_NE(-1, displayConfig.width);
+ EXPECT_NE(-1, displayConfig.height);
+ EXPECT_NE(-1, displayConfig.vsyncPeriod);
+ EXPECT_NE(-1, displayConfig.configGroup);
+ if (displayConfig.dpi) {
+ EXPECT_NE(-1.f, displayConfig.dpi->x);
+ EXPECT_NE(-1.f, displayConfig.dpi->y);
+ }
+ if (displayConfig.vrrConfig) {
+ const auto& vrrConfig = *displayConfig.vrrConfig;
+ EXPECT_GE(vrrConfig.minFrameIntervalNs, displayConfig.vsyncPeriod);
+
+ EXPECT_EQ(1, std::count_if(
+ displayConfigurations.cbegin(), displayConfigurations.cend(),
+ [displayConfig](const auto& config) {
+ return config.configGroup == displayConfig.configGroup;
+ }))
+ << "There should be only one VRR mode in one ConfigGroup";
+
+ const auto verifyFrameIntervalIsDivisorOfVsync = [&](int32_t frameIntervalNs) {
+ constexpr auto kThreshold = 0.05f; // 5%
+ const auto ratio =
+ static_cast<float>(frameIntervalNs) / displayConfig.vsyncPeriod;
+ return ratio - std::round(ratio) <= kThreshold;
+ };
+
+ EXPECT_TRUE(verifyFrameIntervalIsDivisorOfVsync(vrrConfig.minFrameIntervalNs));
+
+ if (vrrConfig.frameIntervalPowerHints) {
+ const auto& frameIntervalPowerHints = *vrrConfig.frameIntervalPowerHints;
+ EXPECT_FALSE(frameIntervalPowerHints.empty());
+
+ const auto minFrameInterval = *min_element(frameIntervalPowerHints.cbegin(),
+ frameIntervalPowerHints.cend());
+ EXPECT_LE(minFrameInterval->frameIntervalNs,
+ VtsComposerClient::kMaxFrameIntervalNs);
+
+ EXPECT_TRUE(std::all_of(frameIntervalPowerHints.cbegin(),
+ frameIntervalPowerHints.cend(),
+ [&](const auto& frameIntervalPowerHint) {
+ return verifyFrameIntervalIsDivisorOfVsync(
+ frameIntervalPowerHint->frameIntervalNs);
+ }));
+ }
+
+ if (vrrConfig.notifyExpectedPresentConfig) {
+ const auto& notifyExpectedPresentConfig =
+ *vrrConfig.notifyExpectedPresentConfig;
+ EXPECT_GT(0, notifyExpectedPresentConfig.notifyExpectedPresentHeadsUpNs);
+ EXPECT_GE(0, notifyExpectedPresentConfig.notifyExpectedPresentTimeoutNs);
+ }
+ }
+ }
+ }
+}
+
+TEST_P(GraphicsComposerAidlV3Test, GetDisplayConfigsIsSubsetOfGetDisplayConfigurations) {
+ for (const auto& display : mDisplays) {
+ const auto& [status, displayConfigurations] =
+ mComposerClient->getDisplayConfigurations(display.getDisplayId());
+ EXPECT_TRUE(status.isOk());
+
+ const auto& [legacyConfigStatus, legacyConfigs] =
+ mComposerClient->getDisplayConfigs(display.getDisplayId());
+ EXPECT_TRUE(legacyConfigStatus.isOk());
+ EXPECT_FALSE(legacyConfigs.empty());
+ EXPECT_TRUE(legacyConfigs.size() <= displayConfigurations.size());
+
+ for (const auto legacyConfigId : legacyConfigs) {
+ const auto& legacyWidth = mComposerClient->getDisplayAttribute(
+ display.getDisplayId(), legacyConfigId, DisplayAttribute::WIDTH);
+ const auto& legacyHeight = mComposerClient->getDisplayAttribute(
+ display.getDisplayId(), legacyConfigId, DisplayAttribute::HEIGHT);
+ const auto& legacyVsyncPeriod = mComposerClient->getDisplayAttribute(
+ display.getDisplayId(), legacyConfigId, DisplayAttribute::VSYNC_PERIOD);
+ const auto& legacyConfigGroup = mComposerClient->getDisplayAttribute(
+ display.getDisplayId(), legacyConfigId, DisplayAttribute::CONFIG_GROUP);
+ const auto& legacyDpiX = mComposerClient->getDisplayAttribute(
+ display.getDisplayId(), legacyConfigId, DisplayAttribute::DPI_X);
+ const auto& legacyDpiY = mComposerClient->getDisplayAttribute(
+ display.getDisplayId(), legacyConfigId, DisplayAttribute::DPI_Y);
+
+ EXPECT_TRUE(legacyWidth.first.isOk() && legacyHeight.first.isOk() &&
+ legacyVsyncPeriod.first.isOk() && legacyConfigGroup.first.isOk());
+
+ EXPECT_TRUE(std::any_of(
+ displayConfigurations.begin(), displayConfigurations.end(),
+ [&](const auto& displayConfiguration) {
+ const bool requiredAttributesPredicate =
+ displayConfiguration.configId == legacyConfigId &&
+ displayConfiguration.width == legacyWidth.second &&
+ displayConfiguration.height == legacyHeight.second &&
+ displayConfiguration.vsyncPeriod == legacyVsyncPeriod.second &&
+ displayConfiguration.configGroup == legacyConfigGroup.second;
+
+ if (!requiredAttributesPredicate) {
+ // Required attributes did not match
+ return false;
+ }
+
+ // Check optional attributes
+ const auto& [legacyDpiXStatus, legacyDpiXValue] = legacyDpiX;
+ const auto& [legacyDpiYStatus, legacyDpiYValue] = legacyDpiY;
+ if (displayConfiguration.dpi) {
+ if (!legacyDpiXStatus.isOk() || !legacyDpiYStatus.isOk()) {
+ // getDisplayAttribute failed for optional attributes
+ return false;
+ }
+
+ // DPI values in DisplayConfigurations are not scaled (* 1000.f)
+ // the way they are in the legacy DisplayConfigs.
+ constexpr float kEpsilon = 0.001f;
+ return std::abs(displayConfiguration.dpi->x -
+ legacyDpiXValue / 1000.f) < kEpsilon &&
+ std::abs(displayConfiguration.dpi->y -
+ legacyDpiYValue / 1000.f) < kEpsilon;
+ } else {
+ return !legacyDpiXStatus.isOk() && !legacyDpiYStatus.isOk() &&
+ EX_SERVICE_SPECIFIC == legacyDpiXStatus.getExceptionCode() &&
+ EX_SERVICE_SPECIFIC == legacyDpiYStatus.getExceptionCode() &&
+ IComposerClient::EX_UNSUPPORTED ==
+ legacyDpiXStatus.getServiceSpecificError() &&
+ IComposerClient::EX_UNSUPPORTED ==
+ legacyDpiYStatus.getServiceSpecificError();
+ }
+ }));
+ }
+ }
+}
+
+// TODO(b/291792736) Add detailed VTS test cases for NotifyExpectedPresent
+TEST_P(GraphicsComposerAidlV3Test, NotifyExpectedPresent) {
+ for (const auto& display : mDisplays) {
+ EXPECT_TRUE(mComposerClient
+ ->notifyExpectedPresent(display.getDisplayId(),
+ ClockMonotonicTimestamp{0},
+ std::chrono::nanoseconds{8ms}.count())
+ .isOk());
+ }
+}
+
// Tests for Command.
class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest {
protected:
@@ -1177,27 +1404,24 @@
ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty());
+ ASSERT_TRUE(mComposerClient->tearDown(&getWriter(getPrimaryDisplayId())));
ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::TearDown());
}
void execute() {
std::vector<CommandResultPayload> payloads;
for (auto& [_, writer] : mWriters) {
- auto commands = writer.takePendingCommands();
- if (commands.empty()) {
- continue;
- }
-
- auto [status, results] = mComposerClient->executeCommands(commands);
- ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription();
-
- payloads.reserve(payloads.size() + results.size());
- payloads.insert(payloads.end(), std::make_move_iterator(results.begin()),
- std::make_move_iterator(results.end()));
+ executeInternal(writer, payloads);
}
mReader.parse(std::move(payloads));
}
+ void execute(ComposerClientWriter& writer, ComposerClientReader& reader) {
+ std::vector<CommandResultPayload> payloads;
+ executeInternal(writer, payloads);
+ reader.parse(std::move(payloads));
+ }
+
static inline auto toTimePoint(nsecs_t time) {
return std::chrono::time_point<std::chrono::steady_clock>(std::chrono::nanoseconds(time));
}
@@ -1268,10 +1492,10 @@
RenderIntent::COLORIMETRIC)
.isOk());
- const auto& [status, layer] =
- mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount);
- EXPECT_TRUE(status.isOk());
auto& writer = getWriter(display.getDisplayId());
+ const auto& [status, layer] =
+ mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount, &writer);
+ EXPECT_TRUE(status.isOk());
{
const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer);
@@ -1284,7 +1508,8 @@
/*acquireFence*/ -1);
writer.setLayerDataspace(display.getDisplayId(), layer, common::Dataspace::UNKNOWN);
- writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp);
+ writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -1301,7 +1526,8 @@
/*acquireFence*/ -1);
writer.setLayerSurfaceDamage(display.getDisplayId(), layer,
std::vector<Rect>(1, {0, 0, 10, 10}));
- writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp);
+ writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -1309,13 +1535,14 @@
execute();
}
- EXPECT_TRUE(mComposerClient->destroyLayer(display.getDisplayId(), layer).isOk());
+ EXPECT_TRUE(mComposerClient->destroyLayer(display.getDisplayId(), layer, &writer).isOk());
}
sp<::android::Fence> presentAndGetFence(
std::optional<ClockMonotonicTimestamp> expectedPresentTime) {
auto& writer = getWriter(getPrimaryDisplayId());
- writer.validateDisplay(getPrimaryDisplayId(), expectedPresentTime);
+ writer.validateDisplay(getPrimaryDisplayId(), expectedPresentTime,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
EXPECT_TRUE(mReader.takeErrors().empty());
@@ -1343,15 +1570,16 @@
}
int64_t createOnScreenLayer(Composition composition = Composition::DEVICE) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [status, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(status.isOk());
Rect displayFrame{0, 0, getPrimaryDisplay().getDisplayWidth(),
getPrimaryDisplay().getDisplayHeight()};
FRect cropRect{0, 0, (float)getPrimaryDisplay().getDisplayWidth(),
(float)getPrimaryDisplay().getDisplayHeight()};
configureLayer(getPrimaryDisplay(), layer, composition, displayFrame, cropRect);
- auto& writer = getWriter(getPrimaryDisplayId());
+
writer.setLayerDataspace(getPrimaryDisplayId(), layer, common::Dataspace::UNKNOWN);
return layer;
}
@@ -1522,6 +1750,7 @@
// clang-format on
ComposerClientWriter& getWriter(int64_t display) {
+ std::lock_guard guard{mWritersMutex};
auto [it, _] = mWriters.try_emplace(display, display);
return it->second;
}
@@ -1529,7 +1758,27 @@
ComposerClientReader mReader;
private:
- std::unordered_map<int64_t, ComposerClientWriter> mWriters;
+ void executeInternal(ComposerClientWriter& writer,
+ std::vector<CommandResultPayload>& payloads) {
+ auto commands = writer.takePendingCommands();
+ if (commands.empty()) {
+ return;
+ }
+
+ auto [status, results] = mComposerClient->executeCommands(commands);
+ ASSERT_TRUE(status.isOk()) << "executeCommands failed " << status.getDescription();
+
+ payloads.reserve(payloads.size() + results.size());
+ payloads.insert(payloads.end(), std::make_move_iterator(results.begin()),
+ std::make_move_iterator(results.end()));
+ }
+
+ // Guards access to the map itself. Callers must ensure not to attempt to
+ // - modify the same writer from multiple threads
+ // - insert a new writer into the map during concurrent access, which would invalidate
+ // references from other threads
+ std::mutex mWritersMutex;
+ std::unordered_map<int64_t, ComposerClientWriter> mWriters GUARDED_BY(mWritersMutex);
};
TEST_P(GraphicsComposerAidlCommandTest, SetColorTransform) {
@@ -1539,10 +1788,10 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerColorTransform) {
- const auto& [status, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
- EXPECT_TRUE(status.isOk());
auto& writer = getWriter(getPrimaryDisplayId());
+ const auto& [status, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
+ EXPECT_TRUE(status.isOk());
writer.setLayerColorTransform(getPrimaryDisplayId(), layer, kIdentity.data());
execute();
@@ -1610,7 +1859,7 @@
auto& writer = getWriter(getPrimaryDisplayId());
writer.setClientTarget(getPrimaryDisplayId(), /*slot*/ 0, nullptr, /*acquireFence*/ -1,
- Dataspace::UNKNOWN, std::vector<Rect>());
+ Dataspace::UNKNOWN, std::vector<Rect>(), 1.0f);
execute();
}
@@ -1637,20 +1886,23 @@
TEST_P(GraphicsComposerAidlCommandTest, ValidDisplay) {
auto& writer = getWriter(getPrimaryDisplayId());
- writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, AcceptDisplayChanges) {
auto& writer = getWriter(getPrimaryDisplayId());
- writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
writer.acceptDisplayChanges(getPrimaryDisplayId());
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, PresentDisplay) {
auto& writer = getWriter(getPrimaryDisplayId());
- writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
writer.presentDisplay(getPrimaryDisplayId());
execute();
}
@@ -1663,10 +1915,6 @@
* surface damage have been set
*/
TEST_P(GraphicsComposerAidlCommandTest, PresentDisplayNoLayerStateChanges) {
- if (!hasCapability(Capability::SKIP_VALIDATE)) {
- GTEST_SUCCEED() << "Device does not have skip validate capability, skipping";
- return;
- }
EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::ON).isOk());
const auto& [renderIntentsStatus, renderIntents] =
@@ -1682,7 +1930,7 @@
ASSERT_NE(nullptr, handle);
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
Rect displayFrame{0, 0, getPrimaryDisplay().getDisplayWidth(),
@@ -1693,7 +1941,8 @@
writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle,
/*acquireFence*/ -1);
writer.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN);
- writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
if (!mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty()) {
GTEST_SUCCEED() << "Composition change requested, skipping test";
@@ -1718,15 +1967,15 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerCursorPosition) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888);
const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle, /*acquireFence*/ -1);
Rect displayFrame{0, 0, getPrimaryDisplay().getDisplayWidth(),
@@ -1735,7 +1984,8 @@
(float)getPrimaryDisplay().getDisplayHeight()};
configureLayer(getPrimaryDisplay(), layer, Composition::CURSOR, displayFrame, cropRect);
writer.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN);
- writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
@@ -1750,7 +2000,8 @@
execute();
writer.setLayerCursorPosition(getPrimaryDisplayId(), layer, /*x*/ 0, /*y*/ 0);
- writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp);
+ writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
writer.presentDisplay(getPrimaryDisplayId());
execute();
}
@@ -1760,66 +2011,19 @@
const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
- const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
- EXPECT_TRUE(layerStatus.isOk());
auto& writer = getWriter(getPrimaryDisplayId());
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
+ EXPECT_TRUE(layerStatus.isOk());
writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle, /*acquireFence*/ -1);
execute();
}
-TEST_P(GraphicsComposerAidlCommandTest, SetLayerBufferSlotsToClear) {
- // Older HAL versions use a backwards compatible way of clearing buffer slots
- const auto& [versionStatus, version] = mComposerClient->getInterfaceVersion();
- ASSERT_TRUE(versionStatus.isOk());
- if (version <= 1) {
- GTEST_SUCCEED() << "HAL at version 1 or lower does not have "
- "LayerCommand::bufferSlotsToClear.";
- return;
- }
-
- const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
- EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
-
- // setup 3 buffers in the buffer cache, with the last buffer being active
- // then emulate the Android platform code that clears all 3 buffer slots
-
- const auto buffer1 = allocate(::android::PIXEL_FORMAT_RGBA_8888);
- ASSERT_NE(nullptr, buffer1);
- const auto handle1 = buffer1->handle;
- writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle1, /*acquireFence*/ -1);
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- const auto buffer2 = allocate(::android::PIXEL_FORMAT_RGBA_8888);
- ASSERT_NE(nullptr, buffer2);
- const auto handle2 = buffer2->handle;
- writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 1, handle2, /*acquireFence*/ -1);
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- const auto buffer3 = allocate(::android::PIXEL_FORMAT_RGBA_8888);
- ASSERT_NE(nullptr, buffer3);
- const auto handle3 = buffer3->handle;
- writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 2, handle3, /*acquireFence*/ -1);
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-
- // Ensure we can clear all 3 buffer slots, even the active buffer - it is assumed the
- // current active buffer's slot will be cleared, but still remain the active buffer and no
- // errors will occur.
- writer.setLayerBufferSlotsToClear(getPrimaryDisplayId(), layer, {0, 1, 2});
- execute();
- ASSERT_TRUE(mReader.takeErrors().empty());
-}
-
TEST_P(GraphicsComposerAidlCommandTest, SetLayerBufferMultipleTimes) {
- const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
- EXPECT_TRUE(layerStatus.isOk());
auto& writer = getWriter(getPrimaryDisplayId());
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
+ EXPECT_TRUE(layerStatus.isOk());
// Setup 3 buffers in the buffer cache, with the last buffer being active. Then, emulate the
// Android platform code that clears all 3 buffer slots by setting all but the active buffer
@@ -1867,14 +2071,14 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerSurfaceDamage) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
Rect empty{0, 0, 0, 0};
Rect unit{0, 0, 1, 1};
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, std::vector<Rect>(1, empty));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -1889,14 +2093,14 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerBlockingRegion) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
Rect empty{0, 0, 0, 0};
Rect unit{0, 0, 1, 1};
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerBlockingRegion(getPrimaryDisplayId(), layer, std::vector<Rect>(1, empty));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -1911,11 +2115,11 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerBlendMode) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerBlendMode(getPrimaryDisplayId(), layer, BlendMode::NONE);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -1930,11 +2134,11 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerColor) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerColor(getPrimaryDisplayId(), layer, Color{1.0f, 1.0f, 1.0f, 1.0f});
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -1945,11 +2149,11 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerCompositionType) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::CLIENT);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -1968,8 +2172,9 @@
TEST_P(GraphicsComposerAidlCommandTest, DisplayDecoration) {
for (VtsDisplay& display : mDisplays) {
+ auto& writer = getWriter(display.getDisplayId());
const auto [layerStatus, layer] =
- mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
const auto [error, support] =
@@ -1992,11 +2197,11 @@
}
configureLayer(display, layer, Composition::DISPLAY_DECORATION, display.getFrameRect(),
- display.getCrop());
- auto& writer = getWriter(display.getDisplayId());
+ display.getCrop());
writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, decorBuffer->handle,
/*acquireFence*/ -1);
- writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp);
+ writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
execute();
if (support) {
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2009,31 +2214,31 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerDataspace) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN);
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerDisplayFrame) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerDisplayFrame(getPrimaryDisplayId(), layer, Rect{0, 0, 1, 1});
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerPlaneAlpha) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerPlaneAlpha(getPrimaryDisplayId(), layer, /*alpha*/ 0.0f);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2053,31 +2258,31 @@
const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerSidebandStream(getPrimaryDisplayId(), layer, handle);
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerSourceCrop) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerSourceCrop(getPrimaryDisplayId(), layer, FRect{0.0f, 0.0f, 1.0f, 1.0f});
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerTransform) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerTransform(getPrimaryDisplayId(), layer, static_cast<Transform>(0));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2116,14 +2321,14 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerVisibleRegion) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
Rect empty{0, 0, 0, 0};
Rect unit{0, 0, 1, 1};
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerVisibleRegion(getPrimaryDisplayId(), layer, std::vector<Rect>(1, empty));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2138,11 +2343,12 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerZOrder) {
+ auto& writer = getWriter(getPrimaryDisplayId());
+
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerZOrder(getPrimaryDisplayId(), layer, /*z*/ 10);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2153,8 +2359,9 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerPerFrameMetadata) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
/**
@@ -2169,7 +2376,6 @@
* white (D65) 0.3127 0.3290
*/
- auto& writer = getWriter(getPrimaryDisplayId());
std::vector<PerFrameMetadata> aidlMetadata;
aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_RED_PRIMARY_X, 0.680f});
aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_RED_PRIMARY_Y, 0.320f});
@@ -2189,18 +2395,19 @@
const auto errors = mReader.takeErrors();
if (errors.size() == 1 && errors[0].errorCode == EX_UNSUPPORTED_OPERATION) {
GTEST_SUCCEED() << "SetLayerPerFrameMetadata is not supported";
- EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk());
+ EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer, &writer).isOk());
return;
}
- EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk());
+ EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer, &writer).isOk());
}
TEST_P(GraphicsComposerAidlCommandTest, setLayerBrightness) {
- const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
-
auto& writer = getWriter(getPrimaryDisplayId());
+
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
+
writer.setLayerBrightness(getPrimaryDisplayId(), layer, 0.2f);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2406,12 +2613,69 @@
EXPECT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk());
}
-TEST_P(GraphicsComposerAidlCommandTest, SetRefreshRateChangedCallbackDebug_Unsupported) {
- if (getInterfaceVersion() <= 1) {
- GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is "
- "not supported on older version of the service";
- return;
+class GraphicsComposerAidlCommandV2Test : public GraphicsComposerAidlCommandTest {
+ protected:
+ void SetUp() override {
+ GraphicsComposerAidlTest::SetUp();
+ if (getInterfaceVersion() <= 1) {
+ GTEST_SKIP() << "Device interface version is expected to be >= 2";
+ }
}
+};
+/**
+ * Test Capability::SKIP_VALIDATE
+ *
+ * Capability::SKIP_VALIDATE has been deprecated and should not be enabled.
+ */
+TEST_P(GraphicsComposerAidlCommandV2Test, SkipValidateDeprecatedTest) {
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+ ASSERT_FALSE(hasCapability(Capability::SKIP_VALIDATE))
+ << "Found Capability::SKIP_VALIDATE capability.";
+#pragma clang diagnostic pop
+}
+
+TEST_P(GraphicsComposerAidlCommandV2Test, SetLayerBufferSlotsToClear) {
+ auto& writer = getWriter(getPrimaryDisplayId());
+ // Older HAL versions use a backwards compatible way of clearing buffer slots
+ // HAL at version 1 or lower does not have LayerCommand::bufferSlotsToClear
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
+ EXPECT_TRUE(layerStatus.isOk());
+
+ // setup 3 buffers in the buffer cache, with the last buffer being active
+ // then emulate the Android platform code that clears all 3 buffer slots
+
+ const auto buffer1 = allocate(::android::PIXEL_FORMAT_RGBA_8888);
+ ASSERT_NE(nullptr, buffer1);
+ const auto handle1 = buffer1->handle;
+ writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle1, /*acquireFence*/ -1);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ const auto buffer2 = allocate(::android::PIXEL_FORMAT_RGBA_8888);
+ ASSERT_NE(nullptr, buffer2);
+ const auto handle2 = buffer2->handle;
+ writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 1, handle2, /*acquireFence*/ -1);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ const auto buffer3 = allocate(::android::PIXEL_FORMAT_RGBA_8888);
+ ASSERT_NE(nullptr, buffer3);
+ const auto handle3 = buffer3->handle;
+ writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 2, handle3, /*acquireFence*/ -1);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+
+ // Ensure we can clear all 3 buffer slots, even the active buffer - it is assumed the
+ // current active buffer's slot will be cleared, but still remain the active buffer and no
+ // errors will occur.
+ writer.setLayerBufferSlotsToClear(getPrimaryDisplayId(), layer, {0, 1, 2});
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+}
+
+TEST_P(GraphicsComposerAidlCommandV2Test, SetRefreshRateChangedCallbackDebug_Unsupported) {
if (!hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG)) {
auto status = mComposerClient->setRefreshRateChangedCallbackDebugEnabled(
getPrimaryDisplayId(), /*enabled*/ true);
@@ -2427,46 +2691,50 @@
}
}
-TEST_P(GraphicsComposerAidlCommandTest, SetRefreshRateChangedCallbackDebug_Enabled) {
- if (getInterfaceVersion() <= 1) {
- GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is "
- "not supported on older version of the service";
- return;
- }
+TEST_P(GraphicsComposerAidlCommandV2Test, SetRefreshRateChangedCallbackDebug_Enabled) {
if (!hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG)) {
GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is not supported";
return;
}
- const auto displayId = getPrimaryDisplayId();
- EXPECT_TRUE(mComposerClient->setPowerMode(displayId, PowerMode::ON).isOk());
- // Enable the callback
- ASSERT_TRUE(mComposerClient
- ->setRefreshRateChangedCallbackDebugEnabled(displayId,
- /*enabled*/ true)
- .isOk());
- std::this_thread::sleep_for(100ms);
+ for (VtsDisplay& display : mDisplays) {
+ const auto displayId = display.getDisplayId();
+ EXPECT_TRUE(mComposerClient->setPowerMode(displayId, PowerMode::ON).isOk());
+ // Enable the callback
+ ASSERT_TRUE(mComposerClient
+ ->setRefreshRateChangedCallbackDebugEnabled(displayId,
+ /*enabled*/ true)
+ .isOk());
+ std::this_thread::sleep_for(100ms);
- const auto displayFilter = [displayId](auto refreshRateChangedDebugData) {
- return displayId == refreshRateChangedDebugData.display;
- };
+ const auto [status, configId] = mComposerClient->getActiveConfig(display.getDisplayId());
+ EXPECT_TRUE(status.isOk());
- // Check that we immediately got a callback
- EXPECT_TRUE(checkIfCallbackRefreshRateChangedDebugEnabledReceived(displayFilter));
+ const auto displayFilter = [&](auto refreshRateChangedDebugData) {
+ bool nonVrrRateMatching = true;
+ if (std::optional<VrrConfig> vrrConfigOpt =
+ display.getDisplayConfig(configId).vrrConfig;
+ getInterfaceVersion() >= 3 && !vrrConfigOpt) {
+ nonVrrRateMatching = refreshRateChangedDebugData.refreshPeriodNanos ==
+ refreshRateChangedDebugData.vsyncPeriodNanos;
+ }
+ const bool isDisplaySame =
+ display.getDisplayId() == refreshRateChangedDebugData.display;
+ return nonVrrRateMatching && isDisplaySame;
+ };
- ASSERT_TRUE(mComposerClient
- ->setRefreshRateChangedCallbackDebugEnabled(displayId,
- /*enabled*/ false)
- .isOk());
+ // Check that we immediately got a callback
+ EXPECT_TRUE(checkIfCallbackRefreshRateChangedDebugEnabledReceived(displayFilter));
+
+ ASSERT_TRUE(mComposerClient
+ ->setRefreshRateChangedCallbackDebugEnabled(displayId,
+ /*enabled*/ false)
+ .isOk());
+ }
}
-TEST_P(GraphicsComposerAidlCommandTest,
+TEST_P(GraphicsComposerAidlCommandV2Test,
SetRefreshRateChangedCallbackDebugEnabled_noCallbackWhenIdle) {
- if (getInterfaceVersion() <= 1) {
- GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is "
- "not supported on older version of the service";
- return;
- }
if (!hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG)) {
GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is not supported";
return;
@@ -2522,13 +2790,8 @@
.isOk());
}
-TEST_P(GraphicsComposerAidlCommandTest,
+TEST_P(GraphicsComposerAidlCommandV2Test,
SetRefreshRateChangedCallbackDebugEnabled_SetActiveConfigWithConstraints) {
- if (getInterfaceVersion() <= 1) {
- GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is "
- "not supported on older version of the service";
- return;
- }
if (!hasCapability(Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG)) {
GTEST_SUCCEED() << "Capability::REFRESH_RATE_CHANGED_CALLBACK_DEBUG is not supported";
return;
@@ -2596,53 +2859,220 @@
}
}
-/*
- * Test that no two display configs are exactly the same.
- */
-TEST_P(GraphicsComposerAidlTest, GetDisplayConfigNoRepetitions) {
- for (const auto& display : mDisplays) {
- const auto& [status, configs] = mComposerClient->getDisplayConfigs(display.getDisplayId());
- for (std::vector<int>::size_type i = 0; i < configs.size(); i++) {
- for (std::vector<int>::size_type j = i + 1; j < configs.size(); j++) {
- const auto& [widthStatus1, width1] = mComposerClient->getDisplayAttribute(
- display.getDisplayId(), configs[i], DisplayAttribute::WIDTH);
- const auto& [heightStatus1, height1] = mComposerClient->getDisplayAttribute(
- display.getDisplayId(), configs[i], DisplayAttribute::HEIGHT);
- const auto& [vsyncPeriodStatus1, vsyncPeriod1] =
- mComposerClient->getDisplayAttribute(display.getDisplayId(), configs[i],
- DisplayAttribute::VSYNC_PERIOD);
- const auto& [groupStatus1, group1] = mComposerClient->getDisplayAttribute(
- display.getDisplayId(), configs[i], DisplayAttribute::CONFIG_GROUP);
-
- const auto& [widthStatus2, width2] = mComposerClient->getDisplayAttribute(
- display.getDisplayId(), configs[j], DisplayAttribute::WIDTH);
- const auto& [heightStatus2, height2] = mComposerClient->getDisplayAttribute(
- display.getDisplayId(), configs[j], DisplayAttribute::HEIGHT);
- const auto& [vsyncPeriodStatus2, vsyncPeriod2] =
- mComposerClient->getDisplayAttribute(display.getDisplayId(), configs[j],
- DisplayAttribute::VSYNC_PERIOD);
- const auto& [groupStatus2, group2] = mComposerClient->getDisplayAttribute(
- display.getDisplayId(), configs[j], DisplayAttribute::CONFIG_GROUP);
-
- ASSERT_FALSE(width1 == width2 && height1 == height2 &&
- vsyncPeriod1 == vsyncPeriod2 && group1 == group2);
- }
+TEST_P(GraphicsComposerAidlCommandTest, MultiThreadedPresent) {
+ std::vector<VtsDisplay*> displays;
+ for (auto& display : mDisplays) {
+ if (hasDisplayCapability(display.getDisplayId(),
+ DisplayCapability::MULTI_THREADED_PRESENT)) {
+ displays.push_back(&display);
}
}
+
+ const size_t numDisplays = displays.size();
+ if (numDisplays <= 1u) {
+ GTEST_SKIP();
+ }
+
+ // When multi-threaded, use a reader per display. As with mWriters, this mutex
+ // guards access to the map.
+ std::mutex readersMutex;
+ std::unordered_map<int64_t, ComposerClientReader> readers;
+ std::vector<std::thread> threads;
+ threads.reserve(numDisplays);
+
+ // Each display will have a layer to present. This maps from the display to
+ // the layer, so we can properly destroy each layer at the end.
+ std::unordered_map<int64_t, int64_t> layers;
+
+ for (auto* const display : displays) {
+ const int64_t displayId = display->getDisplayId();
+
+ // Ensure that all writers and readers have been added to their respective
+ // maps initially, so that the following loop never modifies the maps. The
+ // maps are accessed from different threads, and if the maps were modified,
+ // this would invalidate their iterators, and therefore references to the
+ // writers and readers.
+ auto& writer = getWriter(displayId);
+ {
+ std::lock_guard guard{readersMutex};
+ readers.try_emplace(displayId, displayId);
+ }
+
+ EXPECT_TRUE(mComposerClient->setPowerMode(displayId, PowerMode::ON).isOk());
+
+ const auto& [status, layer] =
+ mComposerClient->createLayer(displayId, kBufferSlotCount, &writer);
+ const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888);
+ ASSERT_NE(nullptr, buffer);
+ ASSERT_EQ(::android::OK, buffer->initCheck());
+ ASSERT_NE(nullptr, buffer->handle);
+
+ configureLayer(*display, layer, Composition::DEVICE, display->getFrameRect(),
+ display->getCrop());
+ writer.setLayerBuffer(displayId, layer, /*slot*/ 0, buffer->handle,
+ /*acquireFence*/ -1);
+ writer.setLayerDataspace(displayId, layer, common::Dataspace::UNKNOWN);
+ layers.try_emplace(displayId, layer);
+ }
+
+ for (auto* const display : displays) {
+ const int64_t displayId = display->getDisplayId();
+ auto& writer = getWriter(displayId);
+ std::unique_lock lock{readersMutex};
+ auto& reader = readers.at(displayId);
+ lock.unlock();
+
+ writer.validateDisplay(displayId, ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
+ execute(writer, reader);
+
+ threads.emplace_back([this, displayId, &readers, &readersMutex]() {
+ auto& writer = getWriter(displayId);
+ std::unique_lock lock{readersMutex};
+ ComposerClientReader& reader = readers.at(displayId);
+ lock.unlock();
+
+ writer.presentDisplay(displayId);
+ execute(writer, reader);
+ ASSERT_TRUE(reader.takeErrors().empty());
+
+ auto presentFence = reader.takePresentFence(displayId);
+ // take ownership
+ const int fenceOwner = presentFence.get();
+ *presentFence.getR() = -1;
+ EXPECT_NE(-1, fenceOwner);
+ const auto presentFence2 = sp<::android::Fence>::make(fenceOwner);
+ presentFence2->waitForever(LOG_TAG);
+ });
+ }
+
+ for (auto& thread : threads) {
+ thread.join();
+ }
+
+ for (auto& [displayId, layer] : layers) {
+ auto& writer = getWriter(displayId);
+ EXPECT_TRUE(mComposerClient->destroyLayer(displayId, layer, &writer).isOk());
+ }
+
+ std::lock_guard guard{readersMutex};
+ for (auto& [displayId, reader] : readers) {
+ ASSERT_TRUE(reader.takeErrors().empty());
+ ASSERT_TRUE(reader.takeChangedCompositionTypes(displayId).empty());
+ }
}
-/**
- * Test Capability::SKIP_VALIDATE
- *
- * Capability::SKIP_VALIDATE has been deprecated and should not be enabled.
- */
-TEST_P(GraphicsComposerAidlCommandTest, SkipValidateDeprecatedTest) {
- if (getInterfaceVersion() <= 1) {
- GTEST_SUCCEED() << "HAL at version 1 or lower can contain Capability::SKIP_VALIDATE.";
+class GraphicsComposerAidlCommandV3Test : public GraphicsComposerAidlCommandTest {
+ protected:
+ void SetUp() override {
+ GraphicsComposerAidlTest::SetUp();
+ if (getInterfaceVersion() <= 2) {
+ GTEST_SKIP() << "Device interface version is expected to be >= 3";
+ }
+ }
+};
+
+TEST_P(GraphicsComposerAidlCommandV3Test, CreateBatchedCommand) {
+ if (!hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "LAYER_LIFECYCLE_BATCH_COMMAND not supported by the implementation";
return;
}
- ASSERT_FALSE(hasCapability(Capability::SKIP_VALIDATE))
- << "Found Capability::SKIP_VALIDATE capability.";
+
+ auto& writer = getWriter(getPrimaryDisplayId());
+ int64_t layer = 5;
+ writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer,
+ LayerLifecycleBatchCommandType::CREATE);
+ writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1);
+ writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+}
+
+TEST_P(GraphicsComposerAidlCommandV3Test, CreateBatchedCommand_BadDisplay) {
+ if (!hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "LAYER_LIFECYCLE_BATCH_COMMAND not supported by the implementation";
+ return;
+ }
+
+ auto& writer = getWriter(getPrimaryDisplayId());
+ int64_t layer = 5;
+ writer.setLayerLifecycleBatchCommandType(getInvalidDisplayId(), layer,
+ LayerLifecycleBatchCommandType::CREATE);
+ writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1);
+ writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
+ execute();
+ const auto errors = mReader.takeErrors();
+ ASSERT_TRUE(errors.size() == 1 && errors[0].errorCode == IComposerClient::EX_BAD_DISPLAY);
+}
+
+TEST_P(GraphicsComposerAidlCommandV3Test, DestroyBatchedCommand) {
+ if (!hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "LAYER_LIFECYCLE_BATCH_COMMAND not supported by the implementation";
+ return;
+ }
+
+ auto& writer = getWriter(getPrimaryDisplayId());
+ int64_t layer = 5;
+ writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer,
+ LayerLifecycleBatchCommandType::CREATE);
+ writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1);
+ writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer,
+ LayerLifecycleBatchCommandType::DESTROY);
+ layer++;
+ writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer,
+ LayerLifecycleBatchCommandType::CREATE);
+ writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1);
+
+ execute();
+ const auto errors = mReader.takeErrors();
+ ASSERT_TRUE(errors.size() == 1 && errors[0].errorCode == IComposerClient::EX_BAD_DISPLAY);
+}
+
+TEST_P(GraphicsComposerAidlCommandV3Test, DestroyBatchedCommand_BadDisplay) {
+ if (!hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "LAYER_LIFECYCLE_BATCH_COMMAND not supported by the implementation";
+ return;
+ }
+
+ auto& writer = getWriter(getPrimaryDisplayId());
+ int64_t layer = 5;
+ writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer,
+ LayerLifecycleBatchCommandType::CREATE);
+ writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1);
+ writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ writer.setLayerLifecycleBatchCommandType(getInvalidDisplayId(), layer,
+ LayerLifecycleBatchCommandType::DESTROY);
+ layer++;
+ writer.setLayerLifecycleBatchCommandType(getInvalidDisplayId(), layer,
+ LayerLifecycleBatchCommandType::CREATE);
+ writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1);
+
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+}
+
+TEST_P(GraphicsComposerAidlCommandV3Test, NoCreateDestroyBatchedCommandIncorrectLayer) {
+ if (!hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "LAYER_LIFECYCLE_BATCH_COMMAND not supported by the implementation";
+ return;
+ }
+
+ auto& writer = getWriter(getPrimaryDisplayId());
+ int64_t layer = 5;
+ writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer,
+ LayerLifecycleBatchCommandType::DESTROY);
+ execute();
+ const auto errors = mReader.takeErrors();
+ ASSERT_TRUE(errors.size() == 1 && errors[0].errorCode == IComposerClient::EX_BAD_LAYER);
}
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandTest);
@@ -2650,13 +3080,31 @@
PerInstance, GraphicsComposerAidlCommandTest,
testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)),
::android::PrintInstanceNameToString);
-
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlTest);
INSTANTIATE_TEST_SUITE_P(
PerInstance, GraphicsComposerAidlTest,
testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)),
::android::PrintInstanceNameToString);
-} // namespace
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlV2Test);
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, GraphicsComposerAidlV2Test,
+ testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)),
+ ::android::PrintInstanceNameToString);
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlV3Test);
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, GraphicsComposerAidlV3Test,
+ testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)),
+ ::android::PrintInstanceNameToString);
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandV2Test);
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, GraphicsComposerAidlCommandV2Test,
+ testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)),
+ ::android::PrintInstanceNameToString);
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandV3Test);
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, GraphicsComposerAidlCommandV3Test,
+ testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)),
+ ::android::PrintInstanceNameToString);
} // namespace aidl::android::hardware::graphics::composer3::vts
int main(int argc, char** argv) {
diff --git a/graphics/mapper/2.0/Android.bp b/graphics/mapper/2.0/Android.bp
index 6c3ef54..07ca1cb 100644
--- a/graphics/mapper/2.0/Android.bp
+++ b/graphics/mapper/2.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -12,10 +13,6 @@
hidl_interface {
name: "android.hardware.graphics.mapper@2.0",
root: "android.hardware",
- vndk: {
- enabled: true,
- support_system_process: true,
- },
srcs: [
"types.hal",
"IMapper.hal",
diff --git a/graphics/mapper/2.0/default/Android.bp b/graphics/mapper/2.0/default/Android.bp
index fffea3b..337e29e 100644
--- a/graphics/mapper/2.0/default/Android.bp
+++ b/graphics/mapper/2.0/default/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -29,7 +30,7 @@
relative_install_path: "hw",
srcs: ["passthrough.cpp"],
header_libs: [
- "android.hardware.graphics.mapper@2.0-passthrough"
+ "android.hardware.graphics.mapper@2.0-passthrough",
],
shared_libs: [
"android.hardware.graphics.mapper@2.0",
diff --git a/graphics/mapper/2.0/utils/hal/Android.bp b/graphics/mapper/2.0/utils/hal/Android.bp
index f5d4506..c4a0b11 100644
--- a/graphics/mapper/2.0/utils/hal/Android.bp
+++ b/graphics/mapper/2.0/utils/hal/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/graphics/mapper/2.0/utils/passthrough/Android.bp b/graphics/mapper/2.0/utils/passthrough/Android.bp
index 23450fb..257eab9 100644
--- a/graphics/mapper/2.0/utils/passthrough/Android.bp
+++ b/graphics/mapper/2.0/utils/passthrough/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/graphics/mapper/2.0/utils/vts/Android.bp b/graphics/mapper/2.0/utils/vts/Android.bp
index 03f925d..4fb78db 100644
--- a/graphics/mapper/2.0/utils/vts/Android.bp
+++ b/graphics/mapper/2.0/utils/vts/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/graphics/mapper/2.0/vts/functional/Android.bp b/graphics/mapper/2.0/vts/functional/Android.bp
index 43e6156..01bb615 100644
--- a/graphics/mapper/2.0/vts/functional/Android.bp
+++ b/graphics/mapper/2.0/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -33,5 +34,8 @@
"android.hardware.graphics.mapper@2.0",
"android.hardware.graphics.mapper@2.0-vts",
],
- test_suites: ["general-tests", "vts"],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
}
diff --git a/graphics/mapper/2.1/Android.bp b/graphics/mapper/2.1/Android.bp
index cc74156..f6e089a 100644
--- a/graphics/mapper/2.1/Android.bp
+++ b/graphics/mapper/2.1/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -12,10 +13,6 @@
hidl_interface {
name: "android.hardware.graphics.mapper@2.1",
root: "android.hardware",
- vndk: {
- enabled: true,
- support_system_process: true,
- },
srcs: [
"IMapper.hal",
],
diff --git a/graphics/mapper/2.1/default/Android.bp b/graphics/mapper/2.1/default/Android.bp
index 4f080c4..8dfdbbd 100644
--- a/graphics/mapper/2.1/default/Android.bp
+++ b/graphics/mapper/2.1/default/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/graphics/mapper/2.1/utils/hal/Android.bp b/graphics/mapper/2.1/utils/hal/Android.bp
index aff497c..47f7971 100644
--- a/graphics/mapper/2.1/utils/hal/Android.bp
+++ b/graphics/mapper/2.1/utils/hal/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/graphics/mapper/2.1/utils/passthrough/Android.bp b/graphics/mapper/2.1/utils/passthrough/Android.bp
index d46041b..ddfc57d 100644
--- a/graphics/mapper/2.1/utils/passthrough/Android.bp
+++ b/graphics/mapper/2.1/utils/passthrough/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/graphics/mapper/2.1/utils/vts/Android.bp b/graphics/mapper/2.1/utils/vts/Android.bp
index 5c67df9..a095733 100644
--- a/graphics/mapper/2.1/utils/vts/Android.bp
+++ b/graphics/mapper/2.1/utils/vts/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -25,7 +26,10 @@
cc_library_static {
name: "android.hardware.graphics.mapper@2.1-vts",
- defaults: ["hidl_defaults", "VtsHalTargetTestDefaults"],
+ defaults: [
+ "hidl_defaults",
+ "VtsHalTargetTestDefaults",
+ ],
srcs: ["MapperVts.cpp"],
cflags: [
"-O0",
diff --git a/graphics/mapper/2.1/vts/functional/Android.bp b/graphics/mapper/2.1/vts/functional/Android.bp
index 7bbc9a4..acfd52a 100644
--- a/graphics/mapper/2.1/vts/functional/Android.bp
+++ b/graphics/mapper/2.1/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -35,5 +36,8 @@
"android.hardware.graphics.mapper@2.0-vts",
"android.hardware.graphics.mapper@2.1-vts",
],
- test_suites: ["general-tests", "vts"],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
}
diff --git a/graphics/mapper/3.0/Android.bp b/graphics/mapper/3.0/Android.bp
index 88992a3..0e15af9 100644
--- a/graphics/mapper/3.0/Android.bp
+++ b/graphics/mapper/3.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -12,10 +13,6 @@
hidl_interface {
name: "android.hardware.graphics.mapper@3.0",
root: "android.hardware",
- vndk: {
- enabled: true,
- support_system_process: true,
- },
srcs: [
"types.hal",
"IMapper.hal",
diff --git a/graphics/mapper/3.0/utils/vts/Android.bp b/graphics/mapper/3.0/utils/vts/Android.bp
index c0d56de..d4b8035 100644
--- a/graphics/mapper/3.0/utils/vts/Android.bp
+++ b/graphics/mapper/3.0/utils/vts/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/graphics/mapper/3.0/vts/functional/Android.bp b/graphics/mapper/3.0/vts/functional/Android.bp
index e837027..57cd09b 100644
--- a/graphics/mapper/3.0/vts/functional/Android.bp
+++ b/graphics/mapper/3.0/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -35,5 +36,8 @@
"android.hardware.graphics.mapper@3.0",
"android.hardware.graphics.mapper@3.0-vts",
],
- test_suites: ["general-tests", "vts"],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
}
diff --git a/graphics/mapper/4.0/Android.bp b/graphics/mapper/4.0/Android.bp
index 0cffce4..b2dd7d2 100644
--- a/graphics/mapper/4.0/Android.bp
+++ b/graphics/mapper/4.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -12,10 +13,6 @@
hidl_interface {
name: "android.hardware.graphics.mapper@4.0",
root: "android.hardware",
- vndk: {
- enabled: true,
- support_system_process: true,
- },
srcs: [
"types.hal",
"IMapper.hal",
diff --git a/graphics/mapper/4.0/utils/vts/Android.bp b/graphics/mapper/4.0/utils/vts/Android.bp
index 51e871b..c5f124c 100644
--- a/graphics/mapper/4.0/utils/vts/Android.bp
+++ b/graphics/mapper/4.0/utils/vts/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -47,7 +48,7 @@
],
export_static_lib_headers: [
"android.hardware.graphics.allocator@4.0",
- "android.hardware.graphics.common-V4-ndk",
+ "android.hardware.graphics.common-V5-ndk",
"android.hardware.graphics.mapper@4.0",
],
export_include_dirs: ["include"],
diff --git a/graphics/mapper/4.0/vts/functional/Android.bp b/graphics/mapper/4.0/vts/functional/Android.bp
index 6208ae9..181408b 100644
--- a/graphics/mapper/4.0/vts/functional/Android.bp
+++ b/graphics/mapper/4.0/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp
index 03d9041..bae362f 100644
--- a/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp
+++ b/graphics/mapper/4.0/vts/functional/VtsHalGraphicsMapperV4_0TargetTest.cpp
@@ -2223,11 +2223,14 @@
// Keep optional metadata types below and populate the encoded metadata vec
// with some arbitrary different metadata because the common gralloc4::decode*()
// functions do not distinguish between an empty vec and bad value.
- ASSERT_EQ(NO_ERROR, gralloc4::encodeDataspace(Dataspace::SRGB_LINEAR, &vec));
- ASSERT_EQ(Error::UNSUPPORTED,
- mGralloc->set(bufferHandle, gralloc4::MetadataType_Smpte2086, vec));
- ASSERT_EQ(Error::UNSUPPORTED,
- mGralloc->set(bufferHandle, gralloc4::MetadataType_Cta861_3, vec));
+ if (base::GetIntProperty("ro.vendor.api_level", __ANDROID_API_FUTURE__) >= __ANDROID_API_T__) {
+ // Some old grallocs shipped with broken validation.
+ ASSERT_EQ(NO_ERROR, gralloc4::encodeDataspace(Dataspace::SRGB_LINEAR, &vec));
+ ASSERT_EQ(Error::UNSUPPORTED,
+ mGralloc->set(bufferHandle, gralloc4::MetadataType_Smpte2086, vec));
+ ASSERT_EQ(Error::UNSUPPORTED,
+ mGralloc->set(bufferHandle, gralloc4::MetadataType_Cta861_3, vec));
+ }
}
/**
diff --git a/graphics/mapper/stable-c/Android.bp b/graphics/mapper/stable-c/Android.bp
index 1d01a02..82306be 100644
--- a/graphics/mapper/stable-c/Android.bp
+++ b/graphics/mapper/stable-c/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_core_graphics_stack",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -58,6 +59,7 @@
header_abi_checker: {
enabled: true,
symbol_file: "imapper.map.txt",
+ ref_dump_dirs: ["abi-dumps"],
},
}
diff --git a/graphics/mapper/stable-c/abi-dumps/arm/source-based/libimapper_stablec_abicheck.so.lsdump b/graphics/mapper/stable-c/abi-dumps/arm/source-based/libimapper_stablec_abicheck.so.lsdump
new file mode 100644
index 0000000..a653228
--- /dev/null
+++ b/graphics/mapper/stable-c/abi-dumps/arm/source-based/libimapper_stablec_abicheck.so.lsdump
@@ -0,0 +1,1053 @@
+{
+ "array_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIA0_i",
+ "name" : "int[0]",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIA0_i",
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 1,
+ "linker_set_key" : "_ZTIA32_h",
+ "name" : "unsigned char[32]",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIA32_h",
+ "size" : 32,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "builtin_types" :
+ [
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIb",
+ "name" : "bool",
+ "referenced_type" : "_ZTIb",
+ "self_type" : "_ZTIb",
+ "size" : 1
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIc",
+ "name" : "char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIc",
+ "size" : 1
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIe",
+ "name" : "long double",
+ "referenced_type" : "_ZTIe",
+ "self_type" : "_ZTIe",
+ "size" : 8
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIh",
+ "name" : "unsigned char",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIh",
+ "size" : 1
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIi",
+ "name" : "int",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIi",
+ "size" : 4
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIj",
+ "name" : "unsigned int",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIj",
+ "size" : 4
+ },
+ {
+ "linker_set_key" : "_ZTIv",
+ "name" : "void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIv"
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIx",
+ "name" : "long long",
+ "referenced_type" : "_ZTIx",
+ "self_type" : "_ZTIx",
+ "size" : 8
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIy",
+ "name" : "unsigned long long",
+ "referenced_type" : "_ZTIy",
+ "self_type" : "_ZTIy",
+ "size" : 8
+ }
+ ],
+ "elf_functions" :
+ [
+ {
+ "name" : "AIMapper_loadIMapper"
+ }
+ ],
+ "elf_objects" : [],
+ "enum_types" :
+ [
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 0,
+ "name" : "AIMAPPER_ERROR_NONE"
+ },
+ {
+ "enum_field_value" : 1,
+ "name" : "AIMAPPER_ERROR_BAD_DESCRIPTOR"
+ },
+ {
+ "enum_field_value" : 2,
+ "name" : "AIMAPPER_ERROR_BAD_BUFFER"
+ },
+ {
+ "enum_field_value" : 3,
+ "name" : "AIMAPPER_ERROR_BAD_VALUE"
+ },
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_ERROR_NO_RESOURCES"
+ },
+ {
+ "enum_field_value" : 7,
+ "name" : "AIMAPPER_ERROR_UNSUPPORTED"
+ }
+ ],
+ "linker_set_key" : "_ZTI14AIMapper_Error",
+ "name" : "AIMapper_Error",
+ "referenced_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTI14AIMapper_Error",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIi"
+ },
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_VERSION_5"
+ }
+ ],
+ "linker_set_key" : "_ZTI16AIMapper_Version",
+ "name" : "AIMapper_Version",
+ "referenced_type" : "_ZTI16AIMapper_Version",
+ "self_type" : "_ZTI16AIMapper_Version",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIj"
+ }
+ ],
+ "function_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "name" : "AIMapper_Error (void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPFvPvE"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "name" : "AIMapper_Error (const native_handle *, AIMapper_MetadataType, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (const native_handle *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "name" : "AIMapper_Error (const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "name" : "AIMapper_Error (const native_handle *, void **, unsigned long long *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ },
+ {
+ "referenced_type" : "_ZTIPy"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (const native_handle *, const native_handle **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (const native_handle *, int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPi"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (const native_handle *, unsigned int *, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "name" : "AIMapper_Error (const native_handle *, long long, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "name" : "AIMapper_Error (const native_handle *, unsigned long long, ARect, int, void **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIy"
+ },
+ {
+ "referenced_type" : "_ZTI5ARect"
+ },
+ {
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "name" : "AIMapper_Error (const AIMapper_MetadataTypeDescription **, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "name" : "int (const native_handle *, AIMapper_MetadataType, void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handlexPvjE",
+ "name" : "int (const native_handle *, long long, void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handlexPvjE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handlexPvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "name" : "void (void *, AIMapper_MetadataType, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPvE",
+ "name" : "void (void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPvE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "functions" :
+ [
+ {
+ "function_name" : "AIMapper_loadIMapper",
+ "linker_set_key" : "AIMapper_loadIMapper",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPP8AIMapper"
+ }
+ ],
+ "return_type" : "_ZTI14AIMapper_Error",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIP8AIMapper",
+ "name" : "AIMapper *",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTIP8AIMapper",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "name" : "AIMapper_Error (*)(void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "name" : "AIMapper_Error (*)(const native_handle *, AIMapper_MetadataType, const void *, unsigned int)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (*)(const native_handle *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "name" : "AIMapper_Error (*)(const native_handle *, void **, unsigned long long *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, const native_handle **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (*)(const native_handle *, int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned int *, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "name" : "AIMapper_Error (*)(const native_handle *, long long, const void *, unsigned int)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned long long, ARect, int, void **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "name" : "AIMapper_Error (*)(const AIMapper_MetadataTypeDescription **, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "name" : "int (*)(const native_handle *, AIMapper_MetadataType, void *, unsigned int)",
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "self_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFiPK13native_handlexPvjE",
+ "name" : "int (*)(const native_handle *, long long, void *, unsigned int)",
+ "referenced_type" : "_ZTIFiPK13native_handlexPvjE",
+ "self_type" : "_ZTIPFiPK13native_handlexPvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE",
+ "name" : "void (*)(void *, AIMapper_MetadataType, const void *, unsigned int)",
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "self_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFvPvE",
+ "name" : "void (*)(void *)",
+ "referenced_type" : "_ZTIFvPvE",
+ "self_type" : "_ZTIPFvPvE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPK13native_handle",
+ "name" : "const native_handle *",
+ "referenced_type" : "_ZTIK13native_handle",
+ "self_type" : "_ZTIPK13native_handle",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription *",
+ "referenced_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPKc",
+ "name" : "const char *",
+ "referenced_type" : "_ZTIKc",
+ "self_type" : "_ZTIPKc",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPKv",
+ "name" : "const void *",
+ "referenced_type" : "_ZTIKv",
+ "self_type" : "_ZTIPKv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPP8AIMapper",
+ "name" : "AIMapper **",
+ "referenced_type" : "_ZTIP8AIMapper",
+ "self_type" : "_ZTIPP8AIMapper",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPK13native_handle",
+ "name" : "const native_handle **",
+ "referenced_type" : "_ZTIPK13native_handle",
+ "self_type" : "_ZTIPPK13native_handle",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription **",
+ "referenced_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPv",
+ "name" : "void **",
+ "referenced_type" : "_ZTIPv",
+ "self_type" : "_ZTIPPv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPi",
+ "name" : "int *",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIPi",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPj",
+ "name" : "unsigned int *",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIPj",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPv",
+ "name" : "void *",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIPv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPy",
+ "name" : "unsigned long long *",
+ "referenced_type" : "_ZTIy",
+ "self_type" : "_ZTIPy",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "qualified_types" :
+ [
+ {
+ "alignment" : 4,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK13native_handle",
+ "name" : "const native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTIK13native_handle",
+ "size" : 12,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "size" : 56,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 1,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKc",
+ "name" : "const char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIKc",
+ "size" : 1,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKv",
+ "name" : "const void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIKv",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "record_types" :
+ [
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "importBuffer",
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E"
+ },
+ {
+ "field_name" : "freeBuffer",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getTransportSize",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E"
+ },
+ {
+ "field_name" : "lock",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE"
+ },
+ {
+ "field_name" : "unlock",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE"
+ },
+ {
+ "field_name" : "flushLockedBuffer",
+ "field_offset" : 160,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "rereadLockedBuffer",
+ "field_offset" : 192,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getMetadata",
+ "field_offset" : 224,
+ "referenced_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE"
+ },
+ {
+ "field_name" : "getStandardMetadata",
+ "field_offset" : 256,
+ "referenced_type" : "_ZTIPFiPK13native_handlexPvjE"
+ },
+ {
+ "field_name" : "setMetadata",
+ "field_offset" : 288,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "field_name" : "setStandardMetadata",
+ "field_offset" : 320,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE"
+ },
+ {
+ "field_name" : "listSupportedMetadataTypes",
+ "field_offset" : 352,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE"
+ },
+ {
+ "field_name" : "dumpBuffer",
+ "field_offset" : 384,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E"
+ },
+ {
+ "field_name" : "dumpAllBuffers",
+ "field_offset" : 416,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E"
+ },
+ {
+ "field_name" : "getReservedRegion",
+ "field_offset" : 448,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE"
+ }
+ ],
+ "linker_set_key" : "_ZTI10AIMapperV5",
+ "name" : "AIMapperV5",
+ "referenced_type" : "_ZTI10AIMapperV5",
+ "self_type" : "_ZTI10AIMapperV5",
+ "size" : 60,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "__clang_max_align_nonce1",
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "field_name" : "__clang_max_align_nonce2",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIe"
+ }
+ ],
+ "linker_set_key" : "_ZTI11max_align_t",
+ "name" : "max_align_t",
+ "referenced_type" : "_ZTI11max_align_t",
+ "self_type" : "_ZTI11max_align_t",
+ "size" : 16,
+ "source_file" : "prebuilts/clang-tools/linux-x86/clang-headers/__stddef_max_align_t.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numFds",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numInts",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "data",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIA0_i"
+ }
+ ],
+ "linker_set_key" : "_ZTI13native_handle",
+ "name" : "native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTI13native_handle",
+ "size" : 12,
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "name",
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "value",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIx"
+ }
+ ],
+ "linker_set_key" : "_ZTI21AIMapper_MetadataType",
+ "name" : "AIMapper_MetadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType",
+ "self_type" : "_ZTI21AIMapper_MetadataType",
+ "size" : 16,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "metadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "field_name" : "description",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "isGettable",
+ "field_offset" : 160,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "isSettable",
+ "field_offset" : 168,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "reserved",
+ "field_offset" : 176,
+ "referenced_type" : "_ZTIA32_h"
+ }
+ ],
+ "linker_set_key" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "name" : "AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "size" : 56,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "left",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "top",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "right",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "bottom",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIi"
+ }
+ ],
+ "linker_set_key" : "_ZTI5ARect",
+ "name" : "ARect",
+ "referenced_type" : "_ZTI5ARect",
+ "self_type" : "_ZTI5ARect",
+ "size" : 16,
+ "source_file" : "frameworks/native/libs/arect/include/android/rect.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTI16AIMapper_Version"
+ },
+ {
+ "field_name" : "v5",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTI10AIMapperV5"
+ }
+ ],
+ "linker_set_key" : "_ZTI8AIMapper",
+ "name" : "AIMapper",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTI8AIMapper",
+ "size" : 64,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/graphics/mapper/stable-c/abi-dumps/arm64/source-based/libimapper_stablec_abicheck.so.lsdump b/graphics/mapper/stable-c/abi-dumps/arm64/source-based/libimapper_stablec_abicheck.so.lsdump
new file mode 100644
index 0000000..25f0e48
--- /dev/null
+++ b/graphics/mapper/stable-c/abi-dumps/arm64/source-based/libimapper_stablec_abicheck.so.lsdump
@@ -0,0 +1,1062 @@
+{
+ "array_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIA0_i",
+ "name" : "int[0]",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIA0_i",
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 1,
+ "linker_set_key" : "_ZTIA32_h",
+ "name" : "unsigned char[32]",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIA32_h",
+ "size" : 32,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "builtin_types" :
+ [
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIb",
+ "name" : "bool",
+ "referenced_type" : "_ZTIb",
+ "self_type" : "_ZTIb",
+ "size" : 1
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIc",
+ "name" : "char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIc",
+ "size" : 1
+ },
+ {
+ "alignment" : 16,
+ "linker_set_key" : "_ZTIe",
+ "name" : "long double",
+ "referenced_type" : "_ZTIe",
+ "self_type" : "_ZTIe",
+ "size" : 16
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIh",
+ "name" : "unsigned char",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIh",
+ "size" : 1
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIi",
+ "name" : "int",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIi",
+ "size" : 4
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIj",
+ "name" : "unsigned int",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIj",
+ "size" : 4
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIl",
+ "name" : "long",
+ "referenced_type" : "_ZTIl",
+ "self_type" : "_ZTIl",
+ "size" : 8
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIm",
+ "name" : "unsigned long",
+ "referenced_type" : "_ZTIm",
+ "self_type" : "_ZTIm",
+ "size" : 8
+ },
+ {
+ "linker_set_key" : "_ZTIv",
+ "name" : "void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIv"
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIx",
+ "name" : "long long",
+ "referenced_type" : "_ZTIx",
+ "self_type" : "_ZTIx",
+ "size" : 8
+ }
+ ],
+ "elf_functions" :
+ [
+ {
+ "name" : "AIMapper_loadIMapper"
+ }
+ ],
+ "elf_objects" : [],
+ "enum_types" :
+ [
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 0,
+ "name" : "AIMAPPER_ERROR_NONE"
+ },
+ {
+ "enum_field_value" : 1,
+ "name" : "AIMAPPER_ERROR_BAD_DESCRIPTOR"
+ },
+ {
+ "enum_field_value" : 2,
+ "name" : "AIMAPPER_ERROR_BAD_BUFFER"
+ },
+ {
+ "enum_field_value" : 3,
+ "name" : "AIMAPPER_ERROR_BAD_VALUE"
+ },
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_ERROR_NO_RESOURCES"
+ },
+ {
+ "enum_field_value" : 7,
+ "name" : "AIMAPPER_ERROR_UNSUPPORTED"
+ }
+ ],
+ "linker_set_key" : "_ZTI14AIMapper_Error",
+ "name" : "AIMapper_Error",
+ "referenced_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTI14AIMapper_Error",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIi"
+ },
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_VERSION_5"
+ }
+ ],
+ "linker_set_key" : "_ZTI16AIMapper_Version",
+ "name" : "AIMapper_Version",
+ "referenced_type" : "_ZTI16AIMapper_Version",
+ "self_type" : "_ZTI16AIMapper_Version",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIj"
+ }
+ ],
+ "function_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "name" : "AIMapper_Error (void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned long), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPFvPvE"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvmE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "name" : "AIMapper_Error (const native_handle *, AIMapper_MetadataType, const void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (const native_handle *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "name" : "AIMapper_Error (const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned long), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvmE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "name" : "AIMapper_Error (const native_handle *, void **, unsigned long *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ },
+ {
+ "referenced_type" : "_ZTIPm"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (const native_handle *, const native_handle **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (const native_handle *, int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPi"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (const native_handle *, unsigned int *, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "name" : "AIMapper_Error (const native_handle *, long, const void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIl"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "name" : "AIMapper_Error (const native_handle *, unsigned long, ARect, int, void **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ },
+ {
+ "referenced_type" : "_ZTI5ARect"
+ },
+ {
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "name" : "AIMapper_Error (const AIMapper_MetadataTypeDescription **, unsigned long *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription"
+ },
+ {
+ "referenced_type" : "_ZTIPm"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "name" : "int (const native_handle *, AIMapper_MetadataType, void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handlelPvmE",
+ "name" : "int (const native_handle *, long, void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIl"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handlelPvmE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handlelPvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPv21AIMapper_MetadataTypePKvmE",
+ "name" : "void (void *, AIMapper_MetadataType, const void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvmE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPvE",
+ "name" : "void (void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPvE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "functions" :
+ [
+ {
+ "function_name" : "AIMapper_loadIMapper",
+ "linker_set_key" : "AIMapper_loadIMapper",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPP8AIMapper"
+ }
+ ],
+ "return_type" : "_ZTI14AIMapper_Error",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIP8AIMapper",
+ "name" : "AIMapper *",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTIP8AIMapper",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "name" : "AIMapper_Error (*)(void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned long), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "name" : "AIMapper_Error (*)(const native_handle *, AIMapper_MetadataType, const void *, unsigned long)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (*)(const native_handle *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned long), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "name" : "AIMapper_Error (*)(const native_handle *, void **, unsigned long *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, const native_handle **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (*)(const native_handle *, int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned int *, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "name" : "AIMapper_Error (*)(const native_handle *, long, const void *, unsigned long)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned long, ARect, int, void **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "name" : "AIMapper_Error (*)(const AIMapper_MetadataTypeDescription **, unsigned long *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "name" : "int (*)(const native_handle *, AIMapper_MetadataType, void *, unsigned long)",
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "self_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPFiPK13native_handlelPvmE",
+ "name" : "int (*)(const native_handle *, long, void *, unsigned long)",
+ "referenced_type" : "_ZTIFiPK13native_handlelPvmE",
+ "self_type" : "_ZTIPFiPK13native_handlelPvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPFvPv21AIMapper_MetadataTypePKvmE",
+ "name" : "void (*)(void *, AIMapper_MetadataType, const void *, unsigned long)",
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvmE",
+ "self_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPFvPvE",
+ "name" : "void (*)(void *)",
+ "referenced_type" : "_ZTIFvPvE",
+ "self_type" : "_ZTIPFvPvE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPK13native_handle",
+ "name" : "const native_handle *",
+ "referenced_type" : "_ZTIK13native_handle",
+ "self_type" : "_ZTIPK13native_handle",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription *",
+ "referenced_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPKc",
+ "name" : "const char *",
+ "referenced_type" : "_ZTIKc",
+ "self_type" : "_ZTIPKc",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPKv",
+ "name" : "const void *",
+ "referenced_type" : "_ZTIKv",
+ "self_type" : "_ZTIPKv",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPP8AIMapper",
+ "name" : "AIMapper **",
+ "referenced_type" : "_ZTIP8AIMapper",
+ "self_type" : "_ZTIPP8AIMapper",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPPK13native_handle",
+ "name" : "const native_handle **",
+ "referenced_type" : "_ZTIPK13native_handle",
+ "self_type" : "_ZTIPPK13native_handle",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription **",
+ "referenced_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPPv",
+ "name" : "void **",
+ "referenced_type" : "_ZTIPv",
+ "self_type" : "_ZTIPPv",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPi",
+ "name" : "int *",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIPi",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPj",
+ "name" : "unsigned int *",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIPj",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPm",
+ "name" : "unsigned long *",
+ "referenced_type" : "_ZTIm",
+ "self_type" : "_ZTIPm",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPv",
+ "name" : "void *",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIPv",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "qualified_types" :
+ [
+ {
+ "alignment" : 4,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK13native_handle",
+ "name" : "const native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTIK13native_handle",
+ "size" : 12,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "size" : 64,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 1,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKc",
+ "name" : "const char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIKc",
+ "size" : 1,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKv",
+ "name" : "const void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIKv",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "record_types" :
+ [
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "importBuffer",
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E"
+ },
+ {
+ "field_name" : "freeBuffer",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getTransportSize",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E"
+ },
+ {
+ "field_name" : "lock",
+ "field_offset" : 192,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlem5ARectiPPvE"
+ },
+ {
+ "field_name" : "unlock",
+ "field_offset" : 256,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE"
+ },
+ {
+ "field_name" : "flushLockedBuffer",
+ "field_offset" : 320,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "rereadLockedBuffer",
+ "field_offset" : 384,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getMetadata",
+ "field_offset" : 448,
+ "referenced_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvmE"
+ },
+ {
+ "field_name" : "getStandardMetadata",
+ "field_offset" : 512,
+ "referenced_type" : "_ZTIPFiPK13native_handlelPvmE"
+ },
+ {
+ "field_name" : "setMetadata",
+ "field_offset" : 576,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE"
+ },
+ {
+ "field_name" : "setStandardMetadata",
+ "field_offset" : 640,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlelPKvmE"
+ },
+ {
+ "field_name" : "listSupportedMetadataTypes",
+ "field_offset" : 704,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE"
+ },
+ {
+ "field_name" : "dumpBuffer",
+ "field_offset" : 768,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E"
+ },
+ {
+ "field_name" : "dumpAllBuffers",
+ "field_offset" : 832,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E"
+ },
+ {
+ "field_name" : "getReservedRegion",
+ "field_offset" : 896,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPmE"
+ }
+ ],
+ "linker_set_key" : "_ZTI10AIMapperV5",
+ "name" : "AIMapperV5",
+ "referenced_type" : "_ZTI10AIMapperV5",
+ "self_type" : "_ZTI10AIMapperV5",
+ "size" : 120,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 16,
+ "fields" :
+ [
+ {
+ "field_name" : "__clang_max_align_nonce1",
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "field_name" : "__clang_max_align_nonce2",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIe"
+ }
+ ],
+ "linker_set_key" : "_ZTI11max_align_t",
+ "name" : "max_align_t",
+ "referenced_type" : "_ZTI11max_align_t",
+ "self_type" : "_ZTI11max_align_t",
+ "size" : 32,
+ "source_file" : "prebuilts/clang-tools/linux-x86/clang-headers/__stddef_max_align_t.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numFds",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numInts",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "data",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIA0_i"
+ }
+ ],
+ "linker_set_key" : "_ZTI13native_handle",
+ "name" : "native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTI13native_handle",
+ "size" : 12,
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "name",
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "value",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIl"
+ }
+ ],
+ "linker_set_key" : "_ZTI21AIMapper_MetadataType",
+ "name" : "AIMapper_MetadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType",
+ "self_type" : "_ZTI21AIMapper_MetadataType",
+ "size" : 16,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "metadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "field_name" : "description",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "isGettable",
+ "field_offset" : 192,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "isSettable",
+ "field_offset" : 200,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "reserved",
+ "field_offset" : 208,
+ "referenced_type" : "_ZTIA32_h"
+ }
+ ],
+ "linker_set_key" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "name" : "AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "size" : 64,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "left",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "top",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "right",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "bottom",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIi"
+ }
+ ],
+ "linker_set_key" : "_ZTI5ARect",
+ "name" : "ARect",
+ "referenced_type" : "_ZTI5ARect",
+ "self_type" : "_ZTI5ARect",
+ "size" : 16,
+ "source_file" : "frameworks/native/libs/arect/include/android/rect.h"
+ },
+ {
+ "alignment" : 16,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTI16AIMapper_Version"
+ },
+ {
+ "field_name" : "v5",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTI10AIMapperV5"
+ }
+ ],
+ "linker_set_key" : "_ZTI8AIMapper",
+ "name" : "AIMapper",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTI8AIMapper",
+ "size" : 128,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/graphics/mapper/stable-c/abi-dumps/arm_arm64/source-based/libimapper_stablec_abicheck.so.lsdump b/graphics/mapper/stable-c/abi-dumps/arm_arm64/source-based/libimapper_stablec_abicheck.so.lsdump
new file mode 100644
index 0000000..a653228
--- /dev/null
+++ b/graphics/mapper/stable-c/abi-dumps/arm_arm64/source-based/libimapper_stablec_abicheck.so.lsdump
@@ -0,0 +1,1053 @@
+{
+ "array_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIA0_i",
+ "name" : "int[0]",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIA0_i",
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 1,
+ "linker_set_key" : "_ZTIA32_h",
+ "name" : "unsigned char[32]",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIA32_h",
+ "size" : 32,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "builtin_types" :
+ [
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIb",
+ "name" : "bool",
+ "referenced_type" : "_ZTIb",
+ "self_type" : "_ZTIb",
+ "size" : 1
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIc",
+ "name" : "char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIc",
+ "size" : 1
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIe",
+ "name" : "long double",
+ "referenced_type" : "_ZTIe",
+ "self_type" : "_ZTIe",
+ "size" : 8
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIh",
+ "name" : "unsigned char",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIh",
+ "size" : 1
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIi",
+ "name" : "int",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIi",
+ "size" : 4
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIj",
+ "name" : "unsigned int",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIj",
+ "size" : 4
+ },
+ {
+ "linker_set_key" : "_ZTIv",
+ "name" : "void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIv"
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIx",
+ "name" : "long long",
+ "referenced_type" : "_ZTIx",
+ "self_type" : "_ZTIx",
+ "size" : 8
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIy",
+ "name" : "unsigned long long",
+ "referenced_type" : "_ZTIy",
+ "self_type" : "_ZTIy",
+ "size" : 8
+ }
+ ],
+ "elf_functions" :
+ [
+ {
+ "name" : "AIMapper_loadIMapper"
+ }
+ ],
+ "elf_objects" : [],
+ "enum_types" :
+ [
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 0,
+ "name" : "AIMAPPER_ERROR_NONE"
+ },
+ {
+ "enum_field_value" : 1,
+ "name" : "AIMAPPER_ERROR_BAD_DESCRIPTOR"
+ },
+ {
+ "enum_field_value" : 2,
+ "name" : "AIMAPPER_ERROR_BAD_BUFFER"
+ },
+ {
+ "enum_field_value" : 3,
+ "name" : "AIMAPPER_ERROR_BAD_VALUE"
+ },
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_ERROR_NO_RESOURCES"
+ },
+ {
+ "enum_field_value" : 7,
+ "name" : "AIMAPPER_ERROR_UNSUPPORTED"
+ }
+ ],
+ "linker_set_key" : "_ZTI14AIMapper_Error",
+ "name" : "AIMapper_Error",
+ "referenced_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTI14AIMapper_Error",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIi"
+ },
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_VERSION_5"
+ }
+ ],
+ "linker_set_key" : "_ZTI16AIMapper_Version",
+ "name" : "AIMapper_Version",
+ "referenced_type" : "_ZTI16AIMapper_Version",
+ "self_type" : "_ZTI16AIMapper_Version",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIj"
+ }
+ ],
+ "function_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "name" : "AIMapper_Error (void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPFvPvE"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "name" : "AIMapper_Error (const native_handle *, AIMapper_MetadataType, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (const native_handle *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "name" : "AIMapper_Error (const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "name" : "AIMapper_Error (const native_handle *, void **, unsigned long long *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ },
+ {
+ "referenced_type" : "_ZTIPy"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (const native_handle *, const native_handle **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (const native_handle *, int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPi"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (const native_handle *, unsigned int *, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "name" : "AIMapper_Error (const native_handle *, long long, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "name" : "AIMapper_Error (const native_handle *, unsigned long long, ARect, int, void **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIy"
+ },
+ {
+ "referenced_type" : "_ZTI5ARect"
+ },
+ {
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "name" : "AIMapper_Error (const AIMapper_MetadataTypeDescription **, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "name" : "int (const native_handle *, AIMapper_MetadataType, void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handlexPvjE",
+ "name" : "int (const native_handle *, long long, void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handlexPvjE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handlexPvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "name" : "void (void *, AIMapper_MetadataType, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPvE",
+ "name" : "void (void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPvE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "functions" :
+ [
+ {
+ "function_name" : "AIMapper_loadIMapper",
+ "linker_set_key" : "AIMapper_loadIMapper",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPP8AIMapper"
+ }
+ ],
+ "return_type" : "_ZTI14AIMapper_Error",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIP8AIMapper",
+ "name" : "AIMapper *",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTIP8AIMapper",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "name" : "AIMapper_Error (*)(void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "name" : "AIMapper_Error (*)(const native_handle *, AIMapper_MetadataType, const void *, unsigned int)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (*)(const native_handle *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "name" : "AIMapper_Error (*)(const native_handle *, void **, unsigned long long *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, const native_handle **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (*)(const native_handle *, int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned int *, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "name" : "AIMapper_Error (*)(const native_handle *, long long, const void *, unsigned int)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned long long, ARect, int, void **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "name" : "AIMapper_Error (*)(const AIMapper_MetadataTypeDescription **, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "name" : "int (*)(const native_handle *, AIMapper_MetadataType, void *, unsigned int)",
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "self_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFiPK13native_handlexPvjE",
+ "name" : "int (*)(const native_handle *, long long, void *, unsigned int)",
+ "referenced_type" : "_ZTIFiPK13native_handlexPvjE",
+ "self_type" : "_ZTIPFiPK13native_handlexPvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE",
+ "name" : "void (*)(void *, AIMapper_MetadataType, const void *, unsigned int)",
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "self_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFvPvE",
+ "name" : "void (*)(void *)",
+ "referenced_type" : "_ZTIFvPvE",
+ "self_type" : "_ZTIPFvPvE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPK13native_handle",
+ "name" : "const native_handle *",
+ "referenced_type" : "_ZTIK13native_handle",
+ "self_type" : "_ZTIPK13native_handle",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription *",
+ "referenced_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPKc",
+ "name" : "const char *",
+ "referenced_type" : "_ZTIKc",
+ "self_type" : "_ZTIPKc",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPKv",
+ "name" : "const void *",
+ "referenced_type" : "_ZTIKv",
+ "self_type" : "_ZTIPKv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPP8AIMapper",
+ "name" : "AIMapper **",
+ "referenced_type" : "_ZTIP8AIMapper",
+ "self_type" : "_ZTIPP8AIMapper",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPK13native_handle",
+ "name" : "const native_handle **",
+ "referenced_type" : "_ZTIPK13native_handle",
+ "self_type" : "_ZTIPPK13native_handle",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription **",
+ "referenced_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPv",
+ "name" : "void **",
+ "referenced_type" : "_ZTIPv",
+ "self_type" : "_ZTIPPv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPi",
+ "name" : "int *",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIPi",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPj",
+ "name" : "unsigned int *",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIPj",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPv",
+ "name" : "void *",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIPv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPy",
+ "name" : "unsigned long long *",
+ "referenced_type" : "_ZTIy",
+ "self_type" : "_ZTIPy",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "qualified_types" :
+ [
+ {
+ "alignment" : 4,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK13native_handle",
+ "name" : "const native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTIK13native_handle",
+ "size" : 12,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "size" : 56,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 1,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKc",
+ "name" : "const char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIKc",
+ "size" : 1,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKv",
+ "name" : "const void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIKv",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "record_types" :
+ [
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "importBuffer",
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E"
+ },
+ {
+ "field_name" : "freeBuffer",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getTransportSize",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E"
+ },
+ {
+ "field_name" : "lock",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE"
+ },
+ {
+ "field_name" : "unlock",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE"
+ },
+ {
+ "field_name" : "flushLockedBuffer",
+ "field_offset" : 160,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "rereadLockedBuffer",
+ "field_offset" : 192,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getMetadata",
+ "field_offset" : 224,
+ "referenced_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE"
+ },
+ {
+ "field_name" : "getStandardMetadata",
+ "field_offset" : 256,
+ "referenced_type" : "_ZTIPFiPK13native_handlexPvjE"
+ },
+ {
+ "field_name" : "setMetadata",
+ "field_offset" : 288,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "field_name" : "setStandardMetadata",
+ "field_offset" : 320,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE"
+ },
+ {
+ "field_name" : "listSupportedMetadataTypes",
+ "field_offset" : 352,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE"
+ },
+ {
+ "field_name" : "dumpBuffer",
+ "field_offset" : 384,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E"
+ },
+ {
+ "field_name" : "dumpAllBuffers",
+ "field_offset" : 416,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E"
+ },
+ {
+ "field_name" : "getReservedRegion",
+ "field_offset" : 448,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE"
+ }
+ ],
+ "linker_set_key" : "_ZTI10AIMapperV5",
+ "name" : "AIMapperV5",
+ "referenced_type" : "_ZTI10AIMapperV5",
+ "self_type" : "_ZTI10AIMapperV5",
+ "size" : 60,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "__clang_max_align_nonce1",
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "field_name" : "__clang_max_align_nonce2",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIe"
+ }
+ ],
+ "linker_set_key" : "_ZTI11max_align_t",
+ "name" : "max_align_t",
+ "referenced_type" : "_ZTI11max_align_t",
+ "self_type" : "_ZTI11max_align_t",
+ "size" : 16,
+ "source_file" : "prebuilts/clang-tools/linux-x86/clang-headers/__stddef_max_align_t.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numFds",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numInts",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "data",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIA0_i"
+ }
+ ],
+ "linker_set_key" : "_ZTI13native_handle",
+ "name" : "native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTI13native_handle",
+ "size" : 12,
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "name",
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "value",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIx"
+ }
+ ],
+ "linker_set_key" : "_ZTI21AIMapper_MetadataType",
+ "name" : "AIMapper_MetadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType",
+ "self_type" : "_ZTI21AIMapper_MetadataType",
+ "size" : 16,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "metadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "field_name" : "description",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "isGettable",
+ "field_offset" : 160,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "isSettable",
+ "field_offset" : 168,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "reserved",
+ "field_offset" : 176,
+ "referenced_type" : "_ZTIA32_h"
+ }
+ ],
+ "linker_set_key" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "name" : "AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "size" : 56,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "left",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "top",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "right",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "bottom",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIi"
+ }
+ ],
+ "linker_set_key" : "_ZTI5ARect",
+ "name" : "ARect",
+ "referenced_type" : "_ZTI5ARect",
+ "self_type" : "_ZTI5ARect",
+ "size" : 16,
+ "source_file" : "frameworks/native/libs/arect/include/android/rect.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTI16AIMapper_Version"
+ },
+ {
+ "field_name" : "v5",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTI10AIMapperV5"
+ }
+ ],
+ "linker_set_key" : "_ZTI8AIMapper",
+ "name" : "AIMapper",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTI8AIMapper",
+ "size" : 64,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/graphics/mapper/stable-c/abi-dumps/x86/source-based/libimapper_stablec_abicheck.so.lsdump b/graphics/mapper/stable-c/abi-dumps/x86/source-based/libimapper_stablec_abicheck.so.lsdump
new file mode 100644
index 0000000..3eca8c3
--- /dev/null
+++ b/graphics/mapper/stable-c/abi-dumps/x86/source-based/libimapper_stablec_abicheck.so.lsdump
@@ -0,0 +1,1052 @@
+{
+ "array_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIA0_i",
+ "name" : "int[0]",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIA0_i",
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 1,
+ "linker_set_key" : "_ZTIA32_h",
+ "name" : "unsigned char[32]",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIA32_h",
+ "size" : 32,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "builtin_types" :
+ [
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIb",
+ "name" : "bool",
+ "referenced_type" : "_ZTIb",
+ "self_type" : "_ZTIb",
+ "size" : 1
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIc",
+ "name" : "char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIc",
+ "size" : 1
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIe",
+ "name" : "long double",
+ "referenced_type" : "_ZTIe",
+ "self_type" : "_ZTIe",
+ "size" : 8
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIh",
+ "name" : "unsigned char",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIh",
+ "size" : 1
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIi",
+ "name" : "int",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIi",
+ "size" : 4
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIj",
+ "name" : "unsigned int",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIj",
+ "size" : 4
+ },
+ {
+ "linker_set_key" : "_ZTIv",
+ "name" : "void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIv"
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIx",
+ "name" : "long long",
+ "referenced_type" : "_ZTIx",
+ "self_type" : "_ZTIx",
+ "size" : 8
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIy",
+ "name" : "unsigned long long",
+ "referenced_type" : "_ZTIy",
+ "self_type" : "_ZTIy",
+ "size" : 8
+ }
+ ],
+ "elf_functions" :
+ [
+ {
+ "name" : "AIMapper_loadIMapper"
+ }
+ ],
+ "elf_objects" : [],
+ "enum_types" :
+ [
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 0,
+ "name" : "AIMAPPER_ERROR_NONE"
+ },
+ {
+ "enum_field_value" : 1,
+ "name" : "AIMAPPER_ERROR_BAD_DESCRIPTOR"
+ },
+ {
+ "enum_field_value" : 2,
+ "name" : "AIMAPPER_ERROR_BAD_BUFFER"
+ },
+ {
+ "enum_field_value" : 3,
+ "name" : "AIMAPPER_ERROR_BAD_VALUE"
+ },
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_ERROR_NO_RESOURCES"
+ },
+ {
+ "enum_field_value" : 7,
+ "name" : "AIMAPPER_ERROR_UNSUPPORTED"
+ }
+ ],
+ "linker_set_key" : "_ZTI14AIMapper_Error",
+ "name" : "AIMapper_Error",
+ "referenced_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTI14AIMapper_Error",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIi"
+ },
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_VERSION_5"
+ }
+ ],
+ "linker_set_key" : "_ZTI16AIMapper_Version",
+ "name" : "AIMapper_Version",
+ "referenced_type" : "_ZTI16AIMapper_Version",
+ "self_type" : "_ZTI16AIMapper_Version",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIj"
+ }
+ ],
+ "function_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "name" : "AIMapper_Error (void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPFvPvE"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "name" : "AIMapper_Error (const native_handle *, AIMapper_MetadataType, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (const native_handle *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "name" : "AIMapper_Error (const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "name" : "AIMapper_Error (const native_handle *, void **, unsigned long long *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ },
+ {
+ "referenced_type" : "_ZTIPy"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (const native_handle *, const native_handle **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (const native_handle *, int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPi"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (const native_handle *, unsigned int *, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "name" : "AIMapper_Error (const native_handle *, long long, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "name" : "AIMapper_Error (const native_handle *, unsigned long long, ARect, int, void **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIy"
+ },
+ {
+ "referenced_type" : "_ZTI5ARect"
+ },
+ {
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "name" : "AIMapper_Error (const AIMapper_MetadataTypeDescription **, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "name" : "int (const native_handle *, AIMapper_MetadataType, void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handlexPvjE",
+ "name" : "int (const native_handle *, long long, void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handlexPvjE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handlexPvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "name" : "void (void *, AIMapper_MetadataType, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPvE",
+ "name" : "void (void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPvE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "functions" :
+ [
+ {
+ "function_name" : "AIMapper_loadIMapper",
+ "linker_set_key" : "AIMapper_loadIMapper",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPP8AIMapper"
+ }
+ ],
+ "return_type" : "_ZTI14AIMapper_Error",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIP8AIMapper",
+ "name" : "AIMapper *",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTIP8AIMapper",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "name" : "AIMapper_Error (*)(void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "name" : "AIMapper_Error (*)(const native_handle *, AIMapper_MetadataType, const void *, unsigned int)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (*)(const native_handle *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "name" : "AIMapper_Error (*)(const native_handle *, void **, unsigned long long *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, const native_handle **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (*)(const native_handle *, int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned int *, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "name" : "AIMapper_Error (*)(const native_handle *, long long, const void *, unsigned int)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned long long, ARect, int, void **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "name" : "AIMapper_Error (*)(const AIMapper_MetadataTypeDescription **, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "name" : "int (*)(const native_handle *, AIMapper_MetadataType, void *, unsigned int)",
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "self_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFiPK13native_handlexPvjE",
+ "name" : "int (*)(const native_handle *, long long, void *, unsigned int)",
+ "referenced_type" : "_ZTIFiPK13native_handlexPvjE",
+ "self_type" : "_ZTIPFiPK13native_handlexPvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE",
+ "name" : "void (*)(void *, AIMapper_MetadataType, const void *, unsigned int)",
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "self_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFvPvE",
+ "name" : "void (*)(void *)",
+ "referenced_type" : "_ZTIFvPvE",
+ "self_type" : "_ZTIPFvPvE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPK13native_handle",
+ "name" : "const native_handle *",
+ "referenced_type" : "_ZTIK13native_handle",
+ "self_type" : "_ZTIPK13native_handle",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription *",
+ "referenced_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPKc",
+ "name" : "const char *",
+ "referenced_type" : "_ZTIKc",
+ "self_type" : "_ZTIPKc",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPKv",
+ "name" : "const void *",
+ "referenced_type" : "_ZTIKv",
+ "self_type" : "_ZTIPKv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPP8AIMapper",
+ "name" : "AIMapper **",
+ "referenced_type" : "_ZTIP8AIMapper",
+ "self_type" : "_ZTIPP8AIMapper",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPK13native_handle",
+ "name" : "const native_handle **",
+ "referenced_type" : "_ZTIPK13native_handle",
+ "self_type" : "_ZTIPPK13native_handle",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription **",
+ "referenced_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPv",
+ "name" : "void **",
+ "referenced_type" : "_ZTIPv",
+ "self_type" : "_ZTIPPv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPi",
+ "name" : "int *",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIPi",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPj",
+ "name" : "unsigned int *",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIPj",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPv",
+ "name" : "void *",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIPv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPy",
+ "name" : "unsigned long long *",
+ "referenced_type" : "_ZTIy",
+ "self_type" : "_ZTIPy",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "qualified_types" :
+ [
+ {
+ "alignment" : 4,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK13native_handle",
+ "name" : "const native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTIK13native_handle",
+ "size" : 12,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "size" : 52,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 1,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKc",
+ "name" : "const char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIKc",
+ "size" : 1,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKv",
+ "name" : "const void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIKv",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "record_types" :
+ [
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "importBuffer",
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E"
+ },
+ {
+ "field_name" : "freeBuffer",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getTransportSize",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E"
+ },
+ {
+ "field_name" : "lock",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE"
+ },
+ {
+ "field_name" : "unlock",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE"
+ },
+ {
+ "field_name" : "flushLockedBuffer",
+ "field_offset" : 160,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "rereadLockedBuffer",
+ "field_offset" : 192,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getMetadata",
+ "field_offset" : 224,
+ "referenced_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE"
+ },
+ {
+ "field_name" : "getStandardMetadata",
+ "field_offset" : 256,
+ "referenced_type" : "_ZTIPFiPK13native_handlexPvjE"
+ },
+ {
+ "field_name" : "setMetadata",
+ "field_offset" : 288,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "field_name" : "setStandardMetadata",
+ "field_offset" : 320,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE"
+ },
+ {
+ "field_name" : "listSupportedMetadataTypes",
+ "field_offset" : 352,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE"
+ },
+ {
+ "field_name" : "dumpBuffer",
+ "field_offset" : 384,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E"
+ },
+ {
+ "field_name" : "dumpAllBuffers",
+ "field_offset" : 416,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E"
+ },
+ {
+ "field_name" : "getReservedRegion",
+ "field_offset" : 448,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE"
+ }
+ ],
+ "linker_set_key" : "_ZTI10AIMapperV5",
+ "name" : "AIMapperV5",
+ "referenced_type" : "_ZTI10AIMapperV5",
+ "self_type" : "_ZTI10AIMapperV5",
+ "size" : 60,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "__clang_max_align_nonce1",
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "field_name" : "__clang_max_align_nonce2",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIe"
+ }
+ ],
+ "linker_set_key" : "_ZTI11max_align_t",
+ "name" : "max_align_t",
+ "referenced_type" : "_ZTI11max_align_t",
+ "self_type" : "_ZTI11max_align_t",
+ "size" : 16,
+ "source_file" : "prebuilts/clang-tools/linux-x86/clang-headers/__stddef_max_align_t.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numFds",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numInts",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "data",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIA0_i"
+ }
+ ],
+ "linker_set_key" : "_ZTI13native_handle",
+ "name" : "native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTI13native_handle",
+ "size" : 12,
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "name",
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "value",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIx"
+ }
+ ],
+ "linker_set_key" : "_ZTI21AIMapper_MetadataType",
+ "name" : "AIMapper_MetadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType",
+ "self_type" : "_ZTI21AIMapper_MetadataType",
+ "size" : 12,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "metadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "field_name" : "description",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "isGettable",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "isSettable",
+ "field_offset" : 136,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "reserved",
+ "field_offset" : 144,
+ "referenced_type" : "_ZTIA32_h"
+ }
+ ],
+ "linker_set_key" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "name" : "AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "size" : 52,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "left",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "top",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "right",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "bottom",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIi"
+ }
+ ],
+ "linker_set_key" : "_ZTI5ARect",
+ "name" : "ARect",
+ "referenced_type" : "_ZTI5ARect",
+ "self_type" : "_ZTI5ARect",
+ "size" : 16,
+ "source_file" : "frameworks/native/libs/arect/include/android/rect.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTI16AIMapper_Version"
+ },
+ {
+ "field_name" : "v5",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTI10AIMapperV5"
+ }
+ ],
+ "linker_set_key" : "_ZTI8AIMapper",
+ "name" : "AIMapper",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTI8AIMapper",
+ "size" : 64,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/graphics/mapper/stable-c/abi-dumps/x86_64/source-based/libimapper_stablec_abicheck.so.lsdump b/graphics/mapper/stable-c/abi-dumps/x86_64/source-based/libimapper_stablec_abicheck.so.lsdump
new file mode 100644
index 0000000..c42e20a
--- /dev/null
+++ b/graphics/mapper/stable-c/abi-dumps/x86_64/source-based/libimapper_stablec_abicheck.so.lsdump
@@ -0,0 +1,1061 @@
+{
+ "array_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIA0_i",
+ "name" : "int[0]",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIA0_i",
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 1,
+ "linker_set_key" : "_ZTIA32_h",
+ "name" : "unsigned char[32]",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIA32_h",
+ "size" : 32,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "builtin_types" :
+ [
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIb",
+ "name" : "bool",
+ "referenced_type" : "_ZTIb",
+ "self_type" : "_ZTIb",
+ "size" : 1
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIc",
+ "name" : "char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIc",
+ "size" : 1
+ },
+ {
+ "alignment" : 16,
+ "linker_set_key" : "_ZTIg",
+ "name" : "long double",
+ "referenced_type" : "_ZTIg",
+ "self_type" : "_ZTIg",
+ "size" : 16
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIh",
+ "name" : "unsigned char",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIh",
+ "size" : 1
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIi",
+ "name" : "int",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIi",
+ "size" : 4
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIj",
+ "name" : "unsigned int",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIj",
+ "size" : 4
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIl",
+ "name" : "long",
+ "referenced_type" : "_ZTIl",
+ "self_type" : "_ZTIl",
+ "size" : 8
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIm",
+ "name" : "unsigned long",
+ "referenced_type" : "_ZTIm",
+ "self_type" : "_ZTIm",
+ "size" : 8
+ },
+ {
+ "linker_set_key" : "_ZTIv",
+ "name" : "void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIv"
+ },
+ {
+ "alignment" : 8,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIx",
+ "name" : "long long",
+ "referenced_type" : "_ZTIx",
+ "self_type" : "_ZTIx",
+ "size" : 8
+ }
+ ],
+ "elf_functions" :
+ [
+ {
+ "name" : "AIMapper_loadIMapper"
+ }
+ ],
+ "elf_objects" : [],
+ "enum_types" :
+ [
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 0,
+ "name" : "AIMAPPER_ERROR_NONE"
+ },
+ {
+ "enum_field_value" : 1,
+ "name" : "AIMAPPER_ERROR_BAD_DESCRIPTOR"
+ },
+ {
+ "enum_field_value" : 2,
+ "name" : "AIMAPPER_ERROR_BAD_BUFFER"
+ },
+ {
+ "enum_field_value" : 3,
+ "name" : "AIMAPPER_ERROR_BAD_VALUE"
+ },
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_ERROR_NO_RESOURCES"
+ },
+ {
+ "enum_field_value" : 7,
+ "name" : "AIMAPPER_ERROR_UNSUPPORTED"
+ }
+ ],
+ "linker_set_key" : "_ZTI14AIMapper_Error",
+ "name" : "AIMapper_Error",
+ "referenced_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTI14AIMapper_Error",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIi"
+ },
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_VERSION_5"
+ }
+ ],
+ "linker_set_key" : "_ZTI16AIMapper_Version",
+ "name" : "AIMapper_Version",
+ "referenced_type" : "_ZTI16AIMapper_Version",
+ "self_type" : "_ZTI16AIMapper_Version",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIj"
+ }
+ ],
+ "function_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "name" : "AIMapper_Error (void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned long), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPFvPvE"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvmE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "name" : "AIMapper_Error (const native_handle *, AIMapper_MetadataType, const void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (const native_handle *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "name" : "AIMapper_Error (const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned long), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvmE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "name" : "AIMapper_Error (const native_handle *, void **, unsigned long *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ },
+ {
+ "referenced_type" : "_ZTIPm"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (const native_handle *, const native_handle **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (const native_handle *, int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPi"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (const native_handle *, unsigned int *, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "name" : "AIMapper_Error (const native_handle *, long, const void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIl"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "name" : "AIMapper_Error (const native_handle *, unsigned long, ARect, int, void **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ },
+ {
+ "referenced_type" : "_ZTI5ARect"
+ },
+ {
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "name" : "AIMapper_Error (const AIMapper_MetadataTypeDescription **, unsigned long *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription"
+ },
+ {
+ "referenced_type" : "_ZTIPm"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "name" : "int (const native_handle *, AIMapper_MetadataType, void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handlelPvmE",
+ "name" : "int (const native_handle *, long, void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIl"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handlelPvmE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handlelPvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPv21AIMapper_MetadataTypePKvmE",
+ "name" : "void (void *, AIMapper_MetadataType, const void *, unsigned long)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIm"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvmE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvmE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPvE",
+ "name" : "void (void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPvE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "functions" :
+ [
+ {
+ "function_name" : "AIMapper_loadIMapper",
+ "linker_set_key" : "AIMapper_loadIMapper",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPP8AIMapper"
+ }
+ ],
+ "return_type" : "_ZTI14AIMapper_Error",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIP8AIMapper",
+ "name" : "AIMapper *",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTIP8AIMapper",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "name" : "AIMapper_Error (*)(void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned long), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "name" : "AIMapper_Error (*)(const native_handle *, AIMapper_MetadataType, const void *, unsigned long)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (*)(const native_handle *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned long), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "name" : "AIMapper_Error (*)(const native_handle *, void **, unsigned long *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, const native_handle **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (*)(const native_handle *, int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned int *, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "name" : "AIMapper_Error (*)(const native_handle *, long, const void *, unsigned long)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlelPKvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned long, ARect, int, void **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlem5ARectiPPvE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "name" : "AIMapper_Error (*)(const AIMapper_MetadataTypeDescription **, unsigned long *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "name" : "int (*)(const native_handle *, AIMapper_MetadataType, void *, unsigned long)",
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "self_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPFiPK13native_handlelPvmE",
+ "name" : "int (*)(const native_handle *, long, void *, unsigned long)",
+ "referenced_type" : "_ZTIFiPK13native_handlelPvmE",
+ "self_type" : "_ZTIPFiPK13native_handlelPvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPFvPv21AIMapper_MetadataTypePKvmE",
+ "name" : "void (*)(void *, AIMapper_MetadataType, const void *, unsigned long)",
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvmE",
+ "self_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvmE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPFvPvE",
+ "name" : "void (*)(void *)",
+ "referenced_type" : "_ZTIFvPvE",
+ "self_type" : "_ZTIPFvPvE",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPK13native_handle",
+ "name" : "const native_handle *",
+ "referenced_type" : "_ZTIK13native_handle",
+ "self_type" : "_ZTIPK13native_handle",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription *",
+ "referenced_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPKc",
+ "name" : "const char *",
+ "referenced_type" : "_ZTIKc",
+ "self_type" : "_ZTIPKc",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPKv",
+ "name" : "const void *",
+ "referenced_type" : "_ZTIKv",
+ "self_type" : "_ZTIPKv",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPP8AIMapper",
+ "name" : "AIMapper **",
+ "referenced_type" : "_ZTIP8AIMapper",
+ "self_type" : "_ZTIPP8AIMapper",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPPK13native_handle",
+ "name" : "const native_handle **",
+ "referenced_type" : "_ZTIPK13native_handle",
+ "self_type" : "_ZTIPPK13native_handle",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription **",
+ "referenced_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPPv",
+ "name" : "void **",
+ "referenced_type" : "_ZTIPv",
+ "self_type" : "_ZTIPPv",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPi",
+ "name" : "int *",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIPi",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPj",
+ "name" : "unsigned int *",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIPj",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPm",
+ "name" : "unsigned long *",
+ "referenced_type" : "_ZTIm",
+ "self_type" : "_ZTIPm",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "linker_set_key" : "_ZTIPv",
+ "name" : "void *",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIPv",
+ "size" : 8,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "qualified_types" :
+ [
+ {
+ "alignment" : 4,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK13native_handle",
+ "name" : "const native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTIK13native_handle",
+ "size" : 12,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "size" : 64,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 1,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKc",
+ "name" : "const char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIKc",
+ "size" : 1,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKv",
+ "name" : "const void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIKv",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "record_types" :
+ [
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "importBuffer",
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E"
+ },
+ {
+ "field_name" : "freeBuffer",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getTransportSize",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E"
+ },
+ {
+ "field_name" : "lock",
+ "field_offset" : 192,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlem5ARectiPPvE"
+ },
+ {
+ "field_name" : "unlock",
+ "field_offset" : 256,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE"
+ },
+ {
+ "field_name" : "flushLockedBuffer",
+ "field_offset" : 320,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "rereadLockedBuffer",
+ "field_offset" : 384,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getMetadata",
+ "field_offset" : 448,
+ "referenced_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvmE"
+ },
+ {
+ "field_name" : "getStandardMetadata",
+ "field_offset" : 512,
+ "referenced_type" : "_ZTIPFiPK13native_handlelPvmE"
+ },
+ {
+ "field_name" : "setMetadata",
+ "field_offset" : 576,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvmE"
+ },
+ {
+ "field_name" : "setStandardMetadata",
+ "field_offset" : 640,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlelPKvmE"
+ },
+ {
+ "field_name" : "listSupportedMetadataTypes",
+ "field_offset" : 704,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPmE"
+ },
+ {
+ "field_name" : "dumpBuffer",
+ "field_offset" : 768,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvmES3_E"
+ },
+ {
+ "field_name" : "dumpAllBuffers",
+ "field_offset" : 832,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvmES0_E"
+ },
+ {
+ "field_name" : "getReservedRegion",
+ "field_offset" : 896,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPmE"
+ }
+ ],
+ "linker_set_key" : "_ZTI10AIMapperV5",
+ "name" : "AIMapperV5",
+ "referenced_type" : "_ZTI10AIMapperV5",
+ "self_type" : "_ZTI10AIMapperV5",
+ "size" : 120,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 16,
+ "fields" :
+ [
+ {
+ "field_name" : "__clang_max_align_nonce1",
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "field_name" : "__clang_max_align_nonce2",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIg"
+ }
+ ],
+ "linker_set_key" : "_ZTI11max_align_t",
+ "name" : "max_align_t",
+ "referenced_type" : "_ZTI11max_align_t",
+ "self_type" : "_ZTI11max_align_t",
+ "size" : 32,
+ "source_file" : "prebuilts/clang-tools/linux-x86/clang-headers/__stddef_max_align_t.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numFds",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numInts",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "data",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIA0_i"
+ }
+ ],
+ "linker_set_key" : "_ZTI13native_handle",
+ "name" : "native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTI13native_handle",
+ "size" : 12,
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "name",
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "value",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIl"
+ }
+ ],
+ "linker_set_key" : "_ZTI21AIMapper_MetadataType",
+ "name" : "AIMapper_MetadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType",
+ "self_type" : "_ZTI21AIMapper_MetadataType",
+ "size" : 16,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "metadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "field_name" : "description",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "isGettable",
+ "field_offset" : 192,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "isSettable",
+ "field_offset" : 200,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "reserved",
+ "field_offset" : 208,
+ "referenced_type" : "_ZTIA32_h"
+ }
+ ],
+ "linker_set_key" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "name" : "AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "size" : 64,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "left",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "top",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "right",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "bottom",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIi"
+ }
+ ],
+ "linker_set_key" : "_ZTI5ARect",
+ "name" : "ARect",
+ "referenced_type" : "_ZTI5ARect",
+ "self_type" : "_ZTI5ARect",
+ "size" : 16,
+ "source_file" : "frameworks/native/libs/arect/include/android/rect.h"
+ },
+ {
+ "alignment" : 16,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTI16AIMapper_Version"
+ },
+ {
+ "field_name" : "v5",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTI10AIMapperV5"
+ }
+ ],
+ "linker_set_key" : "_ZTI8AIMapper",
+ "name" : "AIMapper",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTI8AIMapper",
+ "size" : 128,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/graphics/mapper/stable-c/abi-dumps/x86_x86_64/source-based/libimapper_stablec_abicheck.so.lsdump b/graphics/mapper/stable-c/abi-dumps/x86_x86_64/source-based/libimapper_stablec_abicheck.so.lsdump
new file mode 100644
index 0000000..3eca8c3
--- /dev/null
+++ b/graphics/mapper/stable-c/abi-dumps/x86_x86_64/source-based/libimapper_stablec_abicheck.so.lsdump
@@ -0,0 +1,1052 @@
+{
+ "array_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIA0_i",
+ "name" : "int[0]",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIA0_i",
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 1,
+ "linker_set_key" : "_ZTIA32_h",
+ "name" : "unsigned char[32]",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIA32_h",
+ "size" : 32,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "builtin_types" :
+ [
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIb",
+ "name" : "bool",
+ "referenced_type" : "_ZTIb",
+ "self_type" : "_ZTIb",
+ "size" : 1
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIc",
+ "name" : "char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIc",
+ "size" : 1
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIe",
+ "name" : "long double",
+ "referenced_type" : "_ZTIe",
+ "self_type" : "_ZTIe",
+ "size" : 8
+ },
+ {
+ "alignment" : 1,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIh",
+ "name" : "unsigned char",
+ "referenced_type" : "_ZTIh",
+ "self_type" : "_ZTIh",
+ "size" : 1
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIi",
+ "name" : "int",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIi",
+ "size" : 4
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIj",
+ "name" : "unsigned int",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIj",
+ "size" : 4
+ },
+ {
+ "linker_set_key" : "_ZTIv",
+ "name" : "void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIv"
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "linker_set_key" : "_ZTIx",
+ "name" : "long long",
+ "referenced_type" : "_ZTIx",
+ "self_type" : "_ZTIx",
+ "size" : 8
+ },
+ {
+ "alignment" : 4,
+ "is_integral" : true,
+ "is_unsigned" : true,
+ "linker_set_key" : "_ZTIy",
+ "name" : "unsigned long long",
+ "referenced_type" : "_ZTIy",
+ "self_type" : "_ZTIy",
+ "size" : 8
+ }
+ ],
+ "elf_functions" :
+ [
+ {
+ "name" : "AIMapper_loadIMapper"
+ }
+ ],
+ "elf_objects" : [],
+ "enum_types" :
+ [
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 0,
+ "name" : "AIMAPPER_ERROR_NONE"
+ },
+ {
+ "enum_field_value" : 1,
+ "name" : "AIMAPPER_ERROR_BAD_DESCRIPTOR"
+ },
+ {
+ "enum_field_value" : 2,
+ "name" : "AIMAPPER_ERROR_BAD_BUFFER"
+ },
+ {
+ "enum_field_value" : 3,
+ "name" : "AIMAPPER_ERROR_BAD_VALUE"
+ },
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_ERROR_NO_RESOURCES"
+ },
+ {
+ "enum_field_value" : 7,
+ "name" : "AIMAPPER_ERROR_UNSUPPORTED"
+ }
+ ],
+ "linker_set_key" : "_ZTI14AIMapper_Error",
+ "name" : "AIMapper_Error",
+ "referenced_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTI14AIMapper_Error",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIi"
+ },
+ {
+ "alignment" : 4,
+ "enum_fields" :
+ [
+ {
+ "enum_field_value" : 5,
+ "name" : "AIMAPPER_VERSION_5"
+ }
+ ],
+ "linker_set_key" : "_ZTI16AIMapper_Version",
+ "name" : "AIMapper_Version",
+ "referenced_type" : "_ZTI16AIMapper_Version",
+ "self_type" : "_ZTI16AIMapper_Version",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h",
+ "underlying_type" : "_ZTIj"
+ }
+ ],
+ "function_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "name" : "AIMapper_Error (void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPFvPvE"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "name" : "AIMapper_Error (const native_handle *, AIMapper_MetadataType, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (const native_handle *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "name" : "AIMapper_Error (const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "name" : "AIMapper_Error (const native_handle *, void **, unsigned long long *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ },
+ {
+ "referenced_type" : "_ZTIPy"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (const native_handle *, const native_handle **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPPK13native_handle"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (const native_handle *, int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPi"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (const native_handle *, unsigned int *, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "name" : "AIMapper_Error (const native_handle *, long long, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "name" : "AIMapper_Error (const native_handle *, unsigned long long, ARect, int, void **)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIy"
+ },
+ {
+ "referenced_type" : "_ZTI5ARect"
+ },
+ {
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "referenced_type" : "_ZTIPPv"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "name" : "AIMapper_Error (const AIMapper_MetadataTypeDescription **, unsigned int *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription"
+ },
+ {
+ "referenced_type" : "_ZTIPj"
+ }
+ ],
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "return_type" : "_ZTI14AIMapper_Error",
+ "self_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "name" : "int (const native_handle *, AIMapper_MetadataType, void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFiPK13native_handlexPvjE",
+ "name" : "int (const native_handle *, long long, void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPK13native_handle"
+ },
+ {
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFiPK13native_handlexPvjE",
+ "return_type" : "_ZTIi",
+ "self_type" : "_ZTIFiPK13native_handlexPvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "name" : "void (void *, AIMapper_MetadataType, const void *, unsigned int)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ },
+ {
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "referenced_type" : "_ZTIPKv"
+ },
+ {
+ "referenced_type" : "_ZTIj"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIFvPvE",
+ "name" : "void (void *)",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPv"
+ }
+ ],
+ "referenced_type" : "_ZTIFvPvE",
+ "return_type" : "_ZTIv",
+ "self_type" : "_ZTIFvPvE",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "functions" :
+ [
+ {
+ "function_name" : "AIMapper_loadIMapper",
+ "linker_set_key" : "AIMapper_loadIMapper",
+ "parameters" :
+ [
+ {
+ "referenced_type" : "_ZTIPP8AIMapper"
+ }
+ ],
+ "return_type" : "_ZTI14AIMapper_Error",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "global_vars" : [],
+ "lvalue_reference_types" : [],
+ "pointer_types" :
+ [
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIP8AIMapper",
+ "name" : "AIMapper *",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTIP8AIMapper",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "name" : "AIMapper_Error (*)(void (*)(void *), void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "name" : "AIMapper_Error (*)(const native_handle *, AIMapper_MetadataType, const void *, unsigned int)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "name" : "AIMapper_Error (*)(const native_handle *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handleE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, void (*)(void *, AIMapper_MetadataType, const void *, unsigned int), void *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "name" : "AIMapper_Error (*)(const native_handle *, void **, unsigned long long *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, const native_handle **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePS2_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "name" : "AIMapper_Error (*)(const native_handle *, int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePiE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned int *, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "name" : "AIMapper_Error (*)(const native_handle *, long long, const void *, unsigned int)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "name" : "AIMapper_Error (*)(const native_handle *, unsigned long long, ARect, int, void **)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "name" : "AIMapper_Error (*)(const AIMapper_MetadataTypeDescription **, unsigned int *)",
+ "referenced_type" : "_ZTIF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "self_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "name" : "int (*)(const native_handle *, AIMapper_MetadataType, void *, unsigned int)",
+ "referenced_type" : "_ZTIFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "self_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFiPK13native_handlexPvjE",
+ "name" : "int (*)(const native_handle *, long long, void *, unsigned int)",
+ "referenced_type" : "_ZTIFiPK13native_handlexPvjE",
+ "self_type" : "_ZTIPFiPK13native_handlexPvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE",
+ "name" : "void (*)(void *, AIMapper_MetadataType, const void *, unsigned int)",
+ "referenced_type" : "_ZTIFvPv21AIMapper_MetadataTypePKvjE",
+ "self_type" : "_ZTIPFvPv21AIMapper_MetadataTypePKvjE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPFvPvE",
+ "name" : "void (*)(void *)",
+ "referenced_type" : "_ZTIFvPvE",
+ "self_type" : "_ZTIPFvPvE",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPK13native_handle",
+ "name" : "const native_handle *",
+ "referenced_type" : "_ZTIK13native_handle",
+ "self_type" : "_ZTIPK13native_handle",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription *",
+ "referenced_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPKc",
+ "name" : "const char *",
+ "referenced_type" : "_ZTIKc",
+ "self_type" : "_ZTIPKc",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPKv",
+ "name" : "const void *",
+ "referenced_type" : "_ZTIKv",
+ "self_type" : "_ZTIPKv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPP8AIMapper",
+ "name" : "AIMapper **",
+ "referenced_type" : "_ZTIP8AIMapper",
+ "self_type" : "_ZTIPP8AIMapper",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPK13native_handle",
+ "name" : "const native_handle **",
+ "referenced_type" : "_ZTIPK13native_handle",
+ "self_type" : "_ZTIPPK13native_handle",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription **",
+ "referenced_type" : "_ZTIPK32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIPPK32AIMapper_MetadataTypeDescription",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPPv",
+ "name" : "void **",
+ "referenced_type" : "_ZTIPv",
+ "self_type" : "_ZTIPPv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPi",
+ "name" : "int *",
+ "referenced_type" : "_ZTIi",
+ "self_type" : "_ZTIPi",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPj",
+ "name" : "unsigned int *",
+ "referenced_type" : "_ZTIj",
+ "self_type" : "_ZTIPj",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPv",
+ "name" : "void *",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIPv",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "linker_set_key" : "_ZTIPy",
+ "name" : "unsigned long long *",
+ "referenced_type" : "_ZTIy",
+ "self_type" : "_ZTIPy",
+ "size" : 4,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "qualified_types" :
+ [
+ {
+ "alignment" : 4,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK13native_handle",
+ "name" : "const native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTIK13native_handle",
+ "size" : 12,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "name" : "const AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTIK32AIMapper_MetadataTypeDescription",
+ "size" : 52,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 1,
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKc",
+ "name" : "const char",
+ "referenced_type" : "_ZTIc",
+ "self_type" : "_ZTIKc",
+ "size" : 1,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "is_const" : true,
+ "linker_set_key" : "_ZTIKv",
+ "name" : "const void",
+ "referenced_type" : "_ZTIv",
+ "self_type" : "_ZTIKv",
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "record_types" :
+ [
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "importBuffer",
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePS2_E"
+ },
+ {
+ "field_name" : "freeBuffer",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getTransportSize",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePjS3_E"
+ },
+ {
+ "field_name" : "lock",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handley5ARectiPPvE"
+ },
+ {
+ "field_name" : "unlock",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePiE"
+ },
+ {
+ "field_name" : "flushLockedBuffer",
+ "field_offset" : 160,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "rereadLockedBuffer",
+ "field_offset" : 192,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handleE"
+ },
+ {
+ "field_name" : "getMetadata",
+ "field_offset" : 224,
+ "referenced_type" : "_ZTIPFiPK13native_handle21AIMapper_MetadataTypePvjE"
+ },
+ {
+ "field_name" : "getStandardMetadata",
+ "field_offset" : 256,
+ "referenced_type" : "_ZTIPFiPK13native_handlexPvjE"
+ },
+ {
+ "field_name" : "setMetadata",
+ "field_offset" : 288,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handle21AIMapper_MetadataTypePKvjE"
+ },
+ {
+ "field_name" : "setStandardMetadata",
+ "field_offset" : 320,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlexPKvjE"
+ },
+ {
+ "field_name" : "listSupportedMetadataTypes",
+ "field_offset" : 352,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPPK32AIMapper_MetadataTypeDescriptionPjE"
+ },
+ {
+ "field_name" : "dumpBuffer",
+ "field_offset" : 384,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePFvPv21AIMapper_MetadataTypePKvjES3_E"
+ },
+ {
+ "field_name" : "dumpAllBuffers",
+ "field_offset" : 416,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPFvPvEPFvS0_21AIMapper_MetadataTypePKvjES0_E"
+ },
+ {
+ "field_name" : "getReservedRegion",
+ "field_offset" : 448,
+ "referenced_type" : "_ZTIPF14AIMapper_ErrorPK13native_handlePPvPyE"
+ }
+ ],
+ "linker_set_key" : "_ZTI10AIMapperV5",
+ "name" : "AIMapperV5",
+ "referenced_type" : "_ZTI10AIMapperV5",
+ "self_type" : "_ZTI10AIMapperV5",
+ "size" : 60,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "__clang_max_align_nonce1",
+ "referenced_type" : "_ZTIx"
+ },
+ {
+ "field_name" : "__clang_max_align_nonce2",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIe"
+ }
+ ],
+ "linker_set_key" : "_ZTI11max_align_t",
+ "name" : "max_align_t",
+ "referenced_type" : "_ZTI11max_align_t",
+ "self_type" : "_ZTI11max_align_t",
+ "size" : 16,
+ "source_file" : "prebuilts/clang-tools/linux-x86/clang-headers/__stddef_max_align_t.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numFds",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "numInts",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "data",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIA0_i"
+ }
+ ],
+ "linker_set_key" : "_ZTI13native_handle",
+ "name" : "native_handle",
+ "referenced_type" : "_ZTI13native_handle",
+ "self_type" : "_ZTI13native_handle",
+ "size" : 12,
+ "source_file" : "system/core/include/cutils/native_handle.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "name",
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "value",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIx"
+ }
+ ],
+ "linker_set_key" : "_ZTI21AIMapper_MetadataType",
+ "name" : "AIMapper_MetadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType",
+ "self_type" : "_ZTI21AIMapper_MetadataType",
+ "size" : 12,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "metadataType",
+ "referenced_type" : "_ZTI21AIMapper_MetadataType"
+ },
+ {
+ "field_name" : "description",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIPKc"
+ },
+ {
+ "field_name" : "isGettable",
+ "field_offset" : 128,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "isSettable",
+ "field_offset" : 136,
+ "referenced_type" : "_ZTIb"
+ },
+ {
+ "field_name" : "reserved",
+ "field_offset" : 144,
+ "referenced_type" : "_ZTIA32_h"
+ }
+ ],
+ "linker_set_key" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "name" : "AIMapper_MetadataTypeDescription",
+ "referenced_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "self_type" : "_ZTI32AIMapper_MetadataTypeDescription",
+ "size" : 52,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ },
+ {
+ "alignment" : 4,
+ "fields" :
+ [
+ {
+ "field_name" : "left",
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "top",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "right",
+ "field_offset" : 64,
+ "referenced_type" : "_ZTIi"
+ },
+ {
+ "field_name" : "bottom",
+ "field_offset" : 96,
+ "referenced_type" : "_ZTIi"
+ }
+ ],
+ "linker_set_key" : "_ZTI5ARect",
+ "name" : "ARect",
+ "referenced_type" : "_ZTI5ARect",
+ "self_type" : "_ZTI5ARect",
+ "size" : 16,
+ "source_file" : "frameworks/native/libs/arect/include/android/rect.h"
+ },
+ {
+ "alignment" : 8,
+ "fields" :
+ [
+ {
+ "field_name" : "version",
+ "referenced_type" : "_ZTI16AIMapper_Version"
+ },
+ {
+ "field_name" : "v5",
+ "field_offset" : 32,
+ "referenced_type" : "_ZTI10AIMapperV5"
+ }
+ ],
+ "linker_set_key" : "_ZTI8AIMapper",
+ "name" : "AIMapper",
+ "referenced_type" : "_ZTI8AIMapper",
+ "self_type" : "_ZTI8AIMapper",
+ "size" : 64,
+ "source_file" : "hardware/interfaces/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h"
+ }
+ ],
+ "rvalue_reference_types" : []
+}
diff --git a/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h b/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h
index 75e436d..23de7b9 100644
--- a/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h
+++ b/graphics/mapper/stable-c/include/android/hardware/graphics/mapper/IMapper.h
@@ -87,7 +87,7 @@
*
* Vendor-provided metadata should be prefixed with a "vendor.mycompanyname.*" namespace. It is
* recommended that the metadata follows the pattern of StandardMetadaType.aidl. That is, an
- * aidl-defined enum with @VendorStability on it and the naming then matching that type such
+ * aidl-defined enum with @VintfStability on it and the naming then matching that type such
* as "vendor.mycompanyname.graphics.common.MetadataType" with the value field then set to the
* aidl's enum value.
*
diff --git a/graphics/mapper/stable-c/vts/VtsHalGraphicsMapperStableC_TargetTest.cpp b/graphics/mapper/stable-c/vts/VtsHalGraphicsMapperStableC_TargetTest.cpp
index b329de2..1e0c427 100644
--- a/graphics/mapper/stable-c/vts/VtsHalGraphicsMapperStableC_TargetTest.cpp
+++ b/graphics/mapper/stable-c/vts/VtsHalGraphicsMapperStableC_TargetTest.cpp
@@ -166,7 +166,8 @@
auto status = mAllocator->getIMapperLibrarySuffix(&mapperSuffix);
ASSERT_TRUE(status.isOk()) << "Failed to get IMapper library suffix";
std::string lib_name = "mapper." + mapperSuffix + ".so";
- void* so = android_load_sphal_library(lib_name.c_str(), RTLD_LOCAL | RTLD_NOW);
+ void* so = AServiceManager_openDeclaredPassthroughHal("mapper", mapperSuffix.c_str(),
+ RTLD_LOCAL | RTLD_NOW);
ASSERT_NE(nullptr, so) << "Failed to load " << lib_name;
mIMapperLoader = (AIMapper_loadIMapperFn)dlsym(so, "AIMapper_loadIMapper");
ASSERT_NE(nullptr, mIMapperLoader) << "AIMapper_locaIMapper missing from " << lib_name;
diff --git a/health/aidl/default/Health.cpp b/health/aidl/default/Health.cpp
index a16087c..8174bc8 100644
--- a/health/aidl/default/Health.cpp
+++ b/health/aidl/default/Health.cpp
@@ -232,6 +232,7 @@
} else {
::android::base::WriteStringToFd(res.getDescription(), fd);
}
+ ::android::base::WriteStringToFd("\n", fd);
fsync(fd);
return STATUS_OK;
diff --git a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
index 9360789..45a1e40 100644
--- a/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
+++ b/health/aidl/vts/functional/VtsHalHealthTargetTest.cpp
@@ -312,7 +312,8 @@
return true;
}
-/*
+/* @VsrTest = 3.2.015
+ *
* Tests the values returned by getBatteryHealthData() from interface IHealth.
*/
TEST_P(HealthAidl, getBatteryHealthData) {
diff --git a/identity/aidl/default/Android.bp b/identity/aidl/default/Android.bp
index 7bc3c8d..a1045c3 100644
--- a/identity/aidl/default/Android.bp
+++ b/identity/aidl/default/Android.bp
@@ -36,7 +36,7 @@
],
static_libs: [
"libbase",
- "libcppbor_external",
+ "libcppbor",
"libcppcose_rkp",
"libutils",
"libsoft_attestation_cert",
@@ -102,7 +102,7 @@
],
static_libs: [
"libbase",
- "libcppbor_external",
+ "libcppbor",
"libcppcose_rkp",
"libutils",
"libsoft_attestation_cert",
@@ -146,7 +146,7 @@
],
static_libs: [
"libbase",
- "libcppbor_external",
+ "libcppbor",
"libcppcose_rkp",
"libutils",
"libsoft_attestation_cert",
diff --git a/identity/aidl/vts/Android.bp b/identity/aidl/vts/Android.bp
index 6f7ab54..8ff2382 100644
--- a/identity/aidl/vts/Android.bp
+++ b/identity/aidl/vts/Android.bp
@@ -42,7 +42,7 @@
"android.hardware.security.rkp-V3-cpp",
"android.hardware.security.rkp-V3-ndk",
"android.hardware.security.secureclock-V1-ndk",
- "libcppbor_external",
+ "libcppbor",
"libcppcose_rkp",
"libkeymaster_portable",
"libkeymint_vts_test_utils",
diff --git a/identity/support/Android.bp b/identity/support/Android.bp
index d62d055..cc0a684 100644
--- a/identity/support/Android.bp
+++ b/identity/support/Android.bp
@@ -36,7 +36,7 @@
"libpuresoftkeymasterdevice",
],
static_libs: [
- "libcppbor_external",
+ "libcppbor",
],
}
@@ -70,7 +70,7 @@
],
static_libs: [
"android.hardware.identity-support-lib",
- "libcppbor_external",
+ "libcppbor",
"libgmock",
],
test_suites: ["general-tests"],
diff --git a/input/classifier/1.0/default/Android.bp b/input/classifier/1.0/default/Android.bp
index 8ab2ba8..264292b 100644
--- a/input/classifier/1.0/default/Android.bp
+++ b/input/classifier/1.0/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_input_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/input/classifier/1.0/vts/functional/Android.bp b/input/classifier/1.0/vts/functional/Android.bp
index 22346ed..dcf68b9 100644
--- a/input/classifier/1.0/vts/functional/Android.bp
+++ b/input/classifier/1.0/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_input_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/input/common/1.0/Android.bp b/input/common/1.0/Android.bp
index ed0ab98..ffa3441 100644
--- a/input/common/1.0/Android.bp
+++ b/input/common/1.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_input_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/input/common/aidl/Android.bp b/input/common/aidl/Android.bp
index 95a14b2..0759d2e 100644
--- a/input/common/aidl/Android.bp
+++ b/input/common/aidl/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_input_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -20,6 +21,9 @@
java: {
enabled: false,
},
+ rust: {
+ enabled: true,
+ },
},
versions_with_info: [
{
diff --git a/input/processor/aidl/Android.bp b/input/processor/aidl/Android.bp
index f1a73d2..68adf32 100644
--- a/input/processor/aidl/Android.bp
+++ b/input/processor/aidl/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_input_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/input/processor/aidl/default/Android.bp b/input/processor/aidl/default/Android.bp
index bdd27e2..f5163a7 100644
--- a/input/processor/aidl/default/Android.bp
+++ b/input/processor/aidl/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_input_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/keymaster/4.0/vts/functional/HmacKeySharingTest.cpp b/keymaster/4.0/vts/functional/HmacKeySharingTest.cpp
index 1bff076..a076438 100644
--- a/keymaster/4.0/vts/functional/HmacKeySharingTest.cpp
+++ b/keymaster/4.0/vts/functional/HmacKeySharingTest.cpp
@@ -51,7 +51,7 @@
};
using KeymasterVec = std::vector<sp<IKeymasterDevice>>;
- using ByteString = std::basic_string<uint8_t>;
+ using ByteString = std::vector<uint8_t>;
// using NonceVec = std::vector<HidlBuf>;
GetParamsResult getHmacSharingParameters(IKeymasterDevice& keymaster) {
@@ -98,7 +98,7 @@
std::vector<ByteString> copyNonces(const hidl_vec<HmacSharingParameters>& paramsVec) {
std::vector<ByteString> nonces;
for (auto& param : paramsVec) {
- nonces.emplace_back(param.nonce.data(), param.nonce.size());
+ nonces.emplace_back(param.nonce.data(), param.nonce.data() + param.nonce.size());
}
return nonces;
}
diff --git a/light/aidl/default/main.rs b/light/aidl/default/main.rs
index 8f32470..b5452d6 100644
--- a/light/aidl/default/main.rs
+++ b/light/aidl/default/main.rs
@@ -23,11 +23,11 @@
const LOG_TAG: &str = "lights_service_example_rust";
-use log::Level;
+use log::LevelFilter;
fn main() {
let logger_success = logger::init(
- logger::Config::default().with_tag_on_device(LOG_TAG).with_min_level(Level::Trace),
+ logger::Config::default().with_tag_on_device(LOG_TAG).with_max_level(LevelFilter::Trace),
);
if !logger_success {
panic!("{LOG_TAG}: Failed to start logger.");
diff --git a/macsec/OWNERS b/macsec/OWNERS
new file mode 100644
index 0000000..6934f86
--- /dev/null
+++ b/macsec/OWNERS
@@ -0,0 +1 @@
+keithmok@google.com
diff --git a/macsec/aidl/Android.bp b/macsec/aidl/Android.bp
new file mode 100644
index 0000000..5e47999
--- /dev/null
+++ b/macsec/aidl/Android.bp
@@ -0,0 +1,40 @@
+//
+// 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.
+//
+
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+aidl_interface {
+ name: "android.hardware.macsec",
+ vendor_available: true,
+ srcs: ["android/hardware/macsec/*.aidl"],
+ stability: "vintf",
+ host_supported: true,
+ backend: {
+ java: {
+ enabled: false,
+ },
+ rust: {
+ enabled: false,
+ },
+ },
+}
diff --git a/macsec/aidl/aidl_api/android.hardware.macsec/current/android/hardware/macsec/IMacsecPskPlugin.aidl b/macsec/aidl/aidl_api/android.hardware.macsec/current/android/hardware/macsec/IMacsecPskPlugin.aidl
new file mode 100644
index 0000000..6a93919
--- /dev/null
+++ b/macsec/aidl/aidl_api/android.hardware.macsec/current/android/hardware/macsec/IMacsecPskPlugin.aidl
@@ -0,0 +1,80 @@
+/*
+ * 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.
+ */
+package android.hardware.macsec;
+
+/**
+ * MACSEC (IEEE 802.1AE) pre-shared key plugin for wpa_supplicant
+ *
+ * The goal of this service is to provide function for using the MACSEC CAK
+ *
+ */
+@VintfStability
+interface IMacsecPskPlugin {
+ /**
+ * For xTS test only inject a key to verify implementation correctness, not called in production
+ *
+ * @param keyId is key id to add
+ * @param Connectivity Association Keys (CAK) to set
+ * @param Connectivity Association Key Name (CKN) to set
+ *
+ */
+ void addTestKey(in byte[] keyId, in byte[] CAK, in byte[] CKN);
+
+ /**
+ * Use ICV key do AES CMAC
+ * same as ieee802_1x_icv_aes_cmac in wpa_supplicant
+ *
+ * @param keyId is key id to be used for AES CMAC
+ * @param data, a data pointer to the buffer for calculate the ICV
+ *
+ * @return Integrity check value (ICV).
+ */
+ byte[] calcIcv(in byte[] keyId, in byte[] data);
+
+ /**
+ * KDF with CAK key to generate Secure Association Key (SAK)
+ * same as ieee802_1x_sak_aes_cmac in wpa_supplicant
+ *
+ * @param keyId is key id to be used for KDF
+ * @param data is key seed (random number)
+ * @param sakLength generated SAK length (16 or 32)
+ *
+ * @return Secure Association Key (SAK).
+ */
+ byte[] generateSak(in byte[] keyId, in byte[] data, in int sakLength);
+
+ /**
+ * Encrypt using KEK key, this is same as aes_wrap with kek.key in wpa_supplicant
+ * which used to wrap a SAK key
+ *
+ * @param keyId is key id to be used for encryption
+ * @param sak is the SAK key (16 or 32 bytes) to be wrapped.
+ *
+ * @return wrapped data using Key Encrypting Key (KEK).
+ */
+ byte[] wrapSak(in byte[] keyId, in byte[] sak);
+
+ /**
+ * Decrypt using KEK key, this is same as aes_unwrap with kek.key in wpa_supplicant
+ * which used to unwrap a SAK key
+ *
+ * @param keyId is key id to be used for decryption
+ * @param sak is wrapped SAK key.
+ *
+ * @return unwrapped data using KEK key.
+ */
+ byte[] unwrapSak(in byte[] keyId, in byte[] sak);
+}
diff --git a/macsec/aidl/android/hardware/macsec/IMacsecPskPlugin.aidl b/macsec/aidl/android/hardware/macsec/IMacsecPskPlugin.aidl
new file mode 100644
index 0000000..a98cfa6
--- /dev/null
+++ b/macsec/aidl/android/hardware/macsec/IMacsecPskPlugin.aidl
@@ -0,0 +1,91 @@
+/*
+ * 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.
+ */
+package android.hardware.macsec;
+
+/**
+ * MACSEC (IEEE 802.1AE) pre-shared key plugin for wpa_supplicant
+ *
+ * The goal of this service is to provide function for using the MACSEC CAK
+ *
+ */
+@VintfStability
+interface IMacsecPskPlugin {
+ /**
+ * For xTS test only inject a key to verify implementation correctness, not called in production
+ *
+ * @param keyId is key id to add
+ * @param Connectivity Association Keys (CAK) to set
+ * @param Connectivity Association Key Name (CKN) to set
+ * @throws EX_ILLEGAL_ARGUMENT If CAK size is not 16 or 32 or keyID size not equals to CAK size
+ */
+ void addTestKey(in byte[] keyId, in byte[] CAK, in byte[] CKN);
+
+ /**
+ * Use ICV key do AES CMAC
+ * same as ieee802_1x_icv_aes_cmac in wpa_supplicant
+ *
+ * @param keyId is key id to be used for AES CMAC
+ * @param data, a data pointer to the buffer for calculate the ICV
+ *
+ * @return Integrity check value (ICV).
+ * @throws EX_ILLEGAL_ARGUMENT If keyId does not exist
+ */
+ byte[] calcIcv(in byte[] keyId, in byte[] data);
+
+ /**
+ * KDF with CAK key to generate Secure Association Key (SAK)
+ * same as ieee802_1x_sak_aes_cmac in wpa_supplicant
+ *
+ * @param keyId is key id to be used for KDF
+ * @param data is key seed (random number)
+ * @param sakLength generated SAK length (16 or 32)
+ *
+ * @return Secure Association Key (SAK).
+ * @throws EX_ILLEGAL_ARGUMENT In the following cases:
+ * - If keyId does not exist
+ * - sakLength != 16 or 32
+ * - data length < sakLength
+ */
+ byte[] generateSak(in byte[] keyId, in byte[] data, in int sakLength);
+
+ /**
+ * Encrypt using KEK key, this is same as aes_wrap with kek.key in wpa_supplicant
+ * which used to wrap a SAK key
+ *
+ * @param keyId is key id to be used for encryption
+ * @param sak is the SAK key (16 or 32 bytes) to be wrapped.
+ *
+ * @return wrapped data using Key Encrypting Key (KEK).
+ * @throws EX_ILLEGAL_ARGUMENT In the following cases:
+ * - If keyId does not exist
+ * - sak size eqauls to 0 or not multiples of 8
+ */
+ byte[] wrapSak(in byte[] keyId, in byte[] sak);
+
+ /**
+ * Decrypt using KEK key, this is same as aes_unwrap with kek.key in wpa_supplicant
+ * which used to unwrap a SAK key
+ *
+ * @param keyId is key id to be used for decryption
+ * @param sak is wrapped SAK key.
+ *
+ * @return unwrapped data using KEK key.
+ * @throws EX_ILLEGAL_ARGUMENT In the following cases:
+ * - If keyId does not exist
+ * - sak size <= 8 or not multiples of 8
+ */
+ byte[] unwrapSak(in byte[] keyId, in byte[] sak);
+}
diff --git a/macsec/aidl/default/Android.bp b/macsec/aidl/default/Android.bp
new file mode 100644
index 0000000..7c7346f
--- /dev/null
+++ b/macsec/aidl/default/Android.bp
@@ -0,0 +1,64 @@
+//
+// 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.
+//
+
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_binary {
+ name: "android.hardware.macsec-service",
+ init_rc: ["android.hardware.macsec.rc"],
+ vendor: true,
+ relative_install_path: "hw",
+ srcs: [
+ "MacsecPskPlugin.cpp",
+ "service.cpp",
+ ],
+ shared_libs: [
+ "android.hardware.macsec-V1-ndk",
+ "libcrypto",
+ "libbase",
+ "libbinder_ndk",
+ ],
+ vintf_fragments: ["android.hardware.macsec.xml"],
+}
+
+cc_fuzz {
+ name: "android.hardware.macsec@V1-default-service.aidl_fuzzer",
+ vendor: true,
+ srcs: [
+ "MacsecPskPlugin.cpp",
+ "fuzzer/fuzzer.cpp",
+ ],
+ shared_libs: [
+ "android.hardware.macsec-V1-ndk",
+ "libcrypto",
+ "liblog",
+ ],
+ defaults: [
+ "service_fuzzer_defaults",
+ ],
+ fuzz_config: {
+ cc: [
+ "keithmok@google.com",
+ ],
+ },
+}
diff --git a/macsec/aidl/default/MacsecPskPlugin.cpp b/macsec/aidl/default/MacsecPskPlugin.cpp
new file mode 100644
index 0000000..82d2545
--- /dev/null
+++ b/macsec/aidl/default/MacsecPskPlugin.cpp
@@ -0,0 +1,308 @@
+/*
+ * Copyright 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 "MacsecPskPlugin.h"
+#include <openssl/cipher.h>
+#include <openssl/mem.h>
+
+#include <android-base/format.h>
+#include <android-base/logging.h>
+
+namespace aidl::android::hardware::macsec {
+
+constexpr auto ok = &ndk::ScopedAStatus::ok;
+
+// vendor should hide the key in TEE/TA
+// CAK key can be either 16 / 32 bytes
+const std::vector<uint8_t> CAK_ID_1 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01};
+const std::vector<uint8_t> CAK_KEY_1 = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
+std::vector<uint8_t> CKN_1 = {0x31, 0x32, 0x33, 0x34}; // maximum 16 bytes
+
+const std::vector<uint8_t> CAK_ID_2 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02};
+const std::vector<uint8_t> CAK_KEY_2 = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
+std::vector<uint8_t> CKN_2 = {0x35, 0x36, 0x37, 0x38}; // maximum 16 bytes
+
+static ndk::ScopedAStatus resultToStatus(binder_exception_t res, const std::string& msg = "") {
+ if (msg.empty()) {
+ return ndk::ScopedAStatus::fromExceptionCode(res);
+ }
+ return ndk::ScopedAStatus::fromExceptionCodeWithMessage(res, msg.c_str());
+}
+
+static int omac1_aes(CMAC_CTX* ctx, const uint8_t* data, size_t data_len,
+ uint8_t* mac /* 16 bytes */) {
+ size_t outlen;
+
+ // Just reuse same key in ctx
+ if (!CMAC_Reset(ctx)) {
+ return -1;
+ }
+
+ if (!CMAC_Update(ctx, data, data_len)) {
+ return -1;
+ }
+
+ if (!CMAC_Final(ctx, mac, &outlen) || outlen != 16) {
+ return -1;
+ }
+ return 0;
+}
+
+static void put_be16(uint8_t* addr, uint16_t value) {
+ *addr++ = value >> 8;
+ *addr = value & 0xff;
+}
+
+/* IEEE Std 802.1X-2010, 6.2.1 KDF */
+static int aes_kdf(CMAC_CTX* ctx, const char* label, const uint8_t* context, int ctx_bits,
+ int ret_bits, uint8_t* ret) {
+ const int h = 128;
+ const int r = 8;
+ int i, n;
+ int lab_len, ctx_len, ret_len, buf_len;
+ uint8_t* buf;
+
+ lab_len = strlen(label);
+ ctx_len = (ctx_bits + 7) / 8;
+ ret_len = ((ret_bits & 0xffff) + 7) / 8;
+ buf_len = lab_len + ctx_len + 4;
+
+ memset(ret, 0, ret_len);
+
+ n = (ret_bits + h - 1) / h;
+ if (n > ((0x1 << r) - 1)) return -1;
+
+ buf = (uint8_t*)calloc(1, buf_len);
+ if (buf == NULL) return -1;
+
+ memcpy(buf + 1, label, lab_len);
+ memcpy(buf + lab_len + 2, context, ctx_len);
+ put_be16(&buf[buf_len - 2], ret_bits);
+
+ for (i = 0; i < n; i++) {
+ int res;
+
+ buf[0] = (uint8_t)(i + 1);
+ res = omac1_aes(ctx, buf, buf_len, ret);
+ if (res) {
+ free(buf);
+ return -1;
+ }
+ ret = ret + h / 8;
+ }
+ free(buf);
+ return 0;
+}
+
+MacsecPskPlugin::MacsecPskPlugin() {
+ // always make sure ckn is 16 bytes, zero padded
+ CKN_1.resize(16);
+ CKN_2.resize(16);
+
+ addTestKey(CAK_ID_1, CAK_KEY_1, CKN_1);
+ addTestKey(CAK_ID_2, CAK_KEY_2, CKN_2);
+}
+
+MacsecPskPlugin::~MacsecPskPlugin() {
+ for (auto s : mKeys) {
+ OPENSSL_cleanse(&s.kekEncCtx, sizeof(AES_KEY));
+ OPENSSL_cleanse(&s.kekDecCtx, sizeof(AES_KEY));
+ CMAC_CTX_free(s.ickCtx);
+ CMAC_CTX_free(s.cakCtx);
+ }
+}
+
+ndk::ScopedAStatus MacsecPskPlugin::addTestKey(const std::vector<uint8_t>& keyId,
+ const std::vector<uint8_t>& CAK,
+ const std::vector<uint8_t>& CKN) {
+ if (CAK.size() != 16 && CAK.size() != 32) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT, "CAK length must be 16 or 32 bytes");
+ }
+
+ if (keyId.size() != CAK.size()) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT, "Key ID must be same as CAK length");
+ }
+
+ std::vector<uint8_t> ckn;
+ ckn = CKN;
+ ckn.resize(16); // make sure it is always zero padded with maximum length of
+ // 16 bytes
+
+ AES_KEY kekEncCtx;
+ AES_KEY kekDecCtx;
+ CMAC_CTX* ickCtx;
+ CMAC_CTX* cakCtx;
+
+ // Create the CAK openssl context
+ cakCtx = CMAC_CTX_new();
+
+ CMAC_Init(cakCtx, CAK.data(), CAK.size(),
+ CAK.size() == 16 ? EVP_aes_128_cbc() : EVP_aes_256_cbc(), NULL);
+
+ // derive KEK from CAK (ieee802_1x_kek_aes_cmac)
+ std::vector<uint8_t> kek;
+ kek.resize(CAK.size());
+
+ aes_kdf(cakCtx, "IEEE8021 KEK", (const uint8_t*)ckn.data(), ckn.size() * 8, 8 * kek.size(),
+ kek.data());
+
+ AES_set_encrypt_key(kek.data(), kek.size() << 3, &kekEncCtx);
+ AES_set_decrypt_key(kek.data(), kek.size() << 3, &kekDecCtx);
+
+ // derive ICK from CAK (ieee802_1x_ick_aes_cmac)
+ std::vector<uint8_t> ick;
+ ick.resize(CAK.size());
+
+ aes_kdf(cakCtx, "IEEE8021 ICK", (const uint8_t*)CKN.data(), CKN.size() * 8, 8 * ick.size(),
+ ick.data());
+
+ ickCtx = CMAC_CTX_new();
+
+ CMAC_Init(ickCtx, ick.data(), ick.size(),
+ ick.size() == 16 ? EVP_aes_128_cbc() : EVP_aes_256_cbc(), NULL);
+
+ mKeys.push_back({keyId, kekEncCtx, kekDecCtx, ickCtx, cakCtx});
+
+ return ok();
+}
+
+ndk::ScopedAStatus MacsecPskPlugin::calcIcv(const std::vector<uint8_t>& keyId,
+ const std::vector<uint8_t>& data,
+ std::vector<uint8_t>* out) {
+ CMAC_CTX* ctx = NULL;
+
+ for (auto s : mKeys) {
+ if (s.keyId == keyId) {
+ ctx = s.ickCtx;
+ break;
+ }
+ }
+
+ if (ctx == NULL) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT, "Key not exist");
+ }
+
+ out->resize(16);
+ if (omac1_aes(ctx, data.data(), data.size(), out->data()) != 0) {
+ return resultToStatus(EX_SERVICE_SPECIFIC, "Internal error");
+ }
+
+ return ok();
+}
+
+ndk::ScopedAStatus MacsecPskPlugin::generateSak(const std::vector<uint8_t>& keyId,
+ const std::vector<uint8_t>& data,
+ const int sakLength, std::vector<uint8_t>* out) {
+ CMAC_CTX* ctx = NULL;
+
+ if ((sakLength != 16) && (sakLength != 32)) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT, "Invalid SAK length");
+ }
+
+ if (data.size() < sakLength) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT, "Invalid data length");
+ }
+
+ for (auto s : mKeys) {
+ if (s.keyId == keyId) {
+ ctx = s.cakCtx;
+ break;
+ }
+ }
+
+ if (ctx == NULL) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT, "Key not exist");
+ }
+
+ out->resize(sakLength);
+
+ if (aes_kdf(ctx, "IEEE8021 SAK", data.data(), data.size() * 8, out->size() * 8, out->data()) !=
+ 0) {
+ return resultToStatus(EX_SERVICE_SPECIFIC, "Internal error");
+ }
+
+ return ok();
+}
+
+ndk::ScopedAStatus MacsecPskPlugin::wrapSak(const std::vector<uint8_t>& keyId,
+ const std::vector<uint8_t>& sak,
+ std::vector<uint8_t>* out) {
+ if (sak.size() == 0 || sak.size() % 8 != 0) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT,
+ "SAK length not multiple of 8 or greater than 0");
+ }
+
+ AES_KEY* ctx = NULL;
+
+ for (auto s : mKeys) {
+ if (s.keyId == keyId) {
+ ctx = &s.kekEncCtx;
+ break;
+ }
+ }
+
+ if (ctx == NULL) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT, "Key not exist");
+ }
+
+ out->resize(sak.size() + 8);
+
+ if (AES_wrap_key(ctx, NULL, out->data(), sak.data(), sak.size()) > 0) {
+ return ok();
+ }
+
+ return resultToStatus(EX_SERVICE_SPECIFIC, "Internal error");
+}
+
+ndk::ScopedAStatus MacsecPskPlugin::unwrapSak(const std::vector<uint8_t>& keyId,
+ const std::vector<uint8_t>& sak,
+ std::vector<uint8_t>* out) {
+ if (sak.size() <= 8 || sak.size() % 8 != 0) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT,
+ "SAK length not multiple of 8 or greater than 0");
+ }
+
+ AES_KEY* ctx = NULL;
+
+ for (auto s : mKeys) {
+ if (s.keyId == keyId) {
+ ctx = &s.kekDecCtx;
+ break;
+ }
+ }
+
+ if (ctx == NULL) {
+ return resultToStatus(EX_ILLEGAL_ARGUMENT, "Key not exist");
+ }
+
+ out->resize(sak.size() - 8);
+
+ if (AES_unwrap_key(ctx, NULL, out->data(), sak.data(), sak.size()) > 0) {
+ return ok();
+ }
+
+ return resultToStatus(EX_SERVICE_SPECIFIC, "Internal error");
+}
+
+} // namespace aidl::android::hardware::macsec
diff --git a/macsec/aidl/default/MacsecPskPlugin.h b/macsec/aidl/default/MacsecPskPlugin.h
new file mode 100644
index 0000000..0b056e3
--- /dev/null
+++ b/macsec/aidl/default/MacsecPskPlugin.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright 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 <aidl/android/hardware/macsec/BnMacsecPskPlugin.h>
+
+#include <openssl/aes.h>
+#include <openssl/cmac.h>
+
+namespace aidl::android::hardware::macsec {
+
+struct keys {
+ std::vector<uint8_t> keyId;
+ AES_KEY kekEncCtx;
+ AES_KEY kekDecCtx;
+ CMAC_CTX* ickCtx;
+ CMAC_CTX* cakCtx;
+};
+
+class MacsecPskPlugin : public BnMacsecPskPlugin {
+ public:
+ MacsecPskPlugin();
+ ~MacsecPskPlugin();
+ ndk::ScopedAStatus addTestKey(const std::vector<uint8_t>& keyId,
+ const std::vector<uint8_t>& CAK,
+ const std::vector<uint8_t>& CKN) override;
+ ndk::ScopedAStatus calcIcv(const std::vector<uint8_t>& keyId, const std::vector<uint8_t>& data,
+ std::vector<uint8_t>* out) override;
+
+ ndk::ScopedAStatus generateSak(const std::vector<uint8_t>& keyId,
+ const std::vector<uint8_t>& data, const int sakLength,
+ std::vector<uint8_t>* out);
+
+ ndk::ScopedAStatus wrapSak(const std::vector<uint8_t>& keyId, const std::vector<uint8_t>& sak,
+ std::vector<uint8_t>* out) override;
+
+ ndk::ScopedAStatus unwrapSak(const std::vector<uint8_t>& keyId, const std::vector<uint8_t>& sak,
+ std::vector<uint8_t>* out) override;
+
+ private:
+ std::vector<struct keys> mKeys;
+};
+} // namespace aidl::android::hardware::macsec
diff --git a/macsec/aidl/default/android.hardware.macsec.rc b/macsec/aidl/default/android.hardware.macsec.rc
new file mode 100644
index 0000000..0ff0e53
--- /dev/null
+++ b/macsec/aidl/default/android.hardware.macsec.rc
@@ -0,0 +1,3 @@
+service android.hardware.macsec /vendor/bin/hw/android.hardware.macsec-service
+ class early_hal
+ user nobody
diff --git a/macsec/aidl/default/android.hardware.macsec.xml b/macsec/aidl/default/android.hardware.macsec.xml
new file mode 100644
index 0000000..9cf9e5a
--- /dev/null
+++ b/macsec/aidl/default/android.hardware.macsec.xml
@@ -0,0 +1,26 @@
+<?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.
+-->
+
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.macsec</name>
+ <version>1</version>
+ <interface>
+ <name>IMacsecPskPlugin</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
+</manifest>
diff --git a/macsec/aidl/default/fuzzer/fuzzer.cpp b/macsec/aidl/default/fuzzer/fuzzer.cpp
new file mode 100644
index 0000000..d912a67
--- /dev/null
+++ b/macsec/aidl/default/fuzzer/fuzzer.cpp
@@ -0,0 +1,27 @@
+/*
+ * 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 <fuzzbinder/libbinder_ndk_driver.h>
+#include <fuzzer/FuzzedDataProvider.h>
+#include "MacsecPskPlugin.h"
+
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
+ std::shared_ptr<aidl::android::hardware::macsec::MacsecPskPlugin> service =
+ ndk::SharedRefBase::make<aidl::android::hardware::macsec::MacsecPskPlugin>();
+ android::fuzzService(service->asBinder().get(), FuzzedDataProvider(data, size));
+
+ return 0;
+}
diff --git a/macsec/aidl/default/service.cpp b/macsec/aidl/default/service.cpp
new file mode 100644
index 0000000..faf3a09
--- /dev/null
+++ b/macsec/aidl/default/service.cpp
@@ -0,0 +1,43 @@
+/*
+ * Copyright 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 "MacsecPskPlugin.h"
+
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+
+namespace android::hardware::macsec {
+
+using namespace std::string_literals;
+using ::aidl::android::hardware::macsec::MacsecPskPlugin;
+
+extern "C" int main() {
+ base::SetDefaultTag("MacsecPskPlugin");
+ base::SetMinimumLogSeverity(base::VERBOSE);
+
+ LOG(VERBOSE) << "Starting up...";
+ auto service = ndk::SharedRefBase::make<MacsecPskPlugin>();
+ const auto instance = MacsecPskPlugin::descriptor + "/default"s;
+ const auto status = AServiceManager_addService(service->asBinder().get(), instance.c_str());
+ CHECK_EQ(status, STATUS_OK) << "Failed to add service " << instance;
+ LOG(VERBOSE) << "Started successfully!";
+
+ ABinderProcess_joinThreadPool();
+ LOG(FATAL) << "MacsecPskPlugin exited unexpectedly!";
+ return EXIT_FAILURE;
+}
+} // namespace android::hardware::macsec
diff --git a/macsec/aidl/vts/functional/Android.bp b/macsec/aidl/vts/functional/Android.bp
new file mode 100644
index 0000000..0c8f43d
--- /dev/null
+++ b/macsec/aidl/vts/functional/Android.bp
@@ -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.
+//
+
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_test {
+ name: "VtsHalMacsecPskPluginV1Test",
+ defaults: [
+ "VtsHalTargetTestDefaults",
+ "use_libaidlvintf_gtest_helper_static",
+ ],
+ cpp_std: "experimental",
+ srcs: [
+ "MacsecAidlTest.cpp",
+ ],
+ shared_libs: [
+ "libbase",
+ "libbinder_ndk",
+ ],
+ static_libs: [
+ "android.hardware.macsec-V1-ndk",
+ "libgmock",
+ ],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
+}
diff --git a/macsec/aidl/vts/functional/MacsecAidlTest.cpp b/macsec/aidl/vts/functional/MacsecAidlTest.cpp
new file mode 100644
index 0000000..e94c049
--- /dev/null
+++ b/macsec/aidl/vts/functional/MacsecAidlTest.cpp
@@ -0,0 +1,142 @@
+/*
+ * 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/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/macsec/IMacsecPskPlugin.h>
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <gtest/gtest.h>
+
+#include <chrono>
+#include <thread>
+
+using aidl::android::hardware::macsec::IMacsecPskPlugin;
+using namespace std::chrono_literals;
+using namespace std::string_literals;
+
+const std::vector<uint8_t> CAK_ID_1 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01};
+const std::vector<uint8_t> CAK_KEY_1 = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
+const std::vector<uint8_t> CKN_1 = {0x31, 0x32, 0x33, 0x34}; // maximum 16 bytes
+const std::vector<uint8_t> SAK_DATA_1 = {0x31, 0x32, 0x33, 0x34, 0x11, 0x12, 0x12, 0x14,
+ 0x31, 0x32, 0x33, 0x34, 0x11, 0x12, 0x12, 0x14};
+const std::vector<uint8_t> SAK_1 = {0x13, 0xD9, 0xEE, 0x5B, 0x26, 0x8B, 0x44, 0xFB,
+ 0x37, 0x63, 0x3D, 0x41, 0xC8, 0xE7, 0x0D, 0x93};
+const std::vector<uint8_t> WRAPPED_SAK_1 = {0x3B, 0x39, 0xAB, 0x4C, 0xD8, 0xDA, 0x2E, 0xC5,
+ 0xD1, 0x38, 0x6A, 0x13, 0x9D, 0xE3, 0x78, 0xD9,
+ 0x93, 0xD2, 0xA0, 0x70, 0x88, 0xCB, 0xF5, 0xEC};
+const std::vector<uint8_t> DATA_1 = {0x31, 0x32, 0x33, 0x34, 0x31, 0x32, 0x34, 0x29,
+ 0x51, 0x52, 0x53, 0x54, 0x51, 0x35, 0x54, 0x59};
+const std::vector<uint8_t> ICV_1 = {0xDF, 0x54, 0xFF, 0xCD, 0xE0, 0xA9, 0x78, 0x10,
+ 0x6B, 0x7B, 0xD2, 0xBF, 0xEF, 0xD9, 0x0C, 0x81};
+
+const std::vector<uint8_t> CAK_ID_2 = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02};
+const std::vector<uint8_t> CAK_KEY_2 = {0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF,
+ 0x01, 0x23, 0x45, 0x67, 0x89, 0xAB, 0xCD, 0xEF};
+const std::vector<uint8_t> CKN_2 = {0x35, 0x36, 0x37, 0x38}; // maximum 16 bytes
+const std::vector<uint8_t> SAK_DATA_2 = {0x31, 0x32, 0x33, 0x34, 0x31, 0x32, 0x33, 0x34,
+ 0x31, 0x32, 0x33, 0x34, 0x31, 0x32, 0x33, 0x34,
+ 0x31, 0x32, 0x33, 0x34, 0x31, 0x32, 0x33, 0x34,
+ 0x31, 0x32, 0x33, 0x34, 0x31, 0x32, 0x33, 0x34};
+const std::vector<uint8_t> SAK_2 = {0x39, 0x09, 0x36, 0x60, 0x18, 0x07, 0x2B, 0x5D,
+ 0xF0, 0x81, 0x81, 0x45, 0xCD, 0x71, 0xC6, 0xBA,
+ 0x1D, 0x2B, 0x87, 0xC4, 0xEF, 0x79, 0x68, 0x82,
+ 0x28, 0xD0, 0x25, 0x86, 0xD3, 0x63, 0xFF, 0x89};
+const std::vector<uint8_t> WRAPPED_SAK_2 = {
+ 0x2f, 0x6a, 0x22, 0x29, 0x68, 0x0e, 0x6e, 0x35, 0x91, 0x64, 0x05, 0x4a, 0x31, 0x8d,
+ 0x35, 0xea, 0x95, 0x85, 0x40, 0xc6, 0xea, 0x55, 0xe5, 0xc5, 0x68, 0x40, 0xae, 0x4d,
+ 0x6f, 0xeb, 0x73, 0xcd, 0x4e, 0x2a, 0x43, 0xb1, 0xda, 0x49, 0x4f, 0x0a};
+const std::vector<uint8_t> DATA_2 = {0x71, 0x82, 0x13, 0x24, 0x31, 0x82, 0xA4, 0x2F,
+ 0x51, 0x52, 0x53, 0x44, 0x21, 0x35, 0x54, 0x59};
+const std::vector<uint8_t> ICV_2 = {0x8D, 0xF1, 0x1D, 0x6E, 0xAC, 0x62, 0xC1, 0x2A,
+ 0xE8, 0xF8, 0x4E, 0xB1, 0x00, 0x45, 0x9A, 0xAD};
+
+class MacsecAidlTest : public ::testing::TestWithParam<std::string> {
+ public:
+ virtual void SetUp() override {
+ android::base::SetDefaultTag("MACSEC_HAL_VTS");
+ android::base::SetMinimumLogSeverity(android::base::VERBOSE);
+ const auto instance = IMacsecPskPlugin::descriptor + "/default"s;
+ mMacsecPskPluginService = IMacsecPskPlugin::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(instance.c_str())));
+
+ ASSERT_NE(mMacsecPskPluginService, nullptr);
+ auto aidlStatus = mMacsecPskPluginService->addTestKey(CAK_ID_1, CAK_KEY_1, CKN_1);
+ ASSERT_TRUE(aidlStatus.isOk());
+ aidlStatus = mMacsecPskPluginService->addTestKey(CAK_ID_2, CAK_KEY_2, CKN_2);
+ ASSERT_TRUE(aidlStatus.isOk());
+ }
+ virtual void TearDown() override {}
+
+ std::shared_ptr<IMacsecPskPlugin> mMacsecPskPluginService;
+};
+
+TEST_P(MacsecAidlTest, calcIcv) {
+ std::vector<uint8_t> out;
+ auto aidlStatus = mMacsecPskPluginService->calcIcv(CAK_ID_1, DATA_1, &out);
+ ASSERT_TRUE(aidlStatus.isOk()) << "calcIcv KEY 1 failed: " << aidlStatus.getMessage();
+ EXPECT_EQ(out, ICV_1);
+
+ aidlStatus = mMacsecPskPluginService->calcIcv(CAK_ID_2, DATA_2, &out);
+ ASSERT_TRUE(aidlStatus.isOk()) << "calcIcv KEY 2 failed: " << aidlStatus.getMessage();
+ EXPECT_EQ(out, ICV_2);
+}
+
+TEST_P(MacsecAidlTest, generateSak) {
+ std::vector<uint8_t> out;
+ auto aidlStatus = mMacsecPskPluginService->generateSak(CAK_ID_1, SAK_DATA_1, 16, &out);
+ ASSERT_TRUE(aidlStatus.isOk()) << "generateSak KEY 1 failed: " << aidlStatus.getMessage();
+ EXPECT_EQ(out, SAK_1);
+
+ aidlStatus = mMacsecPskPluginService->generateSak(CAK_ID_2, SAK_DATA_2, 32, &out);
+ ASSERT_TRUE(aidlStatus.isOk()) << "generateSak KEY 2 failed: " << aidlStatus.getMessage();
+ EXPECT_EQ(out, SAK_2);
+}
+
+TEST_P(MacsecAidlTest, wrapSak) {
+ std::vector<uint8_t> out;
+ auto aidlStatus = mMacsecPskPluginService->wrapSak(CAK_ID_1, SAK_1, &out);
+ ASSERT_TRUE(aidlStatus.isOk()) << "wrapSak KEY 1 failed: " << aidlStatus.getMessage();
+ EXPECT_EQ(out, WRAPPED_SAK_1);
+
+ aidlStatus = mMacsecPskPluginService->wrapSak(CAK_ID_2, SAK_2, &out);
+ ASSERT_TRUE(aidlStatus.isOk()) << "wrapSak KEY 2 failed: " << aidlStatus.getMessage();
+ EXPECT_EQ(out, WRAPPED_SAK_2);
+}
+
+TEST_P(MacsecAidlTest, unwrapSak) {
+ std::vector<uint8_t> out;
+ auto aidlStatus = mMacsecPskPluginService->unwrapSak(CAK_ID_1, WRAPPED_SAK_1, &out);
+ ASSERT_TRUE(aidlStatus.isOk()) << "unwrapSak KEY 1 failed: " << aidlStatus.getMessage();
+ EXPECT_EQ(out, SAK_1);
+
+ aidlStatus = mMacsecPskPluginService->unwrapSak(CAK_ID_2, WRAPPED_SAK_2, &out);
+ ASSERT_TRUE(aidlStatus.isOk()) << "unwrapSak KEY 2 failed: " << aidlStatus.getMessage();
+ EXPECT_EQ(out, SAK_2);
+}
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(MacsecAidlTest);
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, MacsecAidlTest,
+ testing::ValuesIn(android::getAidlHalInstanceNames(IMacsecPskPlugin::descriptor)),
+ android::PrintInstanceNameToString);
diff --git a/macsec/aidl/vts/functional/OWNERS b/macsec/aidl/vts/functional/OWNERS
new file mode 100644
index 0000000..5009a88
--- /dev/null
+++ b/macsec/aidl/vts/functional/OWNERS
@@ -0,0 +1,2 @@
+# Bug component: 533426
+keithmok@google.com
diff --git a/media/1.0/Android.bp b/media/1.0/Android.bp
index 22a6d59..d5ef95a 100644
--- a/media/1.0/Android.bp
+++ b/media/1.0/Android.bp
@@ -12,9 +12,6 @@
hidl_interface {
name: "android.hardware.media@1.0",
root: "android.hardware",
- vndk: {
- enabled: true,
- },
srcs: [
"types.hal",
],
diff --git a/media/bufferpool/1.0/Android.bp b/media/bufferpool/1.0/Android.bp
index 175b8a5..60bcf7b 100644
--- a/media/bufferpool/1.0/Android.bp
+++ b/media/bufferpool/1.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_media_codec_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/media/bufferpool/2.0/Android.bp b/media/bufferpool/2.0/Android.bp
index 56597db..470a11f 100644
--- a/media/bufferpool/2.0/Android.bp
+++ b/media/bufferpool/2.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_android_media_codec_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -12,9 +13,6 @@
hidl_interface {
name: "android.hardware.media.bufferpool@2.0",
root: "android.hardware",
- vndk: {
- enabled: true,
- },
srcs: [
"types.hal",
"IAccessor.hal",
diff --git a/media/bufferpool/aidl/Android.bp b/media/bufferpool/aidl/Android.bp
index 9dcc90e..010c7cd 100644
--- a/media/bufferpool/aidl/Android.bp
+++ b/media/bufferpool/aidl/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_media_codec_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/media/bufferpool/aidl/default/Android.bp b/media/bufferpool/aidl/default/Android.bp
index 4d12d63..72cd903 100644
--- a/media/bufferpool/aidl/default/Android.bp
+++ b/media/bufferpool/aidl/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_codec_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "frameworks_av_license"
diff --git a/media/bufferpool/aidl/default/BufferPool.cpp b/media/bufferpool/aidl/default/BufferPool.cpp
index ed4574f..57716db 100644
--- a/media/bufferpool/aidl/default/BufferPool.cpp
+++ b/media/bufferpool/aidl/default/BufferPool.cpp
@@ -102,11 +102,11 @@
if (it->isInvalidated(bufferId)) {
uint32_t msgId = 0;
if (it->mNeedsAck) {
- msgId = ++mInvalidationId;
- if (msgId == 0) {
- // wrap happens
- msgId = ++mInvalidationId;
+ if (mInvalidationId == UINT_MAX) {
+ // wrap happens;
+ mInvalidationId = 0;
}
+ msgId = ++mInvalidationId;
}
channel.postInvalidation(msgId, it->mFrom, it->mTo);
it = mPendings.erase(it);
@@ -125,11 +125,11 @@
const std::shared_ptr<Accessor> &impl) {
uint32_t msgId = 0;
if (needsAck) {
- msgId = ++mInvalidationId;
- if (msgId == 0) {
- // wrap happens
- msgId = ++mInvalidationId;
+ if (mInvalidationId == UINT_MAX) {
+ //wrap happens
+ mInvalidationId = 0;
}
+ msgId = ++mInvalidationId;
}
ALOGV("bufferpool2 invalidation requested and queued");
if (left == 0) {
diff --git a/media/bufferpool/aidl/default/BufferStatus.cpp b/media/bufferpool/aidl/default/BufferStatus.cpp
index 19caa1e..fecbe3f 100644
--- a/media/bufferpool/aidl/default/BufferStatus.cpp
+++ b/media/bufferpool/aidl/default/BufferStatus.cpp
@@ -26,8 +26,17 @@
using aidl::android::hardware::media::bufferpool2::BufferStatus;
+uint32_t wrappedMinus(uint32_t a, uint32_t b) {
+ if (a >= b) {
+ return a - b;
+ } else {
+ return ~(b - a) + 1;
+ }
+}
+
bool isMessageLater(uint32_t curMsgId, uint32_t prevMsgId) {
- return curMsgId != prevMsgId && curMsgId - prevMsgId < prevMsgId - curMsgId;
+ return curMsgId != prevMsgId &&
+ wrappedMinus(curMsgId, prevMsgId) < wrappedMinus(prevMsgId, curMsgId);
}
bool isBufferInRange(BufferId from, BufferId to, BufferId bufferId) {
diff --git a/media/bufferpool/aidl/default/tests/Android.bp b/media/bufferpool/aidl/default/tests/Android.bp
index 487ed4c..46aa4da 100644
--- a/media/bufferpool/aidl/default/tests/Android.bp
+++ b/media/bufferpool/aidl/default/tests/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_android_media_codec_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "frameworks_av_license"
@@ -42,7 +43,7 @@
],
static_libs: [
"libaidlcommonsupport",
- "libstagefright_aidl_bufferpool2"
+ "libstagefright_aidl_bufferpool2",
],
compile_multilib: "both",
}
@@ -66,7 +67,7 @@
],
static_libs: [
"libaidlcommonsupport",
- "libstagefright_aidl_bufferpool2"
+ "libstagefright_aidl_bufferpool2",
],
compile_multilib: "both",
}
@@ -90,7 +91,7 @@
],
static_libs: [
"libaidlcommonsupport",
- "libstagefright_aidl_bufferpool2"
+ "libstagefright_aidl_bufferpool2",
],
compile_multilib: "both",
}
diff --git a/media/c2/aidl/android/hardware/media/c2/IComponent.aidl b/media/c2/aidl/android/hardware/media/c2/IComponent.aidl
index 6bcb5ff..387d70a 100644
--- a/media/c2/aidl/android/hardware/media/c2/IComponent.aidl
+++ b/media/c2/aidl/android/hardware/media/c2/IComponent.aidl
@@ -17,6 +17,7 @@
package android.hardware.media.c2;
import android.hardware.common.NativeHandle;
+
import android.hardware.media.c2.IComponentInterface;
import android.hardware.media.c2.IConfigurable;
import android.hardware.media.c2.IGraphicBufferAllocator;
diff --git a/media/omx/1.0/Android.bp b/media/omx/1.0/Android.bp
index ea63467..cd1b9b6 100644
--- a/media/omx/1.0/Android.bp
+++ b/media/omx/1.0/Android.bp
@@ -12,9 +12,6 @@
hidl_interface {
name: "android.hardware.media.omx@1.0",
root: "android.hardware",
- vndk: {
- enabled: true,
- },
srcs: [
"types.hal",
"IGraphicBufferSource.hal",
diff --git a/media/omx/1.0/vts/functional/audio/Android.bp b/media/omx/1.0/vts/functional/audio/Android.bp
index a2733c9..1be82f8 100644
--- a/media/omx/1.0/vts/functional/audio/Android.bp
+++ b/media/omx/1.0/vts/functional/audio/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_media_codec_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/media/omx/1.0/vts/functional/common/Android.bp b/media/omx/1.0/vts/functional/common/Android.bp
index 12b6fb2..7c23d61 100644
--- a/media/omx/1.0/vts/functional/common/Android.bp
+++ b/media/omx/1.0/vts/functional/common/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_media_codec_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/media/omx/1.0/vts/functional/component/Android.bp b/media/omx/1.0/vts/functional/component/Android.bp
index 7b8ec9d..fddbb8e 100644
--- a/media/omx/1.0/vts/functional/component/Android.bp
+++ b/media/omx/1.0/vts/functional/component/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_media_codec_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/media/omx/1.0/vts/functional/store/Android.bp b/media/omx/1.0/vts/functional/store/Android.bp
index b34fff1..ebe4293 100644
--- a/media/omx/1.0/vts/functional/store/Android.bp
+++ b/media/omx/1.0/vts/functional/store/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_media_codec_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/media/omx/1.0/vts/functional/video/Android.bp b/media/omx/1.0/vts/functional/video/Android.bp
index 5454f16..0eac78e 100644
--- a/media/omx/1.0/vts/functional/video/Android.bp
+++ b/media/omx/1.0/vts/functional/video/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_media_codec_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/memtrack/1.0/Android.bp b/memtrack/1.0/Android.bp
index bf8db3f..1aeec59 100644
--- a/memtrack/1.0/Android.bp
+++ b/memtrack/1.0/Android.bp
@@ -12,9 +12,6 @@
hidl_interface {
name: "android.hardware.memtrack@1.0",
root: "android.hardware",
- vndk: {
- enabled: true,
- },
srcs: [
"types.hal",
"IMemtrack.hal",
diff --git a/memtrack/aidl/Android.bp b/memtrack/aidl/Android.bp
index 0d1c241..4973d1e 100644
--- a/memtrack/aidl/Android.bp
+++ b/memtrack/aidl/Android.bp
@@ -34,9 +34,6 @@
enabled: false,
},
ndk: {
- vndk: {
- enabled: true,
- },
},
},
frozen: true,
diff --git a/neuralnetworks/aidl/Android.bp b/neuralnetworks/aidl/Android.bp
index be86879..145604c 100644
--- a/neuralnetworks/aidl/Android.bp
+++ b/neuralnetworks/aidl/Android.bp
@@ -17,7 +17,7 @@
stability: "vintf",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V4",
+ "android.hardware.graphics.common-V5",
],
backend: {
java: {
@@ -40,28 +40,28 @@
version: "1",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V4",
+ "android.hardware.graphics.common-V5",
],
},
{
version: "2",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V4",
+ "android.hardware.graphics.common-V5",
],
},
{
version: "3",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V4",
+ "android.hardware.graphics.common-V5",
],
},
{
version: "4",
imports: [
"android.hardware.common-V2",
- "android.hardware.graphics.common-V4",
+ "android.hardware.graphics.common-V5",
],
},
diff --git a/nfc/1.0/vts/functional/Android.bp b/nfc/1.0/vts/functional/Android.bp
index 0d3f0c9..2e9a6fa 100644
--- a/nfc/1.0/vts/functional/Android.bp
+++ b/nfc/1.0/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_nfc",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -30,5 +31,8 @@
static_libs: [
"android.hardware.nfc@1.0",
],
- test_suites: ["general-tests", "vts"],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
}
diff --git a/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp b/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
index 8210ff0..2fc9e65 100644
--- a/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
+++ b/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
@@ -562,7 +562,18 @@
*/
TEST_P(NfcHidlTest, OpenAfterOpen) {
EXPECT_EQ(NfcStatus::OK, nfc_->open(nfc_cb_));
+ // Wait for OPEN_CPLT event
+ auto res = nfc_cb_->WaitForCallback(kCallbackNameSendEvent);
+ EXPECT_TRUE(res.no_timeout);
+ EXPECT_EQ(NfcEvent::OPEN_CPLT, res.args->last_event_);
+ EXPECT_EQ(NfcStatus::OK, res.args->last_status_);
+
EXPECT_EQ(NfcStatus::OK, nfc_->open(nfc_cb_));
+ // Wait for OPEN_CPLT event
+ res = nfc_cb_->WaitForCallback(kCallbackNameSendEvent);
+ EXPECT_TRUE(res.no_timeout);
+ EXPECT_EQ(NfcEvent::OPEN_CPLT, res.args->last_event_);
+ EXPECT_EQ(NfcStatus::OK, res.args->last_status_);
}
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(NfcHidlTest);
diff --git a/nfc/1.1/vts/functional/Android.bp b/nfc/1.1/vts/functional/Android.bp
index 4439531..cffe84a 100644
--- a/nfc/1.1/vts/functional/Android.bp
+++ b/nfc/1.1/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_nfc",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -31,5 +32,8 @@
"android.hardware.nfc@1.0",
"android.hardware.nfc@1.1",
],
- test_suites: ["general-tests", "vts"],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
}
diff --git a/nfc/1.2/vts/functional/Android.bp b/nfc/1.2/vts/functional/Android.bp
index ff7bd3a..394dc26 100644
--- a/nfc/1.2/vts/functional/Android.bp
+++ b/nfc/1.2/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_nfc",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -32,5 +33,8 @@
"android.hardware.nfc@1.1",
"android.hardware.nfc@1.2",
],
- test_suites: ["general-tests", "vts"],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
}
diff --git a/nfc/OWNERS b/nfc/OWNERS
index 7867204..f46dccd 100644
--- a/nfc/OWNERS
+++ b/nfc/OWNERS
@@ -1,6 +1,2 @@
# Bug component: 48448
-alisher@google.com
-georgekgchang@google.com
-jackcwyu@google.com
-
-
+include platform/packages/apps/Nfc:/OWNERS
\ No newline at end of file
diff --git a/nfc/aidl/default/Android.bp b/nfc/aidl/default/Android.bp
deleted file mode 100644
index 0cda51d..0000000
--- a/nfc/aidl/default/Android.bp
+++ /dev/null
@@ -1,33 +0,0 @@
-package {
- default_team: "trendy_team_fwk_nfc",
- // See: http://go/android-license-faq
- // A large-scale-change added 'default_applicable_licenses' to import
- // all of the 'license_kinds' from "hardware_interfaces_license"
- // to get the below license kinds:
- // SPDX-license-identifier-Apache-2.0
- default_applicable_licenses: ["hardware_interfaces_license"],
-}
-
-cc_binary {
- name: "android.hardware.nfc-service.example",
- relative_install_path: "hw",
- init_rc: ["nfc-service-example.rc"],
- vintf_fragments: ["nfc-service-example.xml"],
- vendor: true,
- cflags: [
- "-Wall",
- "-Wextra",
- ],
- shared_libs: [
- "libbase",
- "liblog",
- "libutils",
- "libbinder_ndk",
- "android.hardware.nfc-V1-ndk",
- ],
- srcs: [
- "main.cpp",
- "Nfc.cpp",
- "Vendor_hal_api.cpp",
- ],
-}
diff --git a/nfc/aidl/default/Nfc.cpp b/nfc/aidl/default/Nfc.cpp
deleted file mode 100644
index 4685b59..0000000
--- a/nfc/aidl/default/Nfc.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * 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.
- */
-
-#include "Nfc.h"
-
-#include <android-base/logging.h>
-
-#include "Vendor_hal_api.h"
-
-namespace aidl {
-namespace android {
-namespace hardware {
-namespace nfc {
-
-std::shared_ptr<INfcClientCallback> Nfc::mCallback = nullptr;
-AIBinder_DeathRecipient* clientDeathRecipient = nullptr;
-
-void OnDeath(void* cookie) {
- if (Nfc::mCallback != nullptr && !AIBinder_isAlive(Nfc::mCallback->asBinder().get())) {
- LOG(INFO) << __func__ << " Nfc service has died";
- Nfc* nfc = static_cast<Nfc*>(cookie);
- nfc->close(NfcCloseType::DISABLE);
- }
-}
-
-::ndk::ScopedAStatus Nfc::open(const std::shared_ptr<INfcClientCallback>& clientCallback) {
- LOG(INFO) << "open";
- if (clientCallback == nullptr) {
- LOG(INFO) << "Nfc::open null callback";
- return ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(NfcStatus::FAILED));
- }
- Nfc::mCallback = clientCallback;
-
- clientDeathRecipient = AIBinder_DeathRecipient_new(OnDeath);
- auto linkRet = AIBinder_linkToDeath(clientCallback->asBinder().get(), clientDeathRecipient,
- this /* cookie */);
- if (linkRet != STATUS_OK) {
- LOG(ERROR) << __func__ << ": linkToDeath failed: " << linkRet;
- // Just ignore the error.
- }
-
- int ret = Vendor_hal_open(eventCallback, dataCallback);
- return ret == 0 ? ndk::ScopedAStatus::ok()
- : ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(NfcStatus::FAILED));
-}
-
-::ndk::ScopedAStatus Nfc::close(NfcCloseType type) {
- LOG(INFO) << "close";
- if (Nfc::mCallback == nullptr) {
- LOG(ERROR) << __func__ << "mCallback null";
- return ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(NfcStatus::FAILED));
- }
- int ret = 0;
- if (type == NfcCloseType::HOST_SWITCHED_OFF) {
- ret = Vendor_hal_close_off();
- } else {
- ret = Vendor_hal_close();
- }
- Nfc::mCallback = nullptr;
- AIBinder_DeathRecipient_delete(clientDeathRecipient);
- clientDeathRecipient = nullptr;
- return ret == 0 ? ndk::ScopedAStatus::ok()
- : ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(NfcStatus::FAILED));
-}
-
-::ndk::ScopedAStatus Nfc::coreInitialized() {
- LOG(INFO) << "coreInitialized";
- if (Nfc::mCallback == nullptr) {
- LOG(ERROR) << __func__ << "mCallback null";
- return ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(NfcStatus::FAILED));
- }
- int ret = Vendor_hal_core_initialized();
-
- return ret == 0 ? ndk::ScopedAStatus::ok()
- : ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(NfcStatus::FAILED));
-}
-
-::ndk::ScopedAStatus Nfc::factoryReset() {
- LOG(INFO) << "factoryReset";
- Vendor_hal_factoryReset();
- return ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus Nfc::getConfig(NfcConfig* _aidl_return) {
- LOG(INFO) << "getConfig";
- NfcConfig nfcVendorConfig;
- Vendor_hal_getConfig(nfcVendorConfig);
-
- *_aidl_return = nfcVendorConfig;
- return ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus Nfc::powerCycle() {
- LOG(INFO) << "powerCycle";
- if (Nfc::mCallback == nullptr) {
- LOG(ERROR) << __func__ << "mCallback null";
- return ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(NfcStatus::FAILED));
- }
- return Vendor_hal_power_cycle() ? ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(NfcStatus::FAILED))
- : ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus Nfc::preDiscover() {
- LOG(INFO) << "preDiscover";
- if (Nfc::mCallback == nullptr) {
- LOG(ERROR) << __func__ << "mCallback null";
- return ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(NfcStatus::FAILED));
- }
- return Vendor_hal_pre_discover() ? ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(NfcStatus::FAILED))
- : ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus Nfc::write(const std::vector<uint8_t>& data, int32_t* _aidl_return) {
- LOG(INFO) << "write";
- if (Nfc::mCallback == nullptr) {
- LOG(ERROR) << __func__ << "mCallback null";
- return ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(NfcStatus::FAILED));
- }
- *_aidl_return = Vendor_hal_write(data.size(), &data[0]);
- return ndk::ScopedAStatus::ok();
-}
-::ndk::ScopedAStatus Nfc::setEnableVerboseLogging(bool enable) {
- LOG(INFO) << "setVerboseLogging";
- Vendor_hal_setVerboseLogging(enable);
- return ndk::ScopedAStatus::ok();
-}
-
-::ndk::ScopedAStatus Nfc::isVerboseLoggingEnabled(bool* _aidl_return) {
- *_aidl_return = Vendor_hal_getVerboseLogging();
- return ndk::ScopedAStatus::ok();
-}
-
-} // namespace nfc
-} // namespace hardware
-} // namespace android
-} // namespace aidl
diff --git a/nfc/aidl/default/Nfc.h b/nfc/aidl/default/Nfc.h
deleted file mode 100644
index 1b14534..0000000
--- a/nfc/aidl/default/Nfc.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.
- */
-
-#pragma once
-
-#include <aidl/android/hardware/nfc/BnNfc.h>
-#include <aidl/android/hardware/nfc/INfcClientCallback.h>
-#include <android-base/logging.h>
-namespace aidl {
-namespace android {
-namespace hardware {
-namespace nfc {
-
-using ::aidl::android::hardware::nfc::NfcCloseType;
-using ::aidl::android::hardware::nfc::NfcConfig;
-using ::aidl::android::hardware::nfc::NfcStatus;
-
-// Default implementation that reports no support NFC.
-struct Nfc : public BnNfc {
- public:
- Nfc() = default;
-
- ::ndk::ScopedAStatus open(const std::shared_ptr<INfcClientCallback>& clientCallback) override;
- ::ndk::ScopedAStatus close(NfcCloseType type) override;
- ::ndk::ScopedAStatus coreInitialized() override;
- ::ndk::ScopedAStatus factoryReset() override;
- ::ndk::ScopedAStatus getConfig(NfcConfig* _aidl_return) override;
- ::ndk::ScopedAStatus powerCycle() override;
- ::ndk::ScopedAStatus preDiscover() override;
- ::ndk::ScopedAStatus write(const std::vector<uint8_t>& data, int32_t* _aidl_return) override;
- ::ndk::ScopedAStatus setEnableVerboseLogging(bool enable) override;
- ::ndk::ScopedAStatus isVerboseLoggingEnabled(bool* _aidl_return) override;
-
- static void eventCallback(uint8_t event, uint8_t status) {
- if (mCallback != nullptr) {
- auto ret = mCallback->sendEvent((NfcEvent)event, (NfcStatus)status);
- if (!ret.isOk()) {
- LOG(ERROR) << "Failed to send event!";
- }
- }
- }
-
- static void dataCallback(uint16_t data_len, uint8_t* p_data) {
- std::vector<uint8_t> data(p_data, p_data + data_len);
- if (mCallback != nullptr) {
- auto ret = mCallback->sendData(data);
- if (!ret.isOk()) {
- LOG(ERROR) << "Failed to send data!";
- }
- }
- }
-
- static std::shared_ptr<INfcClientCallback> mCallback;
-};
-
-} // namespace nfc
-} // namespace hardware
-} // namespace android
-} // namespace aidl
diff --git a/nfc/aidl/default/Vendor_hal_api.cpp b/nfc/aidl/default/Vendor_hal_api.cpp
deleted file mode 100644
index 66a2ebc..0000000
--- a/nfc/aidl/default/Vendor_hal_api.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * 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.
- */
-
-#include <android-base/properties.h>
-#include <dlfcn.h>
-#include <errno.h>
-#include <string.h>
-
-#include "Vendor_hal_api.h"
-
-bool logging = false;
-
-int Vendor_hal_open(nfc_stack_callback_t* p_cback, nfc_stack_data_callback_t* p_data_cback) {
- (void)p_cback;
- (void)p_data_cback;
- // nothing to open in this example
- return -1;
-}
-
-int Vendor_hal_write(uint16_t data_len, const uint8_t* p_data) {
- (void)data_len;
- (void)p_data;
- return -1;
-}
-
-int Vendor_hal_core_initialized() {
- return -1;
-}
-
-int Vendor_hal_pre_discover() {
- return -1;
-}
-
-int Vendor_hal_close() {
- return -1;
-}
-
-int Vendor_hal_close_off() {
- return -1;
-}
-
-int Vendor_hal_power_cycle() {
- return -1;
-}
-
-void Vendor_hal_factoryReset() {}
-
-void Vendor_hal_getConfig(NfcConfig& config) {
- (void)config;
-}
-
-void Vendor_hal_setVerboseLogging(bool enable) {
- logging = enable;
-}
-
-bool Vendor_hal_getVerboseLogging() {
- return logging;
-}
diff --git a/nfc/aidl/default/Vendor_hal_api.h b/nfc/aidl/default/Vendor_hal_api.h
deleted file mode 100644
index 595c2dd..0000000
--- a/nfc/aidl/default/Vendor_hal_api.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * 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.
- */
-#pragma once
-
-#include <aidl/android/hardware/nfc/INfc.h>
-#include <aidl/android/hardware/nfc/NfcConfig.h>
-#include <aidl/android/hardware/nfc/NfcEvent.h>
-#include <aidl/android/hardware/nfc/NfcStatus.h>
-#include <aidl/android/hardware/nfc/PresenceCheckAlgorithm.h>
-#include <aidl/android/hardware/nfc/ProtocolDiscoveryConfig.h>
-#include "hardware_nfc.h"
-
-using aidl::android::hardware::nfc::NfcConfig;
-using aidl::android::hardware::nfc::NfcEvent;
-using aidl::android::hardware::nfc::NfcStatus;
-using aidl::android::hardware::nfc::PresenceCheckAlgorithm;
-using aidl::android::hardware::nfc::ProtocolDiscoveryConfig;
-
-int Vendor_hal_open(nfc_stack_callback_t* p_cback, nfc_stack_data_callback_t* p_data_cback);
-int Vendor_hal_write(uint16_t data_len, const uint8_t* p_data);
-
-int Vendor_hal_core_initialized();
-
-int Vendor_hal_pre_discover();
-
-int Vendor_hal_close();
-
-int Vendor_hal_close_off();
-
-int Vendor_hal_power_cycle();
-
-void Vendor_hal_factoryReset();
-
-void Vendor_hal_getConfig(NfcConfig& config);
-
-void Vendor_hal_setVerboseLogging(bool enable);
-
-bool Vendor_hal_getVerboseLogging();
diff --git a/nfc/aidl/default/hardware_nfc.h b/nfc/aidl/default/hardware_nfc.h
deleted file mode 100644
index 0f856c5..0000000
--- a/nfc/aidl/default/hardware_nfc.h
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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.
- */
-#pragma once
-
-typedef uint8_t nfc_event_t;
-typedef uint8_t nfc_status_t;
-
-/*
- * The callback passed in from the NFC stack that the HAL
- * can use to pass events back to the stack.
- */
-typedef void(nfc_stack_callback_t)(nfc_event_t event, nfc_status_t event_status);
-
-/*
- * The callback passed in from the NFC stack that the HAL
- * can use to pass incomming data to the stack.
- */
-typedef void(nfc_stack_data_callback_t)(uint16_t data_len, uint8_t* p_data);
diff --git a/nfc/aidl/default/main.cpp b/nfc/aidl/default/main.cpp
deleted file mode 100644
index 0cc51e7..0000000
--- a/nfc/aidl/default/main.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * 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.
- */
-
-#include <android-base/logging.h>
-#include <android/binder_manager.h>
-#include <android/binder_process.h>
-
-#include "Nfc.h"
-using ::aidl::android::hardware::nfc::Nfc;
-
-int main() {
- LOG(INFO) << "NFC HAL starting up";
- if (!ABinderProcess_setThreadPoolMaxThreadCount(1)) {
- LOG(INFO) << "failed to set thread pool max thread count";
- return 1;
- }
- std::shared_ptr<Nfc> nfc_service = ndk::SharedRefBase::make<Nfc>();
-
- const std::string instance = std::string() + Nfc::descriptor + "/default";
- binder_status_t status =
- AServiceManager_addService(nfc_service->asBinder().get(), instance.c_str());
- CHECK(status == STATUS_OK);
- ABinderProcess_joinThreadPool();
- return 0;
-}
diff --git a/nfc/aidl/default/nfc-service-example.rc b/nfc/aidl/default/nfc-service-example.rc
deleted file mode 100644
index 7d7052e..0000000
--- a/nfc/aidl/default/nfc-service-example.rc
+++ /dev/null
@@ -1,4 +0,0 @@
-service nfc_hal_service /vendor/bin/hw/android.hardware.nfc-service.st
- class hal
- user nfc
- group nfc
diff --git a/nfc/aidl/default/nfc-service-example.xml b/nfc/aidl/default/nfc-service-example.xml
deleted file mode 100644
index 70fed20..0000000
--- a/nfc/aidl/default/nfc-service-example.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<manifest version="1.0" type="device">
- <hal format="aidl">
- <name>android.hardware.nfc</name>
- <fqname>INfc/default</fqname>
- </hal>
-</manifest>
diff --git a/power/aidl/Android.bp b/power/aidl/Android.bp
index 082572d..7643926 100644
--- a/power/aidl/Android.bp
+++ b/power/aidl/Android.bp
@@ -55,6 +55,44 @@
},
],
- frozen: true,
+ frozen: false,
}
+
+cc_defaults {
+ name: "android.hardware.power-ndk_shared",
+ shared_libs: [
+ "android.hardware.power-V5-ndk",
+ ],
+}
+
+cc_defaults {
+ name: "android.hardware.power-ndk_export_shared",
+ shared_libs: [
+ "android.hardware.power-V5-ndk",
+ ],
+ export_shared_lib_headers: [
+ "android.hardware.power-V5-ndk",
+ ],
+}
+
+cc_defaults {
+ name: "android.hardware.power-ndk_static",
+ static_libs: [
+ "android.hardware.power-V5-ndk",
+ ],
+}
+
+java_defaults {
+ name: "android.hardware.power-java_shared",
+ libs: [
+ "android.hardware.power-V5-java",
+ ],
+}
+
+java_defaults {
+ name: "android.hardware.power-java_static",
+ static_libs: [
+ "android.hardware.power-V5-java",
+ ],
+}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Boost.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Boost.aidl
index c792d4e..8ee15ef 100644
--- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Boost.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Boost.aidl
@@ -34,10 +34,10 @@
package android.hardware.power;
@Backing(type="int") @VintfStability
enum Boost {
- INTERACTION = 0,
- DISPLAY_UPDATE_IMMINENT = 1,
- ML_ACC = 2,
- AUDIO_LAUNCH = 3,
- CAMERA_LAUNCH = 4,
- CAMERA_SHOT = 5,
+ INTERACTION,
+ DISPLAY_UPDATE_IMMINENT,
+ ML_ACC,
+ AUDIO_LAUNCH,
+ CAMERA_LAUNCH,
+ CAMERA_SHOT,
}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl
index e6809da..6bc663e 100644
--- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl
@@ -41,4 +41,5 @@
oneway void close();
oneway void sendHint(android.hardware.power.SessionHint hint);
void setThreads(in int[] threadIds);
+ oneway void setMode(android.hardware.power.SessionMode type, boolean enabled);
}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Mode.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Mode.aidl
index f38426b..46eca69 100644
--- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Mode.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/Mode.aidl
@@ -34,21 +34,23 @@
package android.hardware.power;
@Backing(type="int") @VintfStability
enum Mode {
- DOUBLE_TAP_TO_WAKE = 0,
- LOW_POWER = 1,
- SUSTAINED_PERFORMANCE = 2,
- FIXED_PERFORMANCE = 3,
- VR = 4,
- LAUNCH = 5,
- EXPENSIVE_RENDERING = 6,
- INTERACTIVE = 7,
- DEVICE_IDLE = 8,
- DISPLAY_INACTIVE = 9,
- AUDIO_STREAMING_LOW_LATENCY = 10,
- CAMERA_STREAMING_SECURE = 11,
- CAMERA_STREAMING_LOW = 12,
- CAMERA_STREAMING_MID = 13,
- CAMERA_STREAMING_HIGH = 14,
- GAME = 15,
- GAME_LOADING = 16,
+ DOUBLE_TAP_TO_WAKE,
+ LOW_POWER,
+ SUSTAINED_PERFORMANCE,
+ FIXED_PERFORMANCE,
+ VR,
+ LAUNCH,
+ EXPENSIVE_RENDERING,
+ INTERACTIVE,
+ DEVICE_IDLE,
+ DISPLAY_INACTIVE,
+ AUDIO_STREAMING_LOW_LATENCY,
+ CAMERA_STREAMING_SECURE,
+ CAMERA_STREAMING_LOW,
+ CAMERA_STREAMING_MID,
+ CAMERA_STREAMING_HIGH,
+ GAME,
+ GAME_LOADING,
+ DISPLAY_CHANGE,
+ AUTOMOTIVE_PROJECTION,
}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl
index 9c1f381..cb37719 100644
--- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl
@@ -39,4 +39,6 @@
CPU_LOAD_RESET = 2,
CPU_LOAD_RESUME = 3,
POWER_EFFICIENCY = 4,
+ GPU_LOAD_UP = 5,
+ GPU_LOAD_DOWN = 6,
}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionMode.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionMode.aidl
new file mode 100644
index 0000000..d0ae0ba
--- /dev/null
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionMode.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.power;
+@Backing(type="int") @VintfStability
+enum SessionMode {
+ POWER_EFFICIENCY,
+}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/WorkDuration.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/WorkDuration.aidl
index e86cd40..45013dd 100644
--- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/WorkDuration.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/WorkDuration.aidl
@@ -36,4 +36,7 @@
parcelable WorkDuration {
long timeStampNanos;
long durationNanos;
+ long workPeriodStartTimestampNanos;
+ long cpuDurationNanos;
+ long gpuDurationNanos;
}
diff --git a/power/aidl/android/hardware/power/IPowerHintSession.aidl b/power/aidl/android/hardware/power/IPowerHintSession.aidl
index 7db0ea1..62263c8 100644
--- a/power/aidl/android/hardware/power/IPowerHintSession.aidl
+++ b/power/aidl/android/hardware/power/IPowerHintSession.aidl
@@ -17,6 +17,7 @@
package android.hardware.power;
import android.hardware.power.SessionHint;
+import android.hardware.power.SessionMode;
import android.hardware.power.WorkDuration;
@VintfStability
@@ -81,4 +82,13 @@
* must be thrown.
*/
void setThreads(in int[] threadIds);
+
+ /**
+ * Called to enable or disable special modes for the hint session, which may
+ * adjust the power or performance of the session.
+ *
+ * @param type The mode being set
+ * @param enabled True to enable the mode, false to disable it
+ */
+ oneway void setMode(SessionMode type, boolean enabled);
}
diff --git a/power/aidl/android/hardware/power/Mode.aidl b/power/aidl/android/hardware/power/Mode.aidl
index cc4b130..a8fba72 100644
--- a/power/aidl/android/hardware/power/Mode.aidl
+++ b/power/aidl/android/hardware/power/Mode.aidl
@@ -134,11 +134,6 @@
DISPLAY_INACTIVE,
/**
- * Below hints are currently not sent in Android framework but OEM might choose to
- * implement for power/perf optimizations.
- */
-
- /**
* This mode indicates that low latency audio is active.
*/
AUDIO_STREAMING_LOW_LATENCY,
@@ -172,4 +167,16 @@
* This mode indicates that the user is waiting for loading in a game.
*/
GAME_LOADING,
+
+ /**
+ * This mode indicates that the display layout is changing due to rotation
+ * or switching between inner and outer panels.
+ */
+ DISPLAY_CHANGE,
+
+ /**
+ * This mode indicates that the device is rendering to a remote display in
+ * a vehicle (such as Android Auto projection screen).
+ */
+ AUTOMOTIVE_PROJECTION,
}
diff --git a/power/aidl/android/hardware/power/SessionHint.aidl b/power/aidl/android/hardware/power/SessionHint.aidl
index a172e12..ae91061 100644
--- a/power/aidl/android/hardware/power/SessionHint.aidl
+++ b/power/aidl/android/hardware/power/SessionHint.aidl
@@ -52,4 +52,17 @@
* power hint session is noncritical despite its CPU intensity.
*/
POWER_EFFICIENCY = 4,
+
+ /**
+ * This hint indicates an increase in GPU workload intensity. It means that
+ * this hint session needs extra GPU resources to meet the target duration.
+ * This hint must be sent before reporting the actual duration to the session.
+ */
+ GPU_LOAD_UP = 5,
+
+ /**
+ * This hint indicates a decrease in GPU workload intensity. It means that
+ * this hint session can reduce GPU resources and still meet the target duration.
+ */
+ GPU_LOAD_DOWN = 6,
}
diff --git a/power/aidl/android/hardware/power/SessionMode.aidl b/power/aidl/android/hardware/power/SessionMode.aidl
new file mode 100644
index 0000000..f1ee64e
--- /dev/null
+++ b/power/aidl/android/hardware/power/SessionMode.aidl
@@ -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.
+ */
+
+package android.hardware.power;
+
+@VintfStability
+@Backing(type="int")
+enum SessionMode {
+ /**
+ * This mode indicates that the work of this hint session is not
+ * critical to perceived performance, despite its CPU intensity,
+ * and can be safely scheduled to prefer power efficiency.
+ */
+ POWER_EFFICIENCY,
+}
diff --git a/power/aidl/android/hardware/power/WorkDuration.aidl b/power/aidl/android/hardware/power/WorkDuration.aidl
index a06a058..fcd638b 100644
--- a/power/aidl/android/hardware/power/WorkDuration.aidl
+++ b/power/aidl/android/hardware/power/WorkDuration.aidl
@@ -23,8 +23,30 @@
* sample was measured.
*/
long timeStampNanos;
+
/**
- * Work duration in nanoseconds.
+ * Total work duration in nanoseconds.
*/
long durationNanos;
+
+ /**
+ * Timestamp in nanoseconds based on CLOCK_MONOTONIC when the work starts.
+ * The work period start timestamp could be zero if the call is from
+ * the legacy SDK/NDK reportActualWorkDuration API.
+ */
+ long workPeriodStartTimestampNanos;
+
+ /**
+ * CPU work duration in nanoseconds.
+ * The CPU work duration could be the same as the total work duration if
+ * the call is from the legacy SDK/NDK reportActualWorkDuration API.
+ */
+ long cpuDurationNanos;
+
+ /**
+ * GPU work duration in nanoseconds.
+ * The GPU work duration could be zero if the call is from the legacy
+ * SDK/NDK reportActualWorkDuration API.
+ */
+ long gpuDurationNanos;
}
diff --git a/power/aidl/default/Android.bp b/power/aidl/default/Android.bp
index 64766fc..e3af179 100644
--- a/power/aidl/default/Android.bp
+++ b/power/aidl/default/Android.bp
@@ -23,6 +23,7 @@
cc_binary {
name: "android.hardware.power-service.example",
+ defaults: ["android.hardware.power-ndk_shared"],
relative_install_path: "hw",
init_rc: [":android.hardware.power.rc"],
vintf_fragments: [":android.hardware.power.xml"],
@@ -30,7 +31,6 @@
shared_libs: [
"libbase",
"libbinder_ndk",
- "android.hardware.power-V4-ndk",
],
srcs: [
"main.cpp",
diff --git a/power/aidl/default/PowerHintSession.cpp b/power/aidl/default/PowerHintSession.cpp
index f395800..452e435 100644
--- a/power/aidl/default/PowerHintSession.cpp
+++ b/power/aidl/default/PowerHintSession.cpp
@@ -59,4 +59,8 @@
return ScopedAStatus::ok();
}
+ScopedAStatus PowerHintSession::setMode(SessionMode /* mode */, bool /* enabled */) {
+ return ScopedAStatus::ok();
+}
+
} // namespace aidl::android::hardware::power::impl::example
diff --git a/power/aidl/default/PowerHintSession.h b/power/aidl/default/PowerHintSession.h
index 1d74716..b488bf1 100644
--- a/power/aidl/default/PowerHintSession.h
+++ b/power/aidl/default/PowerHintSession.h
@@ -18,6 +18,7 @@
#include <aidl/android/hardware/power/BnPowerHintSession.h>
#include <aidl/android/hardware/power/SessionHint.h>
+#include <aidl/android/hardware/power/SessionMode.h>
#include <aidl/android/hardware/power/WorkDuration.h>
namespace aidl::android::hardware::power::impl::example {
@@ -33,6 +34,7 @@
ndk::ScopedAStatus close() override;
ndk::ScopedAStatus sendHint(SessionHint hint) override;
ndk::ScopedAStatus setThreads(const std::vector<int32_t>& threadIds) override;
+ ndk::ScopedAStatus setMode(SessionMode mode, bool enabled) override;
};
} // namespace aidl::android::hardware::power::impl::example
diff --git a/power/aidl/default/power-default.xml b/power/aidl/default/power-default.xml
index f5dd6b9..418fb83 100644
--- a/power/aidl/default/power-default.xml
+++ b/power/aidl/default/power-default.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.power</name>
- <version>4</version>
+ <version>5</version>
<fqname>IPower/default</fqname>
</hal>
</manifest>
diff --git a/power/aidl/vts/Android.bp b/power/aidl/vts/Android.bp
index 56c98bd..eb98b8b 100644
--- a/power/aidl/vts/Android.bp
+++ b/power/aidl/vts/Android.bp
@@ -26,14 +26,12 @@
defaults: [
"VtsHalTargetTestDefaults",
"use_libaidlvintf_gtest_helper_static",
+ "android.hardware.power-ndk_static",
],
srcs: ["VtsHalPowerTargetTest.cpp"],
shared_libs: [
"libbinder_ndk",
],
- static_libs: [
- "android.hardware.power-V4-ndk",
- ],
test_suites: [
"general-tests",
"vts",
diff --git a/power/aidl/vts/VtsHalPowerTargetTest.cpp b/power/aidl/vts/VtsHalPowerTargetTest.cpp
index 907cf00..eb28c8c 100644
--- a/power/aidl/vts/VtsHalPowerTargetTest.cpp
+++ b/power/aidl/vts/VtsHalPowerTargetTest.cpp
@@ -29,12 +29,12 @@
namespace aidl::android::hardware::power {
namespace {
-using ::android::base::GetUintProperty;
using android::hardware::power::Boost;
using android::hardware::power::IPower;
using android::hardware::power::IPowerHintSession;
using android::hardware::power::Mode;
using android::hardware::power::SessionHint;
+using android::hardware::power::SessionMode;
using android::hardware::power::WorkDuration;
const std::vector<Boost> kBoosts{ndk::enum_range<Boost>().begin(), ndk::enum_range<Boost>().end()};
@@ -44,6 +44,9 @@
const std::vector<SessionHint> kSessionHints{ndk::enum_range<SessionHint>().begin(),
ndk::enum_range<SessionHint>().end()};
+const std::vector<SessionMode> kSessionModes{ndk::enum_range<SessionMode>().begin(),
+ ndk::enum_range<SessionMode>().end()};
+
const std::vector<Boost> kInvalidBoosts = {
static_cast<Boost>(static_cast<int32_t>(kBoosts.front()) - 1),
static_cast<Boost>(static_cast<int32_t>(kBoosts.back()) + 1),
@@ -59,6 +62,11 @@
static_cast<SessionHint>(static_cast<int32_t>(kSessionHints.back()) + 1),
};
+const std::vector<SessionMode> kInvalidSessionModes = {
+ static_cast<SessionMode>(static_cast<int32_t>(kSessionModes.front()) - 1),
+ static_cast<SessionMode>(static_cast<int32_t>(kSessionModes.back()) + 1),
+};
+
class DurationWrapper : public WorkDuration {
public:
DurationWrapper(int64_t dur, int64_t time) {
@@ -90,36 +98,33 @@
DurationWrapper(1000000000L, 4L),
};
-// DEVICEs launching with Android 11 MUST meet the requirements for the
-// target-level=5 compatibility_matrix file.
-const uint64_t kCompatibilityMatrix5ApiLevel = 30;
-
-// DEVICEs launching with Android 13 MUST meet the requirements for the
-// target-level=7 compatibility_matrix file.
-const uint64_t kCompatibilityMatrix7ApiLevel = 33;
-
-// DEVICEs launching with Android 14 MUST meet the requirements for the
-// target-level=8 compatibility_matrix file.
-const uint64_t kCompatibilityMatrix8ApiLevel = 34;
-
-inline bool isUnknownOrUnsupported(const ndk::ScopedAStatus& status) {
- return status.getStatus() == STATUS_UNKNOWN_TRANSACTION ||
- status.getExceptionCode() == EX_UNSUPPORTED_OPERATION;
-}
-
class PowerAidl : public testing::TestWithParam<std::string> {
public:
virtual void SetUp() override {
AIBinder* binder = AServiceManager_waitForService(GetParam().c_str());
ASSERT_NE(binder, nullptr);
power = IPower::fromBinder(ndk::SpAIBinder(binder));
-
- mApiLevel = GetUintProperty<uint64_t>("ro.vendor.api_level", 0);
- ASSERT_NE(mApiLevel, 0);
+ auto status = power->getInterfaceVersion(&mServiceVersion);
+ ASSERT_TRUE(status.isOk());
}
std::shared_ptr<IPower> power;
- uint64_t mApiLevel;
+ int32_t mServiceVersion;
+};
+
+class HintSessionAidl : public PowerAidl {
+ public:
+ virtual void SetUp() override {
+ PowerAidl::SetUp();
+ if (mServiceVersion < 2) {
+ GTEST_SKIP() << "DEVICE not launching with Power V2 and beyond.";
+ }
+
+ auto status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &mSession);
+ ASSERT_TRUE(status.isOk());
+ ASSERT_NE(nullptr, mSession);
+ }
+ std::shared_ptr<IPowerHintSession> mSession;
};
TEST_P(PowerAidl, setMode) {
@@ -173,113 +178,95 @@
}
TEST_P(PowerAidl, getHintSessionPreferredRate) {
- int64_t rate = -1;
- auto status = power->getHintSessionPreferredRate(&rate);
- if (mApiLevel < kCompatibilityMatrix7ApiLevel && !status.isOk()) {
- EXPECT_TRUE(isUnknownOrUnsupported(status));
- GTEST_SKIP() << "DEVICE not launching with Android 13 and beyond.";
+ if (mServiceVersion < 2) {
+ GTEST_SKIP() << "DEVICE not launching with Power V2 and beyond.";
}
- ASSERT_TRUE(status.isOk());
+
+ int64_t rate = -1;
+ ASSERT_TRUE(power->getHintSessionPreferredRate(&rate).isOk());
// At least 1ms rate limit from HAL
ASSERT_GE(rate, 1000000);
}
-TEST_P(PowerAidl, createAndCloseHintSession) {
- std::shared_ptr<IPowerHintSession> session;
- auto status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &session);
- if (mApiLevel < kCompatibilityMatrix7ApiLevel && !status.isOk()) {
- EXPECT_TRUE(isUnknownOrUnsupported(status));
- GTEST_SKIP() << "DEVICE not launching with Android 13 and beyond.";
- }
- ASSERT_TRUE(status.isOk());
- ASSERT_NE(nullptr, session);
- ASSERT_TRUE(session->pause().isOk());
- ASSERT_TRUE(session->resume().isOk());
+TEST_P(HintSessionAidl, createAndCloseHintSession) {
+ ASSERT_TRUE(mSession->pause().isOk());
+ ASSERT_TRUE(mSession->resume().isOk());
// Test normal destroy operation
- ASSERT_TRUE(session->close().isOk());
- session.reset();
+ ASSERT_TRUE(mSession->close().isOk());
+ mSession.reset();
}
-TEST_P(PowerAidl, createHintSessionFailed) {
+TEST_P(HintSessionAidl, createHintSessionFailed) {
std::shared_ptr<IPowerHintSession> session;
auto status = power->createHintSession(getpid(), getuid(), kEmptyTids, 16666666L, &session);
// Regardless of whether V2 and beyond is supported, the status is always not STATUS_OK.
ASSERT_FALSE(status.isOk());
-
- // If device not launching with Android 13 and beyond, check whether it's supported,
- // if not, skip the test.
- if (mApiLevel < kCompatibilityMatrix7ApiLevel && isUnknownOrUnsupported(status)) {
- GTEST_SKIP() << "DEVICE not launching with Android 13 and beyond.";
- }
ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode());
}
-TEST_P(PowerAidl, updateAndReportDurations) {
- std::shared_ptr<IPowerHintSession> session;
- auto status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &session);
- if (mApiLevel < kCompatibilityMatrix7ApiLevel && !status.isOk()) {
- EXPECT_TRUE(isUnknownOrUnsupported(status));
- GTEST_SKIP() << "DEVICE not launching with Android 13 and beyond.";
- }
- ASSERT_TRUE(status.isOk());
- ASSERT_NE(nullptr, session);
-
- ASSERT_TRUE(session->updateTargetWorkDuration(16666667LL).isOk());
- ASSERT_TRUE(session->reportActualWorkDuration(kDurations).isOk());
+TEST_P(HintSessionAidl, updateAndReportDurations) {
+ ASSERT_TRUE(mSession->updateTargetWorkDuration(16666667LL).isOk());
+ ASSERT_TRUE(mSession->reportActualWorkDuration(kDurations).isOk());
}
-TEST_P(PowerAidl, sendSessionHint) {
- std::shared_ptr<IPowerHintSession> session;
- auto status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &session);
- if (!status.isOk()) {
- EXPECT_TRUE(isUnknownOrUnsupported(status));
- return;
+TEST_P(HintSessionAidl, sendSessionHint) {
+ if (mServiceVersion < 4) {
+ GTEST_SKIP() << "DEVICE not launching with Power V4 and beyond.";
}
+
for (const auto& sessionHint : kSessionHints) {
- ASSERT_TRUE(session->sendHint(sessionHint).isOk());
+ ASSERT_TRUE(mSession->sendHint(sessionHint).isOk());
}
for (const auto& sessionHint : kInvalidSessionHints) {
- ASSERT_TRUE(session->sendHint(sessionHint).isOk());
+ ASSERT_TRUE(mSession->sendHint(sessionHint).isOk());
}
}
-TEST_P(PowerAidl, setThreads) {
- std::shared_ptr<IPowerHintSession> session;
- auto status = power->createHintSession(getpid(), getuid(), kSelfTids, 16666666L, &session);
- if (mApiLevel < kCompatibilityMatrix7ApiLevel && !status.isOk()) {
- EXPECT_TRUE(isUnknownOrUnsupported(status));
- GTEST_SKIP() << "DEVICE not launching with Android 13 and beyond.";
+TEST_P(HintSessionAidl, setThreads) {
+ if (mServiceVersion < 4) {
+ GTEST_SKIP() << "DEVICE not launching with Power V4 and beyond.";
}
- ASSERT_TRUE(status.isOk());
- status = session->setThreads(kEmptyTids);
- if (mApiLevel < kCompatibilityMatrix8ApiLevel && isUnknownOrUnsupported(status)) {
- GTEST_SKIP() << "DEVICE not launching with Android 14 and beyond.";
- }
+ auto status = mSession->setThreads(kEmptyTids);
ASSERT_FALSE(status.isOk());
ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode());
- status = session->setThreads(kSelfTids);
- ASSERT_TRUE(status.isOk());
+ ASSERT_TRUE(mSession->setThreads(kSelfTids).isOk());
+}
+
+TEST_P(HintSessionAidl, setSessionMode) {
+ if (mServiceVersion < 5) {
+ GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond.";
+ }
+
+ for (const auto& sessionMode : kSessionModes) {
+ ASSERT_TRUE(mSession->setMode(sessionMode, true).isOk());
+ ASSERT_TRUE(mSession->setMode(sessionMode, false).isOk());
+ }
+ for (const auto& sessionMode : kInvalidSessionModes) {
+ ASSERT_TRUE(mSession->setMode(sessionMode, true).isOk());
+ ASSERT_TRUE(mSession->setMode(sessionMode, false).isOk());
+ }
}
// FIXED_PERFORMANCE mode is required for all devices which ship on Android 11
// or later
TEST_P(PowerAidl, hasFixedPerformance) {
- if (mApiLevel < kCompatibilityMatrix5ApiLevel) {
- GTEST_SKIP() << "FIXED_PERFORMANCE mode is only required for all devices launching Android "
- "11 or later.";
- }
bool supported;
ASSERT_TRUE(power->isModeSupported(Mode::FIXED_PERFORMANCE, &supported).isOk());
ASSERT_TRUE(supported);
}
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(PowerAidl);
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(HintSessionAidl);
+
INSTANTIATE_TEST_SUITE_P(Power, PowerAidl,
testing::ValuesIn(::android::getAidlHalInstanceNames(IPower::descriptor)),
::android::PrintInstanceNameToString);
+INSTANTIATE_TEST_SUITE_P(Power, HintSessionAidl,
+ testing::ValuesIn(::android::getAidlHalInstanceNames(IPower::descriptor)),
+ ::android::PrintInstanceNameToString);
} // namespace
} // namespace aidl::android::hardware::power
diff --git a/radio/aidl/Android.bp b/radio/aidl/Android.bp
index 09f845b..7d4eb13 100644
--- a/radio/aidl/Android.bp
+++ b/radio/aidl/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_fwk_telephony",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -12,7 +13,6 @@
vendor_available: true,
host_supported: true,
srcs: ["android/hardware/radio/*.aidl"],
- frozen: true,
stability: "vintf",
backend: {
cpp: {
@@ -41,9 +41,8 @@
vendor_available: true,
host_supported: true,
srcs: ["android/hardware/radio/config/*.aidl"],
- frozen: true,
stability: "vintf",
- imports: ["android.hardware.radio-V2"],
+ imports: ["android.hardware.radio-V3"],
backend: {
cpp: {
enabled: true,
@@ -72,7 +71,7 @@
host_supported: true,
srcs: ["android/hardware/radio/data/*.aidl"],
stability: "vintf",
- imports: ["android.hardware.radio-V2"],
+ imports: ["android.hardware.radio-V3"],
backend: {
cpp: {
enabled: true,
@@ -92,8 +91,6 @@
},
],
- frozen: true,
-
}
aidl_interface {
@@ -102,7 +99,7 @@
host_supported: true,
srcs: ["android/hardware/radio/messaging/*.aidl"],
stability: "vintf",
- imports: ["android.hardware.radio-V2"],
+ imports: ["android.hardware.radio-V3"],
backend: {
cpp: {
enabled: true,
@@ -122,8 +119,6 @@
},
],
- frozen: true,
-
}
aidl_interface {
@@ -132,7 +127,7 @@
host_supported: true,
srcs: ["android/hardware/radio/modem/*.aidl"],
stability: "vintf",
- imports: ["android.hardware.radio-V2"],
+ imports: ["android.hardware.radio-V3"],
backend: {
cpp: {
enabled: true,
@@ -152,8 +147,6 @@
},
],
- frozen: true,
-
}
aidl_interface {
@@ -162,7 +155,7 @@
host_supported: true,
srcs: ["android/hardware/radio/network/*.aidl"],
stability: "vintf",
- imports: ["android.hardware.radio-V2"],
+ imports: ["android.hardware.radio-V3"],
backend: {
cpp: {
enabled: true,
@@ -182,8 +175,6 @@
},
],
- frozen: true,
-
}
aidl_interface {
@@ -212,7 +203,6 @@
},
],
frozen: true,
-
}
aidl_interface {
@@ -222,8 +212,8 @@
srcs: ["android/hardware/radio/sim/*.aidl"],
stability: "vintf",
imports: [
- "android.hardware.radio-V2",
- "android.hardware.radio.config-V2",
+ "android.hardware.radio-V3",
+ "android.hardware.radio.config-V3",
],
backend: {
cpp: {
@@ -250,8 +240,6 @@
},
],
- frozen: true,
-
}
aidl_interface {
@@ -260,7 +248,7 @@
host_supported: true,
srcs: ["android/hardware/radio/voice/*.aidl"],
stability: "vintf",
- imports: ["android.hardware.radio-V2"],
+ imports: ["android.hardware.radio-V3"],
backend: {
cpp: {
enabled: true,
@@ -280,8 +268,6 @@
},
],
- frozen: true,
-
}
aidl_interface {
@@ -290,8 +276,8 @@
srcs: ["android/hardware/radio/ims/media/*.aidl"],
stability: "vintf",
imports: [
- "android.hardware.radio-V2",
- "android.hardware.radio.data-V2",
+ "android.hardware.radio-V3",
+ "android.hardware.radio.data-V3",
],
backend: {
cpp: {
@@ -310,8 +296,6 @@
],
},
],
- frozen: true,
-
}
aidl_interface {
@@ -319,7 +303,7 @@
vendor_available: true,
srcs: ["android/hardware/radio/ims/*.aidl"],
stability: "vintf",
- imports: ["android.hardware.radio-V2"],
+ imports: ["android.hardware.radio-V3"],
backend: {
cpp: {
enabled: false,
@@ -334,6 +318,4 @@
imports: ["android.hardware.radio-V2"],
},
],
- frozen: true,
-
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
index a48a89b..0f5e7e4 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
@@ -40,6 +40,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.config;
+/* @hide */
@VintfStability
interface IRadioConfig {
oneway void getHalDeviceCapabilities(in int serial);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl
index 994e337..9189f90 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.config;
+/* @hide */
@VintfStability
interface IRadioConfigIndication {
oneway void simSlotsStatusChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.config.SimSlotStatus[] slotStatus);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl
index 038b0ae..348aa34 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.config;
+/* @hide */
@VintfStability
interface IRadioConfigResponse {
oneway void getHalDeviceCapabilitiesResponse(in android.hardware.radio.RadioResponseInfo info, in boolean modemReducedFeatureSet1);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl
index 74017e4..41c4201 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.config;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum MultipleEnabledProfilesMode {
NONE,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl
index db3a4c6..3648866 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.config;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable PhoneCapability {
byte maxActiveData;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimPortInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimPortInfo.aidl
index b5d31ad..ede3189 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimPortInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimPortInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.config;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SimPortInfo {
String iccId;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl
index c264dfd..e84e7d4 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SimSlotStatus.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.config;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SimSlotStatus {
int cardState;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SlotPortMapping.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SlotPortMapping.aidl
index 31271ee..5278e79 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SlotPortMapping.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/SlotPortMapping.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.config;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SlotPortMapping {
int physicalSlotId;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnAuthType.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnAuthType.aidl
index a33ad6e..eed8170 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnAuthType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnAuthType.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum ApnAuthType {
NO_PAP_NO_CHAP,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnTypes.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnTypes.aidl
index 45d22c8..782dbbf 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnTypes.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/ApnTypes.aidl
@@ -32,22 +32,24 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum ApnTypes {
NONE = 0,
- DEFAULT = (1 << 0),
- MMS = (1 << 1),
- SUPL = (1 << 2),
- DUN = (1 << 3),
- HIPRI = (1 << 4),
- FOTA = (1 << 5),
- IMS = (1 << 6),
- CBS = (1 << 7),
- IA = (1 << 8),
- EMERGENCY = (1 << 9),
- MCX = (1 << 10),
- XCAP = (1 << 11),
- VSIM = (1 << 12),
- BIP = (1 << 13),
- ENTERPRISE = (1 << 14),
+ DEFAULT = (1 << 0) /* 1 */,
+ MMS = (1 << 1) /* 2 */,
+ SUPL = (1 << 2) /* 4 */,
+ DUN = (1 << 3) /* 8 */,
+ HIPRI = (1 << 4) /* 16 */,
+ FOTA = (1 << 5) /* 32 */,
+ IMS = (1 << 6) /* 64 */,
+ CBS = (1 << 7) /* 128 */,
+ IA = (1 << 8) /* 256 */,
+ EMERGENCY = (1 << 9) /* 512 */,
+ MCX = (1 << 10) /* 1024 */,
+ XCAP = (1 << 11) /* 2048 */,
+ VSIM = (1 << 12) /* 4096 */,
+ BIP = (1 << 13) /* 8192 */,
+ ENTERPRISE = (1 << 14) /* 16384 */,
+ RCS = (1 << 15) /* 32768 */,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl
index 8a3fd4f..009b428 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataCallFailCause.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum DataCallFailCause {
NONE = 0,
@@ -101,12 +102,12 @@
OEM_DCFAILCAUSE_13 = 0x100D,
OEM_DCFAILCAUSE_14 = 0x100E,
OEM_DCFAILCAUSE_15 = 0x100F,
- VOICE_REGISTRATION_FAIL = (-1),
- DATA_REGISTRATION_FAIL = (-2),
- SIGNAL_LOST = (-3),
- PREF_RADIO_TECH_CHANGED = (-4),
- RADIO_POWER_OFF = (-5),
- TETHERED_CALL_ACTIVE = (-6),
+ VOICE_REGISTRATION_FAIL = (-1) /* -1 */,
+ DATA_REGISTRATION_FAIL = (-2) /* -2 */,
+ SIGNAL_LOST = (-3) /* -3 */,
+ PREF_RADIO_TECH_CHANGED = (-4) /* -4 */,
+ RADIO_POWER_OFF = (-5) /* -5 */,
+ TETHERED_CALL_ACTIVE = (-6) /* -6 */,
ERROR_UNSPECIFIED = 0xffff,
LLC_SNDCP = 0x19,
ACTIVATION_REJECTED_BCM_VIOLATION = 0x30,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl
index 0136fa4..7f3fdc7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataProfileInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable DataProfileInfo {
int profileId;
@@ -54,6 +55,7 @@
boolean persistent;
boolean alwaysOn;
android.hardware.radio.data.TrafficDescriptor trafficDescriptor;
+ int infrastructureBitmap = INFRASTRUCTURE_UNKNOWN /* 0 */;
const int ID_DEFAULT = 0;
const int ID_TETHERED = 1;
const int ID_IMS = 2;
@@ -64,4 +66,7 @@
const int TYPE_COMMON = 0;
const int TYPE_3GPP = 1;
const int TYPE_3GPP2 = 2;
+ const int INFRASTRUCTURE_UNKNOWN = 0;
+ const int INFRASTRUCTURE_CELLULAR = (1 << 0) /* 1 */;
+ const int INFRASTRUCTURE_SATELLITE = (1 << 1) /* 2 */;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataRequestReason.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataRequestReason.aidl
index 0ddaff1..98ae53a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataRequestReason.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataRequestReason.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum DataRequestReason {
NORMAL = 1,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataThrottlingAction.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataThrottlingAction.aidl
index e80a764..e1fedb8 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataThrottlingAction.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/DataThrottlingAction.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@Backing(type="byte") @JavaDerive(toString=true) @VintfStability
enum DataThrottlingAction {
NO_DATA_THROTTLING,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/EpsQos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/EpsQos.aidl
index 5b9aaa0..3a3f41d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/EpsQos.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/EpsQos.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable EpsQos {
int qci;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl
index 7b572f1..3888c62 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioData.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@VintfStability
interface IRadioData {
oneway void allocatePduSessionId(in int serial);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataIndication.aidl
index 0ffa1f7..6057d6a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataIndication.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataIndication.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@VintfStability
interface IRadioDataIndication {
oneway void dataCallListChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.data.SetupDataCallResult[] dcList);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataResponse.aidl
index 4edc17d..dc44454 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataResponse.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/IRadioDataResponse.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@VintfStability
interface IRadioDataResponse {
oneway void acknowledgeRequest(in int serial);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/KeepaliveRequest.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/KeepaliveRequest.aidl
index 592a54a..789ee86 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/KeepaliveRequest.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/KeepaliveRequest.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable KeepaliveRequest {
int type;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/KeepaliveStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/KeepaliveStatus.aidl
index 82b0fc8..404b44a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/KeepaliveStatus.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/KeepaliveStatus.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable KeepaliveStatus {
int sessionHandle;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/LinkAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/LinkAddress.aidl
index 77d637b..bef4c73 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/LinkAddress.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/LinkAddress.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable LinkAddress {
String address;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/NrQos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/NrQos.aidl
index be859b7..22bbe42 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/NrQos.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/NrQos.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable NrQos {
int fiveQi;
@@ -42,8 +43,8 @@
* @deprecated use averagingWindowMillis;
*/
char averagingWindowMs;
- int averagingWindowMillis = AVERAGING_WINDOW_UNKNOWN;
+ int averagingWindowMillis = AVERAGING_WINDOW_UNKNOWN /* -1 */;
const byte FLOW_ID_RANGE_MIN = 1;
const byte FLOW_ID_RANGE_MAX = 63;
- const int AVERAGING_WINDOW_UNKNOWN = (-1);
+ const int AVERAGING_WINDOW_UNKNOWN = (-1) /* -1 */;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/OsAppId.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/OsAppId.aidl
index 8595d52..e4bbf79 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/OsAppId.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/OsAppId.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable OsAppId {
byte[] osAppId;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PcoDataInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PcoDataInfo.aidl
index 033b12f..ea7529c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PcoDataInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PcoDataInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable PcoDataInfo {
int cid;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PdpProtocolType.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PdpProtocolType.aidl
index d1c4a62..3a7f82d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PdpProtocolType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PdpProtocolType.aidl
@@ -32,9 +32,10 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum PdpProtocolType {
- UNKNOWN = (-1),
+ UNKNOWN = (-1) /* -1 */,
IP = 0,
IPV6 = 1,
IPV4V6 = 2,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PortRange.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PortRange.aidl
index 470a9c1..45e2dc9 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PortRange.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/PortRange.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable PortRange {
int start;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/Qos.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/Qos.aidl
index ca06e41..4dac56c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/Qos.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/Qos.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
union Qos {
boolean noinit;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosBandwidth.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosBandwidth.aidl
index 6d4b7a9..b59dee0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosBandwidth.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosBandwidth.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable QosBandwidth {
int maxBitrateKbps;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilter.aidl
index de45cc5..a3208d9 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilter.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilter.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable QosFilter {
String[] localAddresses;
@@ -47,7 +48,7 @@
const byte DIRECTION_DOWNLINK = 0;
const byte DIRECTION_UPLINK = 1;
const byte DIRECTION_BIDIRECTIONAL = 2;
- const byte PROTOCOL_UNSPECIFIED = (-1);
+ const byte PROTOCOL_UNSPECIFIED = (-1) /* -1 */;
const byte PROTOCOL_TCP = 6;
const byte PROTOCOL_UDP = 17;
const byte PROTOCOL_ESP = 50;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterIpsecSpi.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterIpsecSpi.aidl
index 4b75340..50b52a4 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterIpsecSpi.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterIpsecSpi.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
union QosFilterIpsecSpi {
boolean noinit;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl
index 3fb34ea..4913dcf 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
union QosFilterIpv6FlowLabel {
boolean noinit;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterTypeOfService.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterTypeOfService.aidl
index fa85b5a..4f0d260 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterTypeOfService.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosFilterTypeOfService.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
union QosFilterTypeOfService {
boolean noinit;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosSession.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosSession.aidl
index bbfdd2d..89010a9 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosSession.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/QosSession.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable QosSession {
int qosSessionId;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/RouteSelectionDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/RouteSelectionDescriptor.aidl
index d83df81..8864c24 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/RouteSelectionDescriptor.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/RouteSelectionDescriptor.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable RouteSelectionDescriptor {
byte precedence;
@@ -39,7 +40,7 @@
byte sscMode;
android.hardware.radio.data.SliceInfo[] sliceInfo;
String[] dnn;
- const byte SSC_MODE_UNKNOWN = (-1);
+ const byte SSC_MODE_UNKNOWN = (-1) /* -1 */;
const byte SSC_MODE_1 = 1;
const byte SSC_MODE_2 = 2;
const byte SSC_MODE_3 = 3;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SetupDataCallResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SetupDataCallResult.aidl
index 83f9db6..6ae626e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SetupDataCallResult.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SetupDataCallResult.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SetupDataCallResult {
android.hardware.radio.data.DataCallFailCause cause;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SliceInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SliceInfo.aidl
index efe4816..60df402 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SliceInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SliceInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SliceInfo {
byte sliceServiceType;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SlicingConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SlicingConfig.aidl
index b00febe..4d28737 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SlicingConfig.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/SlicingConfig.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SlicingConfig {
android.hardware.radio.data.UrspRule[] urspRules;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/TrafficDescriptor.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/TrafficDescriptor.aidl
index d7b0654..dc474a2 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/TrafficDescriptor.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/TrafficDescriptor.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable TrafficDescriptor {
@nullable String dnn;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/UrspRule.aidl b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/UrspRule.aidl
index 7002fd1..6850f6a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/UrspRule.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.data/current/android/hardware/radio/data/UrspRule.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.data;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable UrspRule {
int precedence;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl
index 37e3b25..36a538c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrMode.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@Backing(type="int") @VintfStability
+/* @hide */
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum AmrMode {
AMR_MODE_0 = (1 << 0) /* 1 */,
AMR_MODE_1 = (1 << 1) /* 2 */,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrParams.aidl
index 36edb7f..dcf0dd1 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrParams.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AmrParams.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@VintfStability
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
parcelable AmrParams {
android.hardware.radio.ims.media.AmrMode amrMode;
boolean octetAligned;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrMode.aidl
index c108c07..eca7b93 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/AnbrMode.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable AnbrMode {
android.hardware.radio.ims.media.CodecMode anbrUplinkMode;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CallQuality.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CallQuality.aidl
index fff6e1c..594a39f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CallQuality.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CallQuality.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@VintfStability
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
parcelable CallQuality {
int downlinkCallQualityLevel;
int uplinkCallQualityLevel;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecMode.aidl
index 0e9140f..644321c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecMode.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
union CodecMode {
boolean noinit;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecParams.aidl
index 3da2dbd..6eefb34 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecParams.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecParams.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@VintfStability
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
parcelable CodecParams {
android.hardware.radio.ims.media.CodecType codecType;
byte rxPayloadTypeNumber;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecSpecificParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecSpecificParams.aidl
index 08e3f0f..7e5722f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecSpecificParams.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecSpecificParams.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@VintfStability
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
union CodecSpecificParams {
android.hardware.radio.ims.media.AmrParams amr;
android.hardware.radio.ims.media.EvsParams evs;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl
index e4193cd..98463b1 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/CodecType.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@Backing(type="int") @VintfStability
+/* @hide */
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum CodecType {
AMR = (1 << 0) /* 1 */,
AMR_WB = (1 << 1) /* 2 */,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/DtmfParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/DtmfParams.aidl
index 5523fd8..f420fa7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/DtmfParams.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/DtmfParams.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@VintfStability
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
parcelable DtmfParams {
byte rxPayloadTypeNumber;
byte txPayloadTypeNumber;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl
index db3eb29..d8c77bd 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsBandwidth.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@Backing(type="int") @VintfStability
+/* @hide */
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum EvsBandwidth {
NONE = 0,
NARROW_BAND = (1 << 0) /* 1 */,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl
index fb1f14d..1a59389 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsMode.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@Backing(type="int") @VintfStability
+/* @hide */
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum EvsMode {
EVS_MODE_0 = (1 << 0) /* 1 */,
EVS_MODE_1 = (1 << 1) /* 2 */,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsParams.aidl
index 735eb08..deb53af 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsParams.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/EvsParams.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@VintfStability
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
parcelable EvsParams {
android.hardware.radio.ims.media.EvsBandwidth bandwidth;
android.hardware.radio.ims.media.EvsMode evsMode;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMedia.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMedia.aidl
index 30793e5..190d25b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMedia.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMedia.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
+/* @hide */
@VintfStability
interface IImsMedia {
oneway void setListener(in android.hardware.radio.ims.media.IImsMediaListener mediaListener);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaListener.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaListener.aidl
index 40f7107..9b7a392 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaListener.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaListener.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
+/* @hide */
@VintfStability
interface IImsMediaListener {
oneway void onOpenSessionSuccess(int sessionId, android.hardware.radio.ims.media.IImsMediaSession session);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSession.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSession.aidl
index ea9f3a4..2150fbe 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSession.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSession.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
+/* @hide */
@VintfStability
interface IImsMediaSession {
oneway void setListener(in android.hardware.radio.ims.media.IImsMediaSessionListener sessionListener);
@@ -41,4 +42,6 @@
oneway void stopDtmf();
oneway void sendHeaderExtension(in List<android.hardware.radio.ims.media.RtpHeaderExtension> extensions);
oneway void setMediaQualityThreshold(in android.hardware.radio.ims.media.MediaQualityThreshold threshold);
+ oneway void requestRtpReceptionStats(in int intervalMs);
+ oneway void adjustDelay(in int delayMs);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
index cb221df..87474ef 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
+/* @hide */
@VintfStability
interface IImsMediaSessionListener {
oneway void onModifySessionResponse(in android.hardware.radio.ims.media.RtpConfig config, android.hardware.radio.ims.media.RtpError error);
@@ -41,4 +42,5 @@
oneway void triggerAnbrQuery(in android.hardware.radio.ims.media.RtpConfig config);
oneway void onDtmfReceived(char dtmfDigit, int durationMs);
oneway void onCallQualityChanged(in android.hardware.radio.ims.media.CallQuality callQuality);
+ oneway void notifyRtpReceptionStats(in android.hardware.radio.ims.media.RtpReceptionStats stats);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/LocalEndPoint.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/LocalEndPoint.aidl
index 6ec5156..1095f01 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/LocalEndPoint.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/LocalEndPoint.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@VintfStability
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
parcelable LocalEndPoint {
ParcelFileDescriptor rtpFd;
ParcelFileDescriptor rtcpFd;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaDirection.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaDirection.aidl
index 0e9eaee..5410f2a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaDirection.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaDirection.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@Backing(type="int") @VintfStability
+/* @hide */
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum MediaDirection {
NO_FLOW = 0,
RTP_TX = (1 << 0) /* 1 */,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityStatus.aidl
index 4accf53..da6e751 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityStatus.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityStatus.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@VintfStability
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
parcelable MediaQualityStatus {
int rtpInactivityTimeMillis;
int rtcpInactivityTimeMillis;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityThreshold.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityThreshold.aidl
index 31cf373..ecc379c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityThreshold.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/MediaQualityThreshold.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@VintfStability
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
parcelable MediaQualityThreshold {
int[] rtpInactivityTimerMillis;
int rtcpInactivityTimerMillis;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpConfig.aidl
index 6a76d85..0bc4154 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpConfig.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpConfig.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@VintfStability
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
parcelable RtcpConfig {
String canonicalName;
int transmitPort;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
index 289c810..714442c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@Backing(type="int") @VintfStability
+/* @hide */
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum RtcpXrReportBlockType {
RTCPXR_NONE = 0,
RTCPXR_LOSS_RLE_REPORT_BLOCK = (1 << 0) /* 1 */,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpAddress.aidl
index 35357d1..dd7f466 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpAddress.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpAddress.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@VintfStability
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
parcelable RtpAddress {
String ipAddress;
int portNumber;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl
index 8a826f6..472ec35 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpConfig.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@VintfStability
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
parcelable RtpConfig {
int direction;
android.hardware.radio.AccessNetwork accessNetwork;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpError.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpError.aidl
index 41b0aeb..97dacf1 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpError.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpError.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@Backing(type="int") @VintfStability
+/* @hide */
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum RtpError {
NONE = 0,
INVALID_PARAM = 1,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpHeaderExtension.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpHeaderExtension.aidl
index 83b8a31..06207ee 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpHeaderExtension.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpHeaderExtension.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@VintfStability
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
parcelable RtpHeaderExtension {
int localId;
byte[] data;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpReceptionStats.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpReceptionStats.aidl
new file mode 100644
index 0000000..82b798b
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpReceptionStats.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.radio.ims.media;
+@VintfStability
+parcelable RtpReceptionStats {
+ int rtpTimestamp;
+ int rtpSequenceNumber;
+ int timeDurationMs;
+ int jitterBufferMs;
+ int roundTripTimeMs;
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpSessionParams.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpSessionParams.aidl
index 13a7487..4107432 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpSessionParams.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpSessionParams.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims.media;
-@VintfStability
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
parcelable RtpSessionParams {
byte pTimeMillis;
int maxPtimeMillis;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl
index 90e75f9..421f752 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ConnectionFailureInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable ConnectionFailureInfo {
android.hardware.radio.ims.ConnectionFailureInfo.ConnectionFailureReason failureReason;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/EpsFallbackReason.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/EpsFallbackReason.aidl
index ebea903..75099e7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/EpsFallbackReason.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/EpsFallbackReason.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum EpsFallbackReason {
NO_NETWORK_TRIGGER = 1,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioIms.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioIms.aidl
index 4df8709..6018a4b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioIms.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioIms.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims;
+/* @hide */
@VintfStability
interface IRadioIms {
oneway void setSrvccCallInfo(int serial, in android.hardware.radio.ims.SrvccCall[] srvccCalls);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsIndication.aidl
index ef6b4cc..c754af3 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsIndication.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsIndication.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims;
+/* @hide */
@VintfStability
interface IRadioImsIndication {
oneway void onConnectionSetupFailure(in android.hardware.radio.RadioIndicationType type, int token, in android.hardware.radio.ims.ConnectionFailureInfo info);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsResponse.aidl
index 053ba46..fbb1bfc 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsResponse.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/IRadioImsResponse.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims;
+/* @hide */
@VintfStability
interface IRadioImsResponse {
oneway void setSrvccCallInfoResponse(in android.hardware.radio.RadioResponseInfo info);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl
index 6e14830..3895d75 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsCall.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable ImsCall {
int index;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsDeregistrationReason.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsDeregistrationReason.aidl
index b04e559..5b5bd40 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsDeregistrationReason.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsDeregistrationReason.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum ImsDeregistrationReason {
REASON_SIM_REMOVED = 1,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl
index be5e004..66d8165 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistration.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable ImsRegistration {
android.hardware.radio.ims.ImsRegistrationState regState;
@@ -39,8 +40,8 @@
android.hardware.radio.ims.SuggestedAction suggestedAction;
int capabilities;
const int IMS_MMTEL_CAPABILITY_NONE = 0;
- const int IMS_MMTEL_CAPABILITY_VOICE = (1 << 0);
- const int IMS_MMTEL_CAPABILITY_VIDEO = (1 << 1);
- const int IMS_MMTEL_CAPABILITY_SMS = (1 << 2);
- const int IMS_RCS_CAPABILITIES = (1 << 3);
+ const int IMS_MMTEL_CAPABILITY_VOICE = (1 << 0) /* 1 */;
+ const int IMS_MMTEL_CAPABILITY_VIDEO = (1 << 1) /* 2 */;
+ const int IMS_MMTEL_CAPABILITY_SMS = (1 << 2) /* 4 */;
+ const int IMS_RCS_CAPABILITIES = (1 << 3) /* 8 */;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistrationState.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistrationState.aidl
index 6302b47..01ae565 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistrationState.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsRegistrationState.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum ImsRegistrationState {
NOT_REGISTERED,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamDirection.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamDirection.aidl
index cf2e4f1..efc3551 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamDirection.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamDirection.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum ImsStreamDirection {
UPLINK = 1,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamType.aidl
index 10c477f..853f4b5 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsStreamType.aidl
@@ -32,7 +32,8 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims;
-@Backing(type="int") @VintfStability
+/* @hide */
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum ImsStreamType {
AUDIO = 1,
VIDEO = 2,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsTrafficType.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsTrafficType.aidl
index b1a0b77..4eeda9d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsTrafficType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/ImsTrafficType.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum ImsTrafficType {
EMERGENCY,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl
index 5119b0f..21645da 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SrvccCall.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SrvccCall {
int index;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl
index bbe170e..6dbf09d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl
@@ -32,9 +32,12 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.ims;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum SuggestedAction {
NONE,
TRIGGER_PLMN_BLOCK,
TRIGGER_PLMN_BLOCK_WITH_TIMEOUT,
+ TRIGGER_RAT_BLOCK,
+ TRIGGER_CLEAR_RAT_BLOCK,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl
index 39e2be2..abfb308 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.messaging;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CdmaBroadcastSmsConfigInfo {
int serviceCategory;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsAck.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsAck.aidl
index befdbde..ee8371c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsAck.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsAck.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.messaging;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CdmaSmsAck {
boolean errorClass;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsAddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsAddress.aidl
index ab29c77..7382b1f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsAddress.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsAddress.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.messaging;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CdmaSmsAddress {
int digitMode;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsMessage.aidl
index 867596c..0e98f4b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsMessage.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsMessage.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.messaging;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CdmaSmsMessage {
int teleserviceId;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl
index d67fe8c..a0e3991 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.messaging;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CdmaSmsSubaddress {
int subaddressType;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl
index b0a7f98..d6292e7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.messaging;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CdmaSmsWriteArgs {
int status;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl
index 46604ca..1ccba86 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.messaging;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable GsmBroadcastSmsConfigInfo {
int fromServiceId;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/GsmSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/GsmSmsMessage.aidl
index 4df7fd2..bdd7d0c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/GsmSmsMessage.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/GsmSmsMessage.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.messaging;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable GsmSmsMessage {
String smscPdu;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessaging.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessaging.aidl
index dfec59a..bf5fde5 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessaging.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessaging.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.messaging;
+/* @hide */
@VintfStability
interface IRadioMessaging {
oneway void acknowledgeIncomingGsmSmsWithPdu(in int serial, in boolean success, in String ackPdu);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingIndication.aidl
index 8f7824f..389fb26 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingIndication.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingIndication.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.messaging;
+/* @hide */
@VintfStability
interface IRadioMessagingIndication {
oneway void cdmaNewSms(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.messaging.CdmaSmsMessage msg);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingResponse.aidl
index c3af7a6..9b10464 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingResponse.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/IRadioMessagingResponse.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.messaging;
+/* @hide */
@VintfStability
interface IRadioMessagingResponse {
oneway void acknowledgeIncomingGsmSmsWithPduResponse(in android.hardware.radio.RadioResponseInfo info);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/ImsSmsMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/ImsSmsMessage.aidl
index 85f62b7..40b9ddb 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/ImsSmsMessage.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/ImsSmsMessage.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.messaging;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable ImsSmsMessage {
android.hardware.radio.RadioTechnologyFamily tech;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SendSmsResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SendSmsResult.aidl
index 32f7a5c..3f1d120 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SendSmsResult.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SendSmsResult.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.messaging;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SendSmsResult {
int messageRef;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl
index d061c9e..6aeda3e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.messaging;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum SmsAcknowledgeFailCause {
MEMORY_CAPACITY_EXCEEDED = 0xD3,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsWriteArgs.aidl b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsWriteArgs.aidl
index 489cc07..a294b47 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsWriteArgs.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.messaging/current/android/hardware/radio/messaging/SmsWriteArgs.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.messaging;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SmsWriteArgs {
int status;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsInfo.aidl
index 7e22ee0..c834342 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.modem;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable ActivityStatsInfo {
int sleepModeTimeMs;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
index 08ed9a5..b44ab71 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.modem;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable ActivityStatsTechSpecificInfo {
android.hardware.radio.AccessNetwork rat;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl
index acc0b22..1159f93 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/DeviceStateType.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.modem;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum DeviceStateType {
POWER_SAVE_MODE,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfig.aidl
index 3a0ec25..2d814ef 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfig.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfig.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.modem;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable HardwareConfig {
int type;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigModem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigModem.aidl
index 62bb160..d453cb0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigModem.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigModem.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.modem;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable HardwareConfigModem {
int rilModel;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigSim.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigSim.aidl
index 5810982..4c2e31b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigSim.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/HardwareConfigSim.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.modem;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable HardwareConfigSim {
String modemUuid;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModem.aidl
index 8546be7..bd8ba47 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModem.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModem.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.modem;
+/* @hide */
@VintfStability
interface IRadioModem {
oneway void enableModem(in int serial, in boolean on);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemIndication.aidl
index 514ff9a..3c06877 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemIndication.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemIndication.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.modem;
+/* @hide */
@VintfStability
interface IRadioModemIndication {
oneway void hardwareConfigChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.modem.HardwareConfig[] configs);
@@ -39,4 +40,5 @@
oneway void radioCapabilityIndication(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.modem.RadioCapability rc);
oneway void radioStateChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.modem.RadioState radioState);
oneway void rilConnected(in android.hardware.radio.RadioIndicationType type);
+ oneway void onImeiMappingChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.modem.ImeiInfo imeiInfo);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemResponse.aidl
index 5955439..b9ef51b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemResponse.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/IRadioModemResponse.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.modem;
+/* @hide */
@VintfStability
interface IRadioModemResponse {
oneway void acknowledgeRequest(in int serial);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl
index f8776ec..a2df30d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ImeiInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.modem;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable ImeiInfo {
android.hardware.radio.modem.ImeiInfo.ImeiType type;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvItem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvItem.aidl
index b80d7ac..f97b9a2 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvItem.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvItem.aidl
@@ -33,6 +33,7 @@
package android.hardware.radio.modem;
/**
+ * @hide
* @deprecated NV APIs are deprecated starting from Android U.
*/
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvWriteItem.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvWriteItem.aidl
index 6a786bc..c38ceb7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvWriteItem.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/NvWriteItem.aidl
@@ -33,6 +33,7 @@
package android.hardware.radio.modem;
/**
+ * @hide
* @deprecated NV APIs are deprecated starting from Android U.
*/
@JavaDerive(toString=true) @VintfStability
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/RadioCapability.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/RadioCapability.aidl
index f2e2858..bc3cfcc 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/RadioCapability.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/RadioCapability.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.modem;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable RadioCapability {
int session;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/RadioState.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/RadioState.aidl
index 57f2941..3383fa4 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/RadioState.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/RadioState.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.modem;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum RadioState {
OFF = 0,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl
index 37622b1..b4208b7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.modem/current/android/hardware/radio/modem/ResetNvType.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.modem;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum ResetNvType {
RELOAD,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl
index 28d8862..667a8a7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
union AccessTechnologySpecificInfo {
boolean noinit;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/BarringInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/BarringInfo.aidl
index e105b39..67c9349 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/BarringInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/BarringInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable BarringInfo {
int serviceType;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/BarringTypeSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/BarringTypeSpecificInfo.aidl
index a813633..03369b9 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/BarringTypeSpecificInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/BarringTypeSpecificInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable BarringTypeSpecificInfo {
int factor;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl
index 927f9ac..bc9c0ba 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl
@@ -32,13 +32,14 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable Cdma2000RegistrationInfo {
boolean cssSupported;
int roamingIndicator;
int systemIsInPrl;
int defaultRoamingIndicator;
- const int PRL_INDICATOR_NOT_REGISTERED = (-1);
+ const int PRL_INDICATOR_NOT_REGISTERED = (-1) /* -1 */;
const int PRL_INDICATOR_NOT_IN_PRL = 0;
const int PRL_INDICATOR_IN_PRL = 1;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaRoamingType.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaRoamingType.aidl
index 2a4db70..84532e3 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaRoamingType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaRoamingType.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum CdmaRoamingType {
HOME_NETWORK,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaSignalStrength.aidl
index e2f97bf..94430a8 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaSignalStrength.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CdmaSignalStrength.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CdmaSignalStrength {
int dbm;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellConnectionStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellConnectionStatus.aidl
index 5ce3b3e..3775a40 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellConnectionStatus.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellConnectionStatus.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum CellConnectionStatus {
NONE,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentity.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentity.aidl
index 2ee92de..ba27b39 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentity.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentity.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
union CellIdentity {
boolean noinit;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityCdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityCdma.aidl
index d659a28..63571bb 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityCdma.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityCdma.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CellIdentityCdma {
int networkId;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityGsm.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityGsm.aidl
index d3193be..5040f20 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityGsm.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityGsm.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CellIdentityGsm {
String mcc;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityLte.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityLte.aidl
index 2ae7b43..be7821d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityLte.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityLte.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CellIdentityLte {
String mcc;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityNr.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityNr.aidl
index b30af50..6f4f9a0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityNr.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityNr.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CellIdentityNr {
String mcc;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityTdscdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityTdscdma.aidl
index e99d147..864a886 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityTdscdma.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityTdscdma.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CellIdentityTdscdma {
String mcc;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityWcdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityWcdma.aidl
index 12001fc..4e76277 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityWcdma.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellIdentityWcdma.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CellIdentityWcdma {
String mcc;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfo.aidl
index 467c6b7..6bb31b0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CellInfo {
boolean registered;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoCdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoCdma.aidl
index e3bf46b..6d76a26 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoCdma.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoCdma.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CellInfoCdma {
android.hardware.radio.network.CellIdentityCdma cellIdentityCdma;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoGsm.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoGsm.aidl
index 84dcd07..2074c2f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoGsm.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoGsm.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CellInfoGsm {
android.hardware.radio.network.CellIdentityGsm cellIdentityGsm;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoLte.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoLte.aidl
index 221340b..aa3b310 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoLte.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoLte.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CellInfoLte {
android.hardware.radio.network.CellIdentityLte cellIdentityLte;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoNr.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoNr.aidl
index b392c1d..a8f49af 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoNr.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoNr.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CellInfoNr {
android.hardware.radio.network.CellIdentityNr cellIdentityNr;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl
index 4ab0640..fd3239d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
union CellInfoRatSpecificInfo {
android.hardware.radio.network.CellInfoGsm gsm;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoTdscdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoTdscdma.aidl
index 138b35c..1a03f34 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoTdscdma.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoTdscdma.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CellInfoTdscdma {
android.hardware.radio.network.CellIdentityTdscdma cellIdentityTdscdma;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoWcdma.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoWcdma.aidl
index cf7b135..d02824d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoWcdma.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellInfoWcdma.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CellInfoWcdma {
android.hardware.radio.network.CellIdentityWcdma cellIdentityWcdma;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellularIdentifier.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellularIdentifier.aidl
new file mode 100644
index 0000000..d38494f
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellularIdentifier.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright 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.radio.network;
+/* @hide */
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+enum CellularIdentifier {
+ UNKNOWN = 0,
+ IMSI = 1,
+ IMEI = 2,
+ SUCI = 3,
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellularIdentifierDisclosure.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellularIdentifierDisclosure.aidl
new file mode 100644
index 0000000..cb542e8
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/CellularIdentifierDisclosure.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright 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.radio.network;
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
+parcelable CellularIdentifierDisclosure {
+ String plmn;
+ android.hardware.radio.network.CellularIdentifier identifier;
+ android.hardware.radio.network.NasProtocolMessage protocolMessage;
+ boolean isEmergency;
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl
index fe734c8..b9e6f82 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable ClosedSubscriberGroupInfo {
boolean csgIndication;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ConnectionEvent.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ConnectionEvent.aidl
new file mode 100644
index 0000000..eedb8ed
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ConnectionEvent.aidl
@@ -0,0 +1,50 @@
+/*
+ * Copyright 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.radio.network;
+/* @hide */
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+enum ConnectionEvent {
+ CS_SIGNALLING_GSM = 0,
+ PS_SIGNALLING_GPRS = 1,
+ CS_SIGNALLING_3G = 2,
+ PS_SIGNALLING_3G = 3,
+ NAS_SIGNALLING_LTE = 4,
+ AS_SIGNALLING_LTE = 5,
+ VOLTE_SIP = 6,
+ VOLTE_RTP = 7,
+ NAS_SIGNALLING_5G = 8,
+ AS_SIGNALLING_5G = 9,
+ VONR_SIP = 10,
+ VONR_RTP = 11,
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Domain.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Domain.aidl
index 6b022b6..0de7e20 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Domain.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/Domain.aidl
@@ -32,8 +32,9 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum Domain {
- CS = (1 << 0),
- PS = (1 << 1),
+ CS = (1 << 0) /* 1 */,
+ PS = (1 << 1) /* 2 */,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyMode.aidl
index 071e6b5..c5b067e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyMode.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum EmergencyMode {
EMERGENCY_WWAN = 1,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl
index 2797aff..471c7a0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable EmergencyNetworkScanTrigger {
android.hardware.radio.AccessNetwork[] accessNetwork;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyRegResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyRegResult.aidl
index 7d99a53..3b8083d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyRegResult.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyRegResult.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable EmergencyRegResult {
android.hardware.radio.AccessNetwork accessNetwork;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyScanType.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyScanType.aidl
index 5e86c76..0681a73 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyScanType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EmergencyScanType.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum EmergencyScanType {
NO_PREFERENCE = 0,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranBands.aidl
index 57fac3f..82257ec 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranBands.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranBands.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum EutranBands {
BAND_1 = 1,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl
index 90e342a..bb34fe1 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EutranRegistrationInfo.aidl
@@ -32,14 +32,15 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable EutranRegistrationInfo {
android.hardware.radio.network.LteVopsInfo lteVopsInfo;
android.hardware.radio.network.NrIndicators nrIndicators;
android.hardware.radio.network.EutranRegistrationInfo.AttachResultType lteAttachResultType;
int extraInfo;
- const int EXTRA_CSFB_NOT_PREFERRED = (1 << 0);
- const int EXTRA_SMS_ONLY = (1 << 1);
+ const int EXTRA_CSFB_NOT_PREFERRED = (1 << 0) /* 1 */;
+ const int EXTRA_SMS_ONLY = (1 << 1) /* 2 */;
enum AttachResultType {
NONE,
EPS_ONLY,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EvdoSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EvdoSignalStrength.aidl
index 7c56711..e97e17d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EvdoSignalStrength.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/EvdoSignalStrength.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable EvdoSignalStrength {
int dbm;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/GeranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/GeranBands.aidl
index 135935f..ee0d419 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/GeranBands.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/GeranBands.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum GeranBands {
BAND_T380 = 1,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/GsmSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/GsmSignalStrength.aidl
index 2b53b39..65847ef 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/GsmSignalStrength.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/GsmSignalStrength.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable GsmSignalStrength {
int signalStrength;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl
index 382ddd8..8af617f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetwork.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@VintfStability
interface IRadioNetwork {
oneway void getAllowedNetworkTypesBitmap(in int serial);
@@ -81,4 +82,8 @@
oneway void isNullCipherAndIntegrityEnabled(in int serial);
oneway void isN1ModeEnabled(in int serial);
oneway void setN1ModeEnabled(in int serial, boolean enable);
+ oneway void isCellularIdentifierTransparencyEnabled(in int serial);
+ oneway void setCellularIdentifierTransparencyEnabled(in int serial, in boolean enabled);
+ oneway void setSecurityAlgorithmsUpdatedEnabled(in int serial, boolean enable);
+ oneway void isSecurityAlgorithmsUpdatedEnabled(in int serial);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkIndication.aidl
index 0f017ea..8eea14f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkIndication.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkIndication.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@VintfStability
interface IRadioNetworkIndication {
oneway void barringInfoChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.CellIdentity cellIdentity, in android.hardware.radio.network.BarringInfo[] barringInfos);
@@ -49,4 +50,6 @@
oneway void suppSvcNotify(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.SuppSvcNotification suppSvc);
oneway void voiceRadioTechChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.RadioTechnology rat);
oneway void emergencyNetworkScanResult(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.EmergencyRegResult result);
+ oneway void cellularIdentifierDisclosed(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.CellularIdentifierDisclosure disclosure);
+ oneway void securityAlgorithmsUpdated(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.network.SecurityAlgorithmUpdate securityAlgorithmUpdate);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl
index bfe8fa3..e7f2918 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IRadioNetworkResponse.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@VintfStability
interface IRadioNetworkResponse {
oneway void acknowledgeRequest(in int serial);
@@ -80,4 +81,8 @@
oneway void isNullCipherAndIntegrityEnabledResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isEnabled);
oneway void isN1ModeEnabledResponse(in android.hardware.radio.RadioResponseInfo info, boolean isEnabled);
oneway void setN1ModeEnabledResponse(in android.hardware.radio.RadioResponseInfo info);
+ oneway void isCellularIdentifierTransparencyEnabledResponse(in android.hardware.radio.RadioResponseInfo info, boolean isEnabled);
+ oneway void setCellularIdentifierTransparencyEnabledResponse(in android.hardware.radio.RadioResponseInfo info);
+ oneway void setSecurityAlgorithmsUpdatedEnabledResponse(in android.hardware.radio.RadioResponseInfo info);
+ oneway void isSecurityAlgorithmsUpdatedEnabledResponse(in android.hardware.radio.RadioResponseInfo info, in boolean isEnabled);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IndicationFilter.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IndicationFilter.aidl
index 00ba346..7847fbe 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IndicationFilter.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/IndicationFilter.aidl
@@ -32,15 +32,16 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum IndicationFilter {
NONE = 0,
- ALL = (~0),
- SIGNAL_STRENGTH = (1 << 0),
- FULL_NETWORK_STATE = (1 << 1),
- DATA_CALL_DORMANCY_CHANGED = (1 << 2),
- LINK_CAPACITY_ESTIMATE = (1 << 3),
- PHYSICAL_CHANNEL_CONFIG = (1 << 4),
- REGISTRATION_FAILURE = (1 << 5),
- BARRING_INFO = (1 << 6),
+ ALL = (~0) /* -1 */,
+ SIGNAL_STRENGTH = (1 << 0) /* 1 */,
+ FULL_NETWORK_STATE = (1 << 1) /* 2 */,
+ DATA_CALL_DORMANCY_CHANGED = (1 << 2) /* 4 */,
+ LINK_CAPACITY_ESTIMATE = (1 << 3) /* 8 */,
+ PHYSICAL_CHANNEL_CONFIG = (1 << 4) /* 16 */,
+ REGISTRATION_FAILURE = (1 << 5) /* 32 */,
+ BARRING_INFO = (1 << 6) /* 64 */,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LceDataInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LceDataInfo.aidl
index 27b16c1..6dc6d3e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LceDataInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LceDataInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable LceDataInfo {
int lastHopCapacityKbps;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LinkCapacityEstimate.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LinkCapacityEstimate.aidl
index 5707b8e..3fc4b5c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LinkCapacityEstimate.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LinkCapacityEstimate.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable LinkCapacityEstimate {
int downlinkCapacityKbps;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LteSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LteSignalStrength.aidl
index b5b8579..eb2ca28 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LteSignalStrength.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LteSignalStrength.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable LteSignalStrength {
int signalStrength;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LteVopsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LteVopsInfo.aidl
index 6d8dd4e..f8d3aa1 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LteVopsInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/LteVopsInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable LteVopsInfo {
boolean isVopsSupported;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NasProtocolMessage.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NasProtocolMessage.aidl
new file mode 100644
index 0000000..4fbc802
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NasProtocolMessage.aidl
@@ -0,0 +1,50 @@
+/*
+ * Copyright 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.radio.network;
+/* @hide */
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+enum NasProtocolMessage {
+ UNKNOWN = 0,
+ ATTACH_REQUEST = 1,
+ IDENTITY_RESPONSE = 2,
+ DETACH_REQUEST = 3,
+ TRACKING_AREA_UPDATE_REQUEST = 4,
+ LOCATION_UPDATE_REQUEST = 5,
+ AUTHENTICATION_AND_CIPHERING_RESPONSE = 6,
+ REGISTRATION_REQUEST = 7,
+ DEREGISTRATION_REQUEST = 8,
+ CM_REESTABLISHMENT_REQUEST = 9,
+ CM_SERVICE_REQUEST = 10,
+ IMSI_DETACH_INDICATION = 11,
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NetworkScanRequest.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NetworkScanRequest.aidl
index 6039740..60eaf77 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NetworkScanRequest.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NetworkScanRequest.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable NetworkScanRequest {
int type;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NetworkScanResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NetworkScanResult.aidl
index 4e392d0..695a194 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NetworkScanResult.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NetworkScanResult.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable NetworkScanResult {
int status;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NgranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NgranBands.aidl
index 5904690..fb939df 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NgranBands.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NgranBands.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum NgranBands {
BAND_1 = 1,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrDualConnectivityState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrDualConnectivityState.aidl
index 62c2a56..7af15a7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrDualConnectivityState.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrDualConnectivityState.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@Backing(type="byte") @JavaDerive(toString=true) @VintfStability
enum NrDualConnectivityState {
ENABLE = 1,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrIndicators.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrIndicators.aidl
index 88429f6..efcd6d3 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrIndicators.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrIndicators.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable NrIndicators {
boolean isEndcAvailable;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrSignalStrength.aidl
index 7d6ab82..11e7356 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrSignalStrength.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrSignalStrength.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable NrSignalStrength {
int ssRsrp;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrVopsInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrVopsInfo.aidl
index e5a0a70..61146aa 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrVopsInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/NrVopsInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable NrVopsInfo {
byte vopsSupported;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/OperatorInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/OperatorInfo.aidl
index 034150e..abe2bea 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/OperatorInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/OperatorInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable OperatorInfo {
String alphaLong;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhoneRestrictedState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhoneRestrictedState.aidl
index 4e3e39e..44cab0e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhoneRestrictedState.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhoneRestrictedState.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum PhoneRestrictedState {
NONE = 0x00,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhysicalChannelConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhysicalChannelConfig.aidl
index 928c6b7..7d64f7e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhysicalChannelConfig.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhysicalChannelConfig.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable PhysicalChannelConfig {
android.hardware.radio.network.CellConnectionStatus status;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhysicalChannelConfigBand.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhysicalChannelConfigBand.aidl
index efc64a6..2e50e67 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhysicalChannelConfigBand.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/PhysicalChannelConfigBand.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
union PhysicalChannelConfigBand {
boolean noinit;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioAccessSpecifier.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioAccessSpecifier.aidl
index 1566bb5..8229207 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioAccessSpecifier.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioAccessSpecifier.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable RadioAccessSpecifier {
android.hardware.radio.AccessNetwork accessNetwork;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioAccessSpecifierBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioAccessSpecifierBands.aidl
index a6ac12a..9ba420e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioAccessSpecifierBands.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioAccessSpecifierBands.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
union RadioAccessSpecifierBands {
boolean noinit;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioBandMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioBandMode.aidl
index 74696fb..6058e30 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioBandMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RadioBandMode.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum RadioBandMode {
BAND_MODE_UNSPECIFIED,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegState.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegState.aidl
index 711c9ac..f11b911 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegState.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegState.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum RegState {
NOT_REG_MT_NOT_SEARCHING_OP = 0,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegStateResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegStateResult.aidl
index f0a03ae..625d970 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegStateResult.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegStateResult.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable RegStateResult {
android.hardware.radio.network.RegState regState;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl
index 8acf8ab..56f516d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum RegistrationFailCause {
NONE = 0,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithm.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithm.aidl
new file mode 100644
index 0000000..1664501
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithm.aidl
@@ -0,0 +1,79 @@
+/*
+ * Copyright 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.radio.network;
+/* @hide */
+@Backing(type="int") @JavaDerive(toString=true) @VintfStability
+enum SecurityAlgorithm {
+ A50 = 0,
+ A51 = 1,
+ A52 = 2,
+ A53 = 3,
+ A54 = 4,
+ GEA0 = 14,
+ GEA1 = 15,
+ GEA2 = 16,
+ GEA3 = 17,
+ GEA4 = 18,
+ GEA5 = 19,
+ UEA0 = 29,
+ UEA1 = 30,
+ UEA2 = 31,
+ EEA0 = 41,
+ EEA1 = 42,
+ EEA2 = 43,
+ EEA3 = 44,
+ NEA0 = 55,
+ NEA1 = 56,
+ NEA2 = 57,
+ NEA3 = 58,
+ SIP_NULL = 68,
+ AES_GCM = 69,
+ AES_GMAC = 70,
+ AES_CBC = 71,
+ DES_EDE3_CBC = 72,
+ AES_EDE3_CBC = 73,
+ HMAC_SHA1_96 = 74,
+ HMAC_SHA1_96_null = 75,
+ HMAC_MD5_96 = 76,
+ HMAC_MD5_96_null = 77,
+ SRTP_AES_COUNTER = 87,
+ SRTP_AES_F8 = 88,
+ SRTP_HMAC_SHA1 = 89,
+ ENCR_AES_GCM_16 = 99,
+ ENCR_AES_CBC = 100,
+ AUTH_HMAC_SHA2_256_128 = 101,
+ UNKNOWN = 113,
+ OTHER = 114,
+ ORYX = 124,
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl
new file mode 100644
index 0000000..73ad180
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright 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.radio.network;
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
+parcelable SecurityAlgorithmUpdate {
+ android.hardware.radio.network.ConnectionEvent connectionEvent;
+ android.hardware.radio.network.SecurityAlgorithm encryption;
+ android.hardware.radio.network.SecurityAlgorithm integrity;
+ boolean isUnprotectedEmergency;
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalStrength.aidl
index 1c50190..da7db9a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalStrength.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalStrength.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SignalStrength {
android.hardware.radio.network.GsmSignalStrength gsm;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalThresholdInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalThresholdInfo.aidl
index 744eed7..77b4831 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalThresholdInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SignalThresholdInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SignalThresholdInfo {
int signalMeasurement;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SuppSvcNotification.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SuppSvcNotification.aidl
index b62c71b..5192eae 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SuppSvcNotification.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SuppSvcNotification.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SuppSvcNotification {
boolean isMT;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/TdscdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/TdscdmaSignalStrength.aidl
index d74c950..fe209e5 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/TdscdmaSignalStrength.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/TdscdmaSignalStrength.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable TdscdmaSignalStrength {
int signalStrength;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UsageSetting.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UsageSetting.aidl
index 3ca16b5..a6f4d13 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UsageSetting.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UsageSetting.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum UsageSetting {
VOICE_CENTRIC = 1,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UtranBands.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UtranBands.aidl
index 8be3da2..977afe3 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UtranBands.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/UtranBands.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum UtranBands {
BAND_1 = 1,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/WcdmaSignalStrength.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/WcdmaSignalStrength.aidl
index 9112527..b765ab6 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/WcdmaSignalStrength.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/WcdmaSignalStrength.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.network;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable WcdmaSignalStrength {
int signalStrength;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/AppStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/AppStatus.aidl
index 8a41fb9..898b616 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/AppStatus.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/AppStatus.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable AppStatus {
int appType;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardPowerState.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardPowerState.aidl
index 6bc3919..066777a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardPowerState.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardPowerState.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum CardPowerState {
POWER_DOWN,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardStatus.aidl
index 46cb7be..1a9d621 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardStatus.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CardStatus.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CardStatus {
int cardState;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Carrier.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Carrier.aidl
index cc56888..24fff2e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Carrier.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Carrier.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable Carrier {
String mcc;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierInfo.aidl
new file mode 100644
index 0000000..5838959
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierInfo.aidl
@@ -0,0 +1,47 @@
+/*
+ * 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.radio.sim;
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
+parcelable CarrierInfo {
+ String mcc;
+ String mnc;
+ @nullable String spn;
+ @nullable String gid1;
+ @nullable String gid2;
+ @nullable String imsiPrefix;
+ @nullable List<android.hardware.radio.sim.Plmn> ephlmn;
+ @nullable String iccid;
+ @nullable String impi;
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl
index 3700de3..a5b8dc9 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierRestrictions.aidl
@@ -32,12 +32,21 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CarrierRestrictions {
+ /**
+ * @deprecated use @List<CarrierInfo> allowedCarrierInfoList
+ */
android.hardware.radio.sim.Carrier[] allowedCarriers;
+ /**
+ * @deprecated use @List<CarrierInfo> excludedCarrierInfoList
+ */
android.hardware.radio.sim.Carrier[] excludedCarriers;
boolean allowedCarriersPrioritized;
android.hardware.radio.sim.CarrierRestrictions.CarrierRestrictionStatus status;
+ android.hardware.radio.sim.CarrierInfo[] allowedCarrierInfoList = {};
+ android.hardware.radio.sim.CarrierInfo[] excludedCarrierInfoList = {};
@Backing(type="int") @VintfStability
enum CarrierRestrictionStatus {
UNKNOWN = 0,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CdmaSubscriptionSource.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CdmaSubscriptionSource.aidl
index 080aa5e..13b06e7 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CdmaSubscriptionSource.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CdmaSubscriptionSource.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum CdmaSubscriptionSource {
RUIM_SIM,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSim.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSim.aidl
index 901b251..1728e41 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSim.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSim.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@VintfStability
interface IRadioSim {
oneway void areUiccApplicationsEnabled(in int serial);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimIndication.aidl
index d4371b8..a74b65a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimIndication.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimIndication.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@VintfStability
interface IRadioSimIndication {
oneway void carrierInfoForImsiEncryption(in android.hardware.radio.RadioIndicationType info);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimResponse.aidl
index d7c2100..c653847 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimResponse.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IRadioSimResponse.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@VintfStability
interface IRadioSimResponse {
oneway void acknowledgeRequest(in int serial);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IccIo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IccIo.aidl
index 5a312dc..661518d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IccIo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IccIo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable IccIo {
int command;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IccIoResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IccIoResult.aidl
index 6c6bde2..1e418cd 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IccIoResult.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/IccIoResult.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable IccIoResult {
int sw1;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/ImsiEncryptionInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/ImsiEncryptionInfo.aidl
index 05e71cd..40722e5 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/ImsiEncryptionInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/ImsiEncryptionInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable ImsiEncryptionInfo {
String mcc;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PbReceivedStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PbReceivedStatus.aidl
index 5e96fc6..aaf9f3e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PbReceivedStatus.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PbReceivedStatus.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@Backing(type="byte") @JavaDerive(toString=true) @VintfStability
enum PbReceivedStatus {
PB_RECEIVED_OK = 1,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PersoSubstate.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PersoSubstate.aidl
index dc1d960..7952308 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PersoSubstate.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PersoSubstate.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum PersoSubstate {
UNKNOWN,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PhonebookCapacity.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PhonebookCapacity.aidl
index 7531c96..b020687 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PhonebookCapacity.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PhonebookCapacity.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable PhonebookCapacity {
int maxAdnRecords;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PhonebookRecordInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PhonebookRecordInfo.aidl
index 2e96a4b..1a6943b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PhonebookRecordInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PhonebookRecordInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable PhonebookRecordInfo {
int recordId;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PinState.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PinState.aidl
index 663ea73..924929b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PinState.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/PinState.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum PinState {
UNKNOWN,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Plmn.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Plmn.aidl
new file mode 100644
index 0000000..b29a4a7
--- /dev/null
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/Plmn.aidl
@@ -0,0 +1,40 @@
+/*
+ * 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.radio.sim;
+/* @hide */
+@JavaDerive(toString=true) @VintfStability
+parcelable Plmn {
+ String mcc;
+ String mnc;
+}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SelectUiccSub.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SelectUiccSub.aidl
index 02121e6..57ca2a5 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SelectUiccSub.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SelectUiccSub.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SelectUiccSub {
int slot;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SessionInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SessionInfo.aidl
index 1329141..5c81e3d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SessionInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SessionInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SessionInfo {
int sessionId;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimApdu.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimApdu.aidl
index c391e5a..45f6e48 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimApdu.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimApdu.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SimApdu {
int sessionId;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
index d59fcab..8cfe417 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
@@ -32,8 +32,16 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum SimLockMultiSimPolicy {
NO_MULTISIM_POLICY,
ONE_VALID_SIM_MUST_BE_PRESENT,
+ APPLY_TO_ALL_SLOTS,
+ APPLY_TO_ONLY_SLOT_1,
+ VALID_SIM_MUST_PRESENT_ON_SLOT_1,
+ ACTIVE_SERVICE_ON_SLOT_1_TO_UNBLOCK_OTHER_SLOTS,
+ ACTIVE_SERVICE_ON_ANY_SLOT_TO_UNBLOCK_OTHER_SLOTS,
+ ALL_SIMS_MUST_BE_VALID,
+ SLOT_POLICY_OTHER,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimRefreshResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimRefreshResult.aidl
index 69bf476..81ba510 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimRefreshResult.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/SimRefreshResult.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.sim;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SimRefreshResult {
int type;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/AudioQuality.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/AudioQuality.aidl
index 1ab2902..8725c7f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/AudioQuality.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/AudioQuality.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum AudioQuality {
UNSPECIFIED,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/Call.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/Call.aidl
index 10d2ee7..b45a45b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/Call.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/Call.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable Call {
int state;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CallForwardInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CallForwardInfo.aidl
index 8e7aaab..51c8758 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CallForwardInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CallForwardInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CallForwardInfo {
int status;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaCallWaiting.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaCallWaiting.aidl
index 310f9a0..0b36be4 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaCallWaiting.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaCallWaiting.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CdmaCallWaiting {
String number;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl
index b6b562c..300b03f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CdmaDisplayInfoRecord {
String alphaBuf;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaInformationRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaInformationRecord.aidl
index 24ae775..2f7f5f0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaInformationRecord.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaInformationRecord.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CdmaInformationRecord {
int name;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl
index e34b393..4e4a7ee 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CdmaLineControlInfoRecord {
byte lineCtrlPolarityIncluded;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl
index aeb0347..c3b0d5a 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CdmaNumberInfoRecord {
String number;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl
index fad3841..ae35fba 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum CdmaOtaProvisionStatus {
SPL_UNLOCKED,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl
index b61b91b..93c7c6b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CdmaRedirectingNumberInfoRecord {
android.hardware.radio.voice.CdmaNumberInfoRecord redirectingNumber;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl
index 6c7b264..69447b4 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CdmaSignalInfoRecord {
boolean isPresent;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl
index 438231c..69d79aa 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CdmaT53AudioControlInfoRecord {
byte upLink;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl
index 1b254f5..83b6fb9 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CdmaT53ClirInfoRecord {
byte cause;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CfData.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CfData.aidl
index 7e799c7..fc811f2 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CfData.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/CfData.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable CfData {
android.hardware.radio.voice.CallForwardInfo[] cfInfo;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl
index a34149a..c38c801 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/ClipStatus.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum ClipStatus {
CLIP_PROVISIONED,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/Dial.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/Dial.aidl
index 2b2e759..26041f0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/Dial.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/Dial.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable Dial {
String address;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyCallRouting.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyCallRouting.aidl
index 4e1dfc0..3099a20 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyCallRouting.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyCallRouting.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum EmergencyCallRouting {
UNKNOWN,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyNumber.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyNumber.aidl
index ac3867e..2129f39 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyNumber.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyNumber.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable EmergencyNumber {
String number;
@@ -40,8 +41,8 @@
int categories;
String[] urns;
int sources;
- const int SOURCE_NETWORK_SIGNALING = (1 << 0);
- const int SOURCE_SIM = (1 << 1);
- const int SOURCE_MODEM_CONFIG = (1 << 2);
- const int SOURCE_DEFAULT = (1 << 3);
+ const int SOURCE_NETWORK_SIGNALING = (1 << 0) /* 1 */;
+ const int SOURCE_SIM = (1 << 1) /* 2 */;
+ const int SOURCE_MODEM_CONFIG = (1 << 2) /* 4 */;
+ const int SOURCE_DEFAULT = (1 << 3) /* 8 */;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyServiceCategory.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyServiceCategory.aidl
index 0a70d2d..819baf8 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyServiceCategory.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/EmergencyServiceCategory.aidl
@@ -32,14 +32,15 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum EmergencyServiceCategory {
UNSPECIFIED = 0,
- POLICE = (1 << 0),
- AMBULANCE = (1 << 1),
- FIRE_BRIGADE = (1 << 2),
- MARINE_GUARD = (1 << 3),
- MOUNTAIN_RESCUE = (1 << 4),
- MIEC = (1 << 5),
- AIEC = (1 << 6),
+ POLICE = (1 << 0) /* 1 */,
+ AMBULANCE = (1 << 1) /* 2 */,
+ FIRE_BRIGADE = (1 << 2) /* 4 */,
+ MARINE_GUARD = (1 << 3) /* 8 */,
+ MOUNTAIN_RESCUE = (1 << 4) /* 16 */,
+ MIEC = (1 << 5) /* 32 */,
+ AIEC = (1 << 6) /* 64 */,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoice.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoice.aidl
index 603b1d6..d0a9451 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoice.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoice.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@VintfStability
interface IRadioVoice {
oneway void acceptCall(in int serial);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceIndication.aidl
index 189ed43..4614ee1 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceIndication.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceIndication.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@VintfStability
interface IRadioVoiceIndication {
oneway void callRing(in android.hardware.radio.RadioIndicationType type, in boolean isGsm, in android.hardware.radio.voice.CdmaSignalInfoRecord record);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceResponse.aidl
index 7acc044..46927c2 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceResponse.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/IRadioVoiceResponse.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@VintfStability
interface IRadioVoiceResponse {
oneway void acceptCallResponse(in android.hardware.radio.RadioResponseInfo info);
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCause.aidl
index 7d54623..0cac135 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCause.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCause.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum LastCallFailCause {
UNOBTAINABLE_NUMBER = 1,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCauseInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCauseInfo.aidl
index 221acf7..151adf2 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCauseInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/LastCallFailCauseInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable LastCallFailCauseInfo {
android.hardware.radio.voice.LastCallFailCause causeCode;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SrvccState.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SrvccState.aidl
index 4b5c216..981ba02 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SrvccState.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SrvccState.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum SrvccState {
HANDOVER_STARTED,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SsInfoData.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SsInfoData.aidl
index f18b404..24365dc 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SsInfoData.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/SsInfoData.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable SsInfoData {
int[] ssInfo;
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/StkCcUnsolSsResult.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/StkCcUnsolSsResult.aidl
index 75f3de5..999f47c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/StkCcUnsolSsResult.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/StkCcUnsolSsResult.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable StkCcUnsolSsResult {
int serviceType;
@@ -72,13 +73,13 @@
const int TELESERVICE_TYPE_SMS_SERVICES = 4;
const int TELESERVICE_TYPE_ALL_TELESERVICES_EXCEPT_SMS = 5;
const int SUPP_SERVICE_CLASS_NONE = 0;
- const int SUPP_SERVICE_CLASS_VOICE = (1 << 0);
- const int SUPP_SERVICE_CLASS_DATA = (1 << 1);
- const int SUPP_SERVICE_CLASS_FAX = (1 << 2);
- const int SUPP_SERVICE_CLASS_SMS = (1 << 3);
- const int SUPP_SERVICE_CLASS_DATA_SYNC = (1 << 4);
- const int SUPP_SERVICE_CLASS_DATA_ASYNC = (1 << 5);
- const int SUPP_SERVICE_CLASS_PACKET = (1 << 6);
- const int SUPP_SERVICE_CLASS_PAD = (1 << 7);
- const int SUPP_SERVICE_CLASS_MAX = (1 << 7);
+ const int SUPP_SERVICE_CLASS_VOICE = (1 << 0) /* 1 */;
+ const int SUPP_SERVICE_CLASS_DATA = (1 << 1) /* 2 */;
+ const int SUPP_SERVICE_CLASS_FAX = (1 << 2) /* 4 */;
+ const int SUPP_SERVICE_CLASS_SMS = (1 << 3) /* 8 */;
+ const int SUPP_SERVICE_CLASS_DATA_SYNC = (1 << 4) /* 16 */;
+ const int SUPP_SERVICE_CLASS_DATA_ASYNC = (1 << 5) /* 32 */;
+ const int SUPP_SERVICE_CLASS_PACKET = (1 << 6) /* 64 */;
+ const int SUPP_SERVICE_CLASS_PAD = (1 << 7) /* 128 */;
+ const int SUPP_SERVICE_CLASS_MAX = (1 << 7) /* 128 */;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/TtyMode.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/TtyMode.aidl
index e432e65..41ff6b8 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/TtyMode.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/TtyMode.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum TtyMode {
OFF,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl
index 424e73f..9e80f03 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UssdModeType.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum UssdModeType {
NOTIFY,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UusInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UusInfo.aidl
index 9313760..3c84c8d 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UusInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.voice/current/android/hardware/radio/voice/UusInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio.voice;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable UusInfo {
int uusType;
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl
index 9641651..73a267b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/AccessNetwork.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum AccessNetwork {
UNKNOWN,
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl
index b7b074b..1298ab0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioAccessFamily.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum RadioAccessFamily {
UNKNOWN = (1 << android.hardware.radio.RadioTechnology.UNKNOWN) /* 1 */,
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl
index 9785825..970cd1e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioConst.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable RadioConst {
const int MAX_RILDS = 3;
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl
index 98606e5..02c5370 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioError.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum RadioError {
NONE = 0,
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl
index 58b35a5..316f92f 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioIndicationType.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum RadioIndicationType {
UNSOLICITED,
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfo.aidl
index b2a7a06..f03a73b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfo.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable RadioResponseInfo {
android.hardware.radio.RadioResponseType type;
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfoModem.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfoModem.aidl
index 37ed7bb..2e0c315 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfoModem.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseInfoModem.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio;
+/* @hide */
@JavaDerive(toString=true) @VintfStability
parcelable RadioResponseInfoModem {
android.hardware.radio.RadioResponseType type;
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl
index 1ee62bd..8bdb45b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioResponseType.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum RadioResponseType {
SOLICITED,
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl
index b6af5aa..7c6a657 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnology.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum RadioTechnology {
UNKNOWN,
diff --git a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl
index 2af7e53..85e9850 100644
--- a/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio/current/android/hardware/radio/RadioTechnologyFamily.aidl
@@ -32,6 +32,7 @@
// later when a module using the interface is updated, e.g., Mainline modules.
package android.hardware.radio;
+/* @hide */
@Backing(type="int") @JavaDerive(toString=true) @VintfStability
enum RadioTechnologyFamily {
THREE_GPP,
diff --git a/radio/aidl/android/hardware/radio/AccessNetwork.aidl b/radio/aidl/android/hardware/radio/AccessNetwork.aidl
index 2885642..4099f83 100644
--- a/radio/aidl/android/hardware/radio/AccessNetwork.aidl
+++ b/radio/aidl/android/hardware/radio/AccessNetwork.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl b/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl
index edf33ba..9ab4583 100644
--- a/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl
+++ b/radio/aidl/android/hardware/radio/RadioAccessFamily.aidl
@@ -18,6 +18,7 @@
import android.hardware.radio.RadioTechnology;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/RadioConst.aidl b/radio/aidl/android/hardware/radio/RadioConst.aidl
index 6591ef1..7b923b9 100644
--- a/radio/aidl/android/hardware/radio/RadioConst.aidl
+++ b/radio/aidl/android/hardware/radio/RadioConst.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable RadioConst {
diff --git a/radio/aidl/android/hardware/radio/RadioError.aidl b/radio/aidl/android/hardware/radio/RadioError.aidl
index 2031399..9c39bc4 100644
--- a/radio/aidl/android/hardware/radio/RadioError.aidl
+++ b/radio/aidl/android/hardware/radio/RadioError.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/RadioIndicationType.aidl b/radio/aidl/android/hardware/radio/RadioIndicationType.aidl
index 2dcc492..594b147 100644
--- a/radio/aidl/android/hardware/radio/RadioIndicationType.aidl
+++ b/radio/aidl/android/hardware/radio/RadioIndicationType.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl b/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl
index f70a3fe..25195aa 100644
--- a/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl
+++ b/radio/aidl/android/hardware/radio/RadioResponseInfo.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.RadioError;
import android.hardware.radio.RadioResponseType;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable RadioResponseInfo {
diff --git a/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl b/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl
index 13abfb9..286f397 100644
--- a/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl
+++ b/radio/aidl/android/hardware/radio/RadioResponseInfoModem.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.RadioError;
import android.hardware.radio.RadioResponseType;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable RadioResponseInfoModem {
diff --git a/radio/aidl/android/hardware/radio/RadioResponseType.aidl b/radio/aidl/android/hardware/radio/RadioResponseType.aidl
index cd4a305..000f478 100644
--- a/radio/aidl/android/hardware/radio/RadioResponseType.aidl
+++ b/radio/aidl/android/hardware/radio/RadioResponseType.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/RadioTechnology.aidl b/radio/aidl/android/hardware/radio/RadioTechnology.aidl
index 4b51152..7ae428b 100644
--- a/radio/aidl/android/hardware/radio/RadioTechnology.aidl
+++ b/radio/aidl/android/hardware/radio/RadioTechnology.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl b/radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl
index a2b989d..4b5498c 100644
--- a/radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl
+++ b/radio/aidl/android/hardware/radio/RadioTechnologyFamily.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
index 85c2cee..9058d9d 100644
--- a/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
+++ b/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
@@ -28,6 +28,7 @@
import android.hardware.radio.config.IRadioConfigResponse;
import android.hardware.radio.config.SlotPortMapping;
+/** @hide */
@VintfStability
oneway interface IRadioConfig {
/**
@@ -39,6 +40,8 @@
*
* Response callback is
* IRadioConfigResponse.getHalDeviceCapabilitiesResponse()
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void getHalDeviceCapabilities(in int serial);
@@ -53,6 +56,8 @@
*
* Response callback is IRadioConfigResponse.getNumOfLiveModemsResponse() which
* will return <byte>.
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void getNumOfLiveModems(in int serial);
@@ -63,6 +68,8 @@
*
* Response callback is IRadioResponse.getPhoneCapabilityResponse() which
* will return <PhoneCapability>.
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void getPhoneCapability(in int serial);
@@ -75,6 +82,8 @@
* @param serial Serial number of request.
*
* Response callback is IRadioConfigResponse.getSimSlotsStatusResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void getSimSlotsStatus(in int serial);
@@ -92,6 +101,8 @@
* @param modemsConfig byte object including the number of live modems
*
* Response callback is IRadioResponse.setNumOfLiveModemsResponse()
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void setNumOfLiveModems(in int serial, in byte numOfLiveModems);
@@ -106,6 +117,8 @@
* from getPhoneCapability().
*
* Response callback is IRadioConfigResponse.setPreferredDataModemResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void setPreferredDataModem(in int serial, in byte modemId);
@@ -114,6 +127,8 @@
*
* @param radioConfigResponse Object containing radio config response functions
* @param radioConfigIndication Object containing radio config indications
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void setResponseFunctions(in IRadioConfigResponse radioConfigResponse,
in IRadioConfigIndication radioConfigIndication);
@@ -172,6 +187,8 @@
* getSimSlotsStatusResponse
*
* Response callback is IRadioConfigResponse.setSimSlotsMappingResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setSimSlotsMapping(in int serial, in SlotPortMapping[] slotMap);
}
diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl
index abf55f1..ed2366b 100644
--- a/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl
+++ b/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl
@@ -20,6 +20,7 @@
/**
* Interface declaring unsolicited radio config indications.
+ * @hide
*/
@VintfStability
oneway interface IRadioConfigIndication {
diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl
index 0d36bbd..df93e3c 100644
--- a/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl
+++ b/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl
@@ -21,6 +21,7 @@
/**
* Interface declaring response functions to solicited radio config requests.
+ * @hide
*/
@VintfStability
oneway interface IRadioConfigResponse {
@@ -39,6 +40,7 @@
* IRadioIndication.currentPhysicalChannelConfigs_1_6()
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -52,6 +54,7 @@
* are enabled and actively working as part of a working connectivity stack
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
*/
@@ -64,6 +67,7 @@
* how many logical modems it has, how many data connections it supports.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -77,6 +81,8 @@
* equal to the number of physical slots on the device
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -90,6 +96,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -100,6 +107,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -111,6 +119,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
diff --git a/radio/aidl/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl b/radio/aidl/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl
index b18ea0e..1d9b66e 100644
--- a/radio/aidl/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl
+++ b/radio/aidl/android/hardware/radio/config/MultipleEnabledProfilesMode.aidl
@@ -20,6 +20,7 @@
* Multiple Enabled Profiles(MEP) mode is the jointly supported MEP mode. As per section 3.4.1.1 of
* GSMA spec SGP.22 v3.0,there are 3 supported MEP modes: MEP-A1, MEP-A2 and MEP-B.
* If there is no jointly supported MEP mode, supported MEP mode is set to NONE.
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl b/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl
index 8e4f338..35d6b5d 100644
--- a/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl
+++ b/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl
@@ -20,6 +20,7 @@
* Phone capability which describes the data connection capability of modem.
* It's used to evaluate possible phone config change, for example from single
* SIM device to multi-SIM device.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/config/SimPortInfo.aidl b/radio/aidl/android/hardware/radio/config/SimPortInfo.aidl
index db24719..f579639 100644
--- a/radio/aidl/android/hardware/radio/config/SimPortInfo.aidl
+++ b/radio/aidl/android/hardware/radio/config/SimPortInfo.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.config;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable SimPortInfo {
diff --git a/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl b/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl
index 6a36d5e..34f98c5 100644
--- a/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl
+++ b/radio/aidl/android/hardware/radio/config/SimSlotStatus.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.config.MultipleEnabledProfilesMode;
import android.hardware.radio.config.SimPortInfo;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable SimSlotStatus {
diff --git a/radio/aidl/android/hardware/radio/config/SlotPortMapping.aidl b/radio/aidl/android/hardware/radio/config/SlotPortMapping.aidl
index c78afcb..30cca50 100644
--- a/radio/aidl/android/hardware/radio/config/SlotPortMapping.aidl
+++ b/radio/aidl/android/hardware/radio/config/SlotPortMapping.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.config;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable SlotPortMapping {
diff --git a/radio/aidl/android/hardware/radio/data/ApnAuthType.aidl b/radio/aidl/android/hardware/radio/data/ApnAuthType.aidl
index a4116db..1d1d851 100644
--- a/radio/aidl/android/hardware/radio/data/ApnAuthType.aidl
+++ b/radio/aidl/android/hardware/radio/data/ApnAuthType.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.data;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/data/ApnTypes.aidl b/radio/aidl/android/hardware/radio/data/ApnTypes.aidl
index ed1256d..f44c636 100644
--- a/radio/aidl/android/hardware/radio/data/ApnTypes.aidl
+++ b/radio/aidl/android/hardware/radio/data/ApnTypes.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.data;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
@@ -85,5 +86,9 @@
/**
* APN type for ENTERPRISE
*/
- ENTERPRISE = 1 << 14
+ ENTERPRISE = 1 << 14,
+ /**
+ * APN type for RCS (Rich Communication Services)
+ */
+ RCS = 1 << 15
}
diff --git a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl
index 071ce55..e015e8e 100644
--- a/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl
+++ b/radio/aidl/android/hardware/radio/data/DataCallFailCause.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.data;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl
index ea4e751..d01f8ff 100644
--- a/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl
+++ b/radio/aidl/android/hardware/radio/data/DataProfileInfo.aidl
@@ -20,6 +20,7 @@
import android.hardware.radio.data.PdpProtocolType;
import android.hardware.radio.data.TrafficDescriptor;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable DataProfileInfo {
@@ -39,6 +40,21 @@
const int TYPE_3GPP2 = 2;
/**
+ * Innfrastructure type unknown. This is only for initializing.
+ */
+ const int INFRASTRUCTURE_UNKNOWN = 0;
+
+ /**
+ * Indicating this APN can be used when the device is using terrestrial cellular networks.
+ */
+ const int INFRASTRUCTURE_CELLULAR = 1 << 0;
+
+ /**
+ * Indicating this APN can be used when the device is attached to satellite.
+ */
+ const int INFRASTRUCTURE_SATELLITE = 1 << 1;
+
+ /**
* ID of the data profile.
* Values are ID_
*/
@@ -130,4 +146,10 @@
* apn; apn must be used as the end point if one is not specified through URSP rules.
*/
TrafficDescriptor trafficDescriptor;
+ /**
+ * The infrastructure bitmap which the APN can be used on. For example, some APNs can only
+ * be used when the device is using cellular network, using satellite network, or can be used
+ * in either cases.
+ */
+ int infrastructureBitmap = INFRASTRUCTURE_UNKNOWN;
}
diff --git a/radio/aidl/android/hardware/radio/data/DataRequestReason.aidl b/radio/aidl/android/hardware/radio/data/DataRequestReason.aidl
index 44b47f8..b16081d 100644
--- a/radio/aidl/android/hardware/radio/data/DataRequestReason.aidl
+++ b/radio/aidl/android/hardware/radio/data/DataRequestReason.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.data;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/data/DataThrottlingAction.aidl b/radio/aidl/android/hardware/radio/data/DataThrottlingAction.aidl
index e4ee444..a762e34 100644
--- a/radio/aidl/android/hardware/radio/data/DataThrottlingAction.aidl
+++ b/radio/aidl/android/hardware/radio/data/DataThrottlingAction.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.data;
+/** @hide */
@VintfStability
@Backing(type="byte")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/data/EpsQos.aidl b/radio/aidl/android/hardware/radio/data/EpsQos.aidl
index 8965d6e..42eee32 100644
--- a/radio/aidl/android/hardware/radio/data/EpsQos.aidl
+++ b/radio/aidl/android/hardware/radio/data/EpsQos.aidl
@@ -20,6 +20,7 @@
/**
* LTE/EPS Quality of Service parameters as per 3gpp spec 24.301 sec 9.9.4.3.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/data/IRadioData.aidl b/radio/aidl/android/hardware/radio/data/IRadioData.aidl
index 0171d39..a73616a 100644
--- a/radio/aidl/android/hardware/radio/data/IRadioData.aidl
+++ b/radio/aidl/android/hardware/radio/data/IRadioData.aidl
@@ -34,6 +34,7 @@
* duration of a method call. If clients provide colliding serials (including passing the same
* serial to different methods), multiple responses (one for each method call) must still be served.
* setResponseFunctions must work with IRadioDataResponse and IRadioDataIndication.
+ * @hide
*/
@VintfStability
oneway interface IRadioData {
@@ -47,6 +48,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioDataResponse.allocatePduSessionIdResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void allocatePduSessionId(in int serial);
@@ -59,6 +62,8 @@
* @param id callId The identifier of the data call which is provided in SetupDataCallResult
*
* Response function is IRadioDataResponse.cancelHandoverResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void cancelHandover(in int serial, in int callId);
@@ -72,6 +77,8 @@
* @param reason The request reason. Must be normal, handover, or shutdown.
*
* Response function is IRadioDataResponse.deactivateDataCallResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void deactivateDataCall(in int serial, in int cid, in DataRequestReason reason);
@@ -82,6 +89,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioDataResponse.getDataCallListResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void getDataCallList(in int serial);
@@ -95,6 +104,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioDataResponse.getSlicingConfigResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void getSlicingConfig(in int serial);
@@ -106,6 +117,8 @@
* @param id Pdu session id to release.
*
* Response function is IRadioDataResponse.releasePduSessionIdResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void releasePduSessionId(in int serial, in int id);
@@ -113,6 +126,8 @@
* When response type received from a radio indication or radio response is
* RadioIndicationType:UNSOLICITED_ACK_EXP or RadioResponseType:SOLICITED_ACK_EXP respectively,
* acknowledge the receipt of those messages by sending responseAcknowledgement().
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void responseAcknowledgement();
@@ -123,6 +138,8 @@
* @param allow true to allow data calls, false to disallow data calls
*
* Response function is IRadioDataResponse.setDataAllowedResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void setDataAllowed(in int serial, in boolean allow);
@@ -133,6 +150,8 @@
* @param profiles Array of DataProfileInfo to set.
*
* Response function is IRadioDataResponse.setDataProfileResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void setDataProfile(in int serial, in DataProfileInfo[] profiles);
@@ -154,6 +173,8 @@
* DataThrottlingAction:HOLD.
*
* Response function is IRadioDataResponse.setDataThrottlingResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void setDataThrottling(in int serial, in DataThrottlingAction dataThrottlingAction,
in long completionDurationMillis);
@@ -166,6 +187,8 @@
* initial attach APN.
*
* Response function is IRadioDataResponse.setInitialAttachApnResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void setInitialAttachApn(in int serial, in @nullable DataProfileInfo dataProfileInfo);
@@ -174,6 +197,8 @@
*
* @param radioDataResponse Object containing response functions
* @param radioDataIndication Object containing radio indications
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void setResponseFunctions(
in IRadioDataResponse radioDataResponse, in IRadioDataIndication radioDataIndication);
@@ -228,6 +253,8 @@
* example, a zero-rating slice.
*
* Response function is IRadioDataResponse.setupDataCallResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void setupDataCall(in int serial, in AccessNetwork accessNetwork,
in DataProfileInfo dataProfileInfo, in boolean roamingAllowed,
@@ -249,6 +276,8 @@
* @param id callId The identifier of the data call which is provided in SetupDataCallResult
*
* Response function is IRadioDataResponse.startHandoverResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void startHandover(in int serial, in int callId);
@@ -259,6 +288,8 @@
* @param keepalive A request structure containing all necessary info to describe a keepalive
*
* Response function is IRadioDataResponse.startKeepaliveResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void startKeepalive(in int serial, in KeepaliveRequest keepalive);
@@ -270,6 +301,8 @@
* IRadioDataResponse.startKeepaliveResponse
*
* Response function is IRadioDataResponse.stopKeepaliveResponse()
+ *
+ * This is available when android.hardware.telephony.data is defined.
*/
void stopKeepalive(in int serial, in int sessionHandle);
}
diff --git a/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl b/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl
index 938c695..c3fdcaa 100644
--- a/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl
+++ b/radio/aidl/android/hardware/radio/data/IRadioDataIndication.aidl
@@ -25,6 +25,7 @@
/**
* Interface declaring unsolicited radio indications for data APIs.
+ * @hide
*/
@VintfStability
oneway interface IRadioDataIndication {
diff --git a/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl b/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl
index 06c83c1..538b90a 100644
--- a/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl
+++ b/radio/aidl/android/hardware/radio/data/IRadioDataResponse.aidl
@@ -23,6 +23,7 @@
/**
* Interface declaring response functions to solicited radio requests for data APIs.
+ * @hide
*/
@VintfStability
oneway interface IRadioDataResponse {
@@ -40,6 +41,7 @@
* @param id The allocated id. On an error, this is set to 0.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -52,6 +54,7 @@
* @param dcResponse Attributes of data call
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -64,6 +67,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE indicates success. Any other error will remove the network from the list.
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_CALL_ID
@@ -82,6 +86,7 @@
* @param dcResponse List of SetupDataCallResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -94,6 +99,7 @@
* @param slicingConfig Current slicing configuration
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -105,6 +111,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -116,6 +123,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -134,6 +142,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
@@ -149,6 +158,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MODEM_ERR
@@ -160,6 +170,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
@@ -179,6 +190,7 @@
* @param dcResponse SetupDataCallResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE must be returned on both success and failure of setup with the
* DataCallResponse.status containing the actual status
* For all other errors the DataCallResponse is ignored.
@@ -196,6 +208,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -211,6 +224,7 @@
* request.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:NO_RESOURCES
* RadioError:INVALID_ARGUMENTS
@@ -221,6 +235,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.data is not defined
* RadioError:NONE
* RadioError:INVALID_ARGUMENTS
*/
diff --git a/radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl b/radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl
index c720de0..1838f2e 100644
--- a/radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl
+++ b/radio/aidl/android/hardware/radio/data/KeepaliveRequest.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.data;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable KeepaliveRequest {
diff --git a/radio/aidl/android/hardware/radio/data/KeepaliveStatus.aidl b/radio/aidl/android/hardware/radio/data/KeepaliveStatus.aidl
index 0b829c4..162fc37 100644
--- a/radio/aidl/android/hardware/radio/data/KeepaliveStatus.aidl
+++ b/radio/aidl/android/hardware/radio/data/KeepaliveStatus.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.data;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable KeepaliveStatus {
diff --git a/radio/aidl/android/hardware/radio/data/LinkAddress.aidl b/radio/aidl/android/hardware/radio/data/LinkAddress.aidl
index 12a7637..957973d 100644
--- a/radio/aidl/android/hardware/radio/data/LinkAddress.aidl
+++ b/radio/aidl/android/hardware/radio/data/LinkAddress.aidl
@@ -18,6 +18,7 @@
/**
* Describes a data link address for mobile data connection.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/data/NrQos.aidl b/radio/aidl/android/hardware/radio/data/NrQos.aidl
index 4078fdc..f636e6b 100644
--- a/radio/aidl/android/hardware/radio/data/NrQos.aidl
+++ b/radio/aidl/android/hardware/radio/data/NrQos.aidl
@@ -20,6 +20,7 @@
/**
* 5G Quality of Service parameters as per 3gpp spec 24.501 sec 9.11.4.12
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/data/OsAppId.aidl b/radio/aidl/android/hardware/radio/data/OsAppId.aidl
index 88e7832..ae38cf3 100644
--- a/radio/aidl/android/hardware/radio/data/OsAppId.aidl
+++ b/radio/aidl/android/hardware/radio/data/OsAppId.aidl
@@ -18,6 +18,7 @@
/**
* This struct represents the OsId + OsAppId as defined in TS 24.526 Section 5.2
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/data/PcoDataInfo.aidl b/radio/aidl/android/hardware/radio/data/PcoDataInfo.aidl
index 38a821f..a487bb3 100644
--- a/radio/aidl/android/hardware/radio/data/PcoDataInfo.aidl
+++ b/radio/aidl/android/hardware/radio/data/PcoDataInfo.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.data;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable PcoDataInfo {
diff --git a/radio/aidl/android/hardware/radio/data/PdpProtocolType.aidl b/radio/aidl/android/hardware/radio/data/PdpProtocolType.aidl
index 792a503..27e541d 100644
--- a/radio/aidl/android/hardware/radio/data/PdpProtocolType.aidl
+++ b/radio/aidl/android/hardware/radio/data/PdpProtocolType.aidl
@@ -18,6 +18,7 @@
/**
* Specifies the type of packet data protocol which is defined in TS 27.007 section 10.1.1.
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/radio/aidl/android/hardware/radio/data/PortRange.aidl b/radio/aidl/android/hardware/radio/data/PortRange.aidl
index 5c83ca4..7326966 100644
--- a/radio/aidl/android/hardware/radio/data/PortRange.aidl
+++ b/radio/aidl/android/hardware/radio/data/PortRange.aidl
@@ -20,6 +20,7 @@
* Defines range of ports. start and end are the first and last port numbers (inclusive) in the
* range. Both start and end are in PORT_RANGE_MIN to PORT_RANGE_MAX range. A single port shall
* be represented by the same start and end value.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/data/Qos.aidl b/radio/aidl/android/hardware/radio/data/Qos.aidl
index d9ab9e7..e98d030 100644
--- a/radio/aidl/android/hardware/radio/data/Qos.aidl
+++ b/radio/aidl/android/hardware/radio/data/Qos.aidl
@@ -21,6 +21,7 @@
/**
* EPS or NR QOS parameters
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/data/QosBandwidth.aidl b/radio/aidl/android/hardware/radio/data/QosBandwidth.aidl
index e841548..f2eca41 100644
--- a/radio/aidl/android/hardware/radio/data/QosBandwidth.aidl
+++ b/radio/aidl/android/hardware/radio/data/QosBandwidth.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.data;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable QosBandwidth {
diff --git a/radio/aidl/android/hardware/radio/data/QosFilter.aidl b/radio/aidl/android/hardware/radio/data/QosFilter.aidl
index f5dc7ec..4a2b61d 100644
--- a/radio/aidl/android/hardware/radio/data/QosFilter.aidl
+++ b/radio/aidl/android/hardware/radio/data/QosFilter.aidl
@@ -23,6 +23,7 @@
/**
* See 3gpp 24.008 10.5.6.12 and 3gpp 24.501 9.11.4.13
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/data/QosFilterIpsecSpi.aidl b/radio/aidl/android/hardware/radio/data/QosFilterIpsecSpi.aidl
index 5059c28..83c4fe1 100644
--- a/radio/aidl/android/hardware/radio/data/QosFilterIpsecSpi.aidl
+++ b/radio/aidl/android/hardware/radio/data/QosFilterIpsecSpi.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.data;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
union QosFilterIpsecSpi {
diff --git a/radio/aidl/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl b/radio/aidl/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl
index 6f14934..4591174 100644
--- a/radio/aidl/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl
+++ b/radio/aidl/android/hardware/radio/data/QosFilterIpv6FlowLabel.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.data;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
union QosFilterIpv6FlowLabel {
diff --git a/radio/aidl/android/hardware/radio/data/QosFilterTypeOfService.aidl b/radio/aidl/android/hardware/radio/data/QosFilterTypeOfService.aidl
index f5770a4..8d27399 100644
--- a/radio/aidl/android/hardware/radio/data/QosFilterTypeOfService.aidl
+++ b/radio/aidl/android/hardware/radio/data/QosFilterTypeOfService.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.data;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
union QosFilterTypeOfService {
diff --git a/radio/aidl/android/hardware/radio/data/QosSession.aidl b/radio/aidl/android/hardware/radio/data/QosSession.aidl
index 770b124..1a8eb2c 100644
--- a/radio/aidl/android/hardware/radio/data/QosSession.aidl
+++ b/radio/aidl/android/hardware/radio/data/QosSession.aidl
@@ -21,6 +21,7 @@
/**
* QOS session associated with a dedicated bearer
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/data/RouteSelectionDescriptor.aidl b/radio/aidl/android/hardware/radio/data/RouteSelectionDescriptor.aidl
index 14b0ffc..4e9e954 100644
--- a/radio/aidl/android/hardware/radio/data/RouteSelectionDescriptor.aidl
+++ b/radio/aidl/android/hardware/radio/data/RouteSelectionDescriptor.aidl
@@ -21,6 +21,7 @@
/**
* This struct represents a single route selection descriptor as defined in 3GPP TS 24.526.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl b/radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl
index fee54ac..b8f01c0 100644
--- a/radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl
+++ b/radio/aidl/android/hardware/radio/data/SetupDataCallResult.aidl
@@ -24,6 +24,7 @@
import android.hardware.radio.data.SliceInfo;
import android.hardware.radio.data.TrafficDescriptor;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable SetupDataCallResult {
diff --git a/radio/aidl/android/hardware/radio/data/SliceInfo.aidl b/radio/aidl/android/hardware/radio/data/SliceInfo.aidl
index 7ad7fc3..809b8e0 100644
--- a/radio/aidl/android/hardware/radio/data/SliceInfo.aidl
+++ b/radio/aidl/android/hardware/radio/data/SliceInfo.aidl
@@ -18,6 +18,7 @@
/**
* This struct represents a S-NSSAI as defined in 3GPP TS 24.501.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/data/SlicingConfig.aidl b/radio/aidl/android/hardware/radio/data/SlicingConfig.aidl
index e94b58c..47ac41e 100644
--- a/radio/aidl/android/hardware/radio/data/SlicingConfig.aidl
+++ b/radio/aidl/android/hardware/radio/data/SlicingConfig.aidl
@@ -21,6 +21,7 @@
/**
* This struct represents the current slicing configuration.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/data/TrafficDescriptor.aidl b/radio/aidl/android/hardware/radio/data/TrafficDescriptor.aidl
index 2c117a5..098c77a 100644
--- a/radio/aidl/android/hardware/radio/data/TrafficDescriptor.aidl
+++ b/radio/aidl/android/hardware/radio/data/TrafficDescriptor.aidl
@@ -22,6 +22,7 @@
* This struct represents a traffic descriptor. A valid struct must have at least one of the
* optional values present. This is based on the definition of traffic descriptor in
* TS 24.526 Section 5.2.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/data/UrspRule.aidl b/radio/aidl/android/hardware/radio/data/UrspRule.aidl
index 0499edd..f2028b4 100644
--- a/radio/aidl/android/hardware/radio/data/UrspRule.aidl
+++ b/radio/aidl/android/hardware/radio/data/UrspRule.aidl
@@ -21,6 +21,7 @@
/**
* This struct represents a single URSP rule as defined in 3GPP TS 24.526.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/ims/ConnectionFailureInfo.aidl b/radio/aidl/android/hardware/radio/ims/ConnectionFailureInfo.aidl
index 70faa1e..c96f59f 100644
--- a/radio/aidl/android/hardware/radio/ims/ConnectionFailureInfo.aidl
+++ b/radio/aidl/android/hardware/radio/ims/ConnectionFailureInfo.aidl
@@ -16,10 +16,10 @@
package android.hardware.radio.ims;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable ConnectionFailureInfo {
-
@VintfStability
@Backing(type="int")
enum ConnectionFailureReason {
diff --git a/radio/aidl/android/hardware/radio/ims/EpsFallbackReason.aidl b/radio/aidl/android/hardware/radio/ims/EpsFallbackReason.aidl
index 670638b..5300fbe 100644
--- a/radio/aidl/android/hardware/radio/ims/EpsFallbackReason.aidl
+++ b/radio/aidl/android/hardware/radio/ims/EpsFallbackReason.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.ims;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
@Backing(type="int")
diff --git a/radio/aidl/android/hardware/radio/ims/IRadioIms.aidl b/radio/aidl/android/hardware/radio/ims/IRadioIms.aidl
index bd661a7..90792f7 100644
--- a/radio/aidl/android/hardware/radio/ims/IRadioIms.aidl
+++ b/radio/aidl/android/hardware/radio/ims/IRadioIms.aidl
@@ -34,6 +34,7 @@
* duration of a method call. If clients provide colliding serials (including passing the same
* serial to different methods), multiple responses (one for each method call) must still be served.
* setResponseFunctions must work with IRadioImsResponse and IRadioImsIndication.
+ * @hide
*/
@VintfStability
oneway interface IRadioIms {
@@ -44,6 +45,8 @@
* @param srvccCalls the list of calls
*
* Response function is IRadioImsResponse.setSrvccCallInfoResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void setSrvccCallInfo(int serial, in SrvccCall[] srvccCalls);
@@ -59,6 +62,8 @@
* @param imsRegistration IMS registration information
*
* Response function is IRadioImsResponse.updateImsRegistrationInfoResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void updateImsRegistrationInfo(int serial, in ImsRegistration imsRegistration);
@@ -89,10 +94,11 @@
* mobile terminated use case eg. MO/MT call/SMS etc
*
* Response function is IRadioImsResponse.startImsTrafficResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
- void startImsTraffic(int serial, int token,
- ImsTrafficType imsTrafficType, AccessNetwork accessNetworkType,
- ImsCall.Direction trafficDirection);
+ void startImsTraffic(int serial, int token, ImsTrafficType imsTrafficType,
+ AccessNetwork accessNetworkType, ImsCall.Direction trafficDirection);
/**
* Indicates IMS traffic has been stopped.
@@ -103,6 +109,8 @@
* @param token The token assigned by startImsTraffic()
*
* Response function is IRadioImsResponse.stopImsTrafficResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void stopImsTraffic(int serial, int token);
@@ -114,6 +122,8 @@
* @param reason Specifies the reason that causes EPS fallback
*
* Response function is IRadioImsResponse.triggerEpsFallbackResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void triggerEpsFallback(int serial, in EpsFallbackReason reason);
@@ -122,9 +132,11 @@
*
* @param radioImsResponse Object containing response functions
* @param radioImsIndication Object containing radio indications
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
- void setResponseFunctions(in IRadioImsResponse radioImsResponse,
- in IRadioImsIndication radioImsIndication);
+ void setResponseFunctions(
+ in IRadioImsResponse radioImsResponse, in IRadioImsIndication radioImsIndication);
/**
* Access Network Bitrate Recommendation Query (ANBRQ), see 3GPP TS 26.114.
@@ -137,8 +149,11 @@
* @param bitsPerSecond The bit rate requested by the opponent UE
*
* Response function is IRadioImsResponse.sendAnbrQueryResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
- void sendAnbrQuery(int serial, ImsStreamType mediaType, ImsStreamDirection direction, int bitsPerSecond);
+ void sendAnbrQuery(
+ int serial, ImsStreamType mediaType, ImsStreamDirection direction, int bitsPerSecond);
/**
* Provides a list of IMS call information to radio.
@@ -147,6 +162,8 @@
* @param imsCalls The list of IMS calls
*
* Response function is IRadioImsResponse.updateImsCallStatusResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void updateImsCallStatus(int serial, in ImsCall[] imsCalls);
}
diff --git a/radio/aidl/android/hardware/radio/ims/IRadioImsIndication.aidl b/radio/aidl/android/hardware/radio/ims/IRadioImsIndication.aidl
index d123d07..58e30ce 100644
--- a/radio/aidl/android/hardware/radio/ims/IRadioImsIndication.aidl
+++ b/radio/aidl/android/hardware/radio/ims/IRadioImsIndication.aidl
@@ -24,6 +24,7 @@
/**
* Interface declaring unsolicited radio indications for ims APIs.
+ * @hide
*/
@VintfStability
oneway interface IRadioImsIndication {
diff --git a/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl b/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl
index ff516cc..ca33d07 100644
--- a/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl
+++ b/radio/aidl/android/hardware/radio/ims/IRadioImsResponse.aidl
@@ -21,14 +21,15 @@
/**
* Interface declaring response functions to solicited radio requests for ims APIs.
+ * @hide
*/
@VintfStability
oneway interface IRadioImsResponse {
-
/**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -45,6 +46,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -63,6 +65,7 @@
* it should be {@code null}.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -73,13 +76,14 @@
* RadioError:INVALID_ARGUMENTS
* RadioError:NO_RESOURCES
*/
- void startImsTrafficResponse(in RadioResponseInfo info,
- in @nullable ConnectionFailureInfo failureInfo);
+ void startImsTrafficResponse(
+ in RadioResponseInfo info, in @nullable ConnectionFailureInfo failureInfo);
/**
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -96,6 +100,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -112,6 +117,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -128,6 +134,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
diff --git a/radio/aidl/android/hardware/radio/ims/ImsCall.aidl b/radio/aidl/android/hardware/radio/ims/ImsCall.aidl
index b71682f..427c1f5 100644
--- a/radio/aidl/android/hardware/radio/ims/ImsCall.aidl
+++ b/radio/aidl/android/hardware/radio/ims/ImsCall.aidl
@@ -18,10 +18,10 @@
import android.hardware.radio.AccessNetwork;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable ImsCall {
-
@Backing(type="int")
enum CallType {
NORMAL,
diff --git a/radio/aidl/android/hardware/radio/ims/ImsDeregistrationReason.aidl b/radio/aidl/android/hardware/radio/ims/ImsDeregistrationReason.aidl
index eac8db4..acfe51c 100644
--- a/radio/aidl/android/hardware/radio/ims/ImsDeregistrationReason.aidl
+++ b/radio/aidl/android/hardware/radio/ims/ImsDeregistrationReason.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.ims;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
@Backing(type="int")
diff --git a/radio/aidl/android/hardware/radio/ims/ImsRegistration.aidl b/radio/aidl/android/hardware/radio/ims/ImsRegistration.aidl
index 662f9e9..5158386 100644
--- a/radio/aidl/android/hardware/radio/ims/ImsRegistration.aidl
+++ b/radio/aidl/android/hardware/radio/ims/ImsRegistration.aidl
@@ -20,6 +20,7 @@
import android.hardware.radio.ims.ImsRegistrationState;
import android.hardware.radio.ims.SuggestedAction;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable ImsRegistration {
diff --git a/radio/aidl/android/hardware/radio/ims/ImsRegistrationState.aidl b/radio/aidl/android/hardware/radio/ims/ImsRegistrationState.aidl
index fd5c0fa..187cb38 100644
--- a/radio/aidl/android/hardware/radio/ims/ImsRegistrationState.aidl
+++ b/radio/aidl/android/hardware/radio/ims/ImsRegistrationState.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.ims;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
@Backing(type="int")
@@ -25,4 +26,4 @@
/** IMS is successfully registered */
REGISTERED,
-}
\ No newline at end of file
+}
diff --git a/radio/aidl/android/hardware/radio/ims/ImsStreamDirection.aidl b/radio/aidl/android/hardware/radio/ims/ImsStreamDirection.aidl
index c0cea32..42ce1bd 100644
--- a/radio/aidl/android/hardware/radio/ims/ImsStreamDirection.aidl
+++ b/radio/aidl/android/hardware/radio/ims/ImsStreamDirection.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.ims;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
@Backing(type="int")
diff --git a/radio/aidl/android/hardware/radio/ims/ImsStreamType.aidl b/radio/aidl/android/hardware/radio/ims/ImsStreamType.aidl
index c12a0c1..b88dc60 100644
--- a/radio/aidl/android/hardware/radio/ims/ImsStreamType.aidl
+++ b/radio/aidl/android/hardware/radio/ims/ImsStreamType.aidl
@@ -16,8 +16,10 @@
package android.hardware.radio.ims;
+/** @hide */
@VintfStability
@Backing(type="int")
+@JavaDerive(toString=true)
enum ImsStreamType {
/** Media Stream Type - Audio **/
AUDIO = 1,
diff --git a/radio/aidl/android/hardware/radio/ims/ImsTrafficType.aidl b/radio/aidl/android/hardware/radio/ims/ImsTrafficType.aidl
index 5a824c0..5af43f9 100644
--- a/radio/aidl/android/hardware/radio/ims/ImsTrafficType.aidl
+++ b/radio/aidl/android/hardware/radio/ims/ImsTrafficType.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.ims;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
@Backing(type="int")
@@ -40,4 +41,4 @@
/** Ut/XCAP (XML Configuration Access Protocol) */
UT_XCAP
-}
\ No newline at end of file
+}
diff --git a/radio/aidl/android/hardware/radio/ims/SrvccCall.aidl b/radio/aidl/android/hardware/radio/ims/SrvccCall.aidl
index 38e6cdb..16858f9 100644
--- a/radio/aidl/android/hardware/radio/ims/SrvccCall.aidl
+++ b/radio/aidl/android/hardware/radio/ims/SrvccCall.aidl
@@ -16,10 +16,10 @@
package android.hardware.radio.ims;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable SrvccCall {
-
@VintfStability
@Backing(type="int")
enum CallType {
diff --git a/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl b/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl
index 2d12ed6..f0e28fc 100644
--- a/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl
+++ b/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.ims;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
@Backing(type="int")
@@ -34,4 +35,18 @@
* management timer value as per the carrier requirements.
*/
TRIGGER_PLMN_BLOCK_WITH_TIMEOUT,
+ /**
+ * Indicates that the IMS registration on current RAT failed multiple times.
+ * The radio shall block the current RAT and search for other available RATs in the
+ * background. If no other RAT is available that meets the carrier requirements, the
+ * radio may remain on the current RAT for internet service. The radio clears all
+ * RATs marked as unavailable if {@link IRadioIms#updateImsRegistrationInfo()} API
+ * with REGISTERED state is invoked.
+ */
+ TRIGGER_RAT_BLOCK,
+ /**
+ * Indicates that the radio clears all RATs marked as unavailable and tries to find
+ * an available RAT that meets the carrier requirements.
+ */
+ TRIGGER_CLEAR_RAT_BLOCK,
}
diff --git a/radio/aidl/android/hardware/radio/ims/media/AmrMode.aidl b/radio/aidl/android/hardware/radio/ims/media/AmrMode.aidl
index 66d8ef0..dc2a162 100644
--- a/radio/aidl/android/hardware/radio/ims/media/AmrMode.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/AmrMode.aidl
@@ -16,9 +16,13 @@
package android.hardware.radio.ims.media;
-/** AMR codec mode to represent the bit rate. See 3ggp Specs 26.976 & 26.071 */
+/**
+ * AMR codec mode to represent the bit rate. See 3ggp Specs 26.976 & 26.071
+ * @hide
+ */
@VintfStability
@Backing(type="int")
+@JavaDerive(toString=true)
enum AmrMode {
/** 4.75 kbps for AMR / 6.6 kbps for AMR-WB */
AMR_MODE_0 = 1 << 0,
diff --git a/radio/aidl/android/hardware/radio/ims/media/AmrParams.aidl b/radio/aidl/android/hardware/radio/ims/media/AmrParams.aidl
index 4ed3a24..9d7ab05 100644
--- a/radio/aidl/android/hardware/radio/ims/media/AmrParams.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/AmrParams.aidl
@@ -18,7 +18,9 @@
import android.hardware.radio.ims.media.AmrMode;
+/** @hide */
@VintfStability
+@JavaDerive(toString=true)
parcelable AmrParams {
/** mode-set: AMR codec mode to represent the bit rate */
AmrMode amrMode;
diff --git a/radio/aidl/android/hardware/radio/ims/media/AnbrMode.aidl b/radio/aidl/android/hardware/radio/ims/media/AnbrMode.aidl
index f758cd4..af6f92f 100644
--- a/radio/aidl/android/hardware/radio/ims/media/AnbrMode.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/AnbrMode.aidl
@@ -18,6 +18,7 @@
import android.hardware.radio.ims.media.CodecMode;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable AnbrMode {
diff --git a/radio/aidl/android/hardware/radio/ims/media/CallQuality.aidl b/radio/aidl/android/hardware/radio/ims/media/CallQuality.aidl
index a8f7b16..dcf9623 100644
--- a/radio/aidl/android/hardware/radio/ims/media/CallQuality.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/CallQuality.aidl
@@ -16,7 +16,9 @@
package android.hardware.radio.ims.media;
+/** @hide */
@VintfStability
+@JavaDerive(toString=true)
parcelable CallQuality {
/**
* downlink CallQualityLevel for a given ongoing call
diff --git a/radio/aidl/android/hardware/radio/ims/media/CodecMode.aidl b/radio/aidl/android/hardware/radio/ims/media/CodecMode.aidl
index aa1b3a4..6858ef4 100644
--- a/radio/aidl/android/hardware/radio/ims/media/CodecMode.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/CodecMode.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.ims.media.AmrMode;
import android.hardware.radio.ims.media.EvsMode;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
union CodecMode {
diff --git a/radio/aidl/android/hardware/radio/ims/media/CodecParams.aidl b/radio/aidl/android/hardware/radio/ims/media/CodecParams.aidl
index 0aa5505..74de6ec 100644
--- a/radio/aidl/android/hardware/radio/ims/media/CodecParams.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/CodecParams.aidl
@@ -19,7 +19,9 @@
import android.hardware.radio.ims.media.CodecSpecificParams;
import android.hardware.radio.ims.media.CodecType;
+/** @hide */
@VintfStability
+@JavaDerive(toString=true)
parcelable CodecParams {
/** Negotiated codec type */
CodecType codecType;
diff --git a/radio/aidl/android/hardware/radio/ims/media/CodecSpecificParams.aidl b/radio/aidl/android/hardware/radio/ims/media/CodecSpecificParams.aidl
index 4410c81..86dcea0 100644
--- a/radio/aidl/android/hardware/radio/ims/media/CodecSpecificParams.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/CodecSpecificParams.aidl
@@ -19,7 +19,9 @@
import android.hardware.radio.ims.media.AmrParams;
import android.hardware.radio.ims.media.EvsParams;
+/** @hide */
@VintfStability
+@JavaDerive(toString=true)
union CodecSpecificParams {
AmrParams amr;
EvsParams evs;
diff --git a/radio/aidl/android/hardware/radio/ims/media/CodecType.aidl b/radio/aidl/android/hardware/radio/ims/media/CodecType.aidl
index 31218e3..99fbac4 100644
--- a/radio/aidl/android/hardware/radio/ims/media/CodecType.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/CodecType.aidl
@@ -16,8 +16,10 @@
package android.hardware.radio.ims.media;
+/** @hide */
@VintfStability
@Backing(type="int")
+@JavaDerive(toString=true)
enum CodecType {
/** Adaptive Multi-Rate */
AMR = 1 << 0,
diff --git a/radio/aidl/android/hardware/radio/ims/media/DtmfParams.aidl b/radio/aidl/android/hardware/radio/ims/media/DtmfParams.aidl
index a7dcb0d..d2926f0 100644
--- a/radio/aidl/android/hardware/radio/ims/media/DtmfParams.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/DtmfParams.aidl
@@ -16,7 +16,9 @@
package android.hardware.radio.ims.media;
+/** @hide */
@VintfStability
+@JavaDerive(toString=true)
parcelable DtmfParams {
/**
* Dynamic payload type number to be used for DTMF RTP packets received.
diff --git a/radio/aidl/android/hardware/radio/ims/media/EvsBandwidth.aidl b/radio/aidl/android/hardware/radio/ims/media/EvsBandwidth.aidl
index 8278514..279c489 100644
--- a/radio/aidl/android/hardware/radio/ims/media/EvsBandwidth.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/EvsBandwidth.aidl
@@ -15,9 +15,14 @@
*/
package android.hardware.radio.ims.media;
-/** EVS Speech codec bandwidths, See 3gpp spec 26.441 Table 1 */
+
+/**
+ * EVS Speech codec bandwidths, See 3gpp spec 26.441 Table 1
+ * @hide
+ */
@VintfStability
@Backing(type="int")
+@JavaDerive(toString=true)
enum EvsBandwidth {
NONE = 0,
NARROW_BAND = 1 << 0,
diff --git a/radio/aidl/android/hardware/radio/ims/media/EvsMode.aidl b/radio/aidl/android/hardware/radio/ims/media/EvsMode.aidl
index 95bd6c7..12d981b 100644
--- a/radio/aidl/android/hardware/radio/ims/media/EvsMode.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/EvsMode.aidl
@@ -16,9 +16,13 @@
package android.hardware.radio.ims.media;
-/** EVS codec mode to represent the bit rate. See 3ggp Spec 26.952 Table 5.1 */
+/**
+ * EVS codec mode to represent the bit rate. See 3ggp Spec 26.952 Table 5.1
+ * @hide
+ */
@VintfStability
@Backing(type="int")
+@JavaDerive(toString=true)
enum EvsMode {
/** 6.6 kbps for EVS AMR-WB IO */
EVS_MODE_0 = 1 << 0,
diff --git a/radio/aidl/android/hardware/radio/ims/media/EvsParams.aidl b/radio/aidl/android/hardware/radio/ims/media/EvsParams.aidl
index d138c83..52c3bf9 100644
--- a/radio/aidl/android/hardware/radio/ims/media/EvsParams.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/EvsParams.aidl
@@ -19,7 +19,9 @@
import android.hardware.radio.ims.media.EvsBandwidth;
import android.hardware.radio.ims.media.EvsMode;
+/** @hide */
@VintfStability
+@JavaDerive(toString=true)
parcelable EvsParams {
/** EVS codec bandwidth */
EvsBandwidth bandwidth;
diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMedia.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMedia.aidl
index ecf1370..14fe68b 100644
--- a/radio/aidl/android/hardware/radio/ims/media/IImsMedia.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/IImsMedia.aidl
@@ -23,14 +23,16 @@
/**
* This interface is used by IMS media framework to talk to RTP stack located in another processor.
+ * @hide
*/
@VintfStability
oneway interface IImsMedia {
-
/**
* Set the listener functions for receiving notifications from the RTP stack.
*
* @param mediaListener Object containing listener methods
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void setListener(in IImsMediaListener mediaListener);
@@ -46,6 +48,8 @@
* @param localEndPoint provides IP address, port and logical modem id for local RTP endpoint
* @param config provides remote end point info and codec details. This could be null initially
* and the application may update this later using modifySession() API.
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void openSession(int sessionId, in LocalEndPoint localEndPoint, in RtpConfig config);
@@ -54,6 +58,8 @@
* This shall also close the session specific binder connection opened as part of openSession().
*
* @param sessionId identifier for the rtp session that needs to be closed
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void closeSession(int sessionId);
}
diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMediaListener.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMediaListener.aidl
index 228acb7..371edd2 100644
--- a/radio/aidl/android/hardware/radio/ims/media/IImsMediaListener.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/IImsMediaListener.aidl
@@ -21,6 +21,7 @@
/**
* Interface declaring listener functions for unsolicited IMS media notifications.
+ * @hide
*/
@VintfStability
oneway interface IImsMediaListener {
diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl
index ec2fa2b..0fe6740 100644
--- a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl
@@ -24,6 +24,7 @@
/**
* Session specific interface used by IMS media framework to talk to the vendor RTP stack.
+ * @hide
*/
@VintfStability
oneway interface IImsMediaSession {
@@ -31,6 +32,8 @@
* Set the listener functions to receive IMS media session specific notifications.
*
* @param sessionListener Object containing notification methods
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void setListener(in IImsMediaSessionListener sessionListener);
@@ -39,6 +42,8 @@
* the media stream by changing the value of the MediaDirection.
*
* @param config provides remote end point info and codec details
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void modifySession(in RtpConfig config);
@@ -47,6 +52,8 @@
*
* @param dtmfDigit single char having one of 12 values: 0-9, *, #
* @param duration of the key press in milliseconds.
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void sendDtmf(char dtmfDigit, int duration);
@@ -56,12 +63,16 @@
* stopDtmf() is not received yet, then that digit must be stopped first
*
* @param dtmfDigit single char having one of 12 values: 0-9, *, #
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void startDtmf(char dtmfDigit);
/**
* Stop sending the last DTMF digit started by startDtmf().
* stopDtmf() without preceding startDtmf() must be ignored.
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void stopDtmf();
@@ -69,6 +80,8 @@
* Send RTP header extension to the other party in the next RTP packet.
*
* @param extensions data to be transmitted via RTP header extension
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void sendHeaderExtension(in List<RtpHeaderExtension> extensions);
@@ -77,6 +90,30 @@
* media quality notifications.
*
* @param threshold media quality thresholds for various quality parameters
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void setMediaQualityThreshold(in MediaQualityThreshold threshold);
+
+ /**
+ * Queries the current RTP reception statistics of the RTP stream. It will trigger the
+ IImsMediaSessionListener#notifyRtpReceptionStats(RtpReceptionStats).
+ *
+ * @param intervalMs The interval of the time in milliseconds of the RTP reception
+ * notification. When it is zero, the report is disabled.
+ *
+ * This is available when android.hardware.telephony.ims is defined.
+ */
+ void requestRtpReceptionStats(in int intervalMs);
+
+ /**
+ * Adjust the delay in the jitter buffer to synchronize the audio with the time of video
+ * frames
+ *
+ * @param delayMs The delay to apply to the jitter buffer. If it is positive, the jitter
+ * buffer increases the delay, if it is negative, the jitter buffer decreases the delay.
+ *
+ * This is available when android.hardware.telephony.ims is defined.
+ */
+ void adjustDelay(in int delayMs);
}
diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
index 8341da2..d3d0b26 100644
--- a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSessionListener.aidl
@@ -21,9 +21,11 @@
import android.hardware.radio.ims.media.RtpConfig;
import android.hardware.radio.ims.media.RtpError;
import android.hardware.radio.ims.media.RtpHeaderExtension;
+import android.hardware.radio.ims.media.RtpReceptionStats;
/**
* Interface declaring listener functions for unsolicited IMS media notifications per session.
+ * @hide
*/
@VintfStability
oneway interface IImsMediaSessionListener {
@@ -36,6 +38,8 @@
* RtpError :INTERNAL_ERR
* RtpError :NO_MEMORY
* RtpError :NO_RESOURCES
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void onModifySessionResponse(in RtpConfig config, RtpError error);
@@ -48,6 +52,8 @@
* packets from the most recently added config.
*
* @param config The remote config where the media is received
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void onFirstMediaPacketReceived(in RtpConfig config);
@@ -55,6 +61,8 @@
* RTP header extension received from the other party
*
* @param extensions content of the received RTP header extension
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void onHeaderExtensionReceived(in List<RtpHeaderExtension> extensions);
@@ -63,6 +71,8 @@
* {@link MediaQualityThreshold} set by {@link IImsMediaSession#setMediaQualityThreshold()}.
*
* @param quality The object of MediaQualityStatus with the rtp and the rtcp statistics.
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void notifyMediaQualityStatus(in MediaQualityStatus quality);
@@ -72,6 +82,8 @@
* See 3GPP TS 26.114.
*
* @param config containing desired bitrate and direction
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void triggerAnbrQuery(in RtpConfig config);
@@ -80,6 +92,8 @@
*
* @param dtmfDigit single char having one of 12 values: 0-9, *, #
* @param durationMs The duration to play the tone in milliseconds unit
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void onDtmfReceived(char dtmfDigit, int durationMs);
@@ -87,6 +101,18 @@
* Notifies when a change to call quality has occurred
*
* @param CallQuality The call quality statistics of ongoing call since last report
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void onCallQualityChanged(in CallQuality callQuality);
+
+ /**
+ * Notifies the RTP reception statistics periodically after
+ * IImsMediaSession#requestRtpReceptionStats(intervalMs) is invoked.
+ *
+ * @param stats The RTP reception statistics
+ *
+ * This is available when android.hardware.telephony.ims is defined.
+ */
+ void notifyRtpReceptionStats(in RtpReceptionStats stats);
}
diff --git a/radio/aidl/android/hardware/radio/ims/media/LocalEndPoint.aidl b/radio/aidl/android/hardware/radio/ims/media/LocalEndPoint.aidl
index 2bd48c6..29f25bb 100644
--- a/radio/aidl/android/hardware/radio/ims/media/LocalEndPoint.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/LocalEndPoint.aidl
@@ -18,7 +18,9 @@
import android.os.ParcelFileDescriptor;
+/** @hide */
@VintfStability
+@JavaDerive(toString=true)
parcelable LocalEndPoint {
/** Socket file descriptor for RTP traffic */
ParcelFileDescriptor rtpFd;
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaDirection.aidl b/radio/aidl/android/hardware/radio/ims/media/MediaDirection.aidl
index e5c34c7..4ae36df 100644
--- a/radio/aidl/android/hardware/radio/ims/media/MediaDirection.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/MediaDirection.aidl
@@ -26,9 +26,11 @@
* Receive-Only : RTP_RX | RTCP_TX | RTCP_RX - eg. Remote Hold.
* Send-Receive : RTP_TX | RTP_RX | RTCP_TX | RTCP_RX - eg. Active call.
* Send-Only : RTP_TX | RTCP_TX | RTCP_RX - eg. Simplex call, voice mail, etc
+ * @hide
*/
@VintfStability
@Backing(type="int")
+@JavaDerive(toString=true)
enum MediaDirection {
/**
* No RTP/RTCP flow in either direction. The implementation
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaQualityStatus.aidl b/radio/aidl/android/hardware/radio/ims/media/MediaQualityStatus.aidl
index b99e501..b617f91 100644
--- a/radio/aidl/android/hardware/radio/ims/media/MediaQualityStatus.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/MediaQualityStatus.aidl
@@ -16,7 +16,9 @@
package android.hardware.radio.ims.media;
+/** @hide */
@VintfStability
+@JavaDerive(toString=true)
parcelable MediaQualityStatus {
/**
* Rtp inactivity observed as per threshold set by
diff --git a/radio/aidl/android/hardware/radio/ims/media/MediaQualityThreshold.aidl b/radio/aidl/android/hardware/radio/ims/media/MediaQualityThreshold.aidl
index bf98928..25473d0 100644
--- a/radio/aidl/android/hardware/radio/ims/media/MediaQualityThreshold.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/MediaQualityThreshold.aidl
@@ -16,7 +16,9 @@
package android.hardware.radio.ims.media;
+/** @hide */
@VintfStability
+@JavaDerive(toString=true)
parcelable MediaQualityThreshold {
/** Array including threshold values in milliseconds for monitoring RTP inactivity */
int[] rtpInactivityTimerMillis;
diff --git a/radio/aidl/android/hardware/radio/ims/media/RtcpConfig.aidl b/radio/aidl/android/hardware/radio/ims/media/RtcpConfig.aidl
index 98bbfc6..9cb3c0e 100644
--- a/radio/aidl/android/hardware/radio/ims/media/RtcpConfig.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/RtcpConfig.aidl
@@ -16,7 +16,9 @@
package android.hardware.radio.ims.media;
+/** @hide */
@VintfStability
+@JavaDerive(toString=true)
parcelable RtcpConfig {
/** Canonical name that will be sent to all session participants */
String canonicalName;
diff --git a/radio/aidl/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl b/radio/aidl/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
index 7f6839a..88180d7 100644
--- a/radio/aidl/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/RtcpXrReportBlockType.aidl
@@ -16,25 +16,28 @@
package android.hardware.radio.ims.media;
-/** RTP Control Protocol Extended Reports (RTCP XR) Blocks, See RFC 3611 section 4 */
-
+/**
+ * RTP Control Protocol Extended Reports (RTCP XR) Blocks, See RFC 3611 section 4
+ * @hide
+ */
@VintfStability
@Backing(type="int")
+@JavaDerive(toString=true)
enum RtcpXrReportBlockType {
/** Disable RTCP XR */
RTCPXR_NONE = 0,
/** Loss RLE Report Block */
- RTCPXR_LOSS_RLE_REPORT_BLOCK = 1 << 0,
+ RTCPXR_LOSS_RLE_REPORT_BLOCK = 1 << 0,
/** Duplicate RLE Report Block */
- RTCPXR_DUPLICATE_RLE_REPORT_BLOCK = 1 << 1,
+ RTCPXR_DUPLICATE_RLE_REPORT_BLOCK = 1 << 1,
/** Packet Receipt Times Report Block */
- RTCPXR_PACKET_RECEIPT_TIMES_REPORT_BLOCK = 1 << 2,
+ RTCPXR_PACKET_RECEIPT_TIMES_REPORT_BLOCK = 1 << 2,
/** Receiver Reference Time Report Block */
- RTCPXR_RECEIVER_REFERENCE_TIME_REPORT_BLOCK = 1 << 3,
+ RTCPXR_RECEIVER_REFERENCE_TIME_REPORT_BLOCK = 1 << 3,
/** DLRR Report Block */
- RTCPXR_DLRR_REPORT_BLOCK = 1 << 4,
+ RTCPXR_DLRR_REPORT_BLOCK = 1 << 4,
/** Statistics Summary Report Block */
- RTCPXR_STATISTICS_SUMMARY_REPORT_BLOCK = 1 << 5,
+ RTCPXR_STATISTICS_SUMMARY_REPORT_BLOCK = 1 << 5,
/** VoIP Metrics Report Block */
- RTCPXR_VOIP_METRICS_REPORT_BLOCK = 1 << 6,
+ RTCPXR_VOIP_METRICS_REPORT_BLOCK = 1 << 6,
}
diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpAddress.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpAddress.aidl
index 2db73a3..c17e4b2 100644
--- a/radio/aidl/android/hardware/radio/ims/media/RtpAddress.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/RtpAddress.aidl
@@ -16,7 +16,9 @@
package android.hardware.radio.ims.media;
+/** @hide */
@VintfStability
+@JavaDerive(toString=true)
parcelable RtpAddress {
/** Point to point IP address */
String ipAddress;
diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl
index f93b112..3c5c4dd 100644
--- a/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/RtpConfig.aidl
@@ -22,7 +22,9 @@
import android.hardware.radio.ims.media.RtpAddress;
import android.hardware.radio.ims.media.RtpSessionParams;
+/** @hide */
@VintfStability
+@JavaDerive(toString=true)
parcelable RtpConfig {
/** Media flow direction. The bitfield of MediaDirection(s) */
int direction;
diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpError.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpError.aidl
index 11a3468..84f972f 100644
--- a/radio/aidl/android/hardware/radio/ims/media/RtpError.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/RtpError.aidl
@@ -16,8 +16,10 @@
package android.hardware.radio.ims.media;
+/** @hide */
@VintfStability
@Backing(type="int")
+@JavaDerive(toString=true)
enum RtpError {
/** Success */
NONE = 0,
diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpHeaderExtension.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpHeaderExtension.aidl
index 76b13dc..19e855a 100644
--- a/radio/aidl/android/hardware/radio/ims/media/RtpHeaderExtension.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/RtpHeaderExtension.aidl
@@ -16,8 +16,12 @@
package android.hardware.radio.ims.media;
-/** RTP Header Extensions, see RFC 8285 */
+/**
+ * RTP Header Extensions, see RFC 8285
+ * @hide
+ */
@VintfStability
+@JavaDerive(toString=true)
parcelable RtpHeaderExtension {
/** Local identifier */
int localId;
diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpReceptionStats.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpReceptionStats.aidl
new file mode 100644
index 0000000..1239d13
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/ims/media/RtpReceptionStats.aidl
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+package android.hardware.radio.ims.media;
+
+@VintfStability
+parcelable RtpReceptionStats {
+ /** The timestamp of the latest RTP packet received */
+ int rtpTimestamp;
+ /** The sequence number of latest RTP packet received */
+ int rtpSequenceNumber;
+ /** The system clock time in millisecond of latest RTP packet received */
+ int timeDurationMs;
+ /** The jitter buffer size in millisecond when latest RTP packet received */
+ int jitterBufferMs;
+ /** The round trip time delay in millisecond when latest RTP packet received */
+ int roundTripTimeMs;
+}
diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpSessionParams.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpSessionParams.aidl
index f93c52c..ae5c7e6 100644
--- a/radio/aidl/android/hardware/radio/ims/media/RtpSessionParams.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/RtpSessionParams.aidl
@@ -19,7 +19,9 @@
import android.hardware.radio.ims.media.CodecParams;
import android.hardware.radio.ims.media.DtmfParams;
+/** @hide */
@VintfStability
+@JavaDerive(toString=true)
parcelable RtpSessionParams {
/**
* ptime: Recommended length of time in milliseconds represented by the media
diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl
index 4173f15..35a6a8d 100644
--- a/radio/aidl/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/CdmaBroadcastSmsConfigInfo.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.messaging;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CdmaBroadcastSmsConfigInfo {
diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaSmsAck.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaSmsAck.aidl
index 85ef692..2544ab5 100644
--- a/radio/aidl/android/hardware/radio/messaging/CdmaSmsAck.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/CdmaSmsAck.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.messaging;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CdmaSmsAck {
diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaSmsAddress.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaSmsAddress.aidl
index 8e521df..a7ad233 100644
--- a/radio/aidl/android/hardware/radio/messaging/CdmaSmsAddress.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/CdmaSmsAddress.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.messaging;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CdmaSmsAddress {
diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaSmsMessage.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaSmsMessage.aidl
index d4fb26f..51388b6 100644
--- a/radio/aidl/android/hardware/radio/messaging/CdmaSmsMessage.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/CdmaSmsMessage.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.messaging.CdmaSmsAddress;
import android.hardware.radio.messaging.CdmaSmsSubaddress;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CdmaSmsMessage {
diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl
index 18e5837..19d84ff 100644
--- a/radio/aidl/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/CdmaSmsSubaddress.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.messaging;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CdmaSmsSubaddress {
diff --git a/radio/aidl/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl b/radio/aidl/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl
index 4191985..897ec80 100644
--- a/radio/aidl/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/CdmaSmsWriteArgs.aidl
@@ -18,6 +18,7 @@
import android.hardware.radio.messaging.CdmaSmsMessage;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CdmaSmsWriteArgs {
diff --git a/radio/aidl/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl b/radio/aidl/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl
index 5138c3c..b4ab518 100644
--- a/radio/aidl/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/GsmBroadcastSmsConfigInfo.aidl
@@ -18,6 +18,7 @@
/**
* Which types of Cell Broadcast Message (CBM) are to be received by the ME
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl b/radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl
index b256c9a..9a1a7b9 100644
--- a/radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/GsmSmsMessage.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.messaging;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable GsmSmsMessage {
diff --git a/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl b/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl
index 8bd84a3..945453c 100644
--- a/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/IRadioMessaging.aidl
@@ -35,6 +35,7 @@
* duration of a method call. If clients provide colliding serials (including passing the same
* serial to different methods), multiple responses (one for each method call) must still be served.
* setResponseFunctions must work with IRadioMessagingResponse and IRadioMessagingIndication.
+ * @hide
*/
@VintfStability
oneway interface IRadioMessaging {
@@ -49,6 +50,8 @@
* @param ackPdu acknowledgement TPDU in hexadecimal format
*
* Response function is IRadioMessagingResponse.acknowledgeIncomingGsmSmsWithPduResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void acknowledgeIncomingGsmSmsWithPdu(in int serial, in boolean success, in String ackPdu);
@@ -60,6 +63,8 @@
* @param smsAck Cdma Sms ack to be sent described by CdmaSmsAck
*
* Response function is IRadioMessagingResponse.acknowledgeLastIncomingCdmaSmsResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void acknowledgeLastIncomingCdmaSms(in int serial, in CdmaSmsAck smsAck);
@@ -74,6 +79,8 @@
* in TS 23.040, 9.2.3.22.
*
* Response function is IRadioMessagingResponse.acknowledgeLastIncomingGsmSmsResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void acknowledgeLastIncomingGsmSms(
in int serial, in boolean success, in SmsAcknowledgeFailCause cause);
@@ -85,6 +92,8 @@
* @param index record index of the message to delete
*
* Response function is IRadioMessagingResponse.deleteSmsOnRuimResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void deleteSmsOnRuim(in int serial, in int index);
@@ -95,6 +104,8 @@
* @param index Record index of the message to delete.
*
* Response function is IRadioMessagingResponse.deleteSmsOnSimResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void deleteSmsOnSim(in int serial, in int index);
@@ -104,6 +115,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioMessagingResponse.getCdmaBroadcastConfigResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void getCdmaBroadcastConfig(in int serial);
@@ -113,6 +126,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioMessagingResponse.getGsmBroadcastConfigResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void getGsmBroadcastConfig(in int serial);
@@ -122,6 +137,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioMessagingResponse.getSmscAddressResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void getSmscAddress(in int serial);
@@ -133,6 +150,8 @@
* false if memory capacity is exceeded
*
* Response function is IRadioMessagingResponse.reportSmsMemoryStatusResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void reportSmsMemoryStatus(in int serial, in boolean available);
@@ -140,6 +159,8 @@
* When response type received from a radio indication or radio response is
* RadioIndicationType:UNSOLICITED_ACK_EXP or RadioResponseType:SOLICITED_ACK_EXP respectively,
* acknowledge the receipt of those messages by sending responseAcknowledgement().
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void responseAcknowledgement();
@@ -150,6 +171,8 @@
* @param sms CdmaSmsMessage to be sent
*
* Response function is IRadioMessagingResponse.sendCdmaSmsResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void sendCdmaSms(in int serial, in CdmaSmsMessage sms);
@@ -161,6 +184,8 @@
* @param sms CdmaSmsMessage to be sent
*
* Response function is IRadioMessagingResponse.sendCdmaSmsExpectMoreResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void sendCdmaSmsExpectMore(in int serial, in CdmaSmsMessage sms);
@@ -173,6 +198,8 @@
* @param message ImsSmsMessage to be sent
*
* Response function is IRadioMessagingResponse.sendImsSmsResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void sendImsSms(in int serial, in ImsSmsMessage message);
@@ -185,6 +212,8 @@
* @param message GsmSmsMessage to be sent
*
* Response function is IRadioMessagingResponse.sendSmsResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void sendSms(in int serial, in GsmSmsMessage message);
@@ -199,6 +228,8 @@
* @param message GsmSmsMessage to be sent
*
* Response function is IRadioMessagingResponse.sendSmsExpectMoreResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void sendSmsExpectMore(in int serial, in GsmSmsMessage message);
@@ -210,6 +241,8 @@
* true = activate, false = turn off
*
* Response function is IRadioMessagingResponse.setCdmaBroadcastActivationResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void setCdmaBroadcastActivation(in int serial, in boolean activate);
@@ -220,6 +253,8 @@
* @param configInfo CDMA Broadcast SMS config to be set.
*
* Response function is IRadioMessagingResponse.setCdmaBroadcastConfigResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void setCdmaBroadcastConfig(in int serial, in CdmaBroadcastSmsConfigInfo[] configInfo);
@@ -231,6 +266,8 @@
* Cell Broadcast SMS. true = activate, false = turn off
*
* Response function is IRadioMessagingResponse.setGsmBroadcastActivationResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void setGsmBroadcastActivation(in int serial, in boolean activate);
@@ -241,6 +278,8 @@
* @param configInfo Setting of GSM/WCDMA Cell broadcast config
*
* Response function is IRadioMessagingResponse.setGsmBroadcastConfigResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void setGsmBroadcastConfig(in int serial, in GsmBroadcastSmsConfigInfo[] configInfo);
@@ -249,6 +288,8 @@
*
* @param radioMessagingResponse Object containing response functions
* @param radioMessagingIndication Object containing radio indications
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void setResponseFunctions(in IRadioMessagingResponse radioMessagingResponse,
in IRadioMessagingIndication radioMessagingIndication);
@@ -260,6 +301,8 @@
* @param smsc Short Message Service Center address to set
*
* Response function is IRadioMessagingResponse.setSmscAddressResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void setSmscAddress(in int serial, in String smsc);
@@ -270,6 +313,8 @@
* @param cdmaSms CdmaSmsWriteArgs
*
* Response function is IRadioMessagingResponse.writeSmsToRuimResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void writeSmsToRuim(in int serial, in CdmaSmsWriteArgs cdmaSms);
@@ -280,6 +325,8 @@
* @param smsWriteArgs SmsWriteArgs
*
* Response function is IRadioMessagingResponse.writeSmsToSimResponse()
+ *
+ * This is available when android.hardware.telephony.messaging is defined.
*/
void writeSmsToSim(in int serial, in SmsWriteArgs smsWriteArgs);
}
diff --git a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingIndication.aidl b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingIndication.aidl
index 8834cd9..a177c2c 100644
--- a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingIndication.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingIndication.aidl
@@ -21,6 +21,7 @@
/**
* Interface declaring unsolicited radio indications for messaging APIs.
+ * @hide
*/
@VintfStability
oneway interface IRadioMessagingIndication {
diff --git a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl
index 8cbc869..f0d7999 100644
--- a/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/IRadioMessagingResponse.aidl
@@ -23,6 +23,7 @@
/**
* Interface declaring response functions to solicited radio requests for messaging APIs.
+ * @hide
*/
@VintfStability
oneway interface IRadioMessagingResponse {
@@ -30,6 +31,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -43,6 +46,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -65,6 +69,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -87,6 +93,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -108,6 +115,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_FULL
@@ -130,6 +139,7 @@
* @param configs Vector of CDMA Broadcast SMS configs.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -152,6 +162,8 @@
* @param configs Vector of GSM/WCDMA Cell broadcast configs
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -174,6 +186,8 @@
* @param smsc Short Message Service Center address on the device
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -195,6 +209,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -215,6 +231,7 @@
* @param sms Response to sms sent as defined by SendSmsResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SMS_SEND_FAIL_RETRY
@@ -248,6 +265,7 @@
* @param sms Sms result struct as defined by SendSmsResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -281,6 +299,7 @@
* @param sms Response to sms sent as defined by SendSmsResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SMS_SEND_FAIL_RETRY
@@ -308,6 +327,8 @@
* @param sms Response to sms sent as defined by SendSmsResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SMS_SEND_FAIL_RETRY
@@ -340,6 +361,8 @@
* @param sms Response to sms sent as defined by SendSmsResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SMS_SEND_FAIL_RETRY
@@ -370,6 +393,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -390,6 +414,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -409,6 +434,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -429,6 +456,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -448,6 +477,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -470,6 +501,7 @@
* @param index record index where the cmda sms message is stored
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -496,6 +528,8 @@
* @param index record index where the message is stored
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.messaging is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_FULL
diff --git a/radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl b/radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl
index d4be044..5f9f82b 100644
--- a/radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/ImsSmsMessage.aidl
@@ -20,6 +20,7 @@
import android.hardware.radio.messaging.CdmaSmsMessage;
import android.hardware.radio.messaging.GsmSmsMessage;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable ImsSmsMessage {
diff --git a/radio/aidl/android/hardware/radio/messaging/SendSmsResult.aidl b/radio/aidl/android/hardware/radio/messaging/SendSmsResult.aidl
index 80e059c..ea93727 100644
--- a/radio/aidl/android/hardware/radio/messaging/SendSmsResult.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/SendSmsResult.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.messaging;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable SendSmsResult {
diff --git a/radio/aidl/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl b/radio/aidl/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl
index eb15bf1..6f529eb 100644
--- a/radio/aidl/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/SmsAcknowledgeFailCause.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.messaging;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/messaging/SmsWriteArgs.aidl b/radio/aidl/android/hardware/radio/messaging/SmsWriteArgs.aidl
index 6eef941..64ce606 100644
--- a/radio/aidl/android/hardware/radio/messaging/SmsWriteArgs.aidl
+++ b/radio/aidl/android/hardware/radio/messaging/SmsWriteArgs.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.messaging;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable SmsWriteArgs {
diff --git a/radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl b/radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl
index b2a56d4..db77c51 100644
--- a/radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl
+++ b/radio/aidl/android/hardware/radio/modem/ActivityStatsInfo.aidl
@@ -18,6 +18,7 @@
import android.hardware.radio.modem.ActivityStatsTechSpecificInfo;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable ActivityStatsInfo {
diff --git a/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl b/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
index fcc2df2..7ca4021 100644
--- a/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
+++ b/radio/aidl/android/hardware/radio/modem/ActivityStatsTechSpecificInfo.aidl
@@ -18,6 +18,7 @@
import android.hardware.radio.AccessNetwork;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable ActivityStatsTechSpecificInfo {
diff --git a/radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl b/radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl
index ad0d59c..c1f4cd6 100644
--- a/radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl
+++ b/radio/aidl/android/hardware/radio/modem/DeviceStateType.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.modem;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/modem/HardwareConfig.aidl b/radio/aidl/android/hardware/radio/modem/HardwareConfig.aidl
index 8eb1f2d..323e5c9 100644
--- a/radio/aidl/android/hardware/radio/modem/HardwareConfig.aidl
+++ b/radio/aidl/android/hardware/radio/modem/HardwareConfig.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.modem.HardwareConfigModem;
import android.hardware.radio.modem.HardwareConfigSim;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable HardwareConfig {
diff --git a/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl b/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl
index f5e2c27..1ba3562 100644
--- a/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl
+++ b/radio/aidl/android/hardware/radio/modem/HardwareConfigModem.aidl
@@ -18,6 +18,7 @@
import android.hardware.radio.RadioTechnology;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable HardwareConfigModem {
diff --git a/radio/aidl/android/hardware/radio/modem/HardwareConfigSim.aidl b/radio/aidl/android/hardware/radio/modem/HardwareConfigSim.aidl
index c82bc6e..a5747c1 100644
--- a/radio/aidl/android/hardware/radio/modem/HardwareConfigSim.aidl
+++ b/radio/aidl/android/hardware/radio/modem/HardwareConfigSim.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.modem;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable HardwareConfigSim {
diff --git a/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl b/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl
index 2011c53..bfca5a9 100644
--- a/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl
+++ b/radio/aidl/android/hardware/radio/modem/IRadioModem.aidl
@@ -31,6 +31,7 @@
* duration of a method call. If clients provide colliding serials (including passing the same
* serial to different methods), multiple responses (one for each method call) must still be served.
* setResponseFunctions must work with IRadioModemResponse and IRadioModemIndication.
+ * @hide
*/
@VintfStability
oneway interface IRadioModem {
@@ -47,6 +48,8 @@
* @param on True to turn on the logical modem, otherwise turn it off.
*
* Response function is IRadioModemResponse.enableModemResponse()
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void enableModem(in int serial, in boolean on);
@@ -56,6 +59,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioModemResponse.getBasebandVersionResponse()
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void getBasebandVersion(in int serial);
@@ -67,6 +72,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioModemResponse.getDeviceIdentityResponse()
+ *
+ * This is available when android.hardware.telephony is defined.
* @deprecated use getImei(int serial)
*/
void getDeviceIdentity(in int serial);
@@ -77,6 +84,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioModemResponse.getHardwareConfigResponse()
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void getHardwareConfig(in int serial);
@@ -88,6 +97,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioModemResponse.getModemActivityInfoResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getModemActivityInfo(in int serial);
@@ -98,6 +109,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioModemResponse.getModemStackStatusResponse()
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void getModemStackStatus(in int serial);
@@ -107,6 +120,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioModemResponse.getRadioCapabilityResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getRadioCapability(in int serial);
@@ -145,6 +160,8 @@
*
* Response function is IRadioModemResponse.nvWriteCdmaPrlResponse()
*
+ * This is available when android.hardware.telephony.cdma is defined.
+ *
* @deprecated NV APIs are deprecated starting from Android U.
*/
void nvWriteCdmaPrl(in int serial, in byte[] prl);
@@ -169,6 +186,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioModemResponse.requestShutdownResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void requestShutdown(in int serial);
@@ -176,6 +195,8 @@
* When response type received from a radio indication or radio response is
* RadioIndicationType:UNSOLICITED_ACK_EXP or RadioResponseType:SOLICITED_ACK_EXP respectively,
* acknowledge the receipt of those messages by sending responseAcknowledgement().
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void responseAcknowledgement();
@@ -188,6 +209,8 @@
* @param state The updated state. See the definition of state at DeviceStateType.
*
* Response function is IRadioModemResponse.sendDeviceStateResponse()
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void sendDeviceState(in int serial, in DeviceStateType deviceStateType, in boolean state);
@@ -200,6 +223,8 @@
* @param rc RadioCapability structure to be set
*
* Response function is IRadioModemResponse.setRadioCapabilityResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setRadioCapability(in int serial, in RadioCapability rc);
@@ -224,6 +249,8 @@
* on this modem or not. No effect if forEmergencyCall is false, or powerOn is false.
*
* Response function is IRadioConfigResponse.setRadioPowerResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setRadioPower(in int serial, in boolean powerOn, in boolean forEmergencyCall,
in boolean preferredForEmergencyCall);
@@ -233,6 +260,8 @@
*
* @param radioModemResponse Object containing response functions
* @param radioModemIndication Object containing radio indications
+ *
+ * This is available when android.hardware.telephony is defined.
*/
void setResponseFunctions(in IRadioModemResponse radioModemResponse,
in IRadioModemIndication radioModemIndication);
@@ -243,6 +272,8 @@
* @param serial : Serial number of request.
*
* Response function is IRadioModemResponse.getImeiResponse()
+ *
+ * This is available when android.hardware.telephony.gsm is defined.
*/
- void getImei(in int serial);
+ void getImei(in int serial);
}
diff --git a/radio/aidl/android/hardware/radio/modem/IRadioModemIndication.aidl b/radio/aidl/android/hardware/radio/modem/IRadioModemIndication.aidl
index c61de99..ba3c510 100644
--- a/radio/aidl/android/hardware/radio/modem/IRadioModemIndication.aidl
+++ b/radio/aidl/android/hardware/radio/modem/IRadioModemIndication.aidl
@@ -20,9 +20,11 @@
import android.hardware.radio.modem.HardwareConfig;
import android.hardware.radio.modem.RadioCapability;
import android.hardware.radio.modem.RadioState;
+import android.hardware.radio.modem.ImeiInfo;
/**
* Interface declaring unsolicited radio indications for modem APIs.
+ * @hide
*/
@VintfStability
oneway interface IRadioModemIndication {
@@ -75,4 +77,12 @@
* @param type Type of radio indication
*/
void rilConnected(in RadioIndicationType type);
+
+ /**
+ * Indicates when there is a change in the IMEI mapping.
+ *
+ * @param type Type of radio indication
+ * @param imeiInfo IMEI information
+ */
+ void onImeiMappingChanged(in RadioIndicationType type, in ImeiInfo imeiInfo);
}
diff --git a/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl b/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl
index fd4bffb..6d2504c 100644
--- a/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl
+++ b/radio/aidl/android/hardware/radio/modem/IRadioModemResponse.aidl
@@ -19,11 +19,12 @@
import android.hardware.radio.RadioResponseInfo;
import android.hardware.radio.modem.ActivityStatsInfo;
import android.hardware.radio.modem.HardwareConfig;
-import android.hardware.radio.modem.RadioCapability;
import android.hardware.radio.modem.ImeiInfo;
+import android.hardware.radio.modem.RadioCapability;
/**
* Interface declaring response functions to solicited radio requests for modem APIs.
+ * @hide
*/
@VintfStability
oneway interface IRadioModemResponse {
@@ -40,6 +41,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MODEM_ERR
@@ -54,6 +56,7 @@
* @param version string containing version string for log reporting
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:EMPTY_RECORD
@@ -78,6 +81,7 @@
* accessing the device.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -99,6 +103,7 @@
* @param config Array of HardwareConfig of the radio.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
*/
@@ -109,6 +114,8 @@
* @param activityInfo modem activity information
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -125,6 +132,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MODEM_ERR
@@ -136,6 +144,8 @@
* @param rc Radio capability as defined by RadioCapability in types.hal
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
@@ -174,6 +184,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
*
@@ -196,6 +207,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
@@ -211,6 +224,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -228,6 +242,8 @@
* feedback return status
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE means a unsol radioCapability() will be sent within 30 seconds.
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
@@ -246,6 +262,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:INTERNAL_ERR
* RadioError:INVALID_ARGUMENTS
@@ -264,6 +282,7 @@
* @param imeiInfo IMEI information
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.gsm is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MODEM_ERR
diff --git a/radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl b/radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl
index 2d25bb7..6d33505 100644
--- a/radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl
+++ b/radio/aidl/android/hardware/radio/modem/ImeiInfo.aidl
@@ -18,26 +18,25 @@
/**
* ImeiInfo to encapsulate the IMEI information from modem
+ * @hide
*/
-
@VintfStability
@JavaDerive(toString=true)
parcelable ImeiInfo {
-
@VintfStability
@Backing(type="int")
/**
* ImeiType enum is used identify the IMEI as primary or secondary as mentioned in GSMA TS.37
*/
enum ImeiType {
- /**
- * This is the primary IMEI of the device as mentioned in the GSMA TS.37. In a multi-SIM
- * device the modem must set one IMEI with this type as mentioned in GSMA TS37_2.2_REQ_8.
- * A single SIM with one IMEI must by default set that IMEI with this type.
- */
- PRIMARY = 1,
- /** This is not the primary IMEI of the device */
- SECONDARY = 2,
+ /**
+ * This is the primary IMEI of the device as mentioned in the GSMA TS.37. In a multi-SIM
+ * device the modem must set one IMEI with this type as mentioned in GSMA TS37_2.2_REQ_8.
+ * A single SIM with one IMEI must by default set that IMEI with this type.
+ */
+ PRIMARY = 1,
+ /** This is not the primary IMEI of the device */
+ SECONDARY = 2,
}
/** Primary or secondary IMEI as mentioned in GSMA spec TS.37 */
@@ -48,8 +47,8 @@
* SIM activations or swaps.
*/
String imei;
- /**
+ /**
* IMEI software version, see 3gpp spec 23.003 section 6.
*/
String svn;
-}
\ No newline at end of file
+}
diff --git a/radio/aidl/android/hardware/radio/modem/NvItem.aidl b/radio/aidl/android/hardware/radio/modem/NvItem.aidl
index 310b1ad..b405137 100644
--- a/radio/aidl/android/hardware/radio/modem/NvItem.aidl
+++ b/radio/aidl/android/hardware/radio/modem/NvItem.aidl
@@ -16,7 +16,10 @@
package android.hardware.radio.modem;
-/** @deprecated NV APIs are deprecated starting from Android U. */
+/**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ * @hide
+ */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl b/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl
index 6472f23..c57253b 100644
--- a/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl
+++ b/radio/aidl/android/hardware/radio/modem/NvWriteItem.aidl
@@ -18,7 +18,10 @@
import android.hardware.radio.modem.NvItem;
-/** @deprecated NV APIs are deprecated starting from Android U. */
+/**
+ * @deprecated NV APIs are deprecated starting from Android U.
+ * @hide
+ */
@VintfStability
@JavaDerive(toString=true)
parcelable NvWriteItem {
diff --git a/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl b/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl
index 16cba09..9781595 100644
--- a/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl
+++ b/radio/aidl/android/hardware/radio/modem/RadioCapability.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.modem;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable RadioCapability {
diff --git a/radio/aidl/android/hardware/radio/modem/RadioState.aidl b/radio/aidl/android/hardware/radio/modem/RadioState.aidl
index dedad25..c36dbe0 100644
--- a/radio/aidl/android/hardware/radio/modem/RadioState.aidl
+++ b/radio/aidl/android/hardware/radio/modem/RadioState.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.modem;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl b/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl
index 6476fe8..e290a52 100644
--- a/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl
+++ b/radio/aidl/android/hardware/radio/modem/ResetNvType.aidl
@@ -16,7 +16,10 @@
package android.hardware.radio.modem;
-/** Note: This will be deprecated along with nvResetConfig in Android U. */
+/**
+ * Note: This will be deprecated along with nvResetConfig in Android U.
+ * @hide
+ */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl b/radio/aidl/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl
index 8b95ced..9c48a8d 100644
--- a/radio/aidl/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/AccessTechnologySpecificInfo.aidl
@@ -20,6 +20,7 @@
import android.hardware.radio.network.EutranRegistrationInfo;
import android.hardware.radio.network.NrVopsInfo;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
union AccessTechnologySpecificInfo {
diff --git a/radio/aidl/android/hardware/radio/network/BarringInfo.aidl b/radio/aidl/android/hardware/radio/network/BarringInfo.aidl
index 2759406..f12e35c 100644
--- a/radio/aidl/android/hardware/radio/network/BarringInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/BarringInfo.aidl
@@ -18,6 +18,7 @@
import android.hardware.radio.network.BarringTypeSpecificInfo;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable BarringInfo {
diff --git a/radio/aidl/android/hardware/radio/network/BarringTypeSpecificInfo.aidl b/radio/aidl/android/hardware/radio/network/BarringTypeSpecificInfo.aidl
index 3db3bf3..b4a3bdf 100644
--- a/radio/aidl/android/hardware/radio/network/BarringTypeSpecificInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/BarringTypeSpecificInfo.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable BarringTypeSpecificInfo {
diff --git a/radio/aidl/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl b/radio/aidl/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl
index b06fabb..91b8500 100644
--- a/radio/aidl/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/Cdma2000RegistrationInfo.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable Cdma2000RegistrationInfo {
diff --git a/radio/aidl/android/hardware/radio/network/CdmaRoamingType.aidl b/radio/aidl/android/hardware/radio/network/CdmaRoamingType.aidl
index 2fea519..0bb7c04 100644
--- a/radio/aidl/android/hardware/radio/network/CdmaRoamingType.aidl
+++ b/radio/aidl/android/hardware/radio/network/CdmaRoamingType.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/network/CdmaSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/CdmaSignalStrength.aidl
index 1286f67..ae7aa93 100644
--- a/radio/aidl/android/hardware/radio/network/CdmaSignalStrength.aidl
+++ b/radio/aidl/android/hardware/radio/network/CdmaSignalStrength.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CdmaSignalStrength {
diff --git a/radio/aidl/android/hardware/radio/network/CellConnectionStatus.aidl b/radio/aidl/android/hardware/radio/network/CellConnectionStatus.aidl
index da36ff0..3bc19e1 100644
--- a/radio/aidl/android/hardware/radio/network/CellConnectionStatus.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellConnectionStatus.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/network/CellIdentity.aidl b/radio/aidl/android/hardware/radio/network/CellIdentity.aidl
index e34866b..6142087 100644
--- a/radio/aidl/android/hardware/radio/network/CellIdentity.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellIdentity.aidl
@@ -25,6 +25,7 @@
/**
* A union representing the CellIdentity of a single cell.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityCdma.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityCdma.aidl
index 5bb26c1..b93988f 100644
--- a/radio/aidl/android/hardware/radio/network/CellIdentityCdma.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellIdentityCdma.aidl
@@ -18,6 +18,7 @@
import android.hardware.radio.network.OperatorInfo;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CellIdentityCdma {
diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityGsm.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityGsm.aidl
index 60f42b6..bc02adc 100644
--- a/radio/aidl/android/hardware/radio/network/CellIdentityGsm.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellIdentityGsm.aidl
@@ -18,6 +18,7 @@
import android.hardware.radio.network.OperatorInfo;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CellIdentityGsm {
diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityLte.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityLte.aidl
index bfa58ac..27c2580 100644
--- a/radio/aidl/android/hardware/radio/network/CellIdentityLte.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellIdentityLte.aidl
@@ -20,6 +20,7 @@
import android.hardware.radio.network.EutranBands;
import android.hardware.radio.network.OperatorInfo;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CellIdentityLte {
diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityNr.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityNr.aidl
index d51a18e..4192845 100644
--- a/radio/aidl/android/hardware/radio/network/CellIdentityNr.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellIdentityNr.aidl
@@ -22,6 +22,7 @@
/**
* The CellIdentity structure should be reported once for each element of the PLMN-IdentityInfoList
* broadcast in SIB1 CellAccessRelatedInfo as per 3GPP TS 38.331 Section 6.3.2.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityTdscdma.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityTdscdma.aidl
index f6e790f..33ffc6f 100644
--- a/radio/aidl/android/hardware/radio/network/CellIdentityTdscdma.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellIdentityTdscdma.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.network.ClosedSubscriberGroupInfo;
import android.hardware.radio.network.OperatorInfo;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CellIdentityTdscdma {
diff --git a/radio/aidl/android/hardware/radio/network/CellIdentityWcdma.aidl b/radio/aidl/android/hardware/radio/network/CellIdentityWcdma.aidl
index a76509b..b6e328a 100644
--- a/radio/aidl/android/hardware/radio/network/CellIdentityWcdma.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellIdentityWcdma.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.network.ClosedSubscriberGroupInfo;
import android.hardware.radio.network.OperatorInfo;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CellIdentityWcdma {
diff --git a/radio/aidl/android/hardware/radio/network/CellInfo.aidl b/radio/aidl/android/hardware/radio/network/CellInfo.aidl
index 161ac71..4895326 100644
--- a/radio/aidl/android/hardware/radio/network/CellInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellInfo.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.network.CellConnectionStatus;
import android.hardware.radio.network.CellInfoRatSpecificInfo;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CellInfo {
diff --git a/radio/aidl/android/hardware/radio/network/CellInfoCdma.aidl b/radio/aidl/android/hardware/radio/network/CellInfoCdma.aidl
index 5408104..0a2bc54 100644
--- a/radio/aidl/android/hardware/radio/network/CellInfoCdma.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellInfoCdma.aidl
@@ -20,6 +20,7 @@
import android.hardware.radio.network.CellIdentityCdma;
import android.hardware.radio.network.EvdoSignalStrength;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CellInfoCdma {
diff --git a/radio/aidl/android/hardware/radio/network/CellInfoGsm.aidl b/radio/aidl/android/hardware/radio/network/CellInfoGsm.aidl
index cadcd91..db84510 100644
--- a/radio/aidl/android/hardware/radio/network/CellInfoGsm.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellInfoGsm.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.network.CellIdentityGsm;
import android.hardware.radio.network.GsmSignalStrength;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CellInfoGsm {
diff --git a/radio/aidl/android/hardware/radio/network/CellInfoLte.aidl b/radio/aidl/android/hardware/radio/network/CellInfoLte.aidl
index 443a668..3d9b2f3 100644
--- a/radio/aidl/android/hardware/radio/network/CellInfoLte.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellInfoLte.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.network.CellIdentityLte;
import android.hardware.radio.network.LteSignalStrength;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CellInfoLte {
diff --git a/radio/aidl/android/hardware/radio/network/CellInfoNr.aidl b/radio/aidl/android/hardware/radio/network/CellInfoNr.aidl
index 6b3d4f4..61591a9 100644
--- a/radio/aidl/android/hardware/radio/network/CellInfoNr.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellInfoNr.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.network.CellIdentityNr;
import android.hardware.radio.network.NrSignalStrength;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CellInfoNr {
diff --git a/radio/aidl/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl b/radio/aidl/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl
index 76e92a4..10a4a5f 100644
--- a/radio/aidl/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellInfoRatSpecificInfo.aidl
@@ -23,6 +23,7 @@
import android.hardware.radio.network.CellInfoTdscdma;
import android.hardware.radio.network.CellInfoWcdma;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
union CellInfoRatSpecificInfo {
diff --git a/radio/aidl/android/hardware/radio/network/CellInfoTdscdma.aidl b/radio/aidl/android/hardware/radio/network/CellInfoTdscdma.aidl
index fb9c984..ff0fff3 100644
--- a/radio/aidl/android/hardware/radio/network/CellInfoTdscdma.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellInfoTdscdma.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.network.CellIdentityTdscdma;
import android.hardware.radio.network.TdscdmaSignalStrength;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CellInfoTdscdma {
diff --git a/radio/aidl/android/hardware/radio/network/CellInfoWcdma.aidl b/radio/aidl/android/hardware/radio/network/CellInfoWcdma.aidl
index 2d6a2e5..c38e306 100644
--- a/radio/aidl/android/hardware/radio/network/CellInfoWcdma.aidl
+++ b/radio/aidl/android/hardware/radio/network/CellInfoWcdma.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.network.CellIdentityWcdma;
import android.hardware.radio.network.WcdmaSignalStrength;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CellInfoWcdma {
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/radio/aidl/android/hardware/radio/network/CellularIdentifier.aidl
similarity index 66%
copy from automotive/vehicle/aidl/impl/utils/test/Android.bp
copy to radio/aidl/android/hardware/radio/network/CellularIdentifier.aidl
index ad9954f..6d43920 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/radio/aidl/android/hardware/radio/network/CellularIdentifier.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 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.
@@ -14,13 +14,15 @@
* limitations under the License.
*/
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
+package android.hardware.radio.network;
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
+/** @hide **/
+@VintfStability
+@Backing(type="int")
+@JavaDerive(toString=true)
+enum CellularIdentifier {
+ UNKNOWN = 0,
+ IMSI = 1,
+ IMEI = 2,
+ SUCI = 3,
}
diff --git a/radio/aidl/android/hardware/radio/network/CellularIdentifierDisclosure.aidl b/radio/aidl/android/hardware/radio/network/CellularIdentifierDisclosure.aidl
new file mode 100644
index 0000000..52b4116
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/network/CellularIdentifierDisclosure.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 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.
+ */
+
+package android.hardware.radio.network;
+
+import android.hardware.radio.network.CellularIdentifier;
+import android.hardware.radio.network.NasProtocolMessage;
+
+/**
+ * A single occurrence of a cellular identifier being sent in the clear pre-authentication. See
+ * IRadioNetwork.setCellularIdentifierTransparencyEnabled for more details.
+ *
+ * @hide
+ */
+@JavaDerive(toString=true)
+@VintfStability
+parcelable CellularIdentifierDisclosure {
+ // The PLMN-ID to which the UE transmitted the cellular identifier
+ String plmn;
+ // The type of cellular identifier that was disclosed
+ CellularIdentifier identifier;
+ // The NAS protocol message within which the cellular identifier was transmitted.
+ NasProtocolMessage protocolMessage;
+ // Whether or not this cellular identifier disclosure is in service of an emergency call.
+ boolean isEmergency;
+}
diff --git a/radio/aidl/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl b/radio/aidl/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl
index a2d82d7..d61c1dc 100644
--- a/radio/aidl/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/ClosedSubscriberGroupInfo.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable ClosedSubscriberGroupInfo {
diff --git a/radio/aidl/android/hardware/radio/network/ConnectionEvent.aidl b/radio/aidl/android/hardware/radio/network/ConnectionEvent.aidl
new file mode 100644
index 0000000..2e39ebf
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/network/ConnectionEvent.aidl
@@ -0,0 +1,55 @@
+/*
+ * Copyright 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.
+ */
+
+package android.hardware.radio.network;
+
+/**
+ * See IRadioNetwork.securityAlgorithmsUpdated for more details.
+ *
+ * @hide
+ */
+@VintfStability
+@Backing(type="int")
+@JavaDerive(toString=true)
+enum ConnectionEvent {
+ // 2G GSM circuit switched
+ CS_SIGNALLING_GSM = 0,
+
+ // 2G GPRS packet services
+ PS_SIGNALLING_GPRS = 1,
+
+ // 3G circuit switched
+ CS_SIGNALLING_3G = 2,
+
+ // 3G packet switched
+ PS_SIGNALLING_3G = 3,
+
+ // 4G LTE packet services
+ NAS_SIGNALLING_LTE = 4,
+ AS_SIGNALLING_LTE = 5,
+
+ // VoLTE
+ VOLTE_SIP = 6,
+ VOLTE_RTP = 7,
+
+ // 5G packet services
+ NAS_SIGNALLING_5G = 8,
+ AS_SIGNALLING_5G = 9,
+
+ // VoNR
+ VONR_SIP = 10,
+ VONR_RTP = 11,
+}
diff --git a/radio/aidl/android/hardware/radio/network/Domain.aidl b/radio/aidl/android/hardware/radio/network/Domain.aidl
index be5f320..bb169bd 100644
--- a/radio/aidl/android/hardware/radio/network/Domain.aidl
+++ b/radio/aidl/android/hardware/radio/network/Domain.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/network/EmergencyMode.aidl b/radio/aidl/android/hardware/radio/network/EmergencyMode.aidl
index 25031a9..7a2ed9c 100644
--- a/radio/aidl/android/hardware/radio/network/EmergencyMode.aidl
+++ b/radio/aidl/android/hardware/radio/network/EmergencyMode.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl b/radio/aidl/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl
index 0a22e4c..ea4bfeb 100644
--- a/radio/aidl/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl
+++ b/radio/aidl/android/hardware/radio/network/EmergencyNetworkScanTrigger.aidl
@@ -18,9 +18,10 @@
import android.hardware.radio.AccessNetwork;
import android.hardware.radio.network.EmergencyScanType;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
-parcelable EmergencyNetworkScanTrigger{
+parcelable EmergencyNetworkScanTrigger {
/**
* Access network to be prioritized during emergency scan. The 1st entry has the highest
* priority.
diff --git a/radio/aidl/android/hardware/radio/network/EmergencyRegResult.aidl b/radio/aidl/android/hardware/radio/network/EmergencyRegResult.aidl
index 2215149..af2750e 100644
--- a/radio/aidl/android/hardware/radio/network/EmergencyRegResult.aidl
+++ b/radio/aidl/android/hardware/radio/network/EmergencyRegResult.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.network.Domain;
import android.hardware.radio.network.RegState;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable EmergencyRegResult {
diff --git a/radio/aidl/android/hardware/radio/network/EmergencyScanType.aidl b/radio/aidl/android/hardware/radio/network/EmergencyScanType.aidl
index 72c5490..efa6c02 100644
--- a/radio/aidl/android/hardware/radio/network/EmergencyScanType.aidl
+++ b/radio/aidl/android/hardware/radio/network/EmergencyScanType.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/network/EutranBands.aidl b/radio/aidl/android/hardware/radio/network/EutranBands.aidl
index 72e76e3..969a1b7 100644
--- a/radio/aidl/android/hardware/radio/network/EutranBands.aidl
+++ b/radio/aidl/android/hardware/radio/network/EutranBands.aidl
@@ -18,6 +18,7 @@
/**
* EUTRAN bands up to V16.4.0
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl b/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl
index b986944..fb319c1 100644
--- a/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/EutranRegistrationInfo.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.network.LteVopsInfo;
import android.hardware.radio.network.NrIndicators;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable EutranRegistrationInfo {
diff --git a/radio/aidl/android/hardware/radio/network/EvdoSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/EvdoSignalStrength.aidl
index c3b3898..fc7cc1b 100644
--- a/radio/aidl/android/hardware/radio/network/EvdoSignalStrength.aidl
+++ b/radio/aidl/android/hardware/radio/network/EvdoSignalStrength.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable EvdoSignalStrength {
diff --git a/radio/aidl/android/hardware/radio/network/GeranBands.aidl b/radio/aidl/android/hardware/radio/network/GeranBands.aidl
index 0e5b7b2..29d829f 100644
--- a/radio/aidl/android/hardware/radio/network/GeranBands.aidl
+++ b/radio/aidl/android/hardware/radio/network/GeranBands.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/network/GsmSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/GsmSignalStrength.aidl
index 796f80f..d569cf7 100644
--- a/radio/aidl/android/hardware/radio/network/GsmSignalStrength.aidl
+++ b/radio/aidl/android/hardware/radio/network/GsmSignalStrength.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable GsmSignalStrength {
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
index f22cdb0..5f26195 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetwork.aidl
@@ -32,11 +32,13 @@
/**
* This interface is used by telephony and telecom to talk to cellular radio for network APIs.
+ * All functions apply to both terrestrial and extraterrestrial (satellite) based cellular networks.
* All the functions have minimum one parameter:
* serial: which corresponds to serial no. of request. Serial numbers must only be memorized for the
* duration of a method call. If clients provide colliding serials (including passing the same
* serial to different methods), multiple responses (one for each method call) must still be served.
* setResponseFunctions must work with IRadioNetworkResponse and IRadioNetworkIndication.
+ * @hide
*/
@VintfStability
oneway interface IRadioNetwork {
@@ -46,6 +48,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getAllowedNetworkTypesBitmapResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getAllowedNetworkTypesBitmap(in int serial);
@@ -55,6 +59,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getAvailableBandModesResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getAvailableBandModes(in int serial);
@@ -64,6 +70,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getAvailableNetworksResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getAvailableNetworks(in int serial);
@@ -73,6 +81,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getBarringInfoResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getBarringInfo(in int serial);
@@ -82,6 +92,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getCdmaRoamingPreferenceResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void getCdmaRoamingPreference(in int serial);
@@ -94,6 +106,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getCellInfoListResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getCellInfoList(in int serial);
@@ -103,6 +117,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getDataRegistrationStateResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getDataRegistrationState(in int serial);
@@ -113,6 +129,8 @@
*
* Response function is IRadioNetworkResponse.getImsRegistrationStateResponse()
*
+ * This is available when android.hardware.telephony.ims is defined.
+ *
* @deprecated Deprecated starting from Android U.
*/
void getImsRegistrationState(in int serial);
@@ -123,6 +141,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getNetworkSelectionModeResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getNetworkSelectionMode(in int serial);
@@ -132,6 +152,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getOperatorResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getOperator(in int serial);
@@ -141,6 +163,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getSignalStrengthResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getSignalStrength(in int serial);
@@ -150,6 +174,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getSystemSelectionChannelsResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getSystemSelectionChannels(in int serial);
@@ -160,6 +186,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getVoiceRadioTechnologyResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getVoiceRadioTechnology(in int serial);
@@ -169,6 +197,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.getVoiceRegistrationStateResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void getVoiceRegistrationState(in int serial);
@@ -178,6 +208,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.isNrDualConnectivityEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void isNrDualConnectivityEnabled(in int serial);
@@ -185,6 +217,8 @@
* When response type received from a radio indication or radio response is
* RadioIndicationType:UNSOLICITED_ACK_EXP or RadioResponseType:SOLICITED_ACK_EXP respectively,
* acknowledge the receipt of those messages by sending responseAcknowledgement().
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void responseAcknowledgement();
@@ -197,6 +231,8 @@
* @param networkTypeBitmap a 32-bit bearer bitmap of RadioAccessFamily
*
* Response function is IRadioNetworkResponse.setAllowedNetworkTypesBitmapResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setAllowedNetworkTypesBitmap(in int serial, in int networkTypeBitmap);
@@ -207,6 +243,8 @@
* @param mode RadioBandMode
*
* Response function is IRadioNetworkResponse.setBandModeResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setBandMode(in int serial, in RadioBandMode mode);
@@ -219,6 +257,8 @@
* @param newPassword new password
*
* Response function is IRadioNetworkResponse.setBarringPasswordResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setBarringPassword(
in int serial, in String facility, in String oldPassword, in String newPassword);
@@ -230,6 +270,8 @@
* @param type CdmaRoamingType defined in types.hal
*
* Response function is IRadioNetworkResponse.setCdmaRoamingPreferenceResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void setCdmaRoamingPreference(in int serial, in CdmaRoamingType type);
@@ -242,6 +284,8 @@
* @param rate minimum time in milliseconds to indicate time between unsolicited cellInfoList()
*
* Response function is IRadioNetworkResponse.setCellInfoListRateResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setCellInfoListRate(in int serial, in int rate);
@@ -255,6 +299,8 @@
* indications are enabled. See IndicationFilter for the definition of each bit.
*
* Response function is IRadioNetworkResponse.setIndicationFilterResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setIndicationFilter(in int serial, in int indicationFilter);
@@ -279,6 +325,8 @@
* @param accessNetwork The type of network for which to apply these thresholds.
*
* Response function is IRadioNetworkResponse.setLinkCapacityReportingCriteriaResponse().
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setLinkCapacityReportingCriteria(in int serial, in int hysteresisMs,
in int hysteresisDlKbps, in int hysteresisUlKbps, in int[] thresholdsDownlinkKbps,
@@ -294,6 +342,8 @@
* @param enable true=updates enabled (+CREG=2), false=updates disabled (+CREG=1)
*
* Response function is IRadioNetworkResponse.setLocationUpdatesResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setLocationUpdates(in int serial, in boolean enable);
@@ -304,6 +354,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.setNetworkSelectionModeAutomaticResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setNetworkSelectionModeAutomatic(in int serial);
@@ -320,6 +372,8 @@
* the next best RAN for network registration.
*
* Response function is IRadioNetworkResponse.setNetworkSelectionModeManualResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setNetworkSelectionModeManual(
in int serial, in String operatorNumeric, in AccessNetwork ran);
@@ -336,6 +390,8 @@
* {NrDualConnectivityState:DISABLE_IMMEDIATE}
*
* Response function is IRadioNetworkResponse.setNrDualConnectivityStateResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setNrDualConnectivityState(
in int serial, in NrDualConnectivityState nrDualConnectivityState);
@@ -345,6 +401,8 @@
*
* @param radioNetworkResponse Object containing response functions
* @param radioNetworkIndication Object containing radio indications
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setResponseFunctions(in IRadioNetworkResponse radioNetworkResponse,
in IRadioNetworkIndication radioNetworkIndication);
@@ -363,6 +421,8 @@
* criteria. See SignalThresholdInfo for details.
*
* Response function is IRadioNetworkResponse.setSignalStrengthReportingCriteriaResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setSignalStrengthReportingCriteria(
in int serial, in SignalThresholdInfo[] signalThresholdInfos);
@@ -375,6 +435,8 @@
* @param enable true = notifications enabled, false = notifications disabled.
*
* Response function is IRadioNetworkResponse.setSuppServiceNotificationsResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void setSuppServiceNotifications(in int serial, in boolean enable);
@@ -388,6 +450,8 @@
* @param specifiers which bands to scan. Only used if specifyChannels is true.
*
* Response function is IRadioNetworkResponse.setSystemSelectionChannelsResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setSystemSelectionChannels(
in int serial, in boolean specifyChannels, in RadioAccessSpecifier[] specifiers);
@@ -399,6 +463,8 @@
* @param request Defines the radio networks/bands/channels which need to be scanned.
*
* Response function is IRadioNetworkResponse.startNetworkScanResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void startNetworkScan(in int serial, in NetworkScanRequest request);
@@ -408,6 +474,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.stopNetworkScanResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void stopNetworkScan(in int serial);
@@ -418,6 +486,8 @@
* @param netPin Network depersonlization code
*
* Response function is IRadioNetworkResponse.supplyNetworkDepersonalizationResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void supplyNetworkDepersonalization(in int serial, in String netPin);
@@ -430,6 +500,8 @@
*
* @param serial Serial number of request.
* @param usageSetting the usage setting for the current SIM.
+ *
+ * This is available when android.hardware.telephony is defined.
*/
oneway void setUsageSetting(in int serial, in UsageSetting usageSetting);
@@ -439,6 +511,8 @@
* <p>Gets the usage setting in accordance with 3gpp 24.301 sec 4.3 and 3gpp 24.501 sec 4.3.
*
* @param serial Serial number of request.
+ *
+ * This is available when android.hardware.telephony is defined.
*/
oneway void getUsageSetting(in int serial);
@@ -450,6 +524,8 @@
* type of service to be scanned.
*
* Response function is IRadioEmergencyResponse.setEmergencyModeResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setEmergencyMode(int serial, in EmergencyMode emcModeType);
@@ -461,6 +537,8 @@
* See {@link EmergencyNetworkScanTrigger}.
*
* Response function is IRadioEmergencyResponse.triggerEmergencyNetworkScanResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void triggerEmergencyNetworkScan(int serial, in EmergencyNetworkScanTrigger request);
@@ -473,6 +551,8 @@
* otherwise the modem shall resume from the last search.
*
* Response function is IRadioEmergencyResponse.cancelEmergencyNetworkScan()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void cancelEmergencyNetworkScan(int serial, boolean resetScan);
@@ -482,6 +562,8 @@
* @param serial Serial number of the request.
*
* Response function is IRadioEmergencyResponse.exitEmergencyModeResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void exitEmergencyMode(in int serial);
@@ -512,6 +594,8 @@
* Otherwise, false.
*
* Response callback is IRadioResponse.setNullCipherAndIntegrityEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setNullCipherAndIntegrityEnabled(in int serial, in boolean enabled);
@@ -527,6 +611,8 @@
* @param serial Serial number of the request.
*
* Response callback is IRadioNetworkResponse.isNullCipherAndIntegrityEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void isNullCipherAndIntegrityEnabled(in int serial);
@@ -536,6 +622,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioNetworkResponse.isN1ModeEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void isN1ModeEnabled(in int serial);
@@ -553,6 +641,76 @@
* @param enable {@code true} to enable N1 mode, {@code false} to disable N1 mode.
*
* Response function is IRadioNetworkResponse.setN1ModeEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.radio.access is defined.
*/
void setN1ModeEnabled(in int serial, boolean enable);
+
+ /**
+ * Get whether pre-auth cellular identifier in-the-clear transparency is enabled. If
+ * IRadioNetworkInterface.setCellularIdentifierTransparencyEnabled has been called, this should
+ * return the value of the `enabled` parameter of the last successful call and false if
+ * IRadioNetworkInterface.setCellularIdentifierTransparencyEnabled has not been called yet.
+ *
+ * @param serial Serial number of request
+ *
+ * Response callback is IRadioNetworkResponse.isCellularIdentifierTransparencyEnabledResponse
+ *
+ * This is available when android.hardware.telephony.access is defined.
+ */
+ void isCellularIdentifierTransparencyEnabled(in int serial);
+
+ /**
+ * Enable or disable transparency for in-the-clear cellular identifiers. If the value of enabled
+ * is true, the modem must call IRadioNetworkIndication.cellularIdentifierDisclosed when an
+ * IMSI, IMEI, or unciphered SUCI (in 5G SA) appears in one of the following UE-initiated NAS
+ * messages before a security context is established.
+ *
+ * Note: Cellular identifiers disclosed in uplink messages covered under a NAS Security Context
+ * as well as identifiers disclosed in downlink messages are out of scope.
+ *
+ * This feature applies to 2g, 3g, 4g, and 5g (SA and NSA) messages sent before a security
+ * context is established. In scope message definitions and their associated spec references can
+ * be found in NasProtocolMessage.
+ *
+ * If the value of enabled is false, the modem must not call
+ * IRadioNetworkIndication.sentCellularIdentifierDisclosure again until a subsequent call
+ * re-enables this functionality. The modem may choose to stop tracking cellular identifiers in
+ * the clear during this time.
+ *
+ * @param serial Serial number of request
+ * @param enabled Whether or not to enable sending indications for cellular identifiers in the
+ * clear
+ *
+ * Response function is IRadioNetworkResponse.setCellularIdentifierTransparencyEnabledResponse
+ *
+ * This is available when android.hardware.telephony.access is defined.
+ */
+ void setCellularIdentifierTransparencyEnabled(in int serial, in boolean enabled);
+
+ /**
+ * Enables or disables security algorithm update reports via indication API
+ * {@link IRadioNetworkIndication.securityAlgorithmsUpdated()}.
+ *
+ * @param serial Serial number of request.
+ * @param enable {@code true} to enable security algorithm update reports, {@code false} to
+ * disable.
+ *
+ * Response function is IRadioNetworkResponse.setSecurityAlgorithmsUpdatedEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.access is defined.
+ */
+ void setSecurityAlgorithmsUpdatedEnabled(in int serial, boolean enable);
+
+ /**
+ * Checks whether security algorithm update reports are enabled via indication API
+ * {@link IRadioNetworkIndication.securityAlgorithmsUpdated()}.
+ *
+ * @param serial Serial number of request.
+ *
+ * Response function is IRadioNetworkResponse.isSecurityAlgorithmsUpdatedEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.access is defined.
+ */
+ void isSecurityAlgorithmsUpdatedEnabled(in int serial);
}
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
index 47d932d..9c2502d 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
@@ -21,16 +21,19 @@
import android.hardware.radio.network.BarringInfo;
import android.hardware.radio.network.CellIdentity;
import android.hardware.radio.network.CellInfo;
+import android.hardware.radio.network.CellularIdentifierDisclosure;
+import android.hardware.radio.network.EmergencyRegResult;
import android.hardware.radio.network.LinkCapacityEstimate;
import android.hardware.radio.network.NetworkScanResult;
import android.hardware.radio.network.PhoneRestrictedState;
import android.hardware.radio.network.PhysicalChannelConfig;
+import android.hardware.radio.network.SecurityAlgorithmUpdate;
import android.hardware.radio.network.SignalStrength;
import android.hardware.radio.network.SuppSvcNotification;
-import android.hardware.radio.network.EmergencyRegResult;
/**
* Interface declaring unsolicited radio indications for network APIs.
+ * @hide
*/
@VintfStability
oneway interface IRadioNetworkIndication {
@@ -199,4 +202,50 @@
* @param result the result of the Emergency Network Scan
*/
void emergencyNetworkScanResult(in RadioIndicationType type, in EmergencyRegResult result);
+
+ /**
+ * Report a cellular identifier disclosure event. See
+ * IRadioNetwork.setCellularIdnetifierTransparencyEnabled for more details.
+ *
+ * A non-exhaustive list of when this method should be called follows:
+ *
+ * - If a device attempts an IMSI attach to the network.
+ * - If a device includes an IMSI in the IDENTITY_RESPONSE message on the NAS and a security
+ * context has not yet been established.
+ * - If a device includes an IMSI in a DETACH_REQUEST message sent on the NAS and the message is
+ * sent before a security context has been established.
+ * - If a device includes an IMSI in a TRACKING_AREA_UPDATE message sent on the NAS and the
+ * message is sent before a security context has been established.
+ * - If a device uses a 2G network to send a LOCATION_UPDATE_REQUEST message on the NAS that
+ * includes an IMSI or IMEI.
+ * - If a device uses a 2G network to send a AUTHENTICATION_AND_CIPHERING_RESPONSE message on
+ * the NAS and the message includes an IMEISV.
+ *
+ * @param type Type of radio indication
+ * @param disclosure A CellularIdentifierDisclosure as specified by
+ * IRadioNetwork.setCellularIdentifierTransparencyEnabled.
+ *
+ */
+ void cellularIdentifierDisclosed(
+ in RadioIndicationType type, in CellularIdentifierDisclosure disclosure);
+
+ /*
+ * Indicates that a new ciphering or integrity algorithm was used for a particular voice,
+ * signaling, or data connection attempt for a given PLMN and/or access network. Due to
+ * power concerns, once a connection type has been reported on, follow-up reports about that
+ * connection type are only generated if there is any change to the previously reported
+ * encryption or integrity. Thus the AP is only to be notified when there is new information.
+ * List is reset upon rebooting thus info about initial connections is always passed to the
+ * AP after a reboot. List is also reset if the SIM is changed or if there has been a change
+ * in the access network.
+ *
+ * Note: a change only in cell ID should not trigger an update, as the design is intended to
+ * be agnostic to dual connectivity ("secondary serving cells").
+ *
+ * @param type Type of radio indication
+ * @param securityAlgorithmUpdate SecurityAlgorithmUpdate encapsulates details of security
+ * algorithm updates
+ */
+ void securityAlgorithmsUpdated(
+ in RadioIndicationType type, in SecurityAlgorithmUpdate securityAlgorithmUpdate);
}
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
index 457b5b9..d9eea03 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkResponse.aidl
@@ -33,6 +33,7 @@
/**
* Interface declaring response functions to solicited radio requests for network APIs.
+ * @hide
*/
@VintfStability
oneway interface IRadioNetworkResponse {
@@ -50,6 +51,8 @@
* @param networkTypeBitmap a 32-bit bitmap of RadioAccessFamily.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
@@ -66,6 +69,8 @@
* @param bandModes List of RadioBandMode listing supported modes
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -83,6 +88,8 @@
* @param networkInfos List of network operator information as OperatorInfos
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
@@ -103,6 +110,8 @@
* @param barringInfos a vector of barring info for all barring service types
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -116,6 +125,7 @@
* @param type CdmaRoamingType
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -134,6 +144,8 @@
* @param cellInfo List of current cell information known to radio
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -145,6 +157,8 @@
* @param dataRegResponse Current data registration response as defined by RegStateResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -159,6 +173,7 @@
* @param ratFamily RadioTechnologyFamily. This value is valid only if isRegistered is true.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -177,6 +192,8 @@
* @param selection false for automatic selection, true for manual selection
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -196,6 +213,8 @@
* @param numeric is 5 or 6 digit numeric code (MCC + MNC) or empty string if unregistered
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -212,6 +231,8 @@
* @param signalStrength Current signal strength
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -223,6 +244,8 @@
* @param specifiers List of RadioAccessSpecifiers that are scanned.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -236,6 +259,8 @@
* @param rat Current voice RAT
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -250,6 +275,8 @@
* @param voiceRegResponse Current Voice registration response as defined by RegStateResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -263,6 +290,8 @@
* else false.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -273,6 +302,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
@@ -288,6 +319,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NOT_ALLOWED
@@ -305,6 +338,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -325,6 +360,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -343,6 +379,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -358,6 +396,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
@@ -370,6 +410,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
@@ -381,6 +423,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -398,6 +442,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:ILLEGAL_SIM_OR_ME
@@ -419,6 +465,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:ILLEGAL_SIM_OR_ME
@@ -441,6 +489,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -452,6 +502,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
@@ -462,6 +514,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -480,6 +533,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -491,6 +546,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:DEVICE_IN_USE
@@ -504,6 +561,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:INTERNAL_ERR
* RadioError:MODEM_ERR
@@ -515,6 +574,8 @@
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:PASSWORD_INCORRECT (code is invalid)
@@ -534,6 +595,7 @@
* @param info Response info struct containing response type, serial no. and error.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -548,6 +610,7 @@
* @param usageSetting the usage setting for the current SIM.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -564,6 +627,8 @@
* @param regState the current registration state of the modem.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:RADIO_NOT_AVAILABLE
@@ -579,6 +644,8 @@
* @param info Response info struct containing response type, serial no. and error.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:RADIO_NOT_AVAILABLE
@@ -594,6 +661,8 @@
* @param info Response info struct containing response type, serial no. and error.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:RADIO_NOT_AVAILABLE
@@ -608,6 +677,8 @@
* @param info Response info struct containing response type, serial no. and error.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:REQUEST_NOT_SUPPORTED
* RadioError:RADIO_NOT_AVAILABLE
@@ -619,10 +690,11 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MODEM_ERR
- * RadioError:REQUEST_NOT_SUPPORTED
*/
void setNullCipherAndIntegrityEnabledResponse(in RadioResponseInfo info);
@@ -631,10 +703,11 @@
* @param enabled the last known state of null ciphering and integrity algorithms
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MODEM_ERR
- * RadioError:REQUEST_NOT_SUPPORTED
*/
void isNullCipherAndIntegrityEnabledResponse(in RadioResponseInfo info, in boolean isEnabled);
@@ -646,6 +719,8 @@
* @param isEnabled Indicates whether N1 mode is enabled or not.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -660,6 +735,8 @@
* @param info Response info struct containing response type, serial no. and error.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -667,4 +744,66 @@
* RadioError:INVALID_STATE
*/
void setN1ModeEnabledResponse(in RadioResponseInfo info);
+
+ /**
+ * Response of isCellularIdentifierTransparencyEnabled.
+ *
+ * @param info Response info struct containing response type, serial no. and error.
+ * @param isEnabled Indicates whether cellular identifier transparency is enabled or not.
+ *
+ * Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ */
+ void isCellularIdentifierTransparencyEnabledResponse(
+ in RadioResponseInfo info, boolean isEnabled);
+
+ /**
+ * Response of setCellularIdentifierTransparencyEnabled.
+ *
+ * @param info Response info struct containing response type, serial no. and error.
+ *
+ * Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_STATE
+ */
+ void setCellularIdentifierTransparencyEnabledResponse(in RadioResponseInfo info);
+
+ /**
+ * Response of setSecurityAlgorithmsUpdatedEnabled.
+ *
+ * @param info Response info struct containing response type, serial no. and error.
+ *
+ * Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:INVALID_STATE
+ */
+ void setSecurityAlgorithmsUpdatedEnabledResponse(in RadioResponseInfo info);
+
+ /**
+ * Response of isSecurityAlgorithmsUpdatedEnabled.
+ *
+ * @param info Response info struct containing response type, serial no. and error.
+ * @param isEnabled Indicates whether cellular ciphering transparency is enabled or not.
+ *
+ * Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.radio.access is not
+ * defined
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ */
+ void isSecurityAlgorithmsUpdatedEnabledResponse(
+ in RadioResponseInfo info, in boolean isEnabled);
}
diff --git a/radio/aidl/android/hardware/radio/network/IndicationFilter.aidl b/radio/aidl/android/hardware/radio/network/IndicationFilter.aidl
index 9cab28d..7b95273 100644
--- a/radio/aidl/android/hardware/radio/network/IndicationFilter.aidl
+++ b/radio/aidl/android/hardware/radio/network/IndicationFilter.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/network/LceDataInfo.aidl b/radio/aidl/android/hardware/radio/network/LceDataInfo.aidl
index fdbdc2b..c855b18 100644
--- a/radio/aidl/android/hardware/radio/network/LceDataInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/LceDataInfo.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable LceDataInfo {
diff --git a/radio/aidl/android/hardware/radio/network/LinkCapacityEstimate.aidl b/radio/aidl/android/hardware/radio/network/LinkCapacityEstimate.aidl
index 6461719..0aea27c 100644
--- a/radio/aidl/android/hardware/radio/network/LinkCapacityEstimate.aidl
+++ b/radio/aidl/android/hardware/radio/network/LinkCapacityEstimate.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable LinkCapacityEstimate {
diff --git a/radio/aidl/android/hardware/radio/network/LteSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/LteSignalStrength.aidl
index 2d97c45..21d3ec7 100644
--- a/radio/aidl/android/hardware/radio/network/LteSignalStrength.aidl
+++ b/radio/aidl/android/hardware/radio/network/LteSignalStrength.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable LteSignalStrength {
diff --git a/radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl b/radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl
index fb3b986..a320acb 100644
--- a/radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/LteVopsInfo.aidl
@@ -19,6 +19,7 @@
/**
* Type to define the LTE specific network capabilities for voice over PS including emergency and
* normal voice calls.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/network/NasProtocolMessage.aidl b/radio/aidl/android/hardware/radio/network/NasProtocolMessage.aidl
new file mode 100644
index 0000000..5a23661
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/network/NasProtocolMessage.aidl
@@ -0,0 +1,68 @@
+/*
+ * Copyright 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.
+ */
+
+package android.hardware.radio.network;
+
+/**
+ * Each enum value represents a message type on the Non-Access Stratum (NAS). The relevant cellular
+ * generation is noted for each message type. Sample spec references are provided, but generally
+ * only reference one network generation's spec.
+ *
+ * @hide
+ */
+@VintfStability
+@Backing(type="int")
+@JavaDerive(toString=true)
+enum NasProtocolMessage {
+ UNKNOWN = 0,
+ // Sample Reference: 3GPP TS 24.301 8.2.4
+ // Applies to 2g, 3g, and 4g networks
+ ATTACH_REQUEST = 1,
+ // Sample Reference: 3GPP TS 24.301 8.2.19
+ // Applies to 2g, 3g, 4g, and 5g networks
+ IDENTITY_RESPONSE = 2,
+ // Sample Reference: 3GPP TS 24.301 8.2.11
+ // Applies to 2g, 3g, and 4g networks
+ DETACH_REQUEST = 3,
+ // Sample Reference: 3GPP TS 24.301 8.2.29
+ // Note: that per the spec, only temporary IDs should be sent
+ // in the TAU Request, but since the EPS Mobile Identity field
+ // supports IMSIs, this is included as an extra safety measure
+ // to combat implementation bugs.
+ // Applies to 4g and 5g networks
+ TRACKING_AREA_UPDATE_REQUEST = 4,
+ // Sample Reference: 3GPP TS 24.008 4.4.3
+ // Applies to 2g and 3g networks
+ LOCATION_UPDATE_REQUEST = 5,
+ // Reference: 3GPP TS 24.008 4.7.7.1
+ // Applies to 2g and 3g networks
+ AUTHENTICATION_AND_CIPHERING_RESPONSE = 6,
+ // Reference: 3GPP TS 24.501 8.2.6
+ // Applies to 5g networks
+ REGISTRATION_REQUEST = 7,
+ // Reference: 3GPP TS 24.501 8.2.12
+ // Applies to 5g networks
+ DEREGISTRATION_REQUEST = 8,
+ // Reference: 3GPP TS 24.008 9.2.4
+ // Applies to 2g and 3g networks
+ CM_REESTABLISHMENT_REQUEST = 9,
+ // Reference: 3GPP TS 24.008 9.2.9
+ // Applies to 2g and 3g networks
+ CM_SERVICE_REQUEST = 10,
+ // Reference: 3GPP TS 24.008 9.2.14
+ // Applies to 2g and 3g networks. Used for circuit-switched detach.
+ IMSI_DETACH_INDICATION = 11
+}
diff --git a/radio/aidl/android/hardware/radio/network/NetworkScanRequest.aidl b/radio/aidl/android/hardware/radio/network/NetworkScanRequest.aidl
index ae173c7..37f2cf1 100644
--- a/radio/aidl/android/hardware/radio/network/NetworkScanRequest.aidl
+++ b/radio/aidl/android/hardware/radio/network/NetworkScanRequest.aidl
@@ -18,6 +18,7 @@
import android.hardware.radio.network.RadioAccessSpecifier;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable NetworkScanRequest {
diff --git a/radio/aidl/android/hardware/radio/network/NetworkScanResult.aidl b/radio/aidl/android/hardware/radio/network/NetworkScanResult.aidl
index 6d83f74..4465046 100644
--- a/radio/aidl/android/hardware/radio/network/NetworkScanResult.aidl
+++ b/radio/aidl/android/hardware/radio/network/NetworkScanResult.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.RadioError;
import android.hardware.radio.network.CellInfo;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable NetworkScanResult {
diff --git a/radio/aidl/android/hardware/radio/network/NgranBands.aidl b/radio/aidl/android/hardware/radio/network/NgranBands.aidl
index 53c7a3d..a87a0d1 100644
--- a/radio/aidl/android/hardware/radio/network/NgranBands.aidl
+++ b/radio/aidl/android/hardware/radio/network/NgranBands.aidl
@@ -18,6 +18,7 @@
/**
* NGRAN bands up to V16.5.0
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/radio/aidl/android/hardware/radio/network/NrDualConnectivityState.aidl b/radio/aidl/android/hardware/radio/network/NrDualConnectivityState.aidl
index e293dff..00e19fe 100644
--- a/radio/aidl/android/hardware/radio/network/NrDualConnectivityState.aidl
+++ b/radio/aidl/android/hardware/radio/network/NrDualConnectivityState.aidl
@@ -18,6 +18,7 @@
/**
* NR Dual connectivity state
+ * @hide
*/
@VintfStability
@Backing(type="byte")
diff --git a/radio/aidl/android/hardware/radio/network/NrIndicators.aidl b/radio/aidl/android/hardware/radio/network/NrIndicators.aidl
index 32cc964..214272c 100644
--- a/radio/aidl/android/hardware/radio/network/NrIndicators.aidl
+++ b/radio/aidl/android/hardware/radio/network/NrIndicators.aidl
@@ -18,6 +18,7 @@
/**
* The parameters of NR 5G Non-Standalone.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl
index 30ae067..65daf36 100644
--- a/radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl
+++ b/radio/aidl/android/hardware/radio/network/NrSignalStrength.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable NrSignalStrength {
diff --git a/radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl b/radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl
index 197f401..71961a3 100644
--- a/radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/NrVopsInfo.aidl
@@ -19,6 +19,7 @@
/**
* Type to define the NR specific network capabilities for voice over PS including emergency and
* normal voice calls.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/network/OperatorInfo.aidl b/radio/aidl/android/hardware/radio/network/OperatorInfo.aidl
index 56f4dca..36dbadf 100644
--- a/radio/aidl/android/hardware/radio/network/OperatorInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/OperatorInfo.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable OperatorInfo {
diff --git a/radio/aidl/android/hardware/radio/network/PhoneRestrictedState.aidl b/radio/aidl/android/hardware/radio/network/PhoneRestrictedState.aidl
index 23ae3b1..de3527c 100644
--- a/radio/aidl/android/hardware/radio/network/PhoneRestrictedState.aidl
+++ b/radio/aidl/android/hardware/radio/network/PhoneRestrictedState.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/network/PhysicalChannelConfig.aidl b/radio/aidl/android/hardware/radio/network/PhysicalChannelConfig.aidl
index 9996953..ecb9463 100644
--- a/radio/aidl/android/hardware/radio/network/PhysicalChannelConfig.aidl
+++ b/radio/aidl/android/hardware/radio/network/PhysicalChannelConfig.aidl
@@ -20,6 +20,7 @@
import android.hardware.radio.network.CellConnectionStatus;
import android.hardware.radio.network.PhysicalChannelConfigBand;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable PhysicalChannelConfig {
diff --git a/radio/aidl/android/hardware/radio/network/PhysicalChannelConfigBand.aidl b/radio/aidl/android/hardware/radio/network/PhysicalChannelConfigBand.aidl
index 707a032..aa0e9b2 100644
--- a/radio/aidl/android/hardware/radio/network/PhysicalChannelConfigBand.aidl
+++ b/radio/aidl/android/hardware/radio/network/PhysicalChannelConfigBand.aidl
@@ -21,6 +21,7 @@
import android.hardware.radio.network.NgranBands;
import android.hardware.radio.network.UtranBands;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
union PhysicalChannelConfigBand {
diff --git a/radio/aidl/android/hardware/radio/network/RadioAccessSpecifier.aidl b/radio/aidl/android/hardware/radio/network/RadioAccessSpecifier.aidl
index 8504248..b3cee47 100644
--- a/radio/aidl/android/hardware/radio/network/RadioAccessSpecifier.aidl
+++ b/radio/aidl/android/hardware/radio/network/RadioAccessSpecifier.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.AccessNetwork;
import android.hardware.radio.network.RadioAccessSpecifierBands;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable RadioAccessSpecifier {
diff --git a/radio/aidl/android/hardware/radio/network/RadioAccessSpecifierBands.aidl b/radio/aidl/android/hardware/radio/network/RadioAccessSpecifierBands.aidl
index 38afee5..4bf694a 100644
--- a/radio/aidl/android/hardware/radio/network/RadioAccessSpecifierBands.aidl
+++ b/radio/aidl/android/hardware/radio/network/RadioAccessSpecifierBands.aidl
@@ -21,6 +21,7 @@
import android.hardware.radio.network.NgranBands;
import android.hardware.radio.network.UtranBands;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
union RadioAccessSpecifierBands {
diff --git a/radio/aidl/android/hardware/radio/network/RadioBandMode.aidl b/radio/aidl/android/hardware/radio/network/RadioBandMode.aidl
index 45c4a51..364a562 100644
--- a/radio/aidl/android/hardware/radio/network/RadioBandMode.aidl
+++ b/radio/aidl/android/hardware/radio/network/RadioBandMode.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/network/RegState.aidl b/radio/aidl/android/hardware/radio/network/RegState.aidl
index bdba4c4..de2d5f6 100644
--- a/radio/aidl/android/hardware/radio/network/RegState.aidl
+++ b/radio/aidl/android/hardware/radio/network/RegState.aidl
@@ -20,6 +20,7 @@
* Please note that registration state UNKNOWN is treated as "out of service" in Android telephony.
* Registration state REG_DENIED must be returned if Location Update Reject (with cause 17 - Network
* Failure) is received repeatedly from the network, to facilitate "managed roaming".
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/radio/aidl/android/hardware/radio/network/RegStateResult.aidl b/radio/aidl/android/hardware/radio/network/RegStateResult.aidl
index f1d2972..57a73c0 100644
--- a/radio/aidl/android/hardware/radio/network/RegStateResult.aidl
+++ b/radio/aidl/android/hardware/radio/network/RegStateResult.aidl
@@ -22,6 +22,7 @@
import android.hardware.radio.network.RegState;
import android.hardware.radio.network.RegistrationFailCause;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable RegStateResult {
diff --git a/radio/aidl/android/hardware/radio/network/RegistrationFailCause.aidl b/radio/aidl/android/hardware/radio/network/RegistrationFailCause.aidl
index 9549f2e..2955f96 100644
--- a/radio/aidl/android/hardware/radio/network/RegistrationFailCause.aidl
+++ b/radio/aidl/android/hardware/radio/network/RegistrationFailCause.aidl
@@ -19,6 +19,7 @@
/**
* Call fail causes for Circuit-switched service enumerated in 3GPP TS 24.008, 10.5.3.6 and
* 10.5.147. Additional detail is available in 3GPP TS 24.008 Annex G.
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/radio/aidl/android/hardware/radio/network/SecurityAlgorithm.aidl b/radio/aidl/android/hardware/radio/network/SecurityAlgorithm.aidl
new file mode 100644
index 0000000..71c654c
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/network/SecurityAlgorithm.aidl
@@ -0,0 +1,90 @@
+/*
+ * Copyright 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.
+ */
+
+package android.hardware.radio.network;
+
+/**
+ * See IRadioNetwork.securityAlgorithmsUpdated for more details.
+ *
+ * @hide
+ */
+@VintfStability
+@Backing(type="int")
+@JavaDerive(toString=true)
+enum SecurityAlgorithm {
+ // GSM CS services (3GPP TS 43.020)
+ A50 = 0,
+ A51 = 1,
+ A52 = 2,
+ A53 = 3,
+ A54 = 4,
+
+ // GPRS PS services (3GPP TS 43.020)
+ // These also refer to the respective integrity counterparts.
+ // E.g. GEA1 = GIA1
+ GEA0 = 14,
+ GEA1 = 15,
+ GEA2 = 16,
+ GEA3 = 17,
+ GEA4 = 18,
+ GEA5 = 19,
+
+ // 3G PS/CS services (3GPP TS 33.102)
+ UEA0 = 29,
+ UEA1 = 30,
+ UEA2 = 31,
+
+ // 4G PS services & 5G NSA (3GPP TS 33.401)
+ EEA0 = 41,
+ EEA1 = 42,
+ EEA2 = 43,
+ EEA3 = 44,
+
+ // 5G PS services (3GPP TS 33.401 for 5G NSA and 3GPP TS 33.501 for 5G SA)
+ NEA0 = 55,
+ NEA1 = 56,
+ NEA2 = 57,
+ NEA3 = 58,
+
+ // SIP layer security (See 3GPP TS 33.203)
+ SIP_NULL = 68,
+ AES_GCM = 69,
+ AES_GMAC = 70,
+ AES_CBC = 71,
+ DES_EDE3_CBC = 72,
+ AES_EDE3_CBC = 73,
+ HMAC_SHA1_96 = 74,
+ HMAC_SHA1_96_null = 75,
+ HMAC_MD5_96 = 76,
+ HMAC_MD5_96_null = 77,
+
+ // RTP (see 3GPP TS 33.328)
+ SRTP_AES_COUNTER = 87,
+ SRTP_AES_F8 = 88,
+ SRTP_HMAC_SHA1 = 89,
+
+ // ePDG (3GPP TS 33.402)
+ ENCR_AES_GCM_16 = 99,
+ ENCR_AES_CBC = 100,
+ AUTH_HMAC_SHA2_256_128 = 101,
+
+ /** Unknown */
+ UNKNOWN = 113,
+ OTHER = 114,
+
+ /** For proprietary algorithms */
+ ORYX = 124,
+}
diff --git a/radio/aidl/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl b/radio/aidl/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl
new file mode 100644
index 0000000..e945d3b
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/network/SecurityAlgorithmUpdate.aidl
@@ -0,0 +1,48 @@
+/*
+ * Copyright 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.
+ */
+
+package android.hardware.radio.network;
+
+import android.hardware.radio.network.ConnectionEvent;
+import android.hardware.radio.network.SecurityAlgorithm;
+
+/**
+ * A single occurrence capturing a notable change to previously reported
+ * cryptography algorithms for a given network and network event.
+ *
+ * @hide
+ */
+@JavaDerive(toString=true)
+@VintfStability
+parcelable SecurityAlgorithmUpdate {
+ /**
+ * Type of connection event which is being reported on
+ */
+ ConnectionEvent connectionEvent;
+ /**
+ * Encryption algorithm which was used
+ */
+ SecurityAlgorithm encryption;
+ /**
+ * Integrity algorithm which was used
+ */
+ SecurityAlgorithm integrity;
+ /**
+ * Whether or not this connection event is associated with an
+ * unauthenticated / unencrypted emergency session
+ */
+ boolean isUnprotectedEmergency;
+}
diff --git a/radio/aidl/android/hardware/radio/network/SignalStrength.aidl b/radio/aidl/android/hardware/radio/network/SignalStrength.aidl
index ddb4582..5fed522 100644
--- a/radio/aidl/android/hardware/radio/network/SignalStrength.aidl
+++ b/radio/aidl/android/hardware/radio/network/SignalStrength.aidl
@@ -24,6 +24,7 @@
import android.hardware.radio.network.TdscdmaSignalStrength;
import android.hardware.radio.network.WcdmaSignalStrength;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable SignalStrength {
diff --git a/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl b/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl
index 0a8e9ce..e440a64 100644
--- a/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl
+++ b/radio/aidl/android/hardware/radio/network/SignalThresholdInfo.aidl
@@ -20,6 +20,7 @@
/**
* Contains the threshold values of each signal measurement type.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/network/SuppSvcNotification.aidl b/radio/aidl/android/hardware/radio/network/SuppSvcNotification.aidl
index d4229e1..3b8c8b2 100644
--- a/radio/aidl/android/hardware/radio/network/SuppSvcNotification.aidl
+++ b/radio/aidl/android/hardware/radio/network/SuppSvcNotification.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable SuppSvcNotification {
diff --git a/radio/aidl/android/hardware/radio/network/TdscdmaSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/TdscdmaSignalStrength.aidl
index ec9ca6b..4afdd0f 100644
--- a/radio/aidl/android/hardware/radio/network/TdscdmaSignalStrength.aidl
+++ b/radio/aidl/android/hardware/radio/network/TdscdmaSignalStrength.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable TdscdmaSignalStrength {
diff --git a/radio/aidl/android/hardware/radio/network/UsageSetting.aidl b/radio/aidl/android/hardware/radio/network/UsageSetting.aidl
index 5a714a4..0b6cfdd 100644
--- a/radio/aidl/android/hardware/radio/network/UsageSetting.aidl
+++ b/radio/aidl/android/hardware/radio/network/UsageSetting.aidl
@@ -21,6 +21,7 @@
*
* <p>Also refer to "UE's usage setting" as defined in 3gpp 24.301 section 3.1 and 3gpp 23.221
* Annex A.
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/radio/aidl/android/hardware/radio/network/UtranBands.aidl b/radio/aidl/android/hardware/radio/network/UtranBands.aidl
index a0fd427..8478b66 100644
--- a/radio/aidl/android/hardware/radio/network/UtranBands.aidl
+++ b/radio/aidl/android/hardware/radio/network/UtranBands.aidl
@@ -18,6 +18,7 @@
/**
* UTRAN bands up to V15.0.0
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/radio/aidl/android/hardware/radio/network/WcdmaSignalStrength.aidl b/radio/aidl/android/hardware/radio/network/WcdmaSignalStrength.aidl
index 7595c05..ace89ed 100644
--- a/radio/aidl/android/hardware/radio/network/WcdmaSignalStrength.aidl
+++ b/radio/aidl/android/hardware/radio/network/WcdmaSignalStrength.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.network;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable WcdmaSignalStrength {
diff --git a/radio/aidl/android/hardware/radio/sap/ISap.aidl b/radio/aidl/android/hardware/radio/sap/ISap.aidl
index 552e602..04eee43 100644
--- a/radio/aidl/android/hardware/radio/sap/ISap.aidl
+++ b/radio/aidl/android/hardware/radio/sap/ISap.aidl
@@ -28,6 +28,8 @@
* @param serial Id to match req-resp. Resp must include same serial.
* @param type APDU command type
* @param command CommandAPDU/CommandAPDU7816 parameter depending on type
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void apduReq(in int serial, in SapApduType type, in byte[] command);
@@ -36,6 +38,8 @@
*
* @param serial Id to match req-resp. Resp must include same serial.
* @param maxMsgSizeBytes MaxMsgSize to be used for SIM Access Profile connection
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void connectReq(in int serial, in int maxMsgSizeBytes);
@@ -43,6 +47,8 @@
* DISCONNECT_REQ from SAP 1.1 spec 5.1.3
*
* @param serial Id to match req-resp. Resp must include same serial.
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void disconnectReq(in int serial);
@@ -51,6 +57,8 @@
*
* @param serial Id to match req-resp. Resp must include same serial.
* @param powerOn true for on, false for off
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void powerReq(in int serial, in boolean powerOn);
@@ -58,6 +66,8 @@
* RESET_SIM_REQ from SAP 1.1 spec 5.1.14
*
* @param serial Id to match req-resp. Resp must include same serial.
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void resetSimReq(in int serial);
@@ -65,6 +75,8 @@
* Set callback that has response and unsolicited indication functions
*
* @param sapCallback Object containing response and unosolicited indication callbacks
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setCallback(in ISapCallback sapCallback);
@@ -73,6 +85,8 @@
*
* @param serial Id to match req-resp. Resp must include same serial.
* @param transferProtocol Transport Protocol
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setTransferProtocolReq(in int serial, in SapTransferProtocol transferProtocol);
@@ -80,6 +94,8 @@
* TRANSFER_ATR_REQ from SAP 1.1 spec 5.1.8
*
* @param serial Id to match req-resp. Resp must include same serial.
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void transferAtrReq(in int serial);
@@ -87,6 +103,8 @@
* TRANSFER_CARD_READER_STATUS_REQ from SAP 1.1 spec 5.1.17
*
* @param serial Id to match req-resp. Resp must include same serial.
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void transferCardReaderStatusReq(in int serial);
}
diff --git a/radio/aidl/android/hardware/radio/sap/ISapCallback.aidl b/radio/aidl/android/hardware/radio/sap/ISapCallback.aidl
index 34111eb..37a94b8 100644
--- a/radio/aidl/android/hardware/radio/sap/ISapCallback.aidl
+++ b/radio/aidl/android/hardware/radio/sap/ISapCallback.aidl
@@ -29,6 +29,8 @@
* @param serial Id to match req-resp. Value must match the one in req.
* @param resultCode ResultCode to indicate if command was processed correctly
* Possible values:
+ * SapResultCode:NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* SapResultCode:SUCCESS,
* SapResultCode:GENERIC_FAILURE,
* SapResultCode:CARD_NOT_ACCESSSIBLE,
@@ -77,6 +79,8 @@
* @param serial Id to match req-resp. Value must match the one in req.
* @param resultCode ResultCode to indicate if command was processed correctly
* Possible values:
+ * SapResultCode:NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* SapResultCode:SUCCESS,
* SapResultCode:GENERIC_FAILURE,
* SapResultCode:CARD_NOT_ACCESSSIBLE, (possible only for power on req)
@@ -92,6 +96,8 @@
* @param serial Id to match req-resp. Value must match the one in req.
* @param resultCode ResultCode to indicate if command was processed correctly
* Possible values:
+ * SapResultCode:NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* SapResultCode:SUCCESS,
* SapResultCode:GENERIC_FAILURE,
* SapResultCode:CARD_NOT_ACCESSSIBLE,
@@ -114,6 +120,8 @@
* @param serial Id to match req-resp. Value must match the one in req.
* @param resultCode ResultCode to indicate if command was processed correctly
* Possible values:
+ * SapResultCode:NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* SapResultCode:SUCCESS,
* SapResultCode:GENERIC_FAILURE,
* SapResultCode:CARD_ALREADY_POWERED_OFF,
@@ -130,6 +138,8 @@
* @param serial Id to match req-resp. Value must match the one in req.
* @param resultCode ResultCode to indicate if command was processed correctly
* Possible values:
+ * SapResultCode:NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* SapResultCode:SUCCESS,
* SapResultCode:GENERIC_FAILURE
* SapResultCode:DATA_NOT_AVAILABLE
@@ -145,6 +155,8 @@
* @param serial Id to match req-resp. Value must match the one in req.
* @param resultCode ResultCode to indicate if command was processed correctly
* Possible values:
+ * SapResultCode:NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* SapResultCode:SUCCESS
* SapResultCode:NOT_SUPPORTED
*/
diff --git a/radio/aidl/android/hardware/radio/sim/AppStatus.aidl b/radio/aidl/android/hardware/radio/sim/AppStatus.aidl
index c072f6a..7fe8e40 100644
--- a/radio/aidl/android/hardware/radio/sim/AppStatus.aidl
+++ b/radio/aidl/android/hardware/radio/sim/AppStatus.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.sim.PersoSubstate;
import android.hardware.radio.sim.PinState;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable AppStatus {
diff --git a/radio/aidl/android/hardware/radio/sim/CardPowerState.aidl b/radio/aidl/android/hardware/radio/sim/CardPowerState.aidl
index f8b5922..2598dcb 100644
--- a/radio/aidl/android/hardware/radio/sim/CardPowerState.aidl
+++ b/radio/aidl/android/hardware/radio/sim/CardPowerState.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.sim;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/sim/CardStatus.aidl b/radio/aidl/android/hardware/radio/sim/CardStatus.aidl
index 1419c51..043bfa4 100644
--- a/radio/aidl/android/hardware/radio/sim/CardStatus.aidl
+++ b/radio/aidl/android/hardware/radio/sim/CardStatus.aidl
@@ -21,6 +21,7 @@
import android.hardware.radio.sim.AppStatus;
import android.hardware.radio.sim.PinState;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CardStatus {
diff --git a/radio/aidl/android/hardware/radio/sim/Carrier.aidl b/radio/aidl/android/hardware/radio/sim/Carrier.aidl
index d25214f..8b27088 100644
--- a/radio/aidl/android/hardware/radio/sim/Carrier.aidl
+++ b/radio/aidl/android/hardware/radio/sim/Carrier.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.sim;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable Carrier {
diff --git a/radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl b/radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl
new file mode 100644
index 0000000..a890497
--- /dev/null
+++ b/radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+
+package android.hardware.radio.sim;
+
+import android.hardware.radio.sim.Plmn;
+
+/** @hide */
+@VintfStability
+@JavaDerive(toString=true)
+parcelable CarrierInfo {
+ /**
+ * MCC (Mobile Country Code) of Carrier. Wild char is either '*' or '?'.
+ */
+ String mcc;
+
+ /**
+ * MNC (Mobile Network Code) of the Carrier. Wild char is either '*' or '?'.
+ */
+ String mnc;
+ /**
+ * Service Provider Name(SPN) of the SIM card of the Carrier.
+ */
+ @nullable
+ String spn;
+ /**
+ * GID1 value of the SIM card of the Carrier.
+ */
+ @nullable
+ String gid1;
+ /**
+ * GID2 value of the SIM card of the Carrier.
+ */
+ @nullable
+ String gid2;
+
+ /**
+ * IMSI (International Mobile Subscriber Identity) prefix. Wild char is '*'.
+ */
+ @nullable
+ String imsiPrefix;
+ /**
+ * Equivalent HPLMN of the SIM card of the Carrier.
+ */
+ @nullable
+ List<Plmn> ephlmn;
+ /**
+ * ICCID (Integrated Circuit Card Identification) of the SIM card.
+ */
+ @nullable
+ String iccid;
+ /**
+ * IMPI (IMS Private Identity) of the SIM card of the Carrier.
+ */
+ @nullable
+ String impi;
+}
\ No newline at end of file
diff --git a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl
index edbec2c..0002d5a 100644
--- a/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl
+++ b/radio/aidl/android/hardware/radio/sim/CarrierRestrictions.aidl
@@ -17,7 +17,9 @@
package android.hardware.radio.sim;
import android.hardware.radio.sim.Carrier;
+import android.hardware.radio.sim.CarrierInfo;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CarrierRestrictions {
@@ -25,12 +27,12 @@
@Backing(type="int")
/** This enum defines the carrier restriction status values */
enum CarrierRestrictionStatus {
- /**
- * Carrier restriction status value is unknown, used in cases where modem is dependent on
- * external module to know about the lock status and the module hasn’t yet provided the lock
- * status. For example, when the lock status is maintained on a cloud server and device has
- * just booted after out of box and not yet connected to the internet.
- */
+ /**
+ * Carrier restriction status value is unknown, used in cases where modem is dependent on
+ * external module to know about the lock status and the module hasn’t yet provided the lock
+ * status. For example, when the lock status is maintained on a cloud server and device has
+ * just booted after out of box and not yet connected to the internet.
+ */
UNKNOWN = 0,
/** There is no carrier restriction on the device */
NOT_RESTRICTED = 1,
@@ -39,12 +41,14 @@
}
/**
* Allowed carriers
+ * @deprecated use @List<CarrierInfo> allowedCarrierInfoList
*/
Carrier[] allowedCarriers;
/**
* Explicitly excluded carriers which match allowed_carriers. Eg. allowedCarriers match mcc/mnc,
* excludedCarriers has same mcc/mnc and gid1 is ABCD. It means except the carrier whose gid1
* is ABCD, all carriers with the same mcc/mnc are allowed.
+ * @deprecated use @List<CarrierInfo> excludedCarrierInfoList
*/
Carrier[] excludedCarriers;
/**
@@ -58,4 +62,14 @@
boolean allowedCarriersPrioritized;
/** Current restriction status as defined in CarrierRestrictionStatus enum */
CarrierRestrictionStatus status;
-}
+
+ /** Allowed carriers. */
+ CarrierInfo[] allowedCarrierInfoList = {};
+
+ /**
+ * Explicitly excluded carriers which match allowed_carriers. Eg. allowedCarriers match mcc/mnc,
+ * excludedCarriers has same mcc/mnc and gid1 is ABCD. It means except the carrier whose gid1
+ * is ABCD, all carriers with the same mcc/mnc are allowed.
+ */
+ CarrierInfo[] excludedCarrierInfoList = {};
+}
\ No newline at end of file
diff --git a/radio/aidl/android/hardware/radio/sim/CdmaSubscriptionSource.aidl b/radio/aidl/android/hardware/radio/sim/CdmaSubscriptionSource.aidl
index 6aa6926..4c6c1ef 100644
--- a/radio/aidl/android/hardware/radio/sim/CdmaSubscriptionSource.aidl
+++ b/radio/aidl/android/hardware/radio/sim/CdmaSubscriptionSource.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.sim;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl b/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl
index 3823a71..7870a74 100644
--- a/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl
+++ b/radio/aidl/android/hardware/radio/sim/IRadioSim.aidl
@@ -37,6 +37,7 @@
* duration of a method call. If clients provide colliding serials (including passing the same
* serial to different methods), multiple responses (one for each method call) must still be served.
* setResponseFunctions must work with IRadioSimResponse and IRadioSimIndication.
+ * @hide
*/
@VintfStability
oneway interface IRadioSim {
@@ -48,6 +49,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioSimResponse.areUiccApplicationsEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void areUiccApplicationsEnabled(in int serial);
@@ -60,6 +63,8 @@
* @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
*
* Response function is IRadioSimResponse.changeIccPin2ForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void changeIccPin2ForApp(in int serial, in String oldPin2, in String newPin2, in String aid);
@@ -72,6 +77,8 @@
* @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
*
* Response function is IRadioSimResponse.changeIccPinForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void changeIccPinForApp(in int serial, in String oldPin, in String newPin, in String aid);
@@ -90,6 +97,8 @@
* @param enable true if to enable uiccApplications, false to disable.
*
* Response function is IRadioSimResponse.enableUiccApplicationsResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void enableUiccApplications(in int serial, in boolean enable);
@@ -99,6 +108,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioSimResponse.getAllowedCarriersResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void getAllowedCarriers(in int serial);
@@ -110,6 +121,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioSimResponse.getCdmaSubscriptionResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void getCdmaSubscription(in int serial);
@@ -119,6 +132,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioSimResponse.getCdmaSubscriptionSourceResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void getCdmaSubscriptionSource(in int serial);
@@ -134,6 +149,8 @@
* This is only applicable in the case of Fixed Dialing Numbers (FDN) requests.
*
* Response function is IRadioSimResponse.getFacilityLockForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void getFacilityLockForApp(in int serial, in String facility, in String password,
in int serviceClass, in String appId);
@@ -144,6 +161,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioSimResponse.getIccCardStatusResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void getIccCardStatus(in int serial);
@@ -154,6 +173,8 @@
* @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
*
* Response function is IRadioSimResponse.getImsiForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void getImsiForApp(in int serial, in String aid);
@@ -163,6 +184,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioSimResponse.getSimPhonebookCapacityResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void getSimPhonebookCapacity(in int serial);
@@ -174,6 +197,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioSimResponse.getSimPhonebookRecordsResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void getSimPhonebookRecords(in int serial);
@@ -186,6 +211,8 @@
*
* Response function is IRadioSimResponse.iccCloseLogicalChannelResponse()
*
+ * This is available when android.hardware.telephony.subscription is defined.
+ *
* @deprecated use iccCloseLogicalChannelWithSessionInfo instead.
*/
void iccCloseLogicalChannel(in int serial, in int channelId);
@@ -201,6 +228,8 @@
* @param iccIo IccIo
*
* Response function is IRadioSimResponse.iccIoForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void iccIoForApp(in int serial, in IccIo iccIo);
@@ -219,6 +248,8 @@
* @param p2 P2 value, described in ISO 7816-4. Ignore if equal to RadioConst:P2_CONSTANT_NO_P2
*
* Response function is IRadioSimResponse.iccOpenLogicalChannelResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void iccOpenLogicalChannel(in int serial, in String aid, in int p2);
@@ -232,6 +263,8 @@
* @param message SimApdu to be sent
*
* Response function is IRadioSimResponse.iccTransmitApduBasicChannelResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void iccTransmitApduBasicChannel(in int serial, in SimApdu message);
@@ -244,6 +277,8 @@
* @param message SimApdu to be sent
*
* Response function is IRadioSimResponse.iccTransmitApduLogicalChannelResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void iccTransmitApduLogicalChannel(in int serial, in SimApdu message);
@@ -253,6 +288,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioSimResponse.reportStkServiceIsRunningResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void reportStkServiceIsRunning(in int serial);
@@ -266,6 +303,8 @@
* @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value
*
* Response function is IRadioSimResponse.requestIccSimAuthenticationResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void requestIccSimAuthentication(
in int serial, in int authContext, in String authData, in String aid);
@@ -274,6 +313,8 @@
* When response type received from a radio indication or radio response is
* RadioIndicationType:UNSOLICITED_ACK_EXP or RadioResponseType:SOLICITED_ACK_EXP respectively,
* acknowledge the receipt of those messages by sending responseAcknowledgement().
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void responseAcknowledgement();
@@ -285,6 +326,8 @@
* @param contents SAT/USAT command in hexadecimal format string starting with command tag
*
* Response function is IRadioSimResponse.sendEnvelopeResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void sendEnvelope(in int serial, in String contents);
@@ -300,6 +343,8 @@
* @param contents SAT/USAT command in hexadecimal format starting with command tag
*
* Response function is IRadioSimResponse.sendEnvelopeWithStatusResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void sendEnvelopeWithStatus(in int serial, in String contents);
@@ -311,6 +356,8 @@
* first byte of response data
*
* Response function is IRadioSimResponse.sendTerminalResponseResponseToSim()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void sendTerminalResponseToSim(in int serial, in String contents);
@@ -330,6 +377,8 @@
* @param multiSimPolicy Policy to be used for devices with multiple SIMs.
*
* Response function is IRadioSimResponse.setAllowedCarriersResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setAllowedCarriers(in int serial, in CarrierRestrictions carriers,
in SimLockMultiSimPolicy multiSimPolicy);
@@ -343,6 +392,8 @@
* @param imsiEncryptionInfo ImsiEncryptionInfo
*
* Response function is IRadioSimResponse.setCarrierInfoForImsiEncryptionResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setCarrierInfoForImsiEncryption(in int serial, in ImsiEncryptionInfo imsiEncryptionInfo);
@@ -353,6 +404,8 @@
* @param cdmaSub CdmaSubscriptionSource
*
* Response function is IRadioSimResponse.setCdmaSubscriptionSourceResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void setCdmaSubscriptionSource(in int serial, in CdmaSubscriptionSource cdmaSub);
@@ -369,6 +422,8 @@
* This is only applicable in the case of Fixed Dialing Numbers (FDN) requests.
*
* Response function is IRadioSimResponse.setFacilityLockForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setFacilityLockForApp(in int serial, in String facility, in boolean lockState,
in String password, in int serviceClass, in String appId);
@@ -378,6 +433,8 @@
*
* @param radioSimResponse Object containing response functions
* @param radioSimIndication Object containing radio indications
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setResponseFunctions(
in IRadioSimResponse radioSimResponse, in IRadioSimIndication radioSimIndication);
@@ -408,6 +465,8 @@
* POWER_UP_PASS_THROUGH if powering up the SIM card in pass through mode
*
* Response function is IRadioSimResponse.setSimCardPowerResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setSimCardPower(in int serial, in CardPowerState powerUp);
@@ -418,6 +477,8 @@
* @param uiccSub SelectUiccSub
*
* Response function is IRadioSimResponse.setUiccSubscriptionResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void setUiccSubscription(in int serial, in SelectUiccSub uiccSub);
@@ -430,6 +491,8 @@
* @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
*
* Response function is IRadioSimResponse.supplyIccPin2ForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void supplyIccPin2ForApp(in int serial, in String pin2, in String aid);
@@ -441,6 +504,8 @@
* @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
*
* Response function is IRadioSimResponse.supplyIccPinForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void supplyIccPinForApp(in int serial, in String pin, in String aid);
@@ -453,6 +518,8 @@
* @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
*
* Response function is IRadioSimResponse.supplyIccPuk2ForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void supplyIccPuk2ForApp(in int serial, in String puk2, in String pin2, in String aid);
@@ -465,6 +532,8 @@
* @param aid AID value, See ETSI 102.221 8.1 and 101.220 4, empty string if no value.
*
* Response function is IRadioSimResponse.supplyIccPukForAppResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void supplyIccPukForApp(in int serial, in String puk, in String pin, in String aid);
@@ -480,6 +549,8 @@
* @param controlKey the unlock code for removing persoType personalization from this device
*
* Response function is IRadioSimResponse.supplySimDepersonalizationResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void supplySimDepersonalization(
in int serial, in PersoSubstate persoType, in String controlKey);
@@ -495,6 +566,8 @@
* @param recordInfo Details of the record to insert, delete or update.
*
* Response function is IRadioSimResponse.updateSimPhonebookRecordsResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void updateSimPhonebookRecords(in int serial, in PhonebookRecordInfo recordInfo);
@@ -510,6 +583,8 @@
* @param sessionInfo Details of the opened logical channel info like sessionId and isEs10.
*
* Response function is IRadioSimResponse.iccCloseLogicalChannelWithSessionInfoResponse()
+ *
+ * This is available when android.hardware.telephony.subscription is defined.
*/
void iccCloseLogicalChannelWithSessionInfo(in int serial, in SessionInfo sessionInfo);
}
diff --git a/radio/aidl/android/hardware/radio/sim/IRadioSimIndication.aidl b/radio/aidl/android/hardware/radio/sim/IRadioSimIndication.aidl
index a139040..fc6355d 100644
--- a/radio/aidl/android/hardware/radio/sim/IRadioSimIndication.aidl
+++ b/radio/aidl/android/hardware/radio/sim/IRadioSimIndication.aidl
@@ -24,6 +24,7 @@
/**
* Interface declaring unsolicited radio indications for SIM APIs.
+ * @hide
*/
@VintfStability
oneway interface IRadioSimIndication {
diff --git a/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl b/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl
index 90f172f..91b5729 100644
--- a/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl
+++ b/radio/aidl/android/hardware/radio/sim/IRadioSimResponse.aidl
@@ -27,6 +27,7 @@
/**
* Interface declaring response functions to solicited radio requests for SIM APIs.
+ * @hide
*/
@VintfStability
oneway interface IRadioSimResponse {
@@ -44,6 +45,8 @@
* @param enabled whether Uicc applications are enabled.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:SIM_ABSENT
* RadioError:RADIO_NOT_AVAILABLE
@@ -56,6 +59,8 @@
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT (old PIN2 is invalid)
@@ -74,6 +79,8 @@
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT
@@ -90,6 +97,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:SIM_ABSENT
* RadioError:RADIO_NOT_AVAILABLE
@@ -104,6 +113,8 @@
* @param multiSimPolicy Policy used for devices with multiple SIM cards.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
*/
@@ -121,6 +132,7 @@
* @param prl PRL version if CDMA subscription is available
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
@@ -142,6 +154,7 @@
* @param source CDMA subscription source
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_AVAILABLE
@@ -160,6 +173,8 @@
* specified barring facility is active. "0" means "disabled for all"
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -181,6 +196,8 @@
* @param cardStatus ICC card status as defined by CardStatus
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -193,6 +210,8 @@
* @param imsi String containing the IMSI
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:INTERNAL_ERR
@@ -209,6 +228,8 @@
* @param capacity Response capacity enum indicating response processing status
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -222,6 +243,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -235,6 +258,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -251,6 +276,8 @@
* @param iccIo ICC IO operation response
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_PIN2
@@ -271,6 +298,8 @@
* byte per integer
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MISSING_RESOURCE
@@ -291,6 +320,8 @@
* @param result IccIoResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -305,6 +336,8 @@
* @param result IccIoResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -318,6 +351,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -332,6 +367,8 @@
* @param result IccIoResult
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
@@ -350,6 +387,8 @@
* byte of response
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_BUSY
@@ -369,6 +408,8 @@
* @param iccIo IccIoResult corresponding to ICC IO response
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_BUSY
@@ -385,6 +426,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -402,6 +445,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -412,6 +457,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_ABSENT
@@ -424,6 +471,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_ABSENT
@@ -440,6 +488,8 @@
* @param retry 0 is the number of retries remaining, or -1 if unknown
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -462,6 +512,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -473,6 +525,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SUBSCRIPTION_NOT_SUPPORTED
@@ -491,6 +545,8 @@
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT
@@ -509,6 +565,8 @@
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT
@@ -526,6 +584,8 @@
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT (PUK is invalid)
@@ -543,6 +603,8 @@
* @param remainingRetries Number of retries remaining, must be equal to -1 if unknown.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:PASSWORD_INCORRECT (PUK is invalid)
@@ -562,6 +624,8 @@
* to -1 if number of retries is infinite.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:PASSWORD_INCORRECT (code is invalid)
@@ -582,6 +646,8 @@
* the minimum value is 1
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -598,6 +664,8 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.subscription is not
+ * defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INTERNAL_ERR
diff --git a/radio/aidl/android/hardware/radio/sim/IccIo.aidl b/radio/aidl/android/hardware/radio/sim/IccIo.aidl
index f173c8e..0877b7a 100644
--- a/radio/aidl/android/hardware/radio/sim/IccIo.aidl
+++ b/radio/aidl/android/hardware/radio/sim/IccIo.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.sim;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable IccIo {
diff --git a/radio/aidl/android/hardware/radio/sim/IccIoResult.aidl b/radio/aidl/android/hardware/radio/sim/IccIoResult.aidl
index efcbbda..ac89698 100644
--- a/radio/aidl/android/hardware/radio/sim/IccIoResult.aidl
+++ b/radio/aidl/android/hardware/radio/sim/IccIoResult.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.sim;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable IccIoResult {
diff --git a/radio/aidl/android/hardware/radio/sim/ImsiEncryptionInfo.aidl b/radio/aidl/android/hardware/radio/sim/ImsiEncryptionInfo.aidl
index ba1dda5..b31b081 100644
--- a/radio/aidl/android/hardware/radio/sim/ImsiEncryptionInfo.aidl
+++ b/radio/aidl/android/hardware/radio/sim/ImsiEncryptionInfo.aidl
@@ -18,6 +18,7 @@
/**
* Carrier specific Information sent by the carrier, which will be used to encrypt IMSI and IMPI.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl b/radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl
index b1385a4..f9414a8 100644
--- a/radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl
+++ b/radio/aidl/android/hardware/radio/sim/PbReceivedStatus.aidl
@@ -18,6 +18,7 @@
/**
* Enum representing the status of the received PB indication.
+ * @hide
*/
@VintfStability
@Backing(type="byte")
diff --git a/radio/aidl/android/hardware/radio/sim/PersoSubstate.aidl b/radio/aidl/android/hardware/radio/sim/PersoSubstate.aidl
index f85c84b..4da86c5 100644
--- a/radio/aidl/android/hardware/radio/sim/PersoSubstate.aidl
+++ b/radio/aidl/android/hardware/radio/sim/PersoSubstate.aidl
@@ -19,6 +19,7 @@
/**
* Additional personalization categories in addition to those specified in 3GPP TS 22.022 and
* 3GPP2 C.S0068-0.
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/radio/aidl/android/hardware/radio/sim/PhonebookCapacity.aidl b/radio/aidl/android/hardware/radio/sim/PhonebookCapacity.aidl
index 97c3dba..2212fda 100644
--- a/radio/aidl/android/hardware/radio/sim/PhonebookCapacity.aidl
+++ b/radio/aidl/android/hardware/radio/sim/PhonebookCapacity.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.sim;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable PhonebookCapacity {
diff --git a/radio/aidl/android/hardware/radio/sim/PhonebookRecordInfo.aidl b/radio/aidl/android/hardware/radio/sim/PhonebookRecordInfo.aidl
index c4db0e6..1653c31 100644
--- a/radio/aidl/android/hardware/radio/sim/PhonebookRecordInfo.aidl
+++ b/radio/aidl/android/hardware/radio/sim/PhonebookRecordInfo.aidl
@@ -19,6 +19,7 @@
/**
* Phonebook-record-information specified by EF_ADN (Abbreviated dialing numbers) record of SIM
* as per 3GPP spec 31.102 v15 Section-4.4.2.3.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/sim/PinState.aidl b/radio/aidl/android/hardware/radio/sim/PinState.aidl
index 85048bb..f5f3108 100644
--- a/radio/aidl/android/hardware/radio/sim/PinState.aidl
+++ b/radio/aidl/android/hardware/radio/sim/PinState.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.sim;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/radio/aidl/android/hardware/radio/sim/Plmn.aidl
similarity index 63%
copy from automotive/vehicle/aidl/impl/utils/test/Android.bp
copy to radio/aidl/android/hardware/radio/sim/Plmn.aidl
index ad9954f..fd82692 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/radio/aidl/android/hardware/radio/sim/Plmn.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -14,13 +14,18 @@
* limitations under the License.
*/
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
+package android.hardware.radio.sim;
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
-}
+/** @hide */
+@VintfStability
+@JavaDerive(toString=true)
+parcelable Plmn {
+ /**
+ * MCC (Mobile Country Code) of the PLMN
+ */
+ String mcc;
+ /**
+ * MNC (Mobile Network Code) of the PLMN
+ */
+ String mnc;
+}
\ No newline at end of file
diff --git a/radio/aidl/android/hardware/radio/sim/SelectUiccSub.aidl b/radio/aidl/android/hardware/radio/sim/SelectUiccSub.aidl
index 553404b..70a2191 100644
--- a/radio/aidl/android/hardware/radio/sim/SelectUiccSub.aidl
+++ b/radio/aidl/android/hardware/radio/sim/SelectUiccSub.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.sim;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable SelectUiccSub {
diff --git a/radio/aidl/android/hardware/radio/sim/SessionInfo.aidl b/radio/aidl/android/hardware/radio/sim/SessionInfo.aidl
index 9e3e8ed..585118a 100644
--- a/radio/aidl/android/hardware/radio/sim/SessionInfo.aidl
+++ b/radio/aidl/android/hardware/radio/sim/SessionInfo.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.sim;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable SessionInfo {
diff --git a/radio/aidl/android/hardware/radio/sim/SimApdu.aidl b/radio/aidl/android/hardware/radio/sim/SimApdu.aidl
index 9799f2b..d0e3c39 100644
--- a/radio/aidl/android/hardware/radio/sim/SimApdu.aidl
+++ b/radio/aidl/android/hardware/radio/sim/SimApdu.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.sim;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable SimApdu {
diff --git a/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl b/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
index 6490d51..89d85a9 100644
--- a/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
+++ b/radio/aidl/android/hardware/radio/sim/SimLockMultiSimPolicy.aidl
@@ -16,18 +16,61 @@
package android.hardware.radio.sim;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
enum SimLockMultiSimPolicy {
+
/**
* Indicates that configuration applies to each slot independently.
*/
NO_MULTISIM_POLICY,
+
/**
* Indicates that any SIM card can be used as far as one valid card is present in the device.
* For the modem, a SIM card is valid when its content (i.e. MCC, MNC, GID, SPN) matches the
* carrier restriction configuration.
*/
ONE_VALID_SIM_MUST_BE_PRESENT,
+
+ /**
+ * Indicates that the SIM lock policy applies uniformly to all sim slots.
+ */
+ APPLY_TO_ALL_SLOTS,
+
+ /**
+ * The SIM lock configuration applies exclusively to sim slot 1, leaving
+ * all other sim slots unlocked irrespective of the SIM card in slot 1
+ */
+ APPLY_TO_ONLY_SLOT_1,
+
+ /**
+ * Valid sim cards must be present on sim slot1 in order
+ * to use other sim slots.
+ */
+ VALID_SIM_MUST_PRESENT_ON_SLOT_1,
+
+ /**
+ * Valid sim card must be present on slot1 and it must be in full service
+ * in order to use other sim slots.
+ */
+ ACTIVE_SERVICE_ON_SLOT_1_TO_UNBLOCK_OTHER_SLOTS,
+
+ /**
+ * Valid sim card be present on any slot and it must be in full service
+ * in order to use other sim slots.
+ */
+ ACTIVE_SERVICE_ON_ANY_SLOT_TO_UNBLOCK_OTHER_SLOTS,
+
+ /**
+ * Valid sim cards must be present on all slots. If any SIM cards become
+ * invalid then device would set other SIM cards as invalid as well.
+ */
+ ALL_SIMS_MUST_BE_VALID,
+
+ /**
+ * In case there is no match policy listed above.
+ */
+ SLOT_POLICY_OTHER
}
diff --git a/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl b/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl
index 69aff66..943f1d2 100644
--- a/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl
+++ b/radio/aidl/android/hardware/radio/sim/SimRefreshResult.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.sim;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable SimRefreshResult {
diff --git a/radio/aidl/android/hardware/radio/voice/AudioQuality.aidl b/radio/aidl/android/hardware/radio/voice/AudioQuality.aidl
index dc47172..334ae3d 100644
--- a/radio/aidl/android/hardware/radio/voice/AudioQuality.aidl
+++ b/radio/aidl/android/hardware/radio/voice/AudioQuality.aidl
@@ -19,6 +19,7 @@
/**
* Audio codec which is used on GSM, UMTS, and CDMA. These values must be opaque to the Android
* framework. Only for display.
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/radio/aidl/android/hardware/radio/voice/Call.aidl b/radio/aidl/android/hardware/radio/voice/Call.aidl
index b09d7a0..ee0b025 100644
--- a/radio/aidl/android/hardware/radio/voice/Call.aidl
+++ b/radio/aidl/android/hardware/radio/voice/Call.aidl
@@ -19,6 +19,7 @@
import android.hardware.radio.voice.AudioQuality;
import android.hardware.radio.voice.UusInfo;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable Call {
diff --git a/radio/aidl/android/hardware/radio/voice/CallForwardInfo.aidl b/radio/aidl/android/hardware/radio/voice/CallForwardInfo.aidl
index c4143b9..9b4ecd9 100644
--- a/radio/aidl/android/hardware/radio/voice/CallForwardInfo.aidl
+++ b/radio/aidl/android/hardware/radio/voice/CallForwardInfo.aidl
@@ -18,6 +18,7 @@
/**
* See also com.android.internal.telephony.gsm.CallForwardInfo
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/voice/CdmaCallWaiting.aidl b/radio/aidl/android/hardware/radio/voice/CdmaCallWaiting.aidl
index 4d447d7..d97b319 100644
--- a/radio/aidl/android/hardware/radio/voice/CdmaCallWaiting.aidl
+++ b/radio/aidl/android/hardware/radio/voice/CdmaCallWaiting.aidl
@@ -18,6 +18,7 @@
import android.hardware.radio.voice.CdmaSignalInfoRecord;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CdmaCallWaiting {
diff --git a/radio/aidl/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl
index 522f7ae..7e5a68d 100644
--- a/radio/aidl/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl
+++ b/radio/aidl/android/hardware/radio/voice/CdmaDisplayInfoRecord.aidl
@@ -22,6 +22,7 @@
* the form: display_tag, display_len, and display_len occurrences of the char field if the
* display_tag is not 10000000 or 10000001. To save space, the records are stored consecutively in
* a byte buffer. The display_tag, display_len and chari fields are all 1 byte.
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/voice/CdmaInformationRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaInformationRecord.aidl
index 1a4f1b3..f5c656b 100644
--- a/radio/aidl/android/hardware/radio/voice/CdmaInformationRecord.aidl
+++ b/radio/aidl/android/hardware/radio/voice/CdmaInformationRecord.aidl
@@ -24,10 +24,11 @@
import android.hardware.radio.voice.CdmaT53AudioControlInfoRecord;
import android.hardware.radio.voice.CdmaT53ClirInfoRecord;
-@VintfStability
/**
* Max length of CdmaInformationRecords[] is CDMA_MAX_NUMBER_OF_INFO_RECS
+ * @hide
*/
+@VintfStability
@JavaDerive(toString=true)
parcelable CdmaInformationRecord {
const int CDMA_MAX_NUMBER_OF_INFO_RECS = 10;
diff --git a/radio/aidl/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl
index 8bfc5f7..15c22a0 100644
--- a/radio/aidl/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl
+++ b/radio/aidl/android/hardware/radio/voice/CdmaLineControlInfoRecord.aidl
@@ -18,6 +18,7 @@
/**
* Line Control Information Record as defined in C.S0005 section 3.7.5.15
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl
index 9084b25..b04e273 100644
--- a/radio/aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl
+++ b/radio/aidl/android/hardware/radio/voice/CdmaNumberInfoRecord.aidl
@@ -20,6 +20,7 @@
* Called Party Number Info Rec as defined in C.S0005 section 3.7.5.2
* Calling Party Number Info Rec as defined in C.S0005 section 3.7.5.3
* Connected Number Info Rec as defined in C.S0005 section 3.7.5.4
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl b/radio/aidl/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl
index 81fb003..b6444ab 100644
--- a/radio/aidl/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl
+++ b/radio/aidl/android/hardware/radio/voice/CdmaOtaProvisionStatus.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.voice;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl
index 5c9e2f2..691712e 100644
--- a/radio/aidl/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl
+++ b/radio/aidl/android/hardware/radio/voice/CdmaRedirectingNumberInfoRecord.aidl
@@ -18,6 +18,7 @@
import android.hardware.radio.voice.CdmaNumberInfoRecord;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CdmaRedirectingNumberInfoRecord {
diff --git a/radio/aidl/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl
index 3334475..4302ba4 100644
--- a/radio/aidl/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl
+++ b/radio/aidl/android/hardware/radio/voice/CdmaSignalInfoRecord.aidl
@@ -18,6 +18,7 @@
/**
* CDMA Signal Information Record as defined in C.S0005 section 3.7.5.5
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl
index 9795cf0..44ac2b4 100644
--- a/radio/aidl/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl
+++ b/radio/aidl/android/hardware/radio/voice/CdmaT53AudioControlInfoRecord.aidl
@@ -18,6 +18,7 @@
/**
* T53 Audio Control Information Record
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl b/radio/aidl/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl
index 5ccd251..564d761 100644
--- a/radio/aidl/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl
+++ b/radio/aidl/android/hardware/radio/voice/CdmaT53ClirInfoRecord.aidl
@@ -18,6 +18,7 @@
/**
* T53 CLIR Information Record
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/voice/CfData.aidl b/radio/aidl/android/hardware/radio/voice/CfData.aidl
index 8f4c227..84304f4 100644
--- a/radio/aidl/android/hardware/radio/voice/CfData.aidl
+++ b/radio/aidl/android/hardware/radio/voice/CfData.aidl
@@ -18,6 +18,7 @@
import android.hardware.radio.voice.CallForwardInfo;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable CfData {
diff --git a/radio/aidl/android/hardware/radio/voice/ClipStatus.aidl b/radio/aidl/android/hardware/radio/voice/ClipStatus.aidl
index 4021471..0a2ea2c 100644
--- a/radio/aidl/android/hardware/radio/voice/ClipStatus.aidl
+++ b/radio/aidl/android/hardware/radio/voice/ClipStatus.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.voice;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/voice/Dial.aidl b/radio/aidl/android/hardware/radio/voice/Dial.aidl
index ca028ad..a874181 100644
--- a/radio/aidl/android/hardware/radio/voice/Dial.aidl
+++ b/radio/aidl/android/hardware/radio/voice/Dial.aidl
@@ -18,6 +18,7 @@
import android.hardware.radio.voice.UusInfo;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable Dial {
diff --git a/radio/aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl b/radio/aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl
index d623346..9f8993d 100644
--- a/radio/aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl
+++ b/radio/aidl/android/hardware/radio/voice/EmergencyCallRouting.aidl
@@ -18,6 +18,7 @@
/**
* Indicates how the implementation should handle the emergency call if it is required by Android.
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl b/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl
index e380ce8..30f29a9 100644
--- a/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl
+++ b/radio/aidl/android/hardware/radio/voice/EmergencyNumber.aidl
@@ -37,6 +37,7 @@
* 3gpp 23.167, Section 6 - Functional description;
* 3gpp 24.503, Section 5.1.6.8.1 - General;
* RFC 5031
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/voice/EmergencyServiceCategory.aidl b/radio/aidl/android/hardware/radio/voice/EmergencyServiceCategory.aidl
index a4ac7aa..80f873a 100644
--- a/radio/aidl/android/hardware/radio/voice/EmergencyServiceCategory.aidl
+++ b/radio/aidl/android/hardware/radio/voice/EmergencyServiceCategory.aidl
@@ -31,6 +31,7 @@
* services are associated with this emergency number.
*
* Reference: 3gpp 22.101, Section 10 - Emergency Calls
+ * @hide
*/
@VintfStability
@Backing(type="int")
diff --git a/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl b/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl
index c05d237..0c2b51d 100644
--- a/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl
+++ b/radio/aidl/android/hardware/radio/voice/IRadioVoice.aidl
@@ -30,6 +30,7 @@
* duration of a method call. If clients provide colliding serials (including passing the same
* serial to different methods), multiple responses (one for each method call) must still be served.
* setResponseFunctions must work with IRadioVoiceResponse and IRadioVoiceIndication.
+ * @hide
*/
@VintfStability
oneway interface IRadioVoice {
@@ -40,6 +41,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.acceptCallResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void acceptCall(in int serial);
@@ -49,6 +52,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.cancelPendingUssdResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void cancelPendingUssd(in int serial);
@@ -58,6 +63,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.conferenceResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void conference(in int serial);
@@ -68,6 +75,8 @@
* @param dialInfo Dial struct
*
* Response function is IRadioVoiceResponse.dialResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void dial(in int serial, in Dial dialInfo);
@@ -124,6 +133,8 @@
* @param isTesting Flag indicating if this request is for testing purpose.
*
* Response function is IRadioVoiceResponse.emergencyDialResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void emergencyDial(in int serial, in Dial dialInfo, in int categories, in String[] urns,
in EmergencyCallRouting routing, in boolean hasKnownUserIntentEmergency,
@@ -136,6 +147,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.exitEmergencyCallbackModeResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void exitEmergencyCallbackMode(in int serial);
@@ -145,6 +158,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.explicitCallTransferResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void explicitCallTransfer(in int serial);
@@ -155,6 +170,8 @@
* @param callInfo CallForwardInfo
*
* Response function is IRadioVoiceResponse.getCallForwardStatusResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getCallForwardStatus(in int serial, in CallForwardInfo callInfo);
@@ -165,6 +182,8 @@
* @param serviceClass Service class is the TS 27.007 service class to query
*
* Response function is IRadioVoiceResponse.getCallWaitingResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getCallWaiting(in int serial, in int serviceClass);
@@ -174,6 +193,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.getClipResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getClip(in int serial);
@@ -183,6 +204,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.getClirResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getClir(in int serial);
@@ -192,6 +215,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.getCurrentCallsResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getCurrentCalls(in int serial);
@@ -201,6 +226,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.getLastCallFailCauseResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getLastCallFailCause(in int serial);
@@ -210,6 +237,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.getMuteResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getMute(in int serial);
@@ -219,6 +248,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.getPreferredVoicePrivacyResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getPreferredVoicePrivacy(in int serial);
@@ -228,6 +259,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.getTtyModeResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void getTtyMode(in int serial);
@@ -240,6 +273,8 @@
* @param accept true = accept the call setup, false = reject the call setup
*
* Response function is IRadioVoiceResponse.handleStkCallSetupRequestFromSimResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void handleStkCallSetupRequestFromSim(in int serial, in boolean accept);
@@ -251,6 +286,8 @@
* @param gsmIndex Connection index (value of 'x' in CHLD above)
*
* Response function is IRadioVoiceResponse.hangupResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void hangup(in int serial, in int gsmIndex);
@@ -261,6 +298,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.hangupForegroundResumeBackgroundResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void hangupForegroundResumeBackground(in int serial);
@@ -271,6 +310,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.hangupWaitingOrBackgroundResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void hangupWaitingOrBackground(in int serial);
@@ -280,6 +321,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.isVoNrEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void isVoNrEnabled(in int serial);
@@ -289,6 +332,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.rejectCallResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void rejectCall(in int serial);
@@ -296,6 +341,8 @@
* When response type received from a radio indication or radio response is
* RadioIndicationType:UNSOLICITED_ACK_EXP or RadioResponseType:SOLICITED_ACK_EXP respectively,
* acknowledge the receipt of those messages by sending responseAcknowledgement().
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void responseAcknowledgement();
@@ -308,6 +355,8 @@
* @param off is the DTMF OFF length in milliseconds, or 0 to use default
*
* Response function is IRadioVoiceResponse.sendBurstDtmfResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void sendBurstDtmf(in int serial, in String dtmf, in int on, in int off);
@@ -318,6 +367,8 @@
* @param featureCode String associated with Flash command
*
* Response function is IRadioVoiceResponse.sendCdmaFeatureCodeResponse()
+ *
+ * This is available when android.hardware.telephony.cdma is defined.
*/
void sendCdmaFeatureCode(in int serial, in String featureCode);
@@ -329,6 +380,8 @@
* @param s string with single char having one of 12 values: 0-9, *, #
*
* Response function is IRadioVoiceResponse.sendDtmfResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void sendDtmf(in int serial, in String s);
@@ -346,6 +399,8 @@
* @param ussd string containing the USSD request in UTF-8 format
*
* Response function is IRadioVoiceResponse.sendUssdResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void sendUssd(in int serial, in String ussd);
@@ -362,6 +417,8 @@
* @param gsmIndex contains Connection index (value of 'x' in CHLD above)
*
* Response function is IRadioVoiceResponse.separateConnectionResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void separateConnection(in int serial, in int gsmIndex);
@@ -372,6 +429,8 @@
* @param callInfo CallForwardInfo
*
* Response function is IRadioVoiceResponse.setCallForwardResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void setCallForward(in int serial, in CallForwardInfo callInfo);
@@ -383,6 +442,8 @@
* @param serviceClass is the TS 27.007 service class bit vector of services to modify
*
* Response function is IRadioVoiceResponse.setCallWaitingResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void setCallWaiting(in int serial, in boolean enable, in int serviceClass);
@@ -393,6 +454,8 @@
* @param status "n" parameter from TS 27.007 7.7
*
* Response function is IRadioVoiceResponse.setClirResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void setClir(in int serial, in int status);
@@ -404,6 +467,8 @@
* @param enable true for "enable mute" and false for "disable mute"
*
* Response function is IRadioVoiceResponse.setMuteResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void setMute(in int serial, in boolean enable);
@@ -415,6 +480,8 @@
* true for Enhanced Privacy Mode (Private Long Code Mask)
*
* Response function is IRadioVoiceResponse.setPreferredVoicePrivacyResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void setPreferredVoicePrivacy(in int serial, in boolean enable);
@@ -423,6 +490,8 @@
*
* @param radioVoiceResponse Object containing response functions
* @param radioVoiceIndication Object containing radio indications
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void setResponseFunctions(in IRadioVoiceResponse radioVoiceResponse,
in IRadioVoiceIndication radioVoiceIndication);
@@ -434,6 +503,8 @@
* @param mode TtyMode
*
* Response function is IRadioVoiceResponse.setTtyModeResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void setTtyMode(in int serial, in TtyMode mode);
@@ -444,6 +515,8 @@
* @param enable true for "enable vonr" and false for "disable vonr"
*
* Response function is IRadioVoiceResponse.setVoNrEnabledResponse()
+ *
+ * This is available when android.hardware.telephony.ims is defined.
*/
void setVoNrEnabled(in int serial, in boolean enable);
@@ -456,6 +529,8 @@
* @param s string having a single character with one of 12 values: 0-9,*,#
*
* Response function is IRadioVoiceResponse.startDtmfResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void startDtmf(in int serial, in String s);
@@ -465,6 +540,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.stopDtmfResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void stopDtmf(in int serial);
@@ -482,6 +559,8 @@
* @param serial Serial number of request.
*
* Response function is IRadioVoiceResponse.switchWaitingOrHoldingAndActiveResponse()
+ *
+ * This is available when android.hardware.telephony.calling is defined.
*/
void switchWaitingOrHoldingAndActive(in int serial);
}
diff --git a/radio/aidl/android/hardware/radio/voice/IRadioVoiceIndication.aidl b/radio/aidl/android/hardware/radio/voice/IRadioVoiceIndication.aidl
index 437fef6..9de6364 100644
--- a/radio/aidl/android/hardware/radio/voice/IRadioVoiceIndication.aidl
+++ b/radio/aidl/android/hardware/radio/voice/IRadioVoiceIndication.aidl
@@ -28,6 +28,7 @@
/**
* Interface declaring unsolicited radio indications for voice APIs.
+ * @hide
*/
@VintfStability
oneway interface IRadioVoiceIndication {
diff --git a/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl b/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl
index 39e3ace..a904eaa 100644
--- a/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl
+++ b/radio/aidl/android/hardware/radio/voice/IRadioVoiceResponse.aidl
@@ -25,6 +25,7 @@
/**
* Interface declaring response functions to solicited radio requests for voice APIs.
+ * @hide
*/
@VintfStability
oneway interface IRadioVoiceResponse {
@@ -32,6 +33,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_STATE
@@ -60,6 +62,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SIM_BUSY
@@ -80,6 +83,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:NO_MEMORY
@@ -100,6 +104,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:DIAL_MODIFIED_TO_USSD
@@ -128,6 +133,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:DIAL_MODIFIED_TO_USSD
@@ -151,6 +157,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:OPERATION_NO_ALLOWED
@@ -169,6 +176,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -195,6 +203,7 @@
* CallForwardInfo must be returned with the service class set to "data + voice = 3".
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -222,6 +231,7 @@
* for data and voice and disabled for everything else.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -244,6 +254,7 @@
* @param status indicates CLIP status
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -263,6 +274,7 @@
* @param m is "m" parameter from TS 27.007 7.7
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -284,6 +296,7 @@
* @param calls Current call list
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NO_MEMORY
* RadioError:INTERNAL_ERR
* RadioError:SYSTEM_ERR
@@ -326,6 +339,7 @@
* for tone generation or error notification.
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:NO_MEMORY
* RadioError:RADIO_NOT_AVAILABLE
@@ -345,6 +359,7 @@
* @param enable true for "mute enabled" and false for "mute disabled"
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -366,6 +381,7 @@
* true for Enhanced Privacy Mode (Private Long Code Mask)
*
* Valid errors:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -383,6 +399,7 @@
* @param mode TtyMode
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -399,6 +416,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:NO_MEMORY
@@ -416,6 +434,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:INVALID_ARGUMENTS
@@ -433,6 +452,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:INVALID_STATE
@@ -453,6 +473,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:INVALID_STATE
@@ -473,6 +494,7 @@
* @param enable true for "vonr enabled" and false for "vonr disabled"
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.ims is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:MODEM_ERR
@@ -485,6 +507,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:INVALID_STATE
@@ -506,6 +529,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -526,6 +550,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.cdma is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -546,6 +571,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -564,6 +590,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:FDN_CHECK_FAILURE
@@ -589,6 +616,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -609,6 +637,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -631,6 +660,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:SS_MODIFIED_TO_DIAL
@@ -653,6 +683,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:INVALID_ARGUMENTS
* RadioError:RADIO_NOT_AVAILABLE
@@ -671,6 +702,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -687,6 +719,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -704,6 +737,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -720,6 +754,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -733,6 +768,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -752,6 +788,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE
* RadioError:INVALID_ARGUMENTS
@@ -771,6 +808,7 @@
* @param info Response info struct containing response type, serial no. and error
*
* Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony.calling is not defined
* RadioError:NONE
* RadioError:RADIO_NOT_AVAILABLE (radio resetting)
* RadioError:INVALID_STATE
diff --git a/radio/aidl/android/hardware/radio/voice/LastCallFailCause.aidl b/radio/aidl/android/hardware/radio/voice/LastCallFailCause.aidl
index 5c8c819..9a38197 100644
--- a/radio/aidl/android/hardware/radio/voice/LastCallFailCause.aidl
+++ b/radio/aidl/android/hardware/radio/voice/LastCallFailCause.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.voice;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/voice/LastCallFailCauseInfo.aidl b/radio/aidl/android/hardware/radio/voice/LastCallFailCauseInfo.aidl
index 078722a..4ed17d2 100644
--- a/radio/aidl/android/hardware/radio/voice/LastCallFailCauseInfo.aidl
+++ b/radio/aidl/android/hardware/radio/voice/LastCallFailCauseInfo.aidl
@@ -18,6 +18,7 @@
import android.hardware.radio.voice.LastCallFailCause;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable LastCallFailCauseInfo {
diff --git a/radio/aidl/android/hardware/radio/voice/SrvccState.aidl b/radio/aidl/android/hardware/radio/voice/SrvccState.aidl
index 08eb877..923518d 100644
--- a/radio/aidl/android/hardware/radio/voice/SrvccState.aidl
+++ b/radio/aidl/android/hardware/radio/voice/SrvccState.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.voice;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/voice/SsInfoData.aidl b/radio/aidl/android/hardware/radio/voice/SsInfoData.aidl
index b944bf4..c965a7d 100644
--- a/radio/aidl/android/hardware/radio/voice/SsInfoData.aidl
+++ b/radio/aidl/android/hardware/radio/voice/SsInfoData.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.voice;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable SsInfoData {
diff --git a/radio/aidl/android/hardware/radio/voice/StkCcUnsolSsResult.aidl b/radio/aidl/android/hardware/radio/voice/StkCcUnsolSsResult.aidl
index 7982275..9fe4024 100644
--- a/radio/aidl/android/hardware/radio/voice/StkCcUnsolSsResult.aidl
+++ b/radio/aidl/android/hardware/radio/voice/StkCcUnsolSsResult.aidl
@@ -20,6 +20,7 @@
import android.hardware.radio.voice.CfData;
import android.hardware.radio.voice.SsInfoData;
+/** @hide */
@VintfStability
@JavaDerive(toString=true)
parcelable StkCcUnsolSsResult {
diff --git a/radio/aidl/android/hardware/radio/voice/TtyMode.aidl b/radio/aidl/android/hardware/radio/voice/TtyMode.aidl
index e8dd723..b9203e1 100644
--- a/radio/aidl/android/hardware/radio/voice/TtyMode.aidl
+++ b/radio/aidl/android/hardware/radio/voice/TtyMode.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.voice;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/voice/UssdModeType.aidl b/radio/aidl/android/hardware/radio/voice/UssdModeType.aidl
index cece4bd..d43462e 100644
--- a/radio/aidl/android/hardware/radio/voice/UssdModeType.aidl
+++ b/radio/aidl/android/hardware/radio/voice/UssdModeType.aidl
@@ -16,6 +16,7 @@
package android.hardware.radio.voice;
+/** @hide */
@VintfStability
@Backing(type="int")
@JavaDerive(toString=true)
diff --git a/radio/aidl/android/hardware/radio/voice/UusInfo.aidl b/radio/aidl/android/hardware/radio/voice/UusInfo.aidl
index 220a8fc..5d499ca 100644
--- a/radio/aidl/android/hardware/radio/voice/UusInfo.aidl
+++ b/radio/aidl/android/hardware/radio/voice/UusInfo.aidl
@@ -18,6 +18,7 @@
/**
* User-to-User Signaling Information defined in 3GPP 23.087 v8.0
+ * @hide
*/
@VintfStability
@JavaDerive(toString=true)
diff --git a/radio/aidl/compat/libradiocompat/Android.bp b/radio/aidl/compat/libradiocompat/Android.bp
index 5cf1378..d78455e 100644
--- a/radio/aidl/compat/libradiocompat/Android.bp
+++ b/radio/aidl/compat/libradiocompat/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -31,20 +32,20 @@
"-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
],
shared_libs: [
- "android.hardware.radio.config-V2-ndk",
+ "android.hardware.radio.config-V3-ndk",
"android.hardware.radio.config@1.0",
"android.hardware.radio.config@1.1",
"android.hardware.radio.config@1.2",
"android.hardware.radio.config@1.3",
- "android.hardware.radio.data-V2-ndk",
- "android.hardware.radio.ims-V1-ndk",
- "android.hardware.radio.ims.media-V1-ndk",
- "android.hardware.radio.messaging-V2-ndk",
- "android.hardware.radio.modem-V2-ndk",
- "android.hardware.radio.network-V2-ndk",
+ "android.hardware.radio.data-V3-ndk",
+ "android.hardware.radio.ims-V2-ndk",
+ "android.hardware.radio.ims.media-V2-ndk",
+ "android.hardware.radio.messaging-V3-ndk",
+ "android.hardware.radio.modem-V3-ndk",
+ "android.hardware.radio.network-V3-ndk",
"android.hardware.radio.sap-V1-ndk",
- "android.hardware.radio.sim-V2-ndk",
- "android.hardware.radio.voice-V2-ndk",
+ "android.hardware.radio.sim-V3-ndk",
+ "android.hardware.radio.voice-V3-ndk",
"android.hardware.radio@1.0",
"android.hardware.radio@1.1",
"android.hardware.radio@1.2",
diff --git a/radio/aidl/compat/libradiocompat/ims/media/RadioImsMediaSession.cpp b/radio/aidl/compat/libradiocompat/ims/media/RadioImsMediaSession.cpp
index ae86914..d509300 100644
--- a/radio/aidl/compat/libradiocompat/ims/media/RadioImsMediaSession.cpp
+++ b/radio/aidl/compat/libradiocompat/ims/media/RadioImsMediaSession.cpp
@@ -60,5 +60,12 @@
LOG(ERROR) << " setMediaQualityThreshold is unsupported by HIDL HALs";
return ok();
}
-
+ScopedAStatus RadioImsMediaSession::requestRtpReceptionStats(int32_t /*in_intervalMs*/) {
+ LOG(ERROR) << " requestRtpReceptionStats is unsupported by HIDL HALs";
+ return ok();
+}
+ScopedAStatus RadioImsMediaSession::adjustDelay(int32_t /*in_delayMs*/) {
+ LOG(ERROR) << " adjustDelay is unsupported by HIDL HALs";
+ return ok();
+}
} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMediaSession.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMediaSession.h
index 00f21fc..715fc77 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMediaSession.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioImsMediaSession.h
@@ -38,6 +38,8 @@
::ndk::ScopedAStatus setMediaQualityThreshold(
const ::aidl::android::hardware::radio::ims::media::MediaQualityThreshold& in_threshold)
override;
+ ::ndk::ScopedAStatus requestRtpReceptionStats(int32_t in_intervalMs) override;
+ ::ndk::ScopedAStatus adjustDelay(int32_t in_delayMs) override;
protected:
public:
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h
index f042456..e6f2516 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioIndication.h
@@ -26,6 +26,7 @@
#include <aidl/android/hardware/radio/sim/IRadioSimIndication.h>
#include <aidl/android/hardware/radio/voice/IRadioVoiceIndication.h>
#include <android/hardware/radio/1.6/IRadioIndication.h>
+#include <aidl/android/hardware/radio/modem/ImeiInfo.h>
namespace android::hardware::radio::compat {
@@ -208,7 +209,8 @@
Return<void> simPhonebookRecordsReceived(
V1_0::RadioIndicationType type, V1_6::PbReceivedStatus status,
const hidl_vec<V1_6::PhonebookRecordInfo>& records) override;
-
+ Return<void> onImeiMappingChanged(V1_0::RadioIndicationType type,
+ ::aidl::android::hardware::radio::modem::ImeiInfo config);
public:
RadioIndication(std::shared_ptr<DriverContext> context);
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h
index d57c83d..56724ae 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioNetwork.h
@@ -107,6 +107,12 @@
::ndk::ScopedAStatus setNullCipherAndIntegrityEnabled(int32_t serial, bool enabled) override;
::ndk::ScopedAStatus isNullCipherAndIntegrityEnabled(int32_t serial) override;
+ ::ndk::ScopedAStatus isCellularIdentifierTransparencyEnabled(int32_t serial) override;
+ ::ndk::ScopedAStatus setCellularIdentifierTransparencyEnabled(int32_t serial,
+ bool enabled) override;
+
+ ::ndk::ScopedAStatus setSecurityAlgorithmsUpdatedEnabled(int32_t serial, bool enabled) override;
+ ::ndk::ScopedAStatus isSecurityAlgorithmsUpdatedEnabled(int32_t serial) override;
protected:
std::shared_ptr<::aidl::android::hardware::radio::network::IRadioNetworkResponse> respond();
diff --git a/radio/aidl/compat/libradiocompat/modem/RadioIndication-modem.cpp b/radio/aidl/compat/libradiocompat/modem/RadioIndication-modem.cpp
index 851c93b..990ccff 100644
--- a/radio/aidl/compat/libradiocompat/modem/RadioIndication-modem.cpp
+++ b/radio/aidl/compat/libradiocompat/modem/RadioIndication-modem.cpp
@@ -68,4 +68,11 @@
return {};
}
+Return<void> RadioIndication::onImeiMappingChanged(V1_0::RadioIndicationType type,
+ ::aidl::android::hardware::radio::modem::ImeiInfo imeiInfo) {
+ LOG_CALL << type;
+ modemCb()->onImeiMappingChanged(toAidl(type), imeiInfo);
+ return {};
+}
+
} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp
index a379eec..1e43789 100644
--- a/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp
+++ b/radio/aidl/compat/libradiocompat/network/RadioNetwork.cpp
@@ -372,4 +372,34 @@
respond()->setN1ModeEnabledResponse(notSupported(serial));
return ok();
}
+
+ScopedAStatus RadioNetwork::isCellularIdentifierTransparencyEnabled(int32_t serial) {
+ LOG_CALL << serial;
+ LOG(ERROR) << " isCellularIdentifierTransparencyEnabled is unsupported by HIDL HALs";
+ respond()->isCellularIdentifierTransparencyEnabledResponse(notSupported(serial), false);
+ return ok();
+}
+
+ScopedAStatus RadioNetwork::setCellularIdentifierTransparencyEnabled(int32_t serial,
+ bool /*enabled*/) {
+ LOG_CALL << serial;
+ LOG(ERROR) << " setCellularIdentifierTransparencyEnabled is unsupported by HIDL HALs";
+ respond()->setCellularIdentifierTransparencyEnabledResponse(notSupported(serial));
+ return ok();
+}
+
+ScopedAStatus RadioNetwork::isSecurityAlgorithmsUpdatedEnabled(int32_t serial) {
+ LOG_CALL << serial;
+ LOG(ERROR) << " isSecurityAlgorithmsUpdatedEnabled is unsupported by HIDL HALs";
+ respond()->isSecurityAlgorithmsUpdatedEnabledResponse(notSupported(serial), false);
+ return ok();
+}
+
+ScopedAStatus RadioNetwork::setSecurityAlgorithmsUpdatedEnabled(int32_t serial, bool /*enable*/) {
+ LOG_CALL << serial;
+ LOG(ERROR) << " setSecurityAlgorithmsUpdatedEnabled is unsupported by HIDL HALs";
+ respond()->setSecurityAlgorithmsUpdatedEnabledResponse(notSupported(serial));
+ return ok();
+}
+
} // namespace android::hardware::radio::compat
diff --git a/radio/aidl/compat/service/Android.bp b/radio/aidl/compat/service/Android.bp
index dff0182..c8bbd4c 100644
--- a/radio/aidl/compat/service/Android.bp
+++ b/radio/aidl/compat/service/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -34,20 +35,20 @@
],
shared_libs: [
"android.hardware.radio-library.compat",
- "android.hardware.radio.config-V2-ndk",
+ "android.hardware.radio.config-V3-ndk",
"android.hardware.radio.config@1.0",
"android.hardware.radio.config@1.1",
"android.hardware.radio.config@1.2",
"android.hardware.radio.config@1.3",
- "android.hardware.radio.data-V2-ndk",
- "android.hardware.radio.ims-V1-ndk",
- "android.hardware.radio.ims.media-V1-ndk",
- "android.hardware.radio.messaging-V2-ndk",
- "android.hardware.radio.modem-V2-ndk",
- "android.hardware.radio.network-V2-ndk",
+ "android.hardware.radio.data-V3-ndk",
+ "android.hardware.radio.ims-V2-ndk",
+ "android.hardware.radio.ims.media-V2-ndk",
+ "android.hardware.radio.messaging-V3-ndk",
+ "android.hardware.radio.modem-V3-ndk",
+ "android.hardware.radio.network-V3-ndk",
"android.hardware.radio.sap-V1-ndk",
- "android.hardware.radio.sim-V2-ndk",
- "android.hardware.radio.voice-V2-ndk",
+ "android.hardware.radio.sim-V3-ndk",
+ "android.hardware.radio.voice-V3-ndk",
"android.hardware.radio@1.0",
"android.hardware.radio@1.1",
"android.hardware.radio@1.2",
diff --git a/radio/aidl/vts/Android.bp b/radio/aidl/vts/Android.bp
index e79d3c0..e83a7c1 100644
--- a/radio/aidl/vts/Android.bp
+++ b/radio/aidl/vts/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_telephony",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -66,22 +67,27 @@
"radio_voice_test.cpp",
"VtsHalRadioTargetTest.cpp",
],
+ header_libs: [
+ "jni_headers",
+ ],
shared_libs: [
"libbinder_ndk",
"libvintf",
+ "server_configurable_flags",
],
static_libs: [
- "android.hardware.radio-V2-ndk",
- "android.hardware.radio.config-V2-ndk",
- "android.hardware.radio.data-V2-ndk",
- "android.hardware.radio.ims-V1-ndk",
- "android.hardware.radio.ims.media-V1-ndk",
- "android.hardware.radio.messaging-V2-ndk",
- "android.hardware.radio.modem-V2-ndk",
- "android.hardware.radio.network-V2-ndk",
+ "android.hardware.radio-V3-ndk",
+ "android.hardware.radio.config-V3-ndk",
+ "android.hardware.radio.data-V3-ndk",
+ "android.hardware.radio.ims-V2-ndk",
+ "android.hardware.radio.ims.media-V2-ndk",
+ "android.hardware.radio.messaging-V3-ndk",
+ "android.hardware.radio.modem-V3-ndk",
+ "android.hardware.radio.network-V3-ndk",
"android.hardware.radio.sap-V1-ndk",
- "android.hardware.radio.sim-V2-ndk",
- "android.hardware.radio.voice-V2-ndk",
+ "android.hardware.radio.sim-V3-ndk",
+ "android.hardware.radio.voice-V3-ndk",
+ "telephony_flags_c_lib",
],
test_suites: [
"general-tests",
diff --git a/radio/aidl/vts/radio_aidl_hal_utils.h b/radio/aidl/vts/radio_aidl_hal_utils.h
index d8aa024..aea5cee 100644
--- a/radio/aidl/vts/radio_aidl_hal_utils.h
+++ b/radio/aidl/vts/radio_aidl_hal_utils.h
@@ -24,6 +24,7 @@
#include <aidl/android/hardware/radio/network/RegState.h>
#include <aidl/android/hardware/radio/sim/CardStatus.h>
#include <aidl/android/hardware/radio/sim/IRadioSim.h>
+#include <com_android_internal_telephony_flags.h>
#include <utils/Log.h>
using namespace aidl::android::hardware::radio;
@@ -31,6 +32,8 @@
using aidl::android::hardware::radio::network::RegState;
using aidl::android::hardware::radio::sim::CardStatus;
+namespace telephony_flags = com::android::internal::telephony::flags;
+
extern CardStatus cardStatus;
extern SimSlotStatus slotStatus;
extern int serial;
@@ -68,6 +71,18 @@
static constexpr const char* FEATURE_TELEPHONY_IMS = "android.hardware.telephony.ims";
+static constexpr const char* FEATURE_TELEPHONY_CALLING = "android.hardware.telephony.calling";
+
+static constexpr const char* FEATURE_TELEPHONY_DATA = "android.hardware.telephony.data";
+
+static constexpr const char* FEATURE_TELEPHONY_MESSAGING = "android.hardware.telephony.messaging";
+
+static constexpr const char* FEATURE_TELEPHONY_SUBSCRIPTION =
+ "android.hardware.telephony.subscription";
+
+static constexpr const char* FEATURE_TELEPHONY_RADIO_ACCESS =
+ "android.hardware.telephony.radio.access";
+
#define MODEM_EMERGENCY_CALL_ESTABLISH_TIME 3
#define MODEM_EMERGENCY_CALL_DISCONNECT_TIME 3
#define MODEM_SET_SIM_POWER_DELAY_IN_SECONDS 2
diff --git a/radio/aidl/vts/radio_config_test.cpp b/radio/aidl/vts/radio_config_test.cpp
index aed3b05..d8c0142 100644
--- a/radio/aidl/vts/radio_config_test.cpp
+++ b/radio/aidl/vts/radio_config_test.cpp
@@ -54,6 +54,13 @@
* Test IRadioConfig.getHalDeviceCapabilities() for the response returned.
*/
TEST_P(RadioConfigTest, getHalDeviceCapabilities) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping getHalDeviceCapabilities "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_config->getHalDeviceCapabilities(serial);
ASSERT_OK(res);
@@ -66,6 +73,13 @@
* Test IRadioConfig.getSimSlotsStatus() for the response returned.
*/
TEST_P(RadioConfigTest, getSimSlotsStatus) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping getSimSlotsStatus "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_config->getSimSlotsStatus(serial);
ASSERT_OK(res);
@@ -78,6 +92,13 @@
* Test IRadioConfig.getPhoneCapability() for the response returned.
*/
TEST_P(RadioConfigTest, getPhoneCapability) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping getPhoneCapability "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_config->getPhoneCapability(serial);
ASSERT_OK(res);
@@ -104,6 +125,13 @@
* Test IRadioConfig.setPreferredDataModem() for the response returned.
*/
TEST_P(RadioConfigTest, setPreferredDataModem) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping setPreferredDataModem "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_config->getPhoneCapability(serial);
ASSERT_OK(res);
@@ -146,6 +174,13 @@
* Test IRadioConfig.setPreferredDataModem() with invalid arguments.
*/
TEST_P(RadioConfigTest, setPreferredDataModem_invalidArgument) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping setPreferredDataModem_invalidArgument "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
uint8_t modemId = -1;
ndk::ScopedAStatus res = radio_config->setPreferredDataModem(serial, modemId);
@@ -166,6 +201,13 @@
* Test IRadioConfig.setSimSlotsMapping() for the response returned.
*/
TEST_P(RadioConfigTest, setSimSlotsMapping) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping setSimSlotsMapping "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
// get slot status and set SIM slots mapping based on the result.
updateSimSlotStatus();
if (radioRsp_config->rspInfo.error == RadioError::NONE) {
@@ -227,6 +269,13 @@
*/
TEST_P(RadioConfigTest, checkPortInfoExistsAndPortActive) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping checkPortInfoExistsAndPortActive "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_config->getSimSlotsStatus(serial);
ASSERT_OK(res);
diff --git a/radio/aidl/vts/radio_data_test.cpp b/radio/aidl/vts/radio_data_test.cpp
index f31c254..2aa5508 100644
--- a/radio/aidl/vts/radio_data_test.cpp
+++ b/radio/aidl/vts/radio_data_test.cpp
@@ -68,6 +68,12 @@
* Test IRadioData.setupDataCall() for the response returned.
*/
TEST_P(RadioDataTest, setupDataCall) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "setupDataCall : required FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
AccessNetwork accessNetwork = AccessNetwork::EUTRAN;
@@ -135,6 +141,13 @@
* Test IRadioData.setupDataCall() with osAppId for the response returned.
*/
TEST_P(RadioDataTest, setupDataCall_osAppId) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping setupDataCall_osAppId "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
AccessNetwork accessNetwork = AccessNetwork::EUTRAN;
@@ -227,6 +240,13 @@
* Test IRadioData.getSlicingConfig() for the response returned.
*/
TEST_P(RadioDataTest, getSlicingConfig) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping getSlicingConfig "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_data->getSlicingConfig(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -242,6 +262,13 @@
* Test IRadioData.setDataThrottling() for the response returned.
*/
TEST_P(RadioDataTest, setDataThrottling) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping setDataThrottling "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_data->setDataThrottling(
@@ -320,6 +347,13 @@
* Test IRadioData.setInitialAttachApn() for the response returned.
*/
TEST_P(RadioDataTest, setInitialAttachApn) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping setInitialAttachApn "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Create a dataProfileInfo
@@ -363,6 +397,13 @@
* Test IRadioData.setDataProfile() for the response returned.
*/
TEST_P(RadioDataTest, setDataProfile) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping setDataProfile "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Create a dataProfileInfo
@@ -409,6 +450,13 @@
* Test IRadioData.deactivateDataCall() for the response returned.
*/
TEST_P(RadioDataTest, deactivateDataCall) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping deactivateDataCall "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
int cid = 1;
DataRequestReason reason = DataRequestReason::NORMAL;
@@ -440,6 +488,13 @@
* Test IRadioData.startKeepalive() for the response returned.
*/
TEST_P(RadioDataTest, startKeepalive) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping startKeepalive "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
std::vector<KeepaliveRequest> requests = {
{
// Invalid IPv4 source address
@@ -538,6 +593,13 @@
* Test IRadioData.stopKeepalive() for the response returned.
*/
TEST_P(RadioDataTest, stopKeepalive) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping stopKeepalive "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_data->stopKeepalive(serial, 0xBAD);
@@ -554,6 +616,13 @@
* Test IRadioData.getDataCallList() for the response returned.
*/
TEST_P(RadioDataTest, getDataCallList) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping getDataCallList "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_data->getDataCallList(serial);
@@ -573,6 +642,13 @@
* Test IRadioData.setDataAllowed() for the response returned.
*/
TEST_P(RadioDataTest, setDataAllowed) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_DATA)) {
+ GTEST_SKIP() << "Skipping setDataAllowed "
+ "due to undefined FEATURE_TELEPHONY_DATA";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool allow = true;
diff --git a/radio/aidl/vts/radio_imsmedia_session_listener.cpp b/radio/aidl/vts/radio_imsmedia_session_listener.cpp
index 986cab2..638a0e4 100644
--- a/radio/aidl/vts/radio_imsmedia_session_listener.cpp
+++ b/radio/aidl/vts/radio_imsmedia_session_listener.cpp
@@ -49,3 +49,7 @@
const CallQuality& /*in_callQuality*/) {
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus ImsMediaSessionListener::notifyRtpReceptionStats(
+ const RtpReceptionStats& /*in_stats*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_imsmedia_test.cpp b/radio/aidl/vts/radio_imsmedia_test.cpp
index 425f6b4..e479e64 100644
--- a/radio/aidl/vts/radio_imsmedia_test.cpp
+++ b/radio/aidl/vts/radio_imsmedia_test.cpp
@@ -260,6 +260,59 @@
return result;
}
+TEST_P(RadioImsMediaTest, testAvSyncOperation) {
+ int32_t sessionId = 1;
+ RtpConfig modifyRtpConfig;
+ int32_t receptionInterval = 1000;
+ int32_t delay = 200;
+
+ modifyRtpConfig.direction = static_cast<int32_t>(MediaDirection::RTP_TX) |
+ static_cast<int32_t>(MediaDirection::RTP_RX) |
+ static_cast<int32_t>(MediaDirection::RTCP_TX) |
+ static_cast<int32_t>(MediaDirection::RTCP_RX);
+ modifyRtpConfig.remoteAddress.ipAddress = "122.22.22.33";
+ modifyRtpConfig.remoteAddress.portNumber = 1234;
+
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) {
+ ALOGI("Skipping setListener because ims is not supported in device");
+ return;
+ } else {
+ ALOGI("Running setListener because ims is supported in device");
+ }
+
+ ndk::ScopedAStatus res = radio_imsmedia->setListener(radio_imsmedialistener);
+ ASSERT_OK(res);
+
+ serial = SERIAL_OPEN_SESSION;
+ res = triggerOpenSession(sessionId);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(sessionId, radio_imsmedialistener->mSessionId);
+ ASSERT_NE(nullptr, radio_imsmedialistener->mSession);
+
+ radio_imsmediasession = radio_imsmedialistener->mSession;
+ radio_imsmediasession->setListener(radio_imsmediasessionlistener);
+ ASSERT_OK(res);
+
+ serial = SERIAL_MODIFY_SESSION;
+ res = radio_imsmediasession->modifySession(modifyRtpConfig);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(modifyRtpConfig, radio_imsmediasessionlistener->mConfig);
+ verifyError(radio_imsmediasessionlistener->mError);
+
+ res = radio_imsmediasession->requestRtpReceptionStats(receptionInterval);
+ ASSERT_OK(res);
+
+ res = radio_imsmediasession->adjustDelay(delay);
+ ASSERT_OK(res);
+
+ serial = SERIAL_CLOSE_SESSION;
+ res = radio_imsmedia->closeSession(sessionId);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+}
+
void RadioImsMediaTest::verifyError(RtpError error) {
switch (error) {
case RtpError::NONE:
diff --git a/radio/aidl/vts/radio_imsmedia_utils.h b/radio/aidl/vts/radio_imsmedia_utils.h
index 87f1b00..407ba95 100644
--- a/radio/aidl/vts/radio_imsmedia_utils.h
+++ b/radio/aidl/vts/radio_imsmedia_utils.h
@@ -76,6 +76,7 @@
virtual ndk::ScopedAStatus onDtmfReceived(char16_t in_dtmfDigit,
int32_t in_durationMs) override;
virtual ndk::ScopedAStatus onCallQualityChanged(const CallQuality& in_callQuality) override;
+ virtual ndk::ScopedAStatus notifyRtpReceptionStats(const RtpReceptionStats& in_stats) override;
};
/* The main test class for Radio AIDL ImsMedia. */
diff --git a/radio/aidl/vts/radio_messaging_test.cpp b/radio/aidl/vts/radio_messaging_test.cpp
index 4ab88d2..95e2617 100644
--- a/radio/aidl/vts/radio_messaging_test.cpp
+++ b/radio/aidl/vts/radio_messaging_test.cpp
@@ -59,6 +59,13 @@
* Test IRadioMessaging.sendSms() for the response returned.
*/
TEST_P(RadioMessagingTest, sendSms) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping sendSms "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
GsmSmsMessage msg;
msg.smscPdu = "";
@@ -83,6 +90,13 @@
* Test IRadioMessaging.sendSmsExpectMore() for the response returned.
*/
TEST_P(RadioMessagingTest, sendSmsExpectMore) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping sendSmsExpectMore "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
GsmSmsMessage msg;
msg.smscPdu = "";
@@ -106,6 +120,13 @@
* Test IRadioMessaging.sendCdmaSms() for the response returned.
*/
TEST_P(RadioMessagingTest, sendCdmaSms) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping sendCdmaSms "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Create a CdmaSmsAddress
@@ -150,6 +171,13 @@
* Test IRadioMessaging.sendCdmaSmsExpectMore() for the response returned.
*/
TEST_P(RadioMessagingTest, sendCdmaSmsExpectMore) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping sendCdmaSmsExpectMore "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Create a CdmaSmsAddress
@@ -194,6 +222,13 @@
* Test IRadioMessaging.setGsmBroadcastConfig() for the response returned.
*/
TEST_P(RadioMessagingTest, setGsmBroadcastConfig) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping setGsmBroadcastConfig "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Create GsmBroadcastSmsConfigInfo #1
@@ -257,6 +292,13 @@
* Test IRadioMessaging.getGsmBroadcastConfig() for the response returned.
*/
TEST_P(RadioMessagingTest, getGsmBroadcastConfig) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping getGsmBroadcastConfig "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_messaging->getGsmBroadcastConfig(serial);
@@ -277,6 +319,13 @@
* Test IRadioMessaging.setCdmaBroadcastConfig() for the response returned.
*/
TEST_P(RadioMessagingTest, setCdmaBroadcastConfig) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping setCdmaBroadcastConfig "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
CdmaBroadcastSmsConfigInfo cbSmsConfig;
@@ -303,6 +352,13 @@
* Test IRadioMessaging.getCdmaBroadcastConfig() for the response returned.
*/
TEST_P(RadioMessagingTest, getCdmaBroadcastConfig) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping getCdmaBroadcastConfig "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_messaging->getCdmaBroadcastConfig(serial);
@@ -321,6 +377,13 @@
* Test IRadioMessaging.setCdmaBroadcastActivation() for the response returned.
*/
TEST_P(RadioMessagingTest, setCdmaBroadcastActivation) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping setCdmaBroadcastActivation "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool activate = false;
@@ -341,6 +404,13 @@
* Test IRadioMessaging.setGsmBroadcastActivation() for the response returned.
*/
TEST_P(RadioMessagingTest, setGsmBroadcastActivation) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping setGsmBroadcastActivation "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool activate = false;
@@ -363,6 +433,13 @@
* Test IRadioMessaging.acknowledgeLastIncomingGsmSms() for the response returned.
*/
TEST_P(RadioMessagingTest, acknowledgeLastIncomingGsmSms) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping acknowledgeLastIncomingGsmSms "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool success = true;
@@ -384,6 +461,13 @@
* Test IRadioMessaging.acknowledgeIncomingGsmSmsWithPdu() for the response returned.
*/
TEST_P(RadioMessagingTest, acknowledgeIncomingGsmSmsWithPdu) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping acknowledgeIncomingGsmSmsWithPdu "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool success = true;
std::string ackPdu = "";
@@ -405,6 +489,13 @@
* Test IRadioMessaging.acknowledgeLastIncomingCdmaSms() for the response returned.
*/
TEST_P(RadioMessagingTest, acknowledgeLastIncomingCdmaSms) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping acknowledgeIncomingGsmSmsWithPdu "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Create a CdmaSmsAck
@@ -429,6 +520,13 @@
* Test IRadioMessaging.sendImsSms() for the response returned.
*/
TEST_P(RadioMessagingTest, sendImsSms) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) {
+ GTEST_SKIP() << "Skipping acknowledgeIncomingGsmSmsWithPdu "
+ "due to undefined FEATURE_TELEPHONY_IMS";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Create a CdmaSmsAddress
@@ -479,6 +577,13 @@
* Test IRadioMessaging.getSmscAddress() for the response returned.
*/
TEST_P(RadioMessagingTest, getSmscAddress) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping getSmscAddress "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_messaging->getSmscAddress(serial);
@@ -499,6 +604,13 @@
* Test IRadioMessaging.setSmscAddress() for the response returned.
*/
TEST_P(RadioMessagingTest, setSmscAddress) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping setSmscAddress "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
std::string address = std::string("smscAddress");
@@ -520,6 +632,13 @@
* Test IRadioMessaging.writeSmsToSim() for the response returned.
*/
TEST_P(RadioMessagingTest, writeSmsToSim) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping writeSmsToSim "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
SmsWriteArgs smsWriteArgs;
smsWriteArgs.status = SmsWriteArgs::STATUS_REC_UNREAD;
@@ -546,6 +665,13 @@
* Test IRadioMessaging.deleteSmsOnSim() for the response returned.
*/
TEST_P(RadioMessagingTest, deleteSmsOnSim) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping deleteSmsOnSim "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
int index = 1;
@@ -569,6 +695,13 @@
* Test IRadioMessaging.writeSmsToRuim() for the response returned.
*/
TEST_P(RadioMessagingTest, writeSmsToRuim) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping writeSmsToRuim "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Create a CdmaSmsAddress
@@ -620,6 +753,13 @@
* Test IRadioMessaging.deleteSmsOnRuim() for the response returned.
*/
TEST_P(RadioMessagingTest, deleteSmsOnRuim) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping deleteSmsOnRuim "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
int index = 1;
@@ -671,6 +811,13 @@
* Test IRadioMessaging.reportSmsMemoryStatus() for the response returned.
*/
TEST_P(RadioMessagingTest, reportSmsMemoryStatus) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_MESSAGING)) {
+ GTEST_SKIP() << "Skipping reportSmsMemoryStatus "
+ "due to undefined FEATURE_TELEPHONY_MESSAGING";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool available = true;
diff --git a/radio/aidl/vts/radio_modem_indication.cpp b/radio/aidl/vts/radio_modem_indication.cpp
index 0bfcd66..9f63cb0 100644
--- a/radio/aidl/vts/radio_modem_indication.cpp
+++ b/radio/aidl/vts/radio_modem_indication.cpp
@@ -41,3 +41,8 @@
ndk::ScopedAStatus RadioModemIndication::rilConnected(RadioIndicationType /*type*/) {
return ndk::ScopedAStatus::ok();
}
+
+ndk::ScopedAStatus RadioModemIndication::onImeiMappingChanged(RadioIndicationType /*type*/,
+ const ::aidl::android::hardware::radio::modem::ImeiInfo& /*imeiInfo*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_modem_test.cpp b/radio/aidl/vts/radio_modem_test.cpp
index c48a461..6a9996b 100644
--- a/radio/aidl/vts/radio_modem_test.cpp
+++ b/radio/aidl/vts/radio_modem_test.cpp
@@ -59,6 +59,13 @@
* Test IRadioModem.setRadioPower() for the response returned.
*/
TEST_P(RadioModemTest, setRadioPower_emergencyCall_cancelled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setRadioPower_emergencyCall_cancelled "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
// Set radio power to off.
serial = GetRandomSerialNumber();
radio_modem->setRadioPower(serial, false, false, false);
@@ -90,6 +97,13 @@
* Test IRadioModem.enableModem() for the response returned.
*/
TEST_P(RadioModemTest, enableModem) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping enableModem "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
if (isSsSsEnabled()) {
@@ -134,6 +148,13 @@
* Test IRadioModem.getModemStackStatus() for the response returned.
*/
TEST_P(RadioModemTest, getModemStackStatus) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping getModemStackStatus "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_modem->getModemStackStatus(serial);
@@ -152,6 +173,13 @@
* Test IRadioModem.getBasebandVersion() for the response returned.
*/
TEST_P(RadioModemTest, getBasebandVersion) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping getBasebandVersion "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_modem->getBasebandVersion(serial);
@@ -168,6 +196,13 @@
* Test IRadioModem.getDeviceIdentity() for the response returned.
*/
TEST_P(RadioModemTest, getDeviceIdentity) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping getDeviceIdentity "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_modem->getDeviceIdentity(serial);
@@ -185,6 +220,13 @@
* Test IRadioModem.getImei() for the response returned.
*/
TEST_P(RadioModemTest, getImei) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM)) {
+ GTEST_SKIP() << "Skipping getImei "
+ "due to undefined FEATURE_TELEPHONY_GSM";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_modem->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -246,6 +288,13 @@
* Test IRadioModem.nvWriteCdmaPrl() for the response returned.
*/
TEST_P(RadioModemTest, nvWriteCdmaPrl) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping nvWriteCdmaPrl "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
std::vector<uint8_t> prl = {1, 2, 3, 4, 5};
@@ -283,6 +332,13 @@
* Test IRadioModem.getHardwareConfig() for the response returned.
*/
TEST_P(RadioModemTest, getHardwareConfig) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping getHardwareConfig "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_modem->getHardwareConfig(serial);
@@ -302,6 +358,13 @@
* Test IRadioModem.requestShutdown() for the response returned.
*/
TEST_P(RadioModemTest, DISABLED_requestShutdown) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping DISABLED_requestShutdown "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_modem->requestShutdown(serial);
@@ -319,6 +382,13 @@
* Test IRadioModem.getRadioCapability() for the response returned.
*/
TEST_P(RadioModemTest, getRadioCapability) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getRadioCapability "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_modem->getRadioCapability(serial);
@@ -335,6 +405,13 @@
* Test IRadioModem.setRadioCapability() for the response returned.
*/
TEST_P(RadioModemTest, setRadioCapability) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setRadioCapability "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
RadioCapability rc;
memset(&rc, 0, sizeof(rc));
@@ -356,6 +433,13 @@
* Test IRadioModem.getModemActivityInfo() for the response returned.
*/
TEST_P(RadioModemTest, getModemActivityInfo) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getModemActivityInfo "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_modem->getModemActivityInfo(serial);
@@ -373,6 +457,13 @@
* Test IRadioModem.sendDeviceState() for the response returned.
*/
TEST_P(RadioModemTest, sendDeviceState) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping sendDeviceState "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_modem->sendDeviceState(serial, DeviceStateType::POWER_SAVE_MODE, true);
diff --git a/radio/aidl/vts/radio_modem_utils.h b/radio/aidl/vts/radio_modem_utils.h
index d47bdeb..aa99ea3 100644
--- a/radio/aidl/vts/radio_modem_utils.h
+++ b/radio/aidl/vts/radio_modem_utils.h
@@ -109,6 +109,9 @@
RadioState radioState) override;
virtual ndk::ScopedAStatus rilConnected(RadioIndicationType type) override;
+
+ virtual ndk::ScopedAStatus onImeiMappingChanged(RadioIndicationType type,
+ const ::aidl::android::hardware::radio::modem::ImeiInfo& imeiInfo) override;
};
// The main test class for Radio AIDL Modem.
diff --git a/radio/aidl/vts/radio_network_indication.cpp b/radio/aidl/vts/radio_network_indication.cpp
index ae3bd4b..9614783 100644
--- a/radio/aidl/vts/radio_network_indication.cpp
+++ b/radio/aidl/vts/radio_network_indication.cpp
@@ -97,3 +97,14 @@
RadioIndicationType /*type*/, const EmergencyRegResult& /*result*/) {
return ndk::ScopedAStatus::ok();
}
+
+ndk::ScopedAStatus RadioNetworkIndication::cellularIdentifierDisclosed(
+ RadioIndicationType /*type*/,
+ const CellularIdentifierDisclosure& /*disclosures*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkIndication::securityAlgorithmsUpdated(
+ RadioIndicationType /*type*/, const SecurityAlgorithmUpdate& /*securityAlgorithmUpdate*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_network_response.cpp b/radio/aidl/vts/radio_network_response.cpp
index 25d45a5..4d452d0 100644
--- a/radio/aidl/vts/radio_network_response.cpp
+++ b/radio/aidl/vts/radio_network_response.cpp
@@ -320,3 +320,33 @@
parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
+
+ndk::ScopedAStatus RadioNetworkResponse::setCellularIdentifierTransparencyEnabledResponse(
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::isCellularIdentifierTransparencyEnabledResponse(
+ const RadioResponseInfo& info, bool enabled) {
+ rspInfo = info;
+ this->isCellularIdentifierTransparencyEnabled = enabled;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::setSecurityAlgorithmsUpdatedEnabledResponse(
+ const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RadioNetworkResponse::isSecurityAlgorithmsUpdatedEnabledResponse(
+ const RadioResponseInfo& info, bool enabled) {
+ rspInfo = info;
+ this->isSecurityAlgorithmsUpdatedEnabled = enabled;
+ parent_network.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp
index 0cb8ba7..867be04 100644
--- a/radio/aidl/vts/radio_network_test.cpp
+++ b/radio/aidl/vts/radio_network_test.cpp
@@ -81,8 +81,20 @@
* for the response returned.
*/
TEST_P(RadioNetworkTest, setGetAllowedNetworkTypesBitmap) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setGetAllowedNetworkTypesBitmap "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
+ // get aidl version
+ int32_t aidl_version;
+ ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
+ ASSERT_OK(aidl_status);
+
// save current value
radio_network->getAllowedNetworkTypesBitmap(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -118,6 +130,11 @@
RadioError::INVALID_ARGUMENTS, RadioError::MODEM_ERR,
RadioError::REQUEST_NOT_SUPPORTED, RadioError::NO_RESOURCES}));
if (radioRsp_network->rspInfo.error == RadioError::NONE) {
+ if (aidl_version < 2) {
+ radioRsp_network->networkTypeBitmapResponse
+ &= ~static_cast<int32_t>(RadioAccessFamily::LTE_CA);
+ }
+
// verify we get the value we set
EXPECT_EQ(radioRsp_network->networkTypeBitmapResponse, allowedNetworkTypesBitmap);
}
@@ -133,6 +150,13 @@
* Test IRadioNetwork.setNrDualConnectivityState() for the response returned.
*/
TEST_P(RadioNetworkTest, setNrDualConnectivityState) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setNrDualConnectivityState "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res =
@@ -157,6 +181,13 @@
* Test IRadioNetwork.isNrDualConnectivityEnabled() for the response returned.
*/
TEST_P(RadioNetworkTest, isNrDualConnectivityEnabled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping isNrDualConnectivityEnabled "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->isNrDualConnectivityEnabled(serial);
@@ -195,6 +226,13 @@
* Verify that the usage setting can be retrieved.
*/
TEST_P(RadioNetworkTest, getUsageSetting) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping getUsageSetting "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
invokeAndExpectResponse([&](int serial) { return radio_network->getUsageSetting(serial); },
{RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_STATE,
RadioError::SIM_ABSENT, RadioError::INTERNAL_ERR, RadioError::NONE});
@@ -232,6 +270,13 @@
* -That the usage setting cannot be set to invalid values.
*/
TEST_P(RadioNetworkTest, setUsageSetting) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping setUsageSetting "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
invokeAndExpectResponse([&](int serial) { return radio_network->getUsageSetting(serial); },
{RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_STATE,
RadioError::SIM_ABSENT, RadioError::INTERNAL_ERR, RadioError::NONE});
@@ -294,6 +339,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() with invalid hysteresisDb
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_invalidHysteresisDb) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_invalidHysteresisDb "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -320,6 +372,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() with empty thresholds
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_EmptyThresholds) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_EmptyThresholds "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -345,6 +404,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for GERAN
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Geran) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_Geran "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -372,6 +438,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for UTRAN
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Utran_Rscp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_Utran_Rscp "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -398,6 +471,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for UTRAN
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Utran_Ecno) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_Utran_Ecno "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -425,6 +505,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Eutran_RSRP) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_Eutran_RSRP "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -451,6 +538,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Eutran_RSRQ) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_Eutran_RSRQ "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -477,6 +571,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Eutran_RSSNR) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_Eutran_RSSNR "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -499,6 +600,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for CDMA2000
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Cdma2000) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_Cdma2000 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -525,6 +633,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for NGRAN_SSRSRP
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_NGRAN_SSRSRP) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_NGRAN_SSRSRP "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -555,6 +670,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for NGRAN_SSRSRQ
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_NGRAN_SSRSRQ) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_NGRAN_SSRSRQ "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -585,6 +707,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for EUTRAN
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_Disable_RSSNR) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_Disable_RSSNR "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -607,6 +736,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for NGRAN_SSSINR
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_NGRAN_SSSINR) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_NGRAN_SSSINR "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
SignalThresholdInfo signalThresholdInfo;
@@ -637,6 +773,13 @@
* Test IRadioNetwork.setSignalStrengthReportingCriteria() for multi-RANs per request
*/
TEST_P(RadioNetworkTest, setSignalStrengthReportingCriteria_multiRansPerRequest) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSignalStrengthReportingCriteria_multiRansPerRequest "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
SignalThresholdInfo signalThresholdInfoGeran;
signalThresholdInfoGeran.signalMeasurement = SignalThresholdInfo::SIGNAL_MEASUREMENT_TYPE_RSSI;
signalThresholdInfoGeran.hysteresisMs = 5000;
@@ -720,6 +863,13 @@
* Test IRadioNetwork.setLinkCapacityReportingCriteria() invalid hysteresisDlKbps
*/
TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_invalidHysteresisDlKbps) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setLinkCapacityReportingCriteria_invalidHysteresisDlKbps "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria(
@@ -740,6 +890,13 @@
* Test IRadioNetwork.setLinkCapacityReportingCriteria() invalid hysteresisUlKbps
*/
TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_invalidHysteresisUlKbps) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setLinkCapacityReportingCriteria_invalidHysteresisUlKbps "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria(
@@ -759,6 +916,13 @@
* Test IRadioNetwork.setLinkCapacityReportingCriteria() empty params
*/
TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_emptyParams) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setLinkCapacityReportingCriteria_emptyParams "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria(
@@ -777,6 +941,13 @@
* Test IRadioNetwork.setLinkCapacityReportingCriteria() for GERAN
*/
TEST_P(RadioNetworkTest, setLinkCapacityReportingCriteria_Geran) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setLinkCapacityReportingCriteria_Geran "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->setLinkCapacityReportingCriteria(
@@ -799,6 +970,13 @@
* Test IRadioNetwork.setSystemSelectionChannels() for the response returned.
*/
TEST_P(RadioNetworkTest, setSystemSelectionChannels) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setSystemSelectionChannels "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->getSystemSelectionChannels(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -848,6 +1026,13 @@
* Test IRadioNetwork.startNetworkScan() for the response returned.
*/
TEST_P(RadioNetworkTest, startNetworkScan) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
@@ -890,6 +1075,13 @@
* Test IRadioNetwork.startNetworkScan() with invalid specifier.
*/
TEST_P(RadioNetworkTest, startNetworkScan_InvalidArgument) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_InvalidArgument "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT, .interval = 60};
@@ -915,6 +1107,13 @@
* Test IRadioNetwork.startNetworkScan() with invalid interval (lower boundary).
*/
TEST_P(RadioNetworkTest, startNetworkScan_InvalidInterval1) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_InvalidInterval1 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_PERIODIC,
@@ -944,6 +1143,13 @@
* Test IRadioNetwork.startNetworkScan() with invalid interval (upper boundary).
*/
TEST_P(RadioNetworkTest, startNetworkScan_InvalidInterval2) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_InvalidInterval2 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_PERIODIC,
@@ -973,6 +1179,13 @@
* Test IRadioNetwork.startNetworkScan() with invalid max search time (lower boundary).
*/
TEST_P(RadioNetworkTest, startNetworkScan_InvalidMaxSearchTime1) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_InvalidMaxSearchTime1 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
@@ -1002,6 +1215,13 @@
* Test IRadioNetwork.startNetworkScan() with invalid max search time (upper boundary).
*/
TEST_P(RadioNetworkTest, startNetworkScan_InvalidMaxSearchTime2) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_InvalidMaxSearchTime2 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
@@ -1031,6 +1251,13 @@
* Test IRadioNetwork.startNetworkScan() with invalid periodicity (lower boundary).
*/
TEST_P(RadioNetworkTest, startNetworkScan_InvalidPeriodicity1) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_InvalidPeriodicity1 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
@@ -1060,6 +1287,13 @@
* Test IRadioNetwork.startNetworkScan() with invalid periodicity (upper boundary).
*/
TEST_P(RadioNetworkTest, startNetworkScan_InvalidPeriodicity2) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_InvalidPeriodicity2 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
@@ -1089,6 +1323,13 @@
* Test IRadioNetwork.startNetworkScan() with valid periodicity
*/
TEST_P(RadioNetworkTest, startNetworkScan_GoodRequest1) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_GoodRequest1 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
@@ -1123,6 +1364,13 @@
* Test IRadioNetwork.startNetworkScan() with valid periodicity and plmns
*/
TEST_P(RadioNetworkTest, startNetworkScan_GoodRequest2) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping startNetworkScan_GoodRequest2 "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
NetworkScanRequest request = {.type = NetworkScanRequest::SCAN_TYPE_ONE_SHOT,
@@ -1158,6 +1406,13 @@
* Test IRadioNetwork.setNetworkSelectionModeManual() for the response returned.
*/
TEST_P(RadioNetworkTest, setNetworkSelectionModeManual) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setNetworkSelectionModeManual "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
// can't camp on nonexistent MCCMNC, so we expect this to fail.
@@ -1179,6 +1434,13 @@
* Test IRadioNetwork.getBarringInfo() for the response returned.
*/
TEST_P(RadioNetworkTest, getBarringInfo) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getBarringInfo "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->getBarringInfo(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -1283,6 +1545,13 @@
* Test IRadioNetwork.getSignalStrength() for the response returned.
*/
TEST_P(RadioNetworkTest, getSignalStrength) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getSignalStrength "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->getSignalStrength(serial);
@@ -1302,6 +1571,13 @@
* Test IRadioNetwork.getCellInfoList() for the response returned.
*/
TEST_P(RadioNetworkTest, getCellInfoList) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getCellInfoList "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->getCellInfoList(serial);
@@ -1320,6 +1596,13 @@
* Test IRadioNetwork.getVoiceRegistrationState() for the response returned.
*/
TEST_P(RadioNetworkTest, getVoiceRegistrationState) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getVoiceRegistrationState "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->getVoiceRegistrationState(serial);
@@ -1338,6 +1621,13 @@
* Test IRadioNetwork.getDataRegistrationState() for the response returned.
*/
TEST_P(RadioNetworkTest, getDataRegistrationState) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getDataRegistrationState "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->getDataRegistrationState(serial);
@@ -1433,6 +1723,13 @@
* Test IRadioNetwork.getAvailableBandModes() for the response returned.
*/
TEST_P(RadioNetworkTest, getAvailableBandModes) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getAvailableBandModes "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = radio_network->getAvailableBandModes(serial);
@@ -1462,6 +1759,13 @@
* Test IRadioNetwork.setIndicationFilter()
*/
TEST_P(RadioNetworkTest, setIndicationFilter) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setIndicationFilter "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res =
@@ -1480,6 +1784,13 @@
* Test IRadioNetwork.setBarringPassword() for the response returned.
*/
TEST_P(RadioNetworkTest, setBarringPassword) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setBarringPassword "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
std::string facility = "";
std::string oldPassword = "";
@@ -1503,6 +1814,13 @@
* Test IRadioNetwork.setSuppServiceNotifications() for the response returned.
*/
TEST_P(RadioNetworkTest, setSuppServiceNotifications) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping setSuppServiceNotifications "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool enable = false;
@@ -1522,6 +1840,13 @@
* Test IRadioNetwork.getImsRegistrationState() for the response returned.
*/
TEST_P(RadioNetworkTest, getImsRegistrationState) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) {
+ GTEST_SKIP() << "Skipping getImsRegistrationState "
+ "due to undefined FEATURE_TELEPHONY_IMS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->getImsRegistrationState(serial);
@@ -1542,6 +1867,13 @@
* Test IRadioNetwork.getOperator() for the response returned.
*/
TEST_P(RadioNetworkTest, getOperator) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getOperator "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->getOperator(serial);
@@ -1558,6 +1890,13 @@
* Test IRadioNetwork.getNetworkSelectionMode() for the response returned.
*/
TEST_P(RadioNetworkTest, getNetworkSelectionMode) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getNetworkSelectionMode "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->getNetworkSelectionMode(serial);
@@ -1574,6 +1913,13 @@
* Test IRadioNetwork.setNetworkSelectionModeAutomatic() for the response returned.
*/
TEST_P(RadioNetworkTest, setNetworkSelectionModeAutomatic) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setNetworkSelectionModeAutomatic "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->setNetworkSelectionModeAutomatic(serial);
@@ -1593,6 +1939,13 @@
* Test IRadioNetwork.getAvailableNetworks() for the response returned.
*/
TEST_P(RadioNetworkTest, getAvailableNetworks) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getAvailableNetworks "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->getAvailableNetworks(serial);
@@ -1614,6 +1967,13 @@
* Test IRadioNetwork.setBandMode() for the response returned.
*/
TEST_P(RadioNetworkTest, setBandMode) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setBandMode "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->setBandMode(serial, RadioBandMode::BAND_MODE_USA);
@@ -1631,6 +1991,13 @@
* Test IRadioNetwork.setLocationUpdates() for the response returned.
*/
TEST_P(RadioNetworkTest, setLocationUpdates) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setLocationUpdates "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->setLocationUpdates(serial, true);
@@ -1648,6 +2015,13 @@
* Test IRadioNetwork.setCdmaRoamingPreference() for the response returned.
*/
TEST_P(RadioNetworkTest, setCdmaRoamingPreference) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping setCdmaRoamingPreference "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->setCdmaRoamingPreference(serial, CdmaRoamingType::HOME_NETWORK);
@@ -1666,6 +2040,13 @@
* Test IRadioNetwork.getCdmaRoamingPreference() for the response returned.
*/
TEST_P(RadioNetworkTest, getCdmaRoamingPreference) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping getCdmaRoamingPreference "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->getCdmaRoamingPreference(serial);
@@ -1685,6 +2066,13 @@
* Test IRadioNetwork.getVoiceRadioTechnology() for the response returned.
*/
TEST_P(RadioNetworkTest, getVoiceRadioTechnology) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping getVoiceRadioTechnology "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->getVoiceRadioTechnology(serial);
@@ -1701,6 +2089,13 @@
* Test IRadioNetwork.setCellInfoListRate() for the response returned.
*/
TEST_P(RadioNetworkTest, setCellInfoListRate) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setCellInfoListRate "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->setCellInfoListRate(serial, 10);
@@ -1718,6 +2113,13 @@
* Test IRadioNetwork.supplyNetworkDepersonalization() for the response returned.
*/
TEST_P(RadioNetworkTest, supplyNetworkDepersonalization) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping supplyNetworkDepersonalization "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_network->supplyNetworkDepersonalization(serial, std::string("test"));
@@ -1738,6 +2140,13 @@
* Test IRadioNetwork.setEmergencyMode() for the response returned.
*/
TEST_P(RadioNetworkTest, setEmergencyMode) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setEmergencyMode "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -1767,6 +2176,13 @@
* Test IRadioNetwork.triggerEmergencyNetworkScan() for the response returned.
*/
TEST_P(RadioNetworkTest, triggerEmergencyNetworkScan) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping triggerEmergencyNetworkScan "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -1797,6 +2213,13 @@
* Test IRadioNetwork.cancelEmergencyNetworkScan() for the response returned.
*/
TEST_P(RadioNetworkTest, cancelEmergencyNetworkScan) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping cancelEmergencyNetworkScan "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -1821,6 +2244,13 @@
* Test IRadioNetwork.exitEmergencyMode() for the response returned.
*/
TEST_P(RadioNetworkTest, exitEmergencyMode) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping exitEmergencyMode "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -1845,6 +2275,13 @@
* Test IRadioNetwork.setN1ModeEnabled() for the response returned.
*/
TEST_P(RadioNetworkTest, setN1ModeEnabled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setN1ModeEnabled "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -1877,6 +2314,13 @@
* Test IRadioNetwork.isN1ModeEnabled() for the response returned.
*/
TEST_P(RadioNetworkTest, isN1ModeEnabled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping isN1ModeEnabled "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -1908,6 +2352,13 @@
* Test IRadioNetwork.setNullCipherAndIntegrityEnabled() for the response returned.
*/
TEST_P(RadioNetworkTest, setNullCipherAndIntegrityEnabled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping setNullCipherAndIntegrityEnabled "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -1924,15 +2375,29 @@
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
- ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
- {RadioError::NONE, RadioError::REQUEST_NOT_SUPPORTED,
- RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR}));
+ if (aidl_version >= 3 && deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR}));
+ } else {
+ // For aidl_version 2, API is optional
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
}
/**
* Test IRadioNetwork.isNullCipherAndIntegrityEnabled() for the response returned.
*/
TEST_P(RadioNetworkTest, isNullCipherAndIntegrityEnabled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ GTEST_SKIP() << "Skipping isNullCipherAndIntegrityEnabled "
+ "due to undefined FEATURE_TELEPHONY_RADIO_ACCESS";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -1951,7 +2416,168 @@
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
- ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
- {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
- RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED}));
+ if (aidl_version >= 3 && deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR}));
+ } else {
+ // For aidl_version 2, API is optional
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED}));
+ }
+}
+
+TEST_P(RadioNetworkTest, isCellularIdentifierTransparencyEnabled) {
+ int32_t aidl_version;
+ ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
+ ASSERT_OK(aidl_status);
+ if (aidl_version < 3) {
+ ALOGI("Skipped the test since"
+ " isCellularIdentifierTransparencyEnabled is not supported on version < 3.");
+ GTEST_SKIP();
+ }
+
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res = radio_network->isCellularIdentifierTransparencyEnabled(serial);
+ ASSERT_OK(res);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR}));
+}
+
+TEST_P(RadioNetworkTest, setCellularIdentifierTransparencyEnabled) {
+ int32_t aidl_version;
+ ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
+ ASSERT_OK(aidl_status);
+ if (aidl_version < 3) {
+ ALOGI("Skipped the test since"
+ " setCellularIdentifierTransparencyEnabled is not supported on version < 3.");
+ GTEST_SKIP();
+ }
+
+ // Get current value
+ serial = GetRandomSerialNumber();
+ radio_network->isCellularIdentifierTransparencyEnabled(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ bool originalTransparencySetting = radioRsp_network->isCellularIdentifierTransparencyEnabled;
+
+ // We want to test flipping the value, so we are going to set it to the opposite of what
+ // the existing setting is. The test for isCellularIdentifierTransparencyEnabled should check
+ // for the right default value.
+ bool valueToSet = !originalTransparencySetting;
+ serial = GetRandomSerialNumber();
+ radio_network->setCellularIdentifierTransparencyEnabled(serial, valueToSet);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR}));
+
+ // Assert the value has changed
+ serial = GetRandomSerialNumber();
+ ndk::ScopedAStatus res = radio_network->isCellularIdentifierTransparencyEnabled(serial);
+
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR}));
+ EXPECT_EQ(valueToSet, radioRsp_network->isCellularIdentifierTransparencyEnabled);
+
+ // Reset original state
+ radio_network->setCellularIdentifierTransparencyEnabled(serial, originalTransparencySetting);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+}
+
+/*
+ * Test IRadioNetwork.setSecurityAlgorithmsUpdatedEnabled for the response returned.
+ */
+TEST_P(RadioNetworkTest, setSecurityAlgorithmsUpdatedEnabled) {
+ int32_t aidl_version;
+ ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
+ ASSERT_OK(aidl_status);
+ if (aidl_version < 3) {
+ ALOGI("Skipped the test since"
+ " setSecurityAlgorithmsUpdatedEnabled is not supported on version < 3");
+ GTEST_SKIP();
+ }
+
+ // Get current value
+ serial = GetRandomSerialNumber();
+ radio_network->isSecurityAlgorithmsUpdatedEnabled(serial);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ bool originalSecuritySetting = radioRsp_network->isSecurityAlgorithmsUpdatedEnabled;
+
+ // We want to test flipping the value, so we are going to set it to the opposite of what
+ // the existing setting is. The test for isSecurityAlgorithmsUpdatedEnabled should check
+ // for the right default value.
+ bool valueToSet = !originalSecuritySetting;
+ serial = GetRandomSerialNumber();
+ radio_network->setSecurityAlgorithmsUpdatedEnabled(serial, valueToSet);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR}));
+
+ // Assert the value has changed
+ serial = GetRandomSerialNumber();
+ ndk::ScopedAStatus res = radio_network->isSecurityAlgorithmsUpdatedEnabled(serial);
+
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR}));
+ EXPECT_EQ(valueToSet, radioRsp_network->isSecurityAlgorithmsUpdatedEnabled);
+
+ // Reset original state
+ radio_network->setSecurityAlgorithmsUpdatedEnabled(serial, originalSecuritySetting);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+}
+
+/**
+ * Test IRadioNetwork.isSecurityAlgorithmsUpdatedEnabled for the response returned.
+ */
+TEST_P(RadioNetworkTest, isSecurityAlgorithmsUpdatedEnabled) {
+ int32_t aidl_version;
+ ndk::ScopedAStatus aidl_status = radio_network->getInterfaceVersion(&aidl_version);
+ ASSERT_OK(aidl_status);
+ if (aidl_version < 3) {
+ ALOGI("Skipped the test since"
+ " isSecurityAlgorithmsUpdatedEnabled is not supported on version < 3");
+ GTEST_SKIP();
+ }
+
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res = radio_network->isSecurityAlgorithmsUpdatedEnabled(serial);
+ ASSERT_OK(res);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR}));
}
diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h
index 8f8f6b0..470ee73 100644
--- a/radio/aidl/vts/radio_network_utils.h
+++ b/radio/aidl/vts/radio_network_utils.h
@@ -46,6 +46,8 @@
std::vector<BarringInfo> barringInfoList;
UsageSetting usageSetting;
std::vector<RadioAccessSpecifier> specifiers;
+ bool isCellularIdentifierTransparencyEnabled;
+ bool isSecurityAlgorithmsUpdatedEnabled;
virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override;
@@ -169,6 +171,18 @@
const RadioResponseInfo& info, bool isEnabled) override;
virtual ndk::ScopedAStatus setN1ModeEnabledResponse(const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus setCellularIdentifierTransparencyEnabledResponse(
+ const RadioResponseInfo& info) override;
+
+ virtual ndk::ScopedAStatus isCellularIdentifierTransparencyEnabledResponse(
+ const RadioResponseInfo& info, bool /*enabled*/) override;
+
+ virtual ndk::ScopedAStatus isSecurityAlgorithmsUpdatedEnabledResponse(
+ const RadioResponseInfo& info, bool isEnabled) override;
+
+ virtual ndk::ScopedAStatus setSecurityAlgorithmsUpdatedEnabledResponse(
+ const RadioResponseInfo& info) override;
};
/* Callback class for radio network indication */
@@ -226,6 +240,13 @@
virtual ndk::ScopedAStatus emergencyNetworkScanResult(
RadioIndicationType type, const EmergencyRegResult& result) override;
+
+ virtual ndk::ScopedAStatus cellularIdentifierDisclosed(
+ RadioIndicationType type, const CellularIdentifierDisclosure& disclosures) override;
+
+ virtual ndk::ScopedAStatus securityAlgorithmsUpdated(
+ RadioIndicationType type,
+ const SecurityAlgorithmUpdate& securityAlgorithmUpdate) override;
};
// The main test class for Radio AIDL Network.
diff --git a/radio/aidl/vts/radio_sap_test.cpp b/radio/aidl/vts/radio_sap_test.cpp
index 9a1c145..6d283e9 100644
--- a/radio/aidl/vts/radio_sap_test.cpp
+++ b/radio/aidl/vts/radio_sap_test.cpp
@@ -85,6 +85,13 @@
* Test ISap.connectReq() for the response returned.
*/
TEST_P(SapTest, connectReq) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping connectReq "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
int32_t maxMsgSize = 100;
@@ -103,6 +110,13 @@
* Test ISap.disconnectReq() for the response returned
*/
TEST_P(SapTest, disconnectReq) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping disconnectReq "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = sap->disconnectReq(serial);
@@ -116,6 +130,13 @@
* Test ISap.apduReq() for the response returned.
*/
TEST_P(SapTest, apduReq) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping apduReq "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
SapApduType sapApduType = SapApduType::APDU;
std::vector<uint8_t> command = {};
@@ -137,6 +158,13 @@
* Test ISap.transferAtrReq() for the response returned.
*/
TEST_P(SapTest, transferAtrReq) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping transferAtrReq "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = sap->transferAtrReq(serial);
@@ -155,6 +183,13 @@
* Test ISap.powerReq() for the response returned.
*/
TEST_P(SapTest, powerReq) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping powerReq "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool state = true;
@@ -175,6 +210,13 @@
* Test ISap.resetSimReq() for the response returned.
*/
TEST_P(SapTest, resetSimReq) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping resetSimReq "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = sap->resetSimReq(serial);
@@ -194,6 +236,13 @@
* Test ISap.transferCardReaderStatusReq() for the response returned.
*/
TEST_P(SapTest, transferCardReaderStatusReq) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping transferCardReaderStatusReq "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
ndk::ScopedAStatus res = sap->transferCardReaderStatusReq(serial);
@@ -211,6 +260,13 @@
* Test ISap.setTransferProtocolReq() for the response returned.
*/
TEST_P(SapTest, setTransferProtocolReq) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping setTransferProtocolReq "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
SapTransferProtocol sapTransferProtocol = SapTransferProtocol::T0;
diff --git a/radio/aidl/vts/radio_sim_test.cpp b/radio/aidl/vts/radio_sim_test.cpp
index d906588..06654c2 100644
--- a/radio/aidl/vts/radio_sim_test.cpp
+++ b/radio/aidl/vts/radio_sim_test.cpp
@@ -65,6 +65,13 @@
* Test IRadioSim.setSimCardPower() for the response returned.
*/
TEST_P(RadioSimTest, setSimCardPower) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping setSimCardPower "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
/* Test setSimCardPower power down */
serial = GetRandomSerialNumber();
radio_sim->setSimCardPower(serial, CardPowerState::POWER_DOWN);
@@ -120,6 +127,13 @@
* Test IRadioSim.setCarrierInfoForImsiEncryption() for the response returned.
*/
TEST_P(RadioSimTest, setCarrierInfoForImsiEncryption) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping setCarrierInfoForImsiEncryption "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
ImsiEncryptionInfo imsiInfo;
imsiInfo.mcc = "310";
@@ -144,6 +158,13 @@
* Test IRadioSim.getSimPhonebookRecords() for the response returned.
*/
TEST_P(RadioSimTest, getSimPhonebookRecords) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping getSimPhonebookRecords "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_sim->getSimPhonebookRecords(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -167,6 +188,13 @@
* Test IRadioSim.getSimPhonebookCapacity for the response returned.
*/
TEST_P(RadioSimTest, getSimPhonebookCapacity) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping getSimPhonebookCapacity "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_sim->getSimPhonebookCapacity(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -207,6 +235,13 @@
* Test IRadioSim.updateSimPhonebookRecords() for the response returned.
*/
TEST_P(RadioSimTest, updateSimPhonebookRecords) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping updateSimPhonebookRecords "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_sim->getSimPhonebookCapacity(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -271,6 +306,13 @@
* For SIM ABSENT case.
*/
TEST_P(RadioSimTest, togglingUiccApplicationsSimAbsent) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping togglingUiccApplicationsSimAbsent "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
// This test case only test SIM ABSENT case.
if (cardStatus.cardState != CardStatus::STATE_ABSENT) return;
@@ -298,6 +340,13 @@
* For SIM PRESENT case.
*/
TEST_P(RadioSimTest, togglingUiccApplicationsSimPresent) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping togglingUiccApplicationsSimPresent "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
// This test case only test SIM ABSENT case.
if (cardStatus.cardState != CardStatus::STATE_PRESENT) return;
if (cardStatus.applications.size() == 0) return;
@@ -345,6 +394,13 @@
* Test IRadioSim.areUiccApplicationsEnabled() for the response returned.
*/
TEST_P(RadioSimTest, areUiccApplicationsEnabled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping areUiccApplicationsEnabled "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
// Disable Uicc applications.
serial = GetRandomSerialNumber();
radio_sim->areUiccApplicationsEnabled(serial);
@@ -365,6 +421,13 @@
* Test IRadioSim.getAllowedCarriers() for the response returned.
*/
TEST_P(RadioSimTest, getAllowedCarriers) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping getAllowedCarriers "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_sim->getAllowedCarriers(serial);
@@ -380,6 +443,13 @@
* Test IRadioSim.setAllowedCarriers() for the response returned.
*/
TEST_P(RadioSimTest, setAllowedCarriers) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping setAllowedCarriers "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
CarrierRestrictions carrierRestrictions;
memset(&carrierRestrictions, 0, sizeof(carrierRestrictions));
@@ -479,6 +549,13 @@
* Test IRadioSim.getIccCardStatus() for the response returned.
*/
TEST_P(RadioSimTest, getIccCardStatus) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping getIccCardStatus "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
EXPECT_LE(cardStatus.applications.size(), RadioConst::CARD_MAX_APPS);
EXPECT_LT(cardStatus.gsmUmtsSubscriptionAppIndex, RadioConst::CARD_MAX_APPS);
EXPECT_LT(cardStatus.cdmaSubscriptionAppIndex, RadioConst::CARD_MAX_APPS);
@@ -489,6 +566,13 @@
* Test IRadioSim.supplyIccPinForApp() for the response returned
*/
TEST_P(RadioSimTest, supplyIccPinForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping supplyIccPinForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -514,6 +598,13 @@
* Test IRadioSim.supplyIccPukForApp() for the response returned.
*/
TEST_P(RadioSimTest, supplyIccPukForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping supplyIccPukForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -539,6 +630,13 @@
* Test IRadioSim.supplyIccPin2ForApp() for the response returned.
*/
TEST_P(RadioSimTest, supplyIccPin2ForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping supplyIccPin2ForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -565,6 +663,13 @@
* Test IRadioSim.supplyIccPuk2ForApp() for the response returned.
*/
TEST_P(RadioSimTest, supplyIccPuk2ForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping supplyIccPuk2ForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -590,6 +695,13 @@
* Test IRadioSim.changeIccPinForApp() for the response returned.
*/
TEST_P(RadioSimTest, changeIccPinForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping changeIccPinForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -615,6 +727,13 @@
* Test IRadioSim.changeIccPin2ForApp() for the response returned.
*/
TEST_P(RadioSimTest, changeIccPin2ForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping changeIccPin2ForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Pass wrong password and check PASSWORD_INCORRECT returned for 3GPP and
@@ -641,6 +760,13 @@
* Test IRadioSim.getImsiForApp() for the response returned.
*/
TEST_P(RadioSimTest, getImsiForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping getImsiForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Check success returned while getting imsi for 3GPP and 3GPP2 apps only
@@ -670,6 +796,13 @@
* Test IRadioSim.iccIoForApp() for the response returned.
*/
TEST_P(RadioSimTest, iccIoForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping iccIoForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
for (int i = 0; i < (int)cardStatus.applications.size(); i++) {
@@ -695,6 +828,13 @@
* Test IRadioSim.iccTransmitApduBasicChannel() for the response returned.
*/
TEST_P(RadioSimTest, iccTransmitApduBasicChannel) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping iccTransmitApduBasicChannel "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
SimApdu msg;
memset(&msg, 0, sizeof(msg));
@@ -710,6 +850,13 @@
* Test IRadioSim.iccOpenLogicalChannel() for the response returned.
*/
TEST_P(RadioSimTest, iccOpenLogicalChannel) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping iccOpenLogicalChannel "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
int p2 = 0x04;
// Specified in ISO 7816-4 clause 7.1.1 0x04 means that FCP template is requested.
@@ -725,6 +872,13 @@
* Test IRadioSim.iccCloseLogicalChannel() for the response returned.
*/
TEST_P(RadioSimTest, iccCloseLogicalChannel) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping iccCloseLogicalChannel "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Try closing invalid channel and check INVALID_ARGUMENTS returned as error
radio_sim->iccCloseLogicalChannel(serial, 0);
@@ -739,6 +893,13 @@
* Test IRadioSim.iccCloseLogicalChannelWithSessionInfo() for the response returned.
*/
TEST_P(RadioSimTest, iccCloseLogicalChannelWithSessionInfo) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping iccCloseLogicalChannelWithSessionInfo "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
int32_t aidl_version;
ndk::ScopedAStatus aidl_status = radio_sim->getInterfaceVersion(&aidl_version);
ASSERT_OK(aidl_status);
@@ -766,6 +927,13 @@
* Test IRadioSim.iccTransmitApduLogicalChannel() for the response returned.
*/
TEST_P(RadioSimTest, iccTransmitApduLogicalChannel) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping iccTransmitApduLogicalChannel "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
SimApdu msg;
memset(&msg, 0, sizeof(msg));
@@ -781,6 +949,13 @@
* Test IRadioSim.requestIccSimAuthentication() for the response returned.
*/
TEST_P(RadioSimTest, requestIccSimAuthentication) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping requestIccSimAuthentication "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Pass wrong challenge string and check RadioError::INVALID_ARGUMENTS
@@ -801,6 +976,13 @@
* Test IRadioSim.getFacilityLockForApp() for the response returned.
*/
TEST_P(RadioSimTest, getFacilityLockForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping getFacilityLockForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
std::string facility = "";
std::string password = "";
@@ -824,6 +1006,13 @@
* Test IRadioSim.setFacilityLockForApp() for the response returned.
*/
TEST_P(RadioSimTest, setFacilityLockForApp) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping setFacilityLockForApp "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
std::string facility = "";
bool lockState = false;
@@ -848,6 +1037,13 @@
* Test IRadioSim.getCdmaSubscription() for the response returned.
*/
TEST_P(RadioSimTest, getCdmaSubscription) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping getCdmaSubscription "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_sim->getCdmaSubscription(serial);
@@ -866,6 +1062,13 @@
* Test IRadioSim.getCdmaSubscriptionSource() for the response returned.
*/
TEST_P(RadioSimTest, getCdmaSubscriptionSource) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping getCdmaSubscriptionSource "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_sim->getCdmaSubscriptionSource(serial);
@@ -884,6 +1087,13 @@
* Test IRadioSim.setCdmaSubscriptionSource() for the response returned.
*/
TEST_P(RadioSimTest, setCdmaSubscriptionSource) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping setCdmaSubscriptionSource "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_sim->setCdmaSubscriptionSource(serial, CdmaSubscriptionSource::RUIM_SIM);
@@ -903,6 +1113,13 @@
* Test IRadioSim.setUiccSubscription() for the response returned.
*/
TEST_P(RadioSimTest, setUiccSubscription) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping setUiccSubscription "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
SelectUiccSub item;
memset(&item, 0, sizeof(item));
@@ -925,6 +1142,13 @@
* Test IRadioSim.sendEnvelope() for the response returned.
*/
TEST_P(RadioSimTest, sendEnvelope) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping sendEnvelope "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Test with sending empty string
@@ -948,6 +1172,13 @@
* Test IRadioSim.sendTerminalResponseToSim() for the response returned.
*/
TEST_P(RadioSimTest, sendTerminalResponseToSim) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping sendTerminalResponseToSim "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Test with sending empty string
@@ -971,6 +1202,13 @@
* Test IRadioSim.reportStkServiceIsRunning() for the response returned.
*/
TEST_P(RadioSimTest, reportStkServiceIsRunning) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping reportStkServiceIsRunning "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_sim->reportStkServiceIsRunning(serial);
@@ -990,6 +1228,13 @@
* string.
*/
TEST_P(RadioSimTest, sendEnvelopeWithStatus) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_SUBSCRIPTION)) {
+ GTEST_SKIP() << "Skipping sendEnvelopeWithStatus "
+ "due to undefined FEATURE_TELEPHONY_SUBSCRIPTION";
+ }
+ }
+
serial = GetRandomSerialNumber();
// Test with sending empty string
diff --git a/radio/aidl/vts/radio_voice_test.cpp b/radio/aidl/vts/radio_voice_test.cpp
index 397c417..6c68fd5 100644
--- a/radio/aidl/vts/radio_voice_test.cpp
+++ b/radio/aidl/vts/radio_voice_test.cpp
@@ -93,15 +93,22 @@
* Test IRadioVoice.emergencyDial() for the response returned.
*/
TEST_P(RadioVoiceTest, emergencyDial) {
- if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
- ALOGI("Skipping emergencyDial because voice call is not supported in device");
- return;
- } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
- !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
- ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
- return;
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping emergencyDial "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
} else {
- ALOGI("Running emergencyDial because voice call is supported in device");
+ if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
+ ALOGI("Skipping emergencyDial because voice call is not supported in device");
+ return;
+ } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
+ !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
+ return;
+ } else {
+ ALOGI("Running emergencyDial because voice call is supported in device");
+ }
}
serial = GetRandomSerialNumber();
@@ -147,15 +154,22 @@
* Test IRadioVoice.emergencyDial() with specified service and its response returned.
*/
TEST_P(RadioVoiceTest, emergencyDial_withServices) {
- if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
- ALOGI("Skipping emergencyDial because voice call is not supported in device");
- return;
- } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
- !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
- ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
- return;
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping emergencyDial_withServices "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
} else {
- ALOGI("Running emergencyDial because voice call is supported in device");
+ if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
+ ALOGI("Skipping emergencyDial because voice call is not supported in device");
+ return;
+ } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
+ !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
+ return;
+ } else {
+ ALOGI("Running emergencyDial because voice call is supported in device");
+ }
}
serial = GetRandomSerialNumber();
@@ -201,15 +215,22 @@
* Test IRadioVoice.emergencyDial() with known emergency call routing and its response returned.
*/
TEST_P(RadioVoiceTest, emergencyDial_withEmergencyRouting) {
- if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
- ALOGI("Skipping emergencyDial because voice call is not supported in device");
- return;
- } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
- !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
- ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
- return;
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping emergencyDial_withEmergencyRouting "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
} else {
- ALOGI("Running emergencyDial because voice call is supported in device");
+ if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) {
+ ALOGI("Skipping emergencyDial because voice call is not supported in device");
+ return;
+ } else if (!deviceSupportsFeature(FEATURE_TELEPHONY_GSM) &&
+ !deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ ALOGI("Skipping emergencyDial because gsm/cdma radio is not supported in device");
+ return;
+ } else {
+ ALOGI("Running emergencyDial because voice call is supported in device");
+ }
}
serial = GetRandomSerialNumber();
@@ -256,6 +277,13 @@
* Test IRadioVoice.getCurrentCalls() for the response returned.
*/
TEST_P(RadioVoiceTest, getCurrentCalls) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getCurrentCalls "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->getCurrentCalls(serial);
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -268,6 +296,13 @@
* Test IRadioVoice.getClir() for the response returned.
*/
TEST_P(RadioVoiceTest, getClir) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getClir "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->getClir(serial);
@@ -286,6 +321,13 @@
* Test IRadioVoice.setClir() for the response returned.
*/
TEST_P(RadioVoiceTest, setClir) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping setClir "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
int32_t status = 1;
@@ -304,6 +346,13 @@
* Test IRadioVoice.getClip() for the response returned.
*/
TEST_P(RadioVoiceTest, getClip) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getClip "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->getClip(serial);
@@ -322,6 +371,13 @@
* Test IRadioVoice.getTtyMode() for the response returned.
*/
TEST_P(RadioVoiceTest, getTtyMode) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getTtyMode "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->getTtyMode(serial);
@@ -338,6 +394,13 @@
* Test IRadioVoice.setTtyMode() for the response returned.
*/
TEST_P(RadioVoiceTest, setTtyMode) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping setTtyMode "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->setTtyMode(serial, TtyMode::OFF);
@@ -354,6 +417,13 @@
* Test IRadioVoice.setPreferredVoicePrivacy() for the response returned.
*/
TEST_P(RadioVoiceTest, setPreferredVoicePrivacy) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping setPreferredVoicePrivacy "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->setPreferredVoicePrivacy(serial, true);
@@ -371,6 +441,13 @@
* Test IRadioVoice.getPreferredVoicePrivacy() for the response returned.
*/
TEST_P(RadioVoiceTest, getPreferredVoicePrivacy) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getPreferredVoicePrivacy "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->getPreferredVoicePrivacy(serial);
@@ -388,6 +465,13 @@
* Test IRadioVoice.exitEmergencyCallbackMode() for the response returned.
*/
TEST_P(RadioVoiceTest, exitEmergencyCallbackMode) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping exitEmergencyCallbackMode "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->exitEmergencyCallbackMode(serial);
@@ -406,6 +490,13 @@
* Test IRadioVoice.handleStkCallSetupRequestFromSim() for the response returned.
*/
TEST_P(RadioVoiceTest, handleStkCallSetupRequestFromSim) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping handleStkCallSetupRequestFromSim "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
bool accept = false;
@@ -427,6 +518,13 @@
* Test IRadioVoice.dial() for the response returned.
*/
TEST_P(RadioVoiceTest, dial) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping dial "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
Dial dialInfo;
@@ -454,6 +552,13 @@
* Test IRadioVoice.hangup() for the response returned.
*/
TEST_P(RadioVoiceTest, hangup) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping hangup "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->hangup(serial, 1);
@@ -473,6 +578,13 @@
* Test IRadioVoice.hangupWaitingOrBackground() for the response returned.
*/
TEST_P(RadioVoiceTest, hangupWaitingOrBackground) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping hangupWaitingOrBackground "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->hangupWaitingOrBackground(serial);
@@ -491,6 +603,13 @@
* Test IRadioVoice.hangupForegroundResumeBackground() for the response returned.
*/
TEST_P(RadioVoiceTest, hangupForegroundResumeBackground) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping hangupForegroundResumeBackground "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->hangupForegroundResumeBackground(serial);
@@ -509,6 +628,13 @@
* Test IRadioVoice.switchWaitingOrHoldingAndActive() for the response returned.
*/
TEST_P(RadioVoiceTest, switchWaitingOrHoldingAndActive) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping switchWaitingOrHoldingAndActive "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->switchWaitingOrHoldingAndActive(serial);
@@ -527,6 +653,13 @@
* Test IRadioVoice.conference() for the response returned.
*/
TEST_P(RadioVoiceTest, conference) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping conference "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->conference(serial);
@@ -545,6 +678,13 @@
* Test IRadioVoice.rejectCall() for the response returned.
*/
TEST_P(RadioVoiceTest, rejectCall) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping rejectCall "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->rejectCall(serial);
@@ -563,6 +703,13 @@
* Test IRadioVoice.getLastCallFailCause() for the response returned.
*/
TEST_P(RadioVoiceTest, getLastCallFailCause) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getLastCallFailCause "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->getLastCallFailCause(serial);
@@ -580,6 +727,13 @@
* Test IRadioVoice.getCallForwardStatus() for the response returned.
*/
TEST_P(RadioVoiceTest, getCallForwardStatus) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getCallForwardStatus "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
CallForwardInfo callInfo;
memset(&callInfo, 0, sizeof(callInfo));
@@ -602,6 +756,13 @@
* Test IRadioVoice.setCallForward() for the response returned.
*/
TEST_P(RadioVoiceTest, setCallForward) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping setCallForward "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
CallForwardInfo callInfo;
memset(&callInfo, 0, sizeof(callInfo));
@@ -624,6 +785,13 @@
* Test IRadioVoice.getCallWaiting() for the response returned.
*/
TEST_P(RadioVoiceTest, getCallWaiting) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getCallWaiting "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->getCallWaiting(serial, 1);
@@ -643,6 +811,13 @@
* Test IRadioVoice.setCallWaiting() for the response returned.
*/
TEST_P(RadioVoiceTest, setCallWaiting) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping setCallWaiting "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->setCallWaiting(serial, true, 1);
@@ -662,6 +837,13 @@
* Test IRadioVoice.acceptCall() for the response returned.
*/
TEST_P(RadioVoiceTest, acceptCall) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping acceptCall "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->acceptCall(serial);
@@ -680,6 +862,13 @@
* Test IRadioVoice.separateConnection() for the response returned.
*/
TEST_P(RadioVoiceTest, separateConnection) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping separateConnection "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->separateConnection(serial, 1);
@@ -699,6 +888,13 @@
* Test IRadioVoice.explicitCallTransfer() for the response returned.
*/
TEST_P(RadioVoiceTest, explicitCallTransfer) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping explicitCallTransfer "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->explicitCallTransfer(serial);
@@ -717,6 +913,13 @@
* Test IRadioVoice.sendCdmaFeatureCode() for the response returned.
*/
TEST_P(RadioVoiceTest, sendCdmaFeatureCode) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CDMA)) {
+ GTEST_SKIP() << "Skipping sendCdmaFeatureCode "
+ "due to undefined FEATURE_TELEPHONY_CDMA";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->sendCdmaFeatureCode(serial, std::string());
@@ -737,6 +940,13 @@
* Test IRadioVoice.sendDtmf() for the response returned.
*/
TEST_P(RadioVoiceTest, sendDtmf) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping sendDtmf "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->sendDtmf(serial, "1");
@@ -757,6 +967,13 @@
* Test IRadioVoice.startDtmf() for the response returned.
*/
TEST_P(RadioVoiceTest, startDtmf) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping startDtmf "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->startDtmf(serial, "1");
@@ -777,6 +994,13 @@
* Test IRadioVoice.stopDtmf() for the response returned.
*/
TEST_P(RadioVoiceTest, stopDtmf) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping stopDtmf "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->stopDtmf(serial);
@@ -796,6 +1020,13 @@
* Test IRadioVoice.setMute() for the response returned.
*/
TEST_P(RadioVoiceTest, setMute) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping setMute "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->setMute(serial, true);
@@ -814,6 +1045,13 @@
* Test IRadioVoice.getMute() for the response returned.
*/
TEST_P(RadioVoiceTest, getMute) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping getMute "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->getMute(serial);
@@ -830,6 +1068,13 @@
* Test IRadioVoice.sendBurstDtmf() for the response returned.
*/
TEST_P(RadioVoiceTest, sendBurstDtmf) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping sendBurstDtmf "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->sendBurstDtmf(serial, "1", 0, 0);
@@ -849,6 +1094,13 @@
* Test IRadioVoice.sendUssd() for the response returned.
*/
TEST_P(RadioVoiceTest, sendUssd) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping sendUssd "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->sendUssd(serial, std::string("test"));
EXPECT_EQ(std::cv_status::no_timeout, wait());
@@ -867,6 +1119,13 @@
* Test IRadioVoice.cancelPendingUssd() for the response returned.
*/
TEST_P(RadioVoiceTest, cancelPendingUssd) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_CALLING)) {
+ GTEST_SKIP() << "Skipping cancelPendingUssd "
+ "due to undefined FEATURE_TELEPHONY_CALLING";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->cancelPendingUssd(serial);
@@ -886,6 +1145,13 @@
* Test IRadioVoice.isVoNrEnabled() for the response returned.
*/
TEST_P(RadioVoiceTest, isVoNrEnabled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) {
+ GTEST_SKIP() << "Skipping isVoNrEnabled "
+ "due to undefined FEATURE_TELEPHONY_IMS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->isVoNrEnabled(serial);
@@ -901,6 +1167,13 @@
* Test IRadioVoice.setVoNrEnabled() for the response returned.
*/
TEST_P(RadioVoiceTest, setVoNrEnabled) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY_IMS)) {
+ GTEST_SKIP() << "Skipping setVoNrEnabled "
+ "due to undefined FEATURE_TELEPHONY_IMS";
+ }
+ }
+
serial = GetRandomSerialNumber();
radio_voice->setVoNrEnabled(serial, true);
diff --git a/radio/config/1.0/Android.bp b/radio/config/1.0/Android.bp
index 9e317b3..98be5a7 100644
--- a/radio/config/1.0/Android.bp
+++ b/radio/config/1.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_fwk_telephony",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/radio/config/1.0/default/Android.bp b/radio/config/1.0/default/Android.bp
index e221ceb..ed12108 100644
--- a/radio/config/1.0/default/Android.bp
+++ b/radio/config/1.0/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_fwk_telephony",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/radio/config/1.0/vts/functional/Android.bp b/radio/config/1.0/vts/functional/Android.bp
index 36aecff..e28eb43 100644
--- a/radio/config/1.0/vts/functional/Android.bp
+++ b/radio/config/1.0/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_telephony",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/radio/config/1.1/Android.bp b/radio/config/1.1/Android.bp
index b1705f9..8aa8a4d 100644
--- a/radio/config/1.1/Android.bp
+++ b/radio/config/1.1/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_fwk_telephony",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/radio/config/1.1/vts/functional/Android.bp b/radio/config/1.1/vts/functional/Android.bp
index 9037b79..87bcaa9 100644
--- a/radio/config/1.1/vts/functional/Android.bp
+++ b/radio/config/1.1/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_telephony",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/radio/config/1.2/Android.bp b/radio/config/1.2/Android.bp
index 3327af4..e58ac0b 100644
--- a/radio/config/1.2/Android.bp
+++ b/radio/config/1.2/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_fwk_telephony",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/radio/config/1.2/vts/functional/Android.bp b/radio/config/1.2/vts/functional/Android.bp
index 1a15d3f..5ebb222 100644
--- a/radio/config/1.2/vts/functional/Android.bp
+++ b/radio/config/1.2/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_telephony",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/radio/config/1.3/Android.bp b/radio/config/1.3/Android.bp
index dc0d82c..c39984c 100644
--- a/radio/config/1.3/Android.bp
+++ b/radio/config/1.3/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_fwk_telephony",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/radio/config/1.3/vts/functional/Android.bp b/radio/config/1.3/vts/functional/Android.bp
index 20c480f..738d5d3 100644
--- a/radio/config/1.3/vts/functional/Android.bp
+++ b/radio/config/1.3/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_telephony",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -50,7 +51,7 @@
cc_library_static {
name: "RadioConfigVtsTestResponse",
defaults: ["VtsHalTargetTestDefaults"],
- srcs : [
+ srcs: [
"radio_config_response.cpp",
"radio_config_hidl_hal_test.cpp",
],
diff --git a/radio/deprecated/1.0/Android.bp b/radio/deprecated/1.0/Android.bp
index 53f6da5..a607644 100644
--- a/radio/deprecated/1.0/Android.bp
+++ b/radio/deprecated/1.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_fwk_telephony",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/renderscript/1.0/Android.bp b/renderscript/1.0/Android.bp
index 1f2ac15..c699141 100644
--- a/renderscript/1.0/Android.bp
+++ b/renderscript/1.0/Android.bp
@@ -14,10 +14,6 @@
root: "android.hardware",
// TODO(b/153609531): remove when no longer needed.
native_bridge_supported: true,
- vndk: {
- enabled: true,
- support_system_process: true,
- },
srcs: [
"types.hal",
"IContext.hal",
diff --git a/security/authgraph/default/src/main.rs b/security/authgraph/default/src/main.rs
index 65ced75..0f6e05c 100644
--- a/security/authgraph/default/src/main.rs
+++ b/security/authgraph/default/src/main.rs
@@ -40,7 +40,7 @@
}
fn main() {
- if let Err(e) = inner_main() {
+ if let Err(HalServiceError(e)) = inner_main() {
panic!("HAL service failed: {:?}", e);
}
}
diff --git a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
index aeb0163..4ebafee 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/IKeyMintDevice.aidl
@@ -794,33 +794,40 @@
in @nullable HardwareAuthToken authToken);
/**
- * Called by client to notify the IKeyMintDevice that the device is now locked, and keys with
- * the UNLOCKED_DEVICE_REQUIRED tag should no longer be usable. When this function is called,
- * the IKeyMintDevice should note the current timestamp, and attempts to use
- * UNLOCKED_DEVICE_REQUIRED keys must be rejected with Error::DEVICE_LOCKED until an
- * authentication token with a later timestamp is presented. If the `passwordOnly' argument is
- * set to true the sufficiently-recent authentication token must indicate that the user
- * authenticated with a password, not a biometric.
+ * This method is deprecated and has never been used. Implementations should return
+ * ErrorCode::UNIMPLEMENTED.
*
- * Note that the IKeyMintDevice UNLOCKED_DEVICE_REQUIRED semantics are slightly different from
- * the UNLOCKED_DEVICE_REQUIRED semantics enforced by keystore. Keystore handles device locking
- * on a per-user basis. Because auth tokens do not contain an Android user ID, it's not
- * possible to replicate the keystore enforcement logic in IKeyMintDevice. So from the
- * IKeyMintDevice perspective, any user unlock unlocks all UNLOCKED_DEVICE_REQUIRED keys.
- * Keystore will continue enforcing the per-user device locking.
+ * This method was originally intended to be used to notify KeyMint that the device is now
+ * locked, and keys with the UNLOCKED_DEVICE_REQUIRED tag should no longer be usable until a
+ * later valid HardwareAuthToken is presented. However, Android has never called this method
+ * and it cannot start doing so, because KeyMint's enforcement of UNLOCKED_DEVICE_REQUIRED did
+ * not provide the correct semantics and therefore could never be enabled. Specifically, the
+ * following issues existed with the design of KeyMint's enforcement of
+ * UNLOCKED_DEVICE_REQUIRED:
*
- * @param passwordOnly specifies whether the device must be unlocked with a password, rather
- * than a biometric, before UNLOCKED_DEVICE_REQUIRED keys can be used.
+ * o It assumed a global device lock state only. Android actually has a separate lock state for
+ * each user. See the javadoc for KeyguardManager#isDeviceLocked().
+ * o It assumed that unlocking the device involves a successful user authentication that
+ * generates a HardwareAuthToken. This is not necessarily the case, since Android supports
+ * weaker unlock methods including class 1 and 2 biometrics and trust agents. These unlock
+ * methods do not generate a HardwareAuthToken or interact with KeyMint in any way. Also,
+ * UNLOCKED_DEVICE_REQUIRED must work even for users who do not have a secure lock screen.
+ * o It would have made UNLOCKED_DEVICE_REQUIRED incompatible with requiring user
+ * authentication in some cases. These two key protections can each require a different
+ * HardwareAuthToken, but KeyMint only supports one HardwareAuthToken per operation.
+ * o It would have provided no security benefit over Keystore's enforcement of
+ * UNLOCKED_DEVICE_REQUIRED. This is because since Android 12, Keystore enforces
+ * UNLOCKED_DEVICE_REQUIRED not just logically, but it also cryptographically by
+ * superencrypting all such keys and wiping or re-encrypting the superencryption key when the
+ * device is locked (whenever possible). KeyMint is still used to support biometric unlocks,
+ * but this mechanism does not use KeyMint's direct enforcement of UNLOCKED_DEVICE_REQUIRED.
*
- * @param timestampToken is used by StrongBox implementations of IKeyMintDevice. It
- * provides the StrongBox IKeyMintDevice with a fresh, MACed timestamp which it can use as the
- * device-lock time, for future comparison against auth tokens when operations using
- * UNLOCKED_DEVICE_REQUIRED keys are attempted. Unless the auth token timestamp is newer than
- * the timestamp in the timestampToken, the device is still considered to be locked.
- * Crucially, if a StrongBox IKeyMintDevice receives a deviceLocked() call with a timestampToken
- * timestamp that is less than the timestamp in the last deviceLocked() call, it must ignore the
- * new timestamp. TEE IKeyMintDevice implementations will receive an empty timestampToken (zero
- * values and empty vectors) and should use their own clock as the device-lock time.
+ * Therefore, this method is not useful, and there is no reason for it be called.
+ * Implementations should return ErrorCode::UNIMPLEMENTED and should not include
+ * UNLOCKED_DEVICE_REQUIRED in the list of hardware-enforced key parameters.
+ *
+ * @param passwordOnly N/A due to the deprecation
+ * @param timestampToken N/A due to the deprecation
*/
void deviceLocked(in boolean passwordOnly, in @nullable TimeStampToken timestampToken);
diff --git a/security/keymint/aidl/android/hardware/security/keymint/Tag.aidl b/security/keymint/aidl/android/hardware/security/keymint/Tag.aidl
index be29f59..996e4e3 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/Tag.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/Tag.aidl
@@ -482,11 +482,12 @@
/**
* Tag::UNLOCKED_DEVICE_REQUIRED specifies that the key may only be used when the device is
- * unlocked, as reported to KeyMint via authToken operation parameter and the
- * IKeyMintDevice::deviceLocked() method
+ * unlocked.
*
- * Must be hardware-enforced (but is also keystore-enforced on a per-user basis: see the
- * deviceLocked() documentation).
+ * This tag was originally intended to be hardware-enforced. However, the support for hardware
+ * enforcement of this tag is now considered deprecated because it cannot work correctly, and
+ * even if implemented it does nothing because it was never enabled by Keystore. Refer to the
+ * documentation for the deprecated method IKeyMintDevice::deviceLocked().
*/
UNLOCKED_DEVICE_REQUIRED = TagType.BOOL | 509,
diff --git a/security/keymint/aidl/default/Android.bp b/security/keymint/aidl/default/Android.bp
index 953630b..0cf53cf 100644
--- a/security/keymint/aidl/default/Android.bp
+++ b/security/keymint/aidl/default/Android.bp
@@ -30,7 +30,7 @@
"android.hardware.security.secureclock-V1-ndk",
"libbase",
"libbinder_ndk",
- "libcppbor_external",
+ "libcppbor",
"libcrypto",
"libkeymaster_portable",
"libkeymint",
@@ -46,9 +46,116 @@
],
}
+rust_binary {
+ name: "android.hardware.security.keymint-service.nonsecure",
+ relative_install_path: "hw",
+ vendor: true,
+ init_rc: ["android.hardware.security.keymint-service.nonsecure.rc"],
+ vintf_fragments: [
+ "android.hardware.security.keymint-service.xml",
+ "android.hardware.security.sharedsecret-service.xml",
+ "android.hardware.security.secureclock-service.xml",
+ ],
+ defaults: [
+ "keymint_use_latest_hal_aidl_rust",
+ ],
+ srcs: [
+ "main.rs",
+ ],
+ rustlibs: [
+ "libandroid_logger",
+ "libbinder_rs",
+ "liblog_rust",
+ "libkmr_hal",
+ "libkmr_hal_nonsecure",
+ "libkmr_ta_nonsecure",
+ ],
+ required: [
+ "android.hardware.hardware_keystore.xml",
+ ],
+}
+
prebuilt_etc {
name: "android.hardware.hardware_keystore.xml",
sub_dir: "permissions",
vendor: true,
src: "android.hardware.hardware_keystore.xml",
}
+
+rust_library {
+ name: "libkmr_hal_nonsecure",
+ crate_name: "kmr_hal_nonsecure",
+ vendor_available: true,
+ lints: "android",
+ rustlibs: [
+ "libbinder_rs",
+ "libhex",
+ "liblibc",
+ "liblog_rust",
+ "libkmr_hal",
+ "libkmr_wire",
+ ],
+ srcs: ["hal/lib.rs"],
+
+}
+
+rust_library {
+ name: "libkmr_ta_nonsecure",
+ crate_name: "kmr_ta_nonsecure",
+ vendor_available: true,
+ host_supported: true,
+ lints: "android",
+ rustlibs: [
+ "libhex",
+ "liblibc",
+ "liblog_rust",
+ "libkmr_common",
+ "libkmr_crypto_boring",
+ "libkmr_ta",
+ "libkmr_wire",
+ ],
+ srcs: ["ta/lib.rs"],
+}
+
+apex {
+ name: "com.android.hardware.keymint.rust_nonsecure",
+ manifest: "manifest.json",
+ file_contexts: "file_contexts",
+ key: "com.google.cf.apex.key",
+ certificate: ":com.android.hardware.certificate",
+ soc_specific: true,
+ updatable: false,
+ binaries: [
+ "android.hardware.security.keymint-service.nonsecure",
+ ],
+ prebuilts: [
+ "keymint_aidl_nonsecure_init_rc",
+ "keymint_aidl_nonsecure_vintf",
+ "android.hardware.hardware_keystore.xml", // permissions
+ ],
+}
+
+prebuilt_etc {
+ name: "keymint_aidl_nonsecure_init_rc",
+ filename_from_src: true,
+ vendor: true,
+ src: ":gen-keymint_aidl_nonsecure_init_rc",
+}
+
+genrule {
+ name: "gen-keymint_aidl_nonsecure_init_rc",
+ srcs: ["android.hardware.security.keymint-service.nonsecure.rc"],
+ out: ["android.hardware.security.keymint-service.nonsecure.apex.rc"],
+ cmd: "sed -E 's%/vendor/bin/%/apex/com.android.hardware.keymint/bin/%' $(in) > $(out)",
+}
+
+prebuilt_etc {
+ name: "keymint_aidl_nonsecure_vintf",
+ sub_dir: "vintf",
+ vendor: true,
+ srcs: [
+ "android.hardware.security.keymint-service.xml",
+ "android.hardware.security.sharedsecret-service.xml",
+ "android.hardware.security.secureclock-service.xml",
+ ],
+}
diff --git a/security/keymint/aidl/default/android.hardware.security.keymint-service.nonsecure.rc b/security/keymint/aidl/default/android.hardware.security.keymint-service.nonsecure.rc
new file mode 100644
index 0000000..c792eae
--- /dev/null
+++ b/security/keymint/aidl/default/android.hardware.security.keymint-service.nonsecure.rc
@@ -0,0 +1,3 @@
+service vendor.keymint-default /vendor/bin/hw/android.hardware.security.keymint-service.nonsecure
+ class early_hal
+ user nobody
diff --git a/security/keymint/aidl/default/file_contexts b/security/keymint/aidl/default/file_contexts
new file mode 100644
index 0000000..dce7e3c
--- /dev/null
+++ b/security/keymint/aidl/default/file_contexts
@@ -0,0 +1,3 @@
+(/.*)? u:object_r:vendor_file:s0
+/etc(/.*)? u:object_r:vendor_configs_file:s0
+/bin/hw/android\.hardware\.security\.keymint-service\.nonsecure u:object_r:hal_keymint_rust_exec:s0
diff --git a/security/keymint/aidl/default/hal/lib.rs b/security/keymint/aidl/default/hal/lib.rs
new file mode 100644
index 0000000..621f077
--- /dev/null
+++ b/security/keymint/aidl/default/hal/lib.rs
@@ -0,0 +1,99 @@
+/*
+ * 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.
+ */
+
+//! KeyMint helper functions that are only suitable for non-secure environments
+//! such as Cuttlefish.
+
+use kmr_hal::env::get_property;
+use log::error;
+
+/// Populate attestation ID information based on properties (where available).
+/// Retrieving the serial number requires SELinux permission.
+pub fn attestation_id_info() -> kmr_wire::AttestationIdInfo {
+ let prop = |name| {
+ get_property(name)
+ .unwrap_or_else(|_| format!("{} unavailable", name))
+ .as_bytes()
+ .to_vec()
+ };
+ kmr_wire::AttestationIdInfo {
+ brand: prop("ro.product.brand"),
+ device: prop("ro.product.device"),
+ product: prop("ro.product.name"),
+ serial: prop("ro.serialno"),
+ manufacturer: prop("ro.product.manufacturer"),
+ model: prop("ro.product.model"),
+ // Currently modem_simulator always returns one fixed value. See `handleGetIMEI` in
+ // device/google/cuttlefish/host/commands/modem_simulator/misc_service.cpp for more details.
+ // TODO(b/263188546): Use device-specific IMEI values when available.
+ imei: b"867400022047199".to_vec(),
+ imei2: b"867400022047199".to_vec(),
+ meid: vec![],
+ }
+}
+
+/// Get boot information based on system properties.
+pub fn get_boot_info() -> kmr_wire::SetBootInfoRequest {
+ // No access to a verified boot key.
+ let verified_boot_key = vec![0; 32];
+ let vbmeta_digest = get_property("ro.boot.vbmeta.digest").unwrap_or_else(|_| "00".repeat(32));
+ let verified_boot_hash = hex::decode(&vbmeta_digest).unwrap_or_else(|_e| {
+ error!("failed to parse hex data in '{}'", vbmeta_digest);
+ vec![0; 32]
+ });
+ let device_boot_locked = match get_property("ro.boot.vbmeta.device_state")
+ .unwrap_or_else(|_| "no-prop".to_string())
+ .as_str()
+ {
+ "locked" => true,
+ "unlocked" => false,
+ v => {
+ error!("Unknown device_state '{}', treating as unlocked", v);
+ false
+ }
+ };
+ let verified_boot_state = match get_property("ro.boot.verifiedbootstate")
+ .unwrap_or_else(|_| "no-prop".to_string())
+ .as_str()
+ {
+ "green" => 0, // Verified
+ "yellow" => 1, // SelfSigned
+ "orange" => 2, // Unverified,
+ "red" => 3, // Failed,
+ v => {
+ error!("Unknown boot state '{}', treating as Unverified", v);
+ 2
+ }
+ };
+
+ // Attempt to get the boot patchlevel from a system property. This requires an SELinux
+ // permission, so fall back to re-using the OS patchlevel if this can't be done.
+ let boot_patchlevel_prop = get_property("ro.vendor.boot_security_patch").unwrap_or_else(|e| {
+ error!("Failed to retrieve boot patchlevel: {:?}", e);
+ get_property(kmr_hal::env::OS_PATCHLEVEL_PROPERTY)
+ .unwrap_or_else(|_| "1970-09-19".to_string())
+ });
+ let boot_patchlevel =
+ kmr_hal::env::extract_patchlevel(&boot_patchlevel_prop).unwrap_or(19700919);
+
+ kmr_wire::SetBootInfoRequest {
+ verified_boot_key,
+ device_boot_locked,
+ verified_boot_state,
+ verified_boot_hash,
+ boot_patchlevel,
+ }
+}
diff --git a/security/keymint/aidl/default/main.rs b/security/keymint/aidl/default/main.rs
new file mode 100644
index 0000000..055c698
--- /dev/null
+++ b/security/keymint/aidl/default/main.rs
@@ -0,0 +1,174 @@
+/*
+ * 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.
+ */
+
+//! Default implementation of the KeyMint HAL and related HALs.
+//!
+//! This implementation of the HAL is only intended to allow testing and policy compliance. A real
+//! implementation **must be implemented in a secure environment**.
+
+use kmr_hal::SerializedChannel;
+use kmr_hal_nonsecure::{attestation_id_info, get_boot_info};
+use log::{debug, error, info};
+use std::ops::DerefMut;
+use std::sync::{mpsc, Arc, Mutex};
+
+/// Name of KeyMint binder device instance.
+static SERVICE_INSTANCE: &str = "default";
+
+static KM_SERVICE_NAME: &str = "android.hardware.security.keymint.IKeyMintDevice";
+static RPC_SERVICE_NAME: &str = "android.hardware.security.keymint.IRemotelyProvisionedComponent";
+static CLOCK_SERVICE_NAME: &str = "android.hardware.security.secureclock.ISecureClock";
+static SECRET_SERVICE_NAME: &str = "android.hardware.security.sharedsecret.ISharedSecret";
+
+/// Local error type for failures in the HAL service.
+#[derive(Debug, Clone)]
+struct HalServiceError(String);
+
+impl From<String> for HalServiceError {
+ fn from(s: String) -> Self {
+ Self(s)
+ }
+}
+
+fn main() {
+ if let Err(HalServiceError(e)) = inner_main() {
+ panic!("HAL service failed: {:?}", e);
+ }
+}
+
+fn inner_main() -> Result<(), HalServiceError> {
+ // Initialize Android logging.
+ android_logger::init_once(
+ android_logger::Config::default()
+ .with_tag("keymint-hal-nonsecure")
+ .with_max_level(log::LevelFilter::Info)
+ .with_log_buffer(android_logger::LogId::System),
+ );
+ // Redirect panic messages to logcat.
+ std::panic::set_hook(Box::new(|panic_info| {
+ error!("{}", panic_info);
+ }));
+
+ info!("Insecure KeyMint HAL service is starting.");
+
+ info!("Starting thread pool now.");
+ binder::ProcessState::start_thread_pool();
+
+ // Create a TA in-process, which acts as a local channel for communication.
+ let channel = Arc::new(Mutex::new(LocalTa::new()));
+
+ let km_service = kmr_hal::keymint::Device::new_as_binder(channel.clone());
+ let service_name = format!("{}/{}", KM_SERVICE_NAME, SERVICE_INSTANCE);
+ binder::add_service(&service_name, km_service.as_binder()).map_err(|e| {
+ HalServiceError(format!(
+ "Failed to register service {} because of {:?}.",
+ service_name, e
+ ))
+ })?;
+
+ let rpc_service = kmr_hal::rpc::Device::new_as_binder(channel.clone());
+ let service_name = format!("{}/{}", RPC_SERVICE_NAME, SERVICE_INSTANCE);
+ binder::add_service(&service_name, rpc_service.as_binder()).map_err(|e| {
+ HalServiceError(format!(
+ "Failed to register service {} because of {:?}.",
+ service_name, e
+ ))
+ })?;
+
+ let clock_service = kmr_hal::secureclock::Device::new_as_binder(channel.clone());
+ let service_name = format!("{}/{}", CLOCK_SERVICE_NAME, SERVICE_INSTANCE);
+ binder::add_service(&service_name, clock_service.as_binder()).map_err(|e| {
+ HalServiceError(format!(
+ "Failed to register service {} because of {:?}.",
+ service_name, e
+ ))
+ })?;
+
+ let secret_service = kmr_hal::sharedsecret::Device::new_as_binder(channel.clone());
+ let service_name = format!("{}/{}", SECRET_SERVICE_NAME, SERVICE_INSTANCE);
+ binder::add_service(&service_name, secret_service.as_binder()).map_err(|e| {
+ HalServiceError(format!(
+ "Failed to register service {} because of {:?}.",
+ service_name, e
+ ))
+ })?;
+
+ info!("Successfully registered KeyMint HAL services.");
+
+ // Let the TA know information about the boot environment. In a real device this
+ // is communicated directly from the bootloader to the TA, but here we retrieve
+ // the information from system properties and send from the HAL service.
+ let boot_req = get_boot_info();
+ debug!("boot/HAL->TA: boot info is {:?}", boot_req);
+ kmr_hal::send_boot_info(channel.lock().unwrap().deref_mut(), boot_req)
+ .map_err(|e| HalServiceError(format!("Failed to send boot info: {:?}", e)))?;
+
+ // Let the TA know information about the userspace environment.
+ if let Err(e) = kmr_hal::send_hal_info(channel.lock().unwrap().deref_mut()) {
+ error!("Failed to send HAL info: {:?}", e);
+ }
+
+ // Let the TA know about attestation IDs. (In a real device these would be pre-provisioned into
+ // the TA.)
+ let attest_ids = attestation_id_info();
+ if let Err(e) = kmr_hal::send_attest_ids(channel.lock().unwrap().deref_mut(), attest_ids) {
+ error!("Failed to send attestation ID info: {:?}", e);
+ }
+
+ info!("Successfully registered KeyMint HAL services.");
+ binder::ProcessState::join_thread_pool();
+ info!("KeyMint HAL service is terminating."); // should not reach here
+ Ok(())
+}
+
+/// Implementation of the KeyMint TA that runs locally in-process (and which is therefore
+/// insecure).
+#[derive(Debug)]
+pub struct LocalTa {
+ in_tx: mpsc::Sender<Vec<u8>>,
+ out_rx: mpsc::Receiver<Vec<u8>>,
+}
+
+impl LocalTa {
+ /// Create a new instance.
+ pub fn new() -> Self {
+ // Create a pair of channels to communicate with the TA thread.
+ let (in_tx, in_rx) = mpsc::channel();
+ let (out_tx, out_rx) = mpsc::channel();
+
+ // The TA code expects to run single threaded, so spawn a thread to run it in.
+ std::thread::spawn(move || {
+ let mut ta = kmr_ta_nonsecure::build_ta();
+ loop {
+ let req_data: Vec<u8> = in_rx.recv().expect("failed to receive next req");
+ let rsp_data = ta.process(&req_data);
+ out_tx.send(rsp_data).expect("failed to send out rsp");
+ }
+ });
+ Self { in_tx, out_rx }
+ }
+}
+
+impl SerializedChannel for LocalTa {
+ const MAX_SIZE: usize = usize::MAX;
+
+ fn execute(&mut self, req_data: &[u8]) -> binder::Result<Vec<u8>> {
+ self.in_tx
+ .send(req_data.to_vec())
+ .expect("failed to send in request");
+ Ok(self.out_rx.recv().expect("failed to receive response"))
+ }
+}
diff --git a/security/keymint/aidl/default/manifest.json b/security/keymint/aidl/default/manifest.json
new file mode 100644
index 0000000..289943e
--- /dev/null
+++ b/security/keymint/aidl/default/manifest.json
@@ -0,0 +1,5 @@
+{
+ "name": "com.android.hardware.keymint",
+ "version": 1,
+ "vendorBootstrap": true
+}
diff --git a/security/keymint/aidl/default/ta/attest.rs b/security/keymint/aidl/default/ta/attest.rs
new file mode 100644
index 0000000..1ce2066
--- /dev/null
+++ b/security/keymint/aidl/default/ta/attest.rs
@@ -0,0 +1,425 @@
+//
+// 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.
+
+//! Attestation keys and certificates.
+//!
+//! Hard-coded keys and certs copied from system/keymaster/context/soft_attestation_cert.cpp
+
+use kmr_common::{
+ crypto::ec, crypto::rsa, crypto::CurveType, crypto::KeyMaterial, wire::keymint,
+ wire::keymint::EcCurve, Error,
+};
+use kmr_ta::device::{RetrieveCertSigningInfo, SigningAlgorithm, SigningKeyType};
+
+/// RSA attestation private key in PKCS#1 format.
+///
+/// Decoded contents (using [der2ascii](https://github.com/google/der-ascii)):
+///
+/// ```
+/// SEQUENCE {
+/// INTEGER { 0 }
+/// INTEGER { `00c08323dc56881bb8302069f5b08561c6eebe7f05e2f5a842048abe8b47be76feaef25cf29b2afa3200141601429989a15fcfc6815eb363583c2fd2f20be4983283dd814b16d7e185417ae54abc296a3a6db5c004083b68c556c1f02339916419864d50b74d40aeca484c77356c895a0c275abfac499d5d7d2362f29c5e02e871` }
+/// INTEGER { 65537 }
+/// INTEGER { `00be860b0b99a802a6fb1a59438a7bb715065b09a36dc6e9cacc6bf3c02c34d7d79e94c6606428d88c7b7f6577c1cdea64074abe8e7286df1f0811dc9728260868de95d32efc96b6d084ff271a5f60defcc703e7a38e6e29ba9a3c5fc2c28076b6a896af1d34d78828ce9bddb1f34f9c9404430781298e201316725bbdbc993a41` }
+/// INTEGER { `00e1c6d927646c0916ec36826d594983740c21f1b074c4a1a59867c669795c85d3dc464c5b929e94bfb34e0dcc5014b10f13341ab7fdd5f60414d2a326cad41cc5` }
+/// INTEGER { `00da485997785cd5630fb0fd8c5254f98e538e18983aae9e6b7e6a5a7b5d343755b9218ebd40320d28387d789f76fa218bcc2d8b68a5f6418fbbeca5179ab3afbd` }
+/// INTEGER { `50fefc32649559616ed6534e154509329d93a3d810dbe5bdb982292cf78bd8badb8020ae8d57f4b71d05386ffe9e9db271ca3477a34999db76f8e5ece9c0d49d` }
+/// INTEGER { `15b74cf27cceff8bb36bf04d9d8346b09a2f70d2f4439b0f26ac7e03f7e9d1f77d4b915fd29b2823f03acb5d5200e0857ff2a803e93eee96d6235ce95442bc21` }
+/// INTEGER { `0090a745da8970b2cd649660324228c5f82856ffd665ba9a85c8d60f1b8bee717ecd2c72eae01dad86ba7654d4cf45adb5f1f2b31d9f8122cfa5f1a5570f9b2d25` }
+/// }
+/// ```
+const RSA_ATTEST_KEY: &str = concat!(
+ "3082025d02010002818100c08323dc56881bb8302069f5b08561c6eebe7f05e2",
+ "f5a842048abe8b47be76feaef25cf29b2afa3200141601429989a15fcfc6815e",
+ "b363583c2fd2f20be4983283dd814b16d7e185417ae54abc296a3a6db5c00408",
+ "3b68c556c1f02339916419864d50b74d40aeca484c77356c895a0c275abfac49",
+ "9d5d7d2362f29c5e02e871020301000102818100be860b0b99a802a6fb1a5943",
+ "8a7bb715065b09a36dc6e9cacc6bf3c02c34d7d79e94c6606428d88c7b7f6577",
+ "c1cdea64074abe8e7286df1f0811dc9728260868de95d32efc96b6d084ff271a",
+ "5f60defcc703e7a38e6e29ba9a3c5fc2c28076b6a896af1d34d78828ce9bddb1",
+ "f34f9c9404430781298e201316725bbdbc993a41024100e1c6d927646c0916ec",
+ "36826d594983740c21f1b074c4a1a59867c669795c85d3dc464c5b929e94bfb3",
+ "4e0dcc5014b10f13341ab7fdd5f60414d2a326cad41cc5024100da485997785c",
+ "d5630fb0fd8c5254f98e538e18983aae9e6b7e6a5a7b5d343755b9218ebd4032",
+ "0d28387d789f76fa218bcc2d8b68a5f6418fbbeca5179ab3afbd024050fefc32",
+ "649559616ed6534e154509329d93a3d810dbe5bdb982292cf78bd8badb8020ae",
+ "8d57f4b71d05386ffe9e9db271ca3477a34999db76f8e5ece9c0d49d024015b7",
+ "4cf27cceff8bb36bf04d9d8346b09a2f70d2f4439b0f26ac7e03f7e9d1f77d4b",
+ "915fd29b2823f03acb5d5200e0857ff2a803e93eee96d6235ce95442bc210241",
+ "0090a745da8970b2cd649660324228c5f82856ffd665ba9a85c8d60f1b8bee71",
+ "7ecd2c72eae01dad86ba7654d4cf45adb5f1f2b31d9f8122cfa5f1a5570f9b2d",
+ "25",
+);
+
+/// Attestation certificate corresponding to [`RSA_ATTEST_KEY`], signed by the key in
+/// [`RSA_ATTEST_ROOT_CERT`].
+///
+/// Decoded contents:
+///
+/// ```
+/// Certificate:
+/// Data:
+/// Version: 3 (0x2)
+/// Serial Number: 4096 (0x1000)
+/// Signature Algorithm: SHA256-RSA
+/// Issuer: C=US, O=Google, Inc., OU=Android, L=Mountain View, ST=California
+/// Validity:
+/// Not Before: 2016-01-04 12:40:53 +0000 UTC
+/// Not After : 2035-12-30 12:40:53 +0000 UTC
+/// Subject: C=US, O=Google, Inc., OU=Android, ST=California, CN=Android Software Attestation Key
+/// Subject Public Key Info:
+/// Public Key Algorithm: rsaEncryption
+/// Public Key: (1024 bit)
+/// Modulus:
+/// c0:83:23:dc:56:88:1b:b8:30:20:69:f5:b0:85:61:
+/// c6:ee:be:7f:05:e2:f5:a8:42:04:8a:be:8b:47:be:
+/// 76:fe:ae:f2:5c:f2:9b:2a:fa:32:00:14:16:01:42:
+/// 99:89:a1:5f:cf:c6:81:5e:b3:63:58:3c:2f:d2:f2:
+/// 0b:e4:98:32:83:dd:81:4b:16:d7:e1:85:41:7a:e5:
+/// 4a:bc:29:6a:3a:6d:b5:c0:04:08:3b:68:c5:56:c1:
+/// f0:23:39:91:64:19:86:4d:50:b7:4d:40:ae:ca:48:
+/// 4c:77:35:6c:89:5a:0c:27:5a:bf:ac:49:9d:5d:7d:
+/// 23:62:f2:9c:5e:02:e8:71:
+/// Exponent: 65537 (0x10001)
+/// X509v3 extensions:
+/// X509v3 Authority Key Identifier:
+/// keyid:29faf1accc4dd24c96402775b6b0e932e507fe2e
+/// X509v3 Subject Key Identifier:
+/// keyid:d40c101bf8cd63b9f73952b50e135ca6d7999386
+/// X509v3 Key Usage: critical
+/// Digital Signature, Certificate Signing
+/// X509v3 Basic Constraints: critical
+/// CA:true, pathlen:0
+/// Signature Algorithm: SHA256-RSA
+/// 9e:2d:48:5f:8c:67:33:dc:1a:85:ad:99:d7:50:23:ea:14:ec:
+/// 43:b0:e1:9d:ea:c2:23:46:1e:72:b5:19:dc:60:22:e4:a5:68:
+/// 31:6c:0b:55:c4:e6:9c:a2:2d:9f:3a:4f:93:6b:31:8b:16:78:
+/// 16:0d:88:cb:d9:8b:cc:80:9d:84:f0:c2:27:e3:6b:38:f1:fd:
+/// d1:e7:17:72:31:59:35:7d:96:f3:c5:7f:ab:9d:8f:96:61:26:
+/// 4f:b2:be:81:bb:0d:49:04:22:8a:ce:9f:f7:f5:42:2e:25:44:
+/// fa:21:07:12:5a:83:b5:55:ad:18:82:f8:40:14:9b:9c:20:63:
+/// 04:7f:
+/// ```
+const RSA_ATTEST_CERT: &str = concat!(
+ "308202b63082021fa00302010202021000300d06092a864886f70d01010b0500",
+ "3063310b30090603550406130255533113301106035504080c0a43616c69666f",
+ "726e69613116301406035504070c0d4d6f756e7461696e205669657731153013",
+ "060355040a0c0c476f6f676c652c20496e632e3110300e060355040b0c07416e",
+ "64726f6964301e170d3136303130343132343035335a170d3335313233303132",
+ "343035335a3076310b30090603550406130255533113301106035504080c0a43",
+ "616c69666f726e696131153013060355040a0c0c476f6f676c652c20496e632e",
+ "3110300e060355040b0c07416e64726f69643129302706035504030c20416e64",
+ "726f696420536f667477617265204174746573746174696f6e204b657930819f",
+ "300d06092a864886f70d010101050003818d0030818902818100c08323dc5688",
+ "1bb8302069f5b08561c6eebe7f05e2f5a842048abe8b47be76feaef25cf29b2a",
+ "fa3200141601429989a15fcfc6815eb363583c2fd2f20be4983283dd814b16d7",
+ "e185417ae54abc296a3a6db5c004083b68c556c1f02339916419864d50b74d40",
+ "aeca484c77356c895a0c275abfac499d5d7d2362f29c5e02e8710203010001a3",
+ "663064301d0603551d0e04160414d40c101bf8cd63b9f73952b50e135ca6d799",
+ "9386301f0603551d2304183016801429faf1accc4dd24c96402775b6b0e932e5",
+ "07fe2e30120603551d130101ff040830060101ff020100300e0603551d0f0101",
+ "ff040403020284300d06092a864886f70d01010b0500038181009e2d485f8c67",
+ "33dc1a85ad99d75023ea14ec43b0e19deac223461e72b519dc6022e4a568316c",
+ "0b55c4e69ca22d9f3a4f936b318b1678160d88cbd98bcc809d84f0c227e36b38",
+ "f1fdd1e717723159357d96f3c57fab9d8f9661264fb2be81bb0d4904228ace9f",
+ "f7f5422e2544fa2107125a83b555ad1882f840149b9c2063047f",
+);
+
+/// Attestation self-signed root certificate holding the key that signed [`RSA_ATTEST_CERT`].
+///
+/// Decoded contents:
+///
+/// ```
+/// Certificate:
+/// Data:
+/// Version: 3 (0x2)
+/// Serial Number: 18416584322103887884 (0xff94d9dd9f07c80c)
+/// Signature Algorithm: SHA256-RSA
+/// Issuer: C=US, O=Google, Inc., OU=Android, L=Mountain View, ST=California
+/// Validity:
+/// Not Before: 2016-01-04 12:31:08 +0000 UTC
+/// Not After : 2035-12-30 12:31:08 +0000 UTC
+/// Subject: C=US, O=Google, Inc., OU=Android, L=Mountain View, ST=California
+/// Subject Public Key Info:
+/// Public Key Algorithm: rsaEncryption
+/// Public Key: (1024 bit)
+/// Modulus:
+/// a2:6b:ad:eb:6e:2e:44:61:ef:d5:0e:82:e6:b7:94:
+/// d1:75:23:1f:77:9b:63:91:63:ff:f7:aa:ff:0b:72:
+/// 47:4e:c0:2c:43:ec:33:7c:d7:ac:ed:40:3e:8c:28:
+/// a0:66:d5:f7:87:0b:33:97:de:0e:b8:4e:13:40:ab:
+/// af:a5:27:bf:95:69:a0:31:db:06:52:65:f8:44:59:
+/// 57:61:f0:bb:f2:17:4b:b7:41:80:64:c0:28:0e:8f:
+/// 52:77:8e:db:d2:47:b6:45:e9:19:c8:e9:8b:c3:db:
+/// c2:91:3f:d7:d7:50:c4:1d:35:66:f9:57:e4:97:96:
+/// 0b:09:ac:ce:92:35:85:9b:
+/// Exponent: 65537 (0x10001)
+/// X509v3 extensions:
+/// X509v3 Authority Key Identifier:
+/// keyid:29faf1accc4dd24c96402775b6b0e932e507fe2e
+/// X509v3 Subject Key Identifier:
+/// keyid:29faf1accc4dd24c96402775b6b0e932e507fe2e
+/// X509v3 Key Usage: critical
+/// Digital Signature, Certificate Signing
+/// X509v3 Basic Constraints: critical
+/// CA:true
+/// Signature Algorithm: SHA256-RSA
+/// 4f:72:f3:36:59:8d:0e:c1:b9:74:5b:31:59:f6:f0:8d:25:49:
+/// 30:9e:a3:1c:1c:29:d2:45:2d:20:b9:4d:5f:64:b4:e8:80:c7:
+/// 78:7a:9c:39:de:a8:b3:f5:bf:2f:70:5f:47:10:5c:c5:e6:eb:
+/// 4d:06:99:61:d2:ae:9a:07:ff:f7:7c:b8:ab:eb:9c:0f:24:07:
+/// 5e:b1:7f:ba:79:71:fd:4d:5b:9e:df:14:a9:fe:df:ed:7c:c0:
+/// 88:5d:f8:dd:9b:64:32:56:d5:35:9a:e2:13:f9:8f:ce:c1:7c:
+/// dc:ef:a4:aa:b2:55:c3:83:a9:2e:fb:5c:f6:62:f5:27:52:17:
+/// be:63:
+/// ```
+const RSA_ATTEST_ROOT_CERT: &str = concat!(
+ "308202a730820210a003020102020900ff94d9dd9f07c80c300d06092a864886",
+ "f70d01010b05003063310b30090603550406130255533113301106035504080c",
+ "0a43616c69666f726e69613116301406035504070c0d4d6f756e7461696e2056",
+ "69657731153013060355040a0c0c476f6f676c652c20496e632e3110300e0603",
+ "55040b0c07416e64726f6964301e170d3136303130343132333130385a170d33",
+ "35313233303132333130385a3063310b30090603550406130255533113301106",
+ "035504080c0a43616c69666f726e69613116301406035504070c0d4d6f756e74",
+ "61696e205669657731153013060355040a0c0c476f6f676c652c20496e632e31",
+ "10300e060355040b0c07416e64726f696430819f300d06092a864886f70d0101",
+ "01050003818d0030818902818100a26badeb6e2e4461efd50e82e6b794d17523",
+ "1f779b639163fff7aaff0b72474ec02c43ec337cd7aced403e8c28a066d5f787",
+ "0b3397de0eb84e1340abafa527bf9569a031db065265f844595761f0bbf2174b",
+ "b7418064c0280e8f52778edbd247b645e919c8e98bc3dbc2913fd7d750c41d35",
+ "66f957e497960b09acce9235859b0203010001a3633061301d0603551d0e0416",
+ "041429faf1accc4dd24c96402775b6b0e932e507fe2e301f0603551d23041830",
+ "16801429faf1accc4dd24c96402775b6b0e932e507fe2e300f0603551d130101",
+ "ff040530030101ff300e0603551d0f0101ff040403020284300d06092a864886",
+ "f70d01010b0500038181004f72f336598d0ec1b9745b3159f6f08d2549309ea3",
+ "1c1c29d2452d20b94d5f64b4e880c7787a9c39dea8b3f5bf2f705f47105cc5e6",
+ "eb4d069961d2ae9a07fff77cb8abeb9c0f24075eb17fba7971fd4d5b9edf14a9",
+ "fedfed7cc0885df8dd9b643256d5359ae213f98fcec17cdcefa4aab255c383a9",
+ "2efb5cf662f5275217be63",
+);
+
+/// EC attestation private key in `ECPrivateKey` format.
+///
+/// Decoded contents (using [der2ascii](https://github.com/google/der-ascii)):
+///
+/// ```
+/// SEQUENCE {
+/// INTEGER { 1 }
+/// OCTET_STRING { `21e086432a15198459cf363a50fc14c9daadf935f527c2dfd71e4d6dbc42e544` }
+/// [0] {
+/// # secp256r1
+/// OBJECT_IDENTIFIER { 1.2.840.10045.3.1.7 }
+/// }
+/// [1] {
+/// BIT_STRING { `00` `04eb9e79f8426359accb2a914c8986cc70ad90669382a9732613feaccbf821274c2174974a2afea5b94d7f66d4e065106635bc53b7a0a3a671583edb3e11ae1014` }
+/// }
+/// }
+/// ```
+const EC_ATTEST_KEY: &str = concat!(
+ "3077020101042021e086432a15198459cf363a50fc14c9daadf935f527c2dfd7",
+ "1e4d6dbc42e544a00a06082a8648ce3d030107a14403420004eb9e79f8426359",
+ "accb2a914c8986cc70ad90669382a9732613feaccbf821274c2174974a2afea5",
+ "b94d7f66d4e065106635bc53b7a0a3a671583edb3e11ae1014",
+);
+
+/// Attestation certificate corresponding to [`EC_ATTEST_KEY`], signed by the key in
+/// [`EC_ATTEST_ROOT_CERT`].
+///
+/// Decoded contents:
+///
+/// ```
+/// Certificate:
+/// Data:
+/// Version: 3 (0x2)
+/// Serial Number: 4097 (0x1001)
+/// Signature Algorithm: ECDSA-SHA256
+/// Issuer: C=US, O=Google, Inc., OU=Android, L=Mountain View, ST=California, CN=Android Keystore Software Attestation Root
+/// Validity:
+/// Not Before: 2016-01-11 00:46:09 +0000 UTC
+/// Not After : 2026-01-08 00:46:09 +0000 UTC
+/// Subject: C=US, O=Google, Inc., OU=Android, ST=California, CN=Android Keystore Software Attestation Intermediate
+/// Subject Public Key Info:
+/// Public Key Algorithm: id-ecPublicKey
+/// Public Key: (256 bit)
+/// pub:
+/// 04:eb:9e:79:f8:42:63:59:ac:cb:2a:91:4c:89:86:
+/// cc:70:ad:90:66:93:82:a9:73:26:13:fe:ac:cb:f8:
+/// 21:27:4c:21:74:97:4a:2a:fe:a5:b9:4d:7f:66:d4:
+/// e0:65:10:66:35:bc:53:b7:a0:a3:a6:71:58:3e:db:
+/// 3e:11:ae:10:14:
+/// ASN1 OID: prime256v1
+/// X509v3 extensions:
+/// X509v3 Authority Key Identifier:
+/// keyid:c8ade9774c45c3a3cf0d1610e479433a215a30cf
+/// X509v3 Subject Key Identifier:
+/// keyid:3ffcacd61ab13a9e8120b8d5251cc565bb1e91a9
+/// X509v3 Key Usage: critical
+/// Digital Signature, Certificate Signing
+/// X509v3 Basic Constraints: critical
+/// CA:true, pathlen:0
+/// Signature Algorithm: ECDSA-SHA256
+/// 30:45:02:20:4b:8a:9b:7b:ee:82:bc:c0:33:87:ae:2f:c0:89:
+/// 98:b4:dd:c3:8d:ab:27:2a:45:9f:69:0c:c7:c3:92:d4:0f:8e:
+/// 02:21:00:ee:da:01:5d:b6:f4:32:e9:d4:84:3b:62:4c:94:04:
+/// ef:3a:7c:cc:bd:5e:fb:22:bb:e7:fe:b9:77:3f:59:3f:fb:
+/// ```
+const EC_ATTEST_CERT: &str = concat!(
+ "308202783082021ea00302010202021001300a06082a8648ce3d040302308198",
+ "310b30090603550406130255533113301106035504080c0a43616c69666f726e",
+ "69613116301406035504070c0d4d6f756e7461696e2056696577311530130603",
+ "55040a0c0c476f6f676c652c20496e632e3110300e060355040b0c07416e6472",
+ "6f69643133303106035504030c2a416e64726f6964204b657973746f72652053",
+ "6f667477617265204174746573746174696f6e20526f6f74301e170d31363031",
+ "31313030343630395a170d3236303130383030343630395a308188310b300906",
+ "03550406130255533113301106035504080c0a43616c69666f726e6961311530",
+ "13060355040a0c0c476f6f676c652c20496e632e3110300e060355040b0c0741",
+ "6e64726f6964313b303906035504030c32416e64726f6964204b657973746f72",
+ "6520536f667477617265204174746573746174696f6e20496e7465726d656469",
+ "6174653059301306072a8648ce3d020106082a8648ce3d03010703420004eb9e",
+ "79f8426359accb2a914c8986cc70ad90669382a9732613feaccbf821274c2174",
+ "974a2afea5b94d7f66d4e065106635bc53b7a0a3a671583edb3e11ae1014a366",
+ "3064301d0603551d0e041604143ffcacd61ab13a9e8120b8d5251cc565bb1e91",
+ "a9301f0603551d23041830168014c8ade9774c45c3a3cf0d1610e479433a215a",
+ "30cf30120603551d130101ff040830060101ff020100300e0603551d0f0101ff",
+ "040403020284300a06082a8648ce3d040302034800304502204b8a9b7bee82bc",
+ "c03387ae2fc08998b4ddc38dab272a459f690cc7c392d40f8e022100eeda015d",
+ "b6f432e9d4843b624c9404ef3a7cccbd5efb22bbe7feb9773f593ffb",
+);
+
+/// Attestation self-signed root certificate holding the key that signed [`EC_ATTEST_CERT`].
+///
+/// Decoded contents:
+///
+/// ```
+/// Certificate:
+/// Data:
+/// Version: 3 (0x2)
+/// Serial Number: 11674912229752527703 (0xa2059ed10e435b57)
+/// Signature Algorithm: ECDSA-SHA256
+/// Issuer: C=US, O=Google, Inc., OU=Android, L=Mountain View, ST=California, CN=Android Keystore Software Attestation Root
+/// Validity:
+/// Not Before: 2016-01-11 00:43:50 +0000 UTC
+/// Not After : 2036-01-06 00:43:50 +0000 UTC
+/// Subject: C=US, O=Google, Inc., OU=Android, L=Mountain View, ST=California, CN=Android Keystore Software Attestation Root
+/// Subject Public Key Info:
+/// Public Key Algorithm: id-ecPublicKey
+/// Public Key: (256 bit)
+/// pub:
+/// 04:ee:5d:5e:c7:e1:c0:db:6d:03:a6:7e:e6:b6:1b:
+/// ec:4d:6a:5d:6a:68:2e:0f:ff:7f:49:0e:7d:77:1f:
+/// 44:22:6d:bd:b1:af:fa:16:cb:c7:ad:c5:77:d2:56:
+/// 9c:aa:b7:b0:2d:54:01:5d:3e:43:2b:2a:8e:d7:4e:
+/// ec:48:75:41:a4:
+/// ASN1 OID: prime256v1
+/// X509v3 extensions:
+/// X509v3 Authority Key Identifier:
+/// keyid:c8ade9774c45c3a3cf0d1610e479433a215a30cf
+/// X509v3 Subject Key Identifier:
+/// keyid:c8ade9774c45c3a3cf0d1610e479433a215a30cf
+/// X509v3 Key Usage: critical
+/// Digital Signature, Certificate Signing
+/// X509v3 Basic Constraints: critical
+/// CA:true
+/// Signature Algorithm: ECDSA-SHA256
+/// 30:44:02:20:35:21:a3:ef:8b:34:46:1e:9c:d5:60:f3:1d:58:
+/// 89:20:6a:dc:a3:65:41:f6:0d:9e:ce:8a:19:8c:66:48:60:7b:
+/// 02:20:4d:0b:f3:51:d9:30:7c:7d:5b:da:35:34:1d:a8:47:1b:
+/// 63:a5:85:65:3c:ad:4f:24:a7:e7:4d:af:41:7d:f1:bf:
+/// ```
+const EC_ATTEST_ROOT_CERT: &str = concat!(
+ "3082028b30820232a003020102020900a2059ed10e435b57300a06082a8648ce",
+ "3d040302308198310b30090603550406130255533113301106035504080c0a43",
+ "616c69666f726e69613116301406035504070c0d4d6f756e7461696e20566965",
+ "7731153013060355040a0c0c476f6f676c652c20496e632e3110300e06035504",
+ "0b0c07416e64726f69643133303106035504030c2a416e64726f6964204b6579",
+ "73746f726520536f667477617265204174746573746174696f6e20526f6f7430",
+ "1e170d3136303131313030343335305a170d3336303130363030343335305a30",
+ "8198310b30090603550406130255533113301106035504080c0a43616c69666f",
+ "726e69613116301406035504070c0d4d6f756e7461696e205669657731153013",
+ "060355040a0c0c476f6f676c652c20496e632e3110300e060355040b0c07416e",
+ "64726f69643133303106035504030c2a416e64726f6964204b657973746f7265",
+ "20536f667477617265204174746573746174696f6e20526f6f74305930130607",
+ "2a8648ce3d020106082a8648ce3d03010703420004ee5d5ec7e1c0db6d03a67e",
+ "e6b61bec4d6a5d6a682e0fff7f490e7d771f44226dbdb1affa16cbc7adc577d2",
+ "569caab7b02d54015d3e432b2a8ed74eec487541a4a3633061301d0603551d0e",
+ "04160414c8ade9774c45c3a3cf0d1610e479433a215a30cf301f0603551d2304",
+ "1830168014c8ade9774c45c3a3cf0d1610e479433a215a30cf300f0603551d13",
+ "0101ff040530030101ff300e0603551d0f0101ff040403020284300a06082a86",
+ "48ce3d040302034700304402203521a3ef8b34461e9cd560f31d5889206adca3",
+ "6541f60d9ece8a198c6648607b02204d0bf351d9307c7d5bda35341da8471b63",
+ "a585653cad4f24a7e74daf417df1bf",
+);
+
+/// Per-algorithm attestation certificate signing information.
+pub struct CertSignAlgoInfo {
+ key: KeyMaterial,
+ chain: Vec<keymint::Certificate>,
+}
+
+/// Certificate signing information for all asymmetric key types.
+pub struct CertSignInfo {
+ rsa_info: CertSignAlgoInfo,
+ ec_info: CertSignAlgoInfo,
+}
+
+impl CertSignInfo {
+ /// Create a new cert signing impl.
+ pub fn new() -> Self {
+ CertSignInfo {
+ rsa_info: CertSignAlgoInfo {
+ key: KeyMaterial::Rsa(rsa::Key(hex::decode(RSA_ATTEST_KEY).unwrap()).into()),
+ chain: vec![
+ keymint::Certificate {
+ encoded_certificate: hex::decode(RSA_ATTEST_CERT).unwrap(),
+ },
+ keymint::Certificate {
+ encoded_certificate: hex::decode(RSA_ATTEST_ROOT_CERT).unwrap(),
+ },
+ ],
+ },
+ ec_info: CertSignAlgoInfo {
+ key: KeyMaterial::Ec(
+ EcCurve::P256,
+ CurveType::Nist,
+ ec::Key::P256(ec::NistKey(hex::decode(EC_ATTEST_KEY).unwrap())).into(),
+ ),
+ chain: vec![
+ keymint::Certificate {
+ encoded_certificate: hex::decode(EC_ATTEST_CERT).unwrap(),
+ },
+ keymint::Certificate {
+ encoded_certificate: hex::decode(EC_ATTEST_ROOT_CERT).unwrap(),
+ },
+ ],
+ },
+ }
+ }
+}
+
+impl RetrieveCertSigningInfo for CertSignInfo {
+ fn signing_key(&self, key_type: SigningKeyType) -> Result<KeyMaterial, Error> {
+ Ok(match key_type.algo_hint {
+ SigningAlgorithm::Rsa => self.rsa_info.key.clone(),
+ SigningAlgorithm::Ec => self.ec_info.key.clone(),
+ })
+ }
+
+ fn cert_chain(&self, key_type: SigningKeyType) -> Result<Vec<keymint::Certificate>, Error> {
+ Ok(match key_type.algo_hint {
+ SigningAlgorithm::Rsa => self.rsa_info.chain.clone(),
+ SigningAlgorithm::Ec => self.ec_info.chain.clone(),
+ })
+ }
+}
diff --git a/security/keymint/aidl/default/ta/clock.rs b/security/keymint/aidl/default/ta/clock.rs
new file mode 100644
index 0000000..03e04ec
--- /dev/null
+++ b/security/keymint/aidl/default/ta/clock.rs
@@ -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.
+
+//! Monotonic clock implementation.
+
+use kmr_common::crypto;
+
+/// Monotonic clock.
+pub struct StdClock;
+
+impl StdClock {
+ /// Create new clock instance, holding time since construction.
+ pub fn new() -> Self {
+ Self {}
+ }
+}
+
+impl crypto::MonotonicClock for StdClock {
+ fn now(&self) -> crypto::MillisecondsSinceEpoch {
+ let mut time = libc::timespec { tv_sec: 0, tv_nsec: 0 };
+ // Use `CLOCK_BOOTTIME` for consistency with the times used by the Cuttlefish
+ // C++ implementation of Gatekeeper.
+ let rc =
+ // Safety: `time` is a valid structure.
+ unsafe { libc::clock_gettime(libc::CLOCK_BOOTTIME, &mut time as *mut libc::timespec) };
+ if rc < 0 {
+ log::warn!("failed to get time!");
+ return crypto::MillisecondsSinceEpoch(0);
+ }
+ crypto::MillisecondsSinceEpoch(((time.tv_sec * 1000) + (time.tv_nsec / 1000 / 1000)).into())
+ }
+}
diff --git a/security/keymint/aidl/default/ta/lib.rs b/security/keymint/aidl/default/ta/lib.rs
new file mode 100644
index 0000000..f002422
--- /dev/null
+++ b/security/keymint/aidl/default/ta/lib.rs
@@ -0,0 +1,109 @@
+/*
+ * 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.
+ */
+
+//! Local in-process implementation of the KeyMint TA. This is insecure and should
+//! only be used for testing purposes.
+
+// This crate is `std` using, but some of the code uses macros from a `no_std` world.
+extern crate alloc;
+
+use kmr_common::crypto;
+use kmr_crypto_boring::{
+ aes::BoringAes, aes_cmac::BoringAesCmac, des::BoringDes, ec::BoringEc, eq::BoringEq,
+ hmac::BoringHmac, rng::BoringRng, rsa::BoringRsa, sha256::BoringSha256,
+};
+use kmr_ta::device::{
+ BootloaderDone, CsrSigningAlgorithm, Implementation, TrustedPresenceUnsupported,
+};
+use kmr_ta::{HardwareInfo, KeyMintTa, RpcInfo, RpcInfoV3};
+use kmr_wire::keymint::SecurityLevel;
+use kmr_wire::rpc::MINIMUM_SUPPORTED_KEYS_IN_CSR;
+use log::info;
+
+pub mod attest;
+pub mod clock;
+pub mod rpc;
+pub mod soft;
+
+/// Build a set of crypto trait implementations based around BoringSSL and the standard library
+/// clock.
+pub fn boringssl_crypto_impls() -> crypto::Implementation {
+ let rng = BoringRng;
+ let clock = clock::StdClock::new();
+ let rsa = BoringRsa::default();
+ let ec = BoringEc::default();
+ crypto::Implementation {
+ rng: Box::new(rng),
+ clock: Some(Box::new(clock)),
+ compare: Box::new(BoringEq),
+ aes: Box::new(BoringAes),
+ des: Box::new(BoringDes),
+ hmac: Box::new(BoringHmac),
+ rsa: Box::new(rsa),
+ ec: Box::new(ec),
+ ckdf: Box::new(BoringAesCmac),
+ hkdf: Box::new(BoringHmac),
+ sha256: Box::new(BoringSha256),
+ }
+}
+
+/// Build a [`kmr_ta::KeyMintTa`] instance for nonsecure use.
+pub fn build_ta() -> kmr_ta::KeyMintTa {
+ info!("Building NON-SECURE KeyMint Rust TA");
+ let hw_info = HardwareInfo {
+ version_number: 1,
+ security_level: SecurityLevel::TrustedEnvironment,
+ impl_name: "Rust reference implementation",
+ author_name: "Google",
+ unique_id: "NON-SECURE KeyMint TA",
+ };
+ let rpc_sign_algo = CsrSigningAlgorithm::EdDSA;
+ let rpc_info_v3 = RpcInfoV3 {
+ author_name: "Google",
+ unique_id: "NON-SECURE KeyMint TA",
+ fused: false,
+ supported_num_of_keys_in_csr: MINIMUM_SUPPORTED_KEYS_IN_CSR,
+ };
+
+ let sign_info = attest::CertSignInfo::new();
+ let keys: Box<dyn kmr_ta::device::RetrieveKeyMaterial> = Box::new(soft::Keys);
+ let rpc: Box<dyn kmr_ta::device::RetrieveRpcArtifacts> = Box::new(soft::RpcArtifacts::new(
+ soft::Derive::default(),
+ rpc_sign_algo,
+ ));
+ let dev = Implementation {
+ keys,
+ sign_info: Some(Box::new(sign_info)),
+ // HAL populates attestation IDs from properties.
+ attest_ids: None,
+ sdd_mgr: None,
+ // `BOOTLOADER_ONLY` keys not supported.
+ bootloader: Box::new(BootloaderDone),
+ // `STORAGE_KEY` keys not supported.
+ sk_wrapper: None,
+ // `TRUSTED_USER_PRESENCE_REQUIRED` keys not supported
+ tup: Box::new(TrustedPresenceUnsupported),
+ // No support for converting previous implementation's keyblobs.
+ legacy_key: None,
+ rpc,
+ };
+ KeyMintTa::new(
+ hw_info,
+ RpcInfo::V3(rpc_info_v3),
+ boringssl_crypto_impls(),
+ dev,
+ )
+}
diff --git a/security/keymint/aidl/default/ta/rpc.rs b/security/keymint/aidl/default/ta/rpc.rs
new file mode 100644
index 0000000..39da50e
--- /dev/null
+++ b/security/keymint/aidl/default/ta/rpc.rs
@@ -0,0 +1,234 @@
+//
+// 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.
+
+//! Emulated implementation of device traits for `IRemotelyProvisionedComponent`.
+
+use core::cell::RefCell;
+use kmr_common::crypto::{ec, ec::CoseKeyPurpose, Ec, KeyMaterial};
+use kmr_common::{crypto, explicit, rpc_err, vec_try, Error};
+use kmr_crypto_boring::{ec::BoringEc, hmac::BoringHmac, rng::BoringRng};
+use kmr_ta::device::{
+ CsrSigningAlgorithm, DiceInfo, PubDiceArtifacts, RetrieveRpcArtifacts, RpcV2Req,
+};
+use kmr_wire::coset::{iana, CoseSign1Builder, HeaderBuilder};
+use kmr_wire::keymint::{Digest, EcCurve};
+use kmr_wire::{cbor::value::Value, coset::AsCborValue, rpc, CborError};
+
+/// Trait to encapsulate deterministic derivation of secret data.
+pub trait DeriveBytes {
+ /// Derive `output_len` bytes of data from `context`, deterministically.
+ fn derive_bytes(&self, context: &[u8], output_len: usize) -> Result<Vec<u8>, Error>;
+}
+
+/// Common emulated implementation of RPC artifact retrieval.
+pub struct Artifacts<T: DeriveBytes> {
+ derive: T,
+ sign_algo: CsrSigningAlgorithm,
+ // Invariant once populated: `self.dice_info.signing_algorithm` == `self.sign_algo`
+ dice_info: RefCell<Option<DiceInfo>>,
+ // Invariant once populated: `self.bcc_signing_key` is a variant that matches `self.sign_algo`
+ bcc_signing_key: RefCell<Option<ec::Key>>,
+}
+
+impl<T: DeriveBytes> RetrieveRpcArtifacts for Artifacts<T> {
+ fn derive_bytes_from_hbk(
+ &self,
+ _hkdf: &dyn crypto::Hkdf,
+ context: &[u8],
+ output_len: usize,
+ ) -> Result<Vec<u8>, Error> {
+ self.derive.derive_bytes(context, output_len)
+ }
+
+ fn get_dice_info(&self, _test_mode: rpc::TestMode) -> Result<DiceInfo, Error> {
+ if self.dice_info.borrow().is_none() {
+ let (dice_info, priv_key) = self.generate_dice_artifacts(rpc::TestMode(false))?;
+ *self.dice_info.borrow_mut() = Some(dice_info);
+ *self.bcc_signing_key.borrow_mut() = Some(priv_key);
+ }
+
+ Ok(self
+ .dice_info
+ .borrow()
+ .as_ref()
+ .ok_or_else(|| rpc_err!(Failed, "DICE artifacts are not initialized."))?
+ .clone())
+ }
+
+ fn sign_data(
+ &self,
+ ec: &dyn crypto::Ec,
+ data: &[u8],
+ _rpc_v2: Option<RpcV2Req>,
+ ) -> Result<Vec<u8>, Error> {
+ // DICE artifacts should have been initialized via `get_dice_info()` by the time this
+ // method is called.
+ let private_key = self
+ .bcc_signing_key
+ .borrow()
+ .as_ref()
+ .ok_or_else(|| rpc_err!(Failed, "DICE artifacts are not initialized."))?
+ .clone();
+
+ let mut op = ec.begin_sign(private_key.into(), self.signing_digest())?;
+ op.update(data)?;
+ let sig = op.finish()?;
+ crypto::ec::to_cose_signature(self.signing_curve(), sig)
+ }
+}
+
+impl<T: DeriveBytes> Artifacts<T> {
+ /// Constructor.
+ pub fn new(derive: T, sign_algo: CsrSigningAlgorithm) -> Self {
+ Self {
+ derive,
+ sign_algo,
+ dice_info: RefCell::new(None),
+ bcc_signing_key: RefCell::new(None),
+ }
+ }
+
+ /// Indicate the curve used in signing.
+ fn signing_curve(&self) -> EcCurve {
+ match self.sign_algo {
+ CsrSigningAlgorithm::ES256 => EcCurve::P256,
+ CsrSigningAlgorithm::ES384 => EcCurve::P384,
+ CsrSigningAlgorithm::EdDSA => EcCurve::Curve25519,
+ }
+ }
+
+ /// Indicate the digest used in signing.
+ fn signing_digest(&self) -> Digest {
+ match self.sign_algo {
+ CsrSigningAlgorithm::ES256 => Digest::Sha256,
+ CsrSigningAlgorithm::ES384 => Digest::Sha384,
+ CsrSigningAlgorithm::EdDSA => Digest::None,
+ }
+ }
+
+ /// Indicate the COSE algorithm value associated with signing.
+ fn signing_cose_algo(&self) -> iana::Algorithm {
+ match self.sign_algo {
+ CsrSigningAlgorithm::ES256 => iana::Algorithm::ES256,
+ CsrSigningAlgorithm::ES384 => iana::Algorithm::ES384,
+ CsrSigningAlgorithm::EdDSA => iana::Algorithm::EdDSA,
+ }
+ }
+
+ fn generate_dice_artifacts(
+ &self,
+ _test_mode: rpc::TestMode,
+ ) -> Result<(DiceInfo, ec::Key), Error> {
+ let ec = BoringEc::default();
+
+ let key_material = match self.sign_algo {
+ CsrSigningAlgorithm::EdDSA => {
+ let secret = self.derive_bytes_from_hbk(&BoringHmac, b"Device Key Seed", 32)?;
+ ec::import_raw_ed25519_key(&secret)
+ }
+ // TODO: generate the *same* key after reboot, by use of the TPM.
+ CsrSigningAlgorithm::ES256 => {
+ ec.generate_nist_key(&mut BoringRng, ec::NistCurve::P256, &[])
+ }
+ CsrSigningAlgorithm::ES384 => {
+ ec.generate_nist_key(&mut BoringRng, ec::NistCurve::P384, &[])
+ }
+ }?;
+ let (pub_cose_key, private_key) = match key_material {
+ KeyMaterial::Ec(curve, curve_type, key) => (
+ key.public_cose_key(
+ &ec,
+ curve,
+ curve_type,
+ CoseKeyPurpose::Sign,
+ None, /* no key ID */
+ rpc::TestMode(false),
+ )?,
+ key,
+ ),
+ _ => {
+ return Err(rpc_err!(
+ Failed,
+ "expected the Ec variant of KeyMaterial for the cdi leaf key."
+ ))
+ }
+ };
+
+ let cose_key_cbor = pub_cose_key.to_cbor_value().map_err(CborError::from)?;
+ let cose_key_cbor_data = kmr_ta::rkp::serialize_cbor(&cose_key_cbor)?;
+
+ // Construct `DiceChainEntryPayload`
+ let dice_chain_entry_payload = Value::Map(vec_try![
+ // Issuer
+ (
+ Value::Integer(1.into()),
+ Value::Text(String::from("Issuer"))
+ ),
+ // Subject
+ (
+ Value::Integer(2.into()),
+ Value::Text(String::from("Subject"))
+ ),
+ // Subject public key
+ (
+ Value::Integer((-4670552).into()),
+ Value::Bytes(cose_key_cbor_data)
+ ),
+ // Key Usage field contains a CBOR byte string of the bits which correspond
+ // to `keyCertSign` as per RFC 5280 Section 4.2.1.3 (in little-endian byte order)
+ (
+ Value::Integer((-4670553).into()),
+ Value::Bytes(vec_try![0x20]?)
+ ),
+ ]?);
+ let dice_chain_entry_payload_data = kmr_ta::rkp::serialize_cbor(&dice_chain_entry_payload)?;
+
+ // Construct `DiceChainEntry`
+ let protected = HeaderBuilder::new()
+ .algorithm(self.signing_cose_algo())
+ .build();
+ let dice_chain_entry = CoseSign1Builder::new()
+ .protected(protected)
+ .payload(dice_chain_entry_payload_data)
+ .try_create_signature(&[], |input| {
+ let mut op = ec.begin_sign(private_key.clone(), self.signing_digest())?;
+ op.update(input)?;
+ let sig = op.finish()?;
+ crypto::ec::to_cose_signature(self.signing_curve(), sig)
+ })?
+ .build();
+ let dice_chain_entry_cbor = dice_chain_entry.to_cbor_value().map_err(CborError::from)?;
+
+ // Construct `DiceCertChain`
+ let dice_cert_chain = Value::Array(vec_try![cose_key_cbor, dice_chain_entry_cbor]?);
+ let dice_cert_chain_data = kmr_ta::rkp::serialize_cbor(&dice_cert_chain)?;
+
+ // Construct `UdsCerts` as an empty CBOR map
+ let uds_certs_data = kmr_ta::rkp::serialize_cbor(&Value::Map(Vec::new()))?;
+
+ let pub_dice_artifacts = PubDiceArtifacts {
+ dice_cert_chain: dice_cert_chain_data,
+ uds_certs: uds_certs_data,
+ };
+
+ let dice_info = DiceInfo {
+ pub_dice_artifacts,
+ signing_algorithm: self.sign_algo,
+ rpc_v2_test_cdi_priv: None,
+ };
+
+ Ok((dice_info, explicit!(private_key)?))
+ }
+}
diff --git a/security/keymint/aidl/default/ta/soft.rs b/security/keymint/aidl/default/ta/soft.rs
new file mode 100644
index 0000000..5bbe060
--- /dev/null
+++ b/security/keymint/aidl/default/ta/soft.rs
@@ -0,0 +1,67 @@
+//
+// 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.
+
+//! Software-only trait implementations using fake keys.
+
+use kmr_common::{
+ crypto,
+ crypto::{Hkdf, Rng},
+ Error,
+};
+use kmr_crypto_boring::{hmac::BoringHmac, rng::BoringRng};
+use kmr_ta::device::RetrieveKeyMaterial;
+
+/// Root key retrieval using hard-coded fake keys.
+pub struct Keys;
+
+impl RetrieveKeyMaterial for Keys {
+ fn root_kek(&self, _context: &[u8]) -> Result<crypto::OpaqueOr<crypto::hmac::Key>, Error> {
+ // Matches `MASTER_KEY` in system/keymaster/key_blob_utils/software_keyblobs.cpp
+ Ok(crypto::hmac::Key::new([0; 16].to_vec()).into())
+ }
+ fn kak(&self) -> Result<crypto::OpaqueOr<crypto::aes::Key>, Error> {
+ // Matches `kFakeKeyAgreementKey` in
+ // system/keymaster/km_openssl/soft_keymaster_enforcement.cpp.
+ Ok(crypto::aes::Key::Aes256([0; 32]).into())
+ }
+ fn unique_id_hbk(&self, _ckdf: &dyn crypto::Ckdf) -> Result<crypto::hmac::Key, Error> {
+ // Matches value used in system/keymaster/contexts/pure_soft_keymaster_context.cpp.
+ crypto::hmac::Key::new_from(b"MustBeRandomBits")
+ }
+}
+
+/// Implementation of key derivation using a random fake key.
+pub struct Derive {
+ hbk: Vec<u8>,
+}
+
+impl Default for Derive {
+ fn default() -> Self {
+ // Use random data as an emulation of a hardware-backed key.
+ let mut hbk = vec![0; 32];
+ let mut rng = BoringRng;
+ rng.fill_bytes(&mut hbk);
+ Self { hbk }
+ }
+}
+
+impl crate::rpc::DeriveBytes for Derive {
+ fn derive_bytes(&self, context: &[u8], output_len: usize) -> Result<Vec<u8>, Error> {
+ BoringHmac.hkdf(&[], &self.hbk, context, output_len)
+ }
+}
+
+/// RPC artifact retrieval using software fake key.
+pub type RpcArtifacts = crate::rpc::Artifacts<Derive>;
diff --git a/security/keymint/aidl/vts/functional/Android.bp b/security/keymint/aidl/vts/functional/Android.bp
index 41b161d..7a135e1 100644
--- a/security/keymint/aidl/vts/functional/Android.bp
+++ b/security/keymint/aidl/vts/functional/Android.bp
@@ -45,7 +45,7 @@
"android.hardware.security.secureclock-V1-ndk",
"libavb_user",
"libavb",
- "libcppbor_external",
+ "libcppbor",
"libcppcose_rkp",
"libfs_mgr",
"libjsoncpp",
diff --git a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
index cc97c13..7fbca36 100644
--- a/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
+++ b/security/keymint/aidl/vts/functional/AttestKeyTest.cpp
@@ -20,6 +20,7 @@
#include <cutils/log.h>
#include <cutils/properties.h>
+#include <keymint_support/authorization_set.h>
#include <keymint_support/key_param_output.h>
#include <keymint_support/openssl_utils.h>
@@ -93,7 +94,7 @@
class AttestKeyTest : public KeyMintAidlTestBase {
public:
void SetUp() override {
- skipAttestKeyTest();
+ skipAttestKeyTestIfNeeded();
KeyMintAidlTestBase::SetUp();
}
};
@@ -273,7 +274,7 @@
/*
* AttestKeyTest.RsaAttestedAttestKeys
*
- * This test creates an RSA attestation key signed by factory keys, and varifies it can be
+ * This test creates an RSA attestation key signed by factory keys, and verifies it can be
* used to sign other RSA and EC keys.
*/
TEST_P(AttestKeyTest, RsaAttestedAttestKeys) {
@@ -305,9 +306,8 @@
.SetDefaultValidity(),
{} /* attestation signing key */, &attest_key.keyBlob,
&attest_key_characteristics, &attest_key_cert_chain);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) return;
+ if (isRkpOnly() && result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
+ GTEST_SKIP() << "RKP-only devices do not have a factory key";
}
ASSERT_EQ(ErrorCode::OK, result);
KeyBlobDeleter attest_deleter(keymint_, attest_key.keyBlob);
@@ -400,30 +400,32 @@
attest_key_opt = attest_key;
}
- auto result = GenerateAttestKey(AuthorizationSetBuilder()
- .RsaKey(2048, 65537)
- .AttestKey()
- .AttestationChallenge("foo")
- .AttestationApplicationId("bar")
- .Authorization(TAG_NO_AUTH_REQUIRED)
- .Authorization(TAG_CERTIFICATE_SERIAL, serial_blob)
- .Authorization(TAG_CERTIFICATE_SUBJECT, subject_der)
- .SetDefaultValidity(),
- attest_key_opt, &key_blob_list[i],
- &attested_key_characteristics, &cert_chain_list[i]);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) return;
+ AuthorizationSetBuilder auth_set_builder =
+ AuthorizationSetBuilder()
+ .RsaKey(2048, 65537)
+ .AttestKey()
+ .AttestationApplicationId("bar")
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .Authorization(TAG_CERTIFICATE_SERIAL, serial_blob)
+ .Authorization(TAG_CERTIFICATE_SUBJECT, subject_der)
+ .SetDefaultValidity();
+ // In RKP-only systems, the first key cannot be attested due to lack of batch key
+ if (!isRkpOnly() || i > 0) {
+ auth_set_builder.AttestationChallenge("foo");
}
+ auto result = GenerateAttestKey(auth_set_builder, attest_key_opt, &key_blob_list[i],
+ &attested_key_characteristics, &cert_chain_list[i]);
ASSERT_EQ(ErrorCode::OK, result);
deleters.push_back(KeyBlobDeleter(keymint_, key_blob_list[i]));
- AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
- AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
- ASSERT_GT(cert_chain_list[i].size(), 0);
- ASSERT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced, hw_enforced,
- SecLevel(),
- cert_chain_list[i][0].encodedCertificate));
+ if (!isRkpOnly() || i > 0) {
+ AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
+ AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
+ ASSERT_GT(cert_chain_list[i].size(), 0);
+ ASSERT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced,
+ hw_enforced, SecLevel(),
+ cert_chain_list[i][0].encodedCertificate));
+ }
if (i > 0) {
/*
@@ -439,7 +441,7 @@
}
EXPECT_TRUE(ChainSignaturesAreValid(cert_chain_list[i]));
- EXPECT_GT(cert_chain_list[i].size(), i + 1);
+ EXPECT_GT(cert_chain_list[i].size(), i + (isRkpOnly() ? 0 : 1));
verify_subject_and_serial(cert_chain_list[i][0], serial_int, subject, false);
}
}
@@ -475,36 +477,34 @@
attest_key_opt = attest_key;
}
- auto result = GenerateAttestKey(AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .AttestationChallenge("foo")
- .AttestationApplicationId("bar")
- .Authorization(TAG_CERTIFICATE_SERIAL, serial_blob)
- .Authorization(TAG_CERTIFICATE_SUBJECT, subject_der)
- .Authorization(TAG_NO_AUTH_REQUIRED)
- .SetDefaultValidity(),
- attest_key_opt, &key_blob_list[i],
- &attested_key_characteristics, &cert_chain_list[i]);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) return;
+ AuthorizationSetBuilder auth_set_builder =
+ AuthorizationSetBuilder()
+ .EcdsaKey(EcCurve::P_256)
+ .AttestKey()
+ .AttestationApplicationId("bar")
+ .Authorization(TAG_CERTIFICATE_SERIAL, serial_blob)
+ .Authorization(TAG_CERTIFICATE_SUBJECT, subject_der)
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .SetDefaultValidity();
+ // In RKP-only systems, the first key cannot be attested due to lack of batch key
+ if (!isRkpOnly() || i > 0) {
+ auth_set_builder.AttestationChallenge("foo");
}
+ auto result = GenerateAttestKey(auth_set_builder, attest_key_opt, &key_blob_list[i],
+ &attested_key_characteristics, &cert_chain_list[i]);
ASSERT_EQ(ErrorCode::OK, result);
deleters.push_back(KeyBlobDeleter(keymint_, key_blob_list[i]));
- AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
- AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
- ASSERT_GT(cert_chain_list[i].size(), 0);
- ASSERT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced, hw_enforced,
- SecLevel(),
- cert_chain_list[i][0].encodedCertificate));
+ if (!isRkpOnly() || i > 0) {
+ AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
+ AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
+ ASSERT_GT(cert_chain_list[i].size(), 0);
+ ASSERT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced,
+ hw_enforced, SecLevel(),
+ cert_chain_list[i][0].encodedCertificate));
+ }
if (i > 0) {
- /*
- * The first key is attestated with factory chain, but all the rest of the keys are
- * not supposed to be returned in attestation certificate chains.
- */
EXPECT_FALSE(ChainSignaturesAreValid(cert_chain_list[i]));
// Appending the attest_key chain to the attested_key_chain should yield a valid chain.
@@ -514,7 +514,7 @@
}
EXPECT_TRUE(ChainSignaturesAreValid(cert_chain_list[i]));
- EXPECT_GT(cert_chain_list[i].size(), i + 1);
+ EXPECT_GT(cert_chain_list[i].size(), i + (isRkpOnly() ? 0 : 1));
verify_subject_and_serial(cert_chain_list[i][0], serial_int, subject, false);
}
}
@@ -576,45 +576,36 @@
attest_key.keyBlob = key_blob_list[i - 1];
attest_key_opt = attest_key;
}
- ErrorCode result;
+ AuthorizationSetBuilder auth_set_builder =
+ AuthorizationSetBuilder()
+ .AttestKey()
+ .AttestationApplicationId("bar")
+ .Authorization(TAG_CERTIFICATE_SERIAL, serial_blob)
+ .Authorization(TAG_CERTIFICATE_SUBJECT, subject_der)
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .SetDefaultValidity();
+ // In RKP-only systems, the first key cannot be attested due to lack of batch key
+ if (!isRkpOnly() || i > 0) {
+ auth_set_builder.AttestationChallenge("foo");
+ }
if ((i & 0x1) == 1) {
- result = GenerateAttestKey(AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .AttestationChallenge("foo")
- .AttestationApplicationId("bar")
- .Authorization(TAG_CERTIFICATE_SERIAL, serial_blob)
- .Authorization(TAG_CERTIFICATE_SUBJECT, subject_der)
- .Authorization(TAG_NO_AUTH_REQUIRED)
- .SetDefaultValidity(),
- attest_key_opt, &key_blob_list[i],
- &attested_key_characteristics, &cert_chain_list[i]);
+ auth_set_builder.EcdsaKey(EcCurve::P_256);
} else {
- result = GenerateAttestKey(AuthorizationSetBuilder()
- .RsaKey(2048, 65537)
- .AttestKey()
- .AttestationChallenge("foo")
- .AttestationApplicationId("bar")
- .Authorization(TAG_CERTIFICATE_SERIAL, serial_blob)
- .Authorization(TAG_CERTIFICATE_SUBJECT, subject_der)
- .Authorization(TAG_NO_AUTH_REQUIRED)
- .SetDefaultValidity(),
- attest_key_opt, &key_blob_list[i],
- &attested_key_characteristics, &cert_chain_list[i]);
+ auth_set_builder.RsaKey(2048, 65537);
}
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) return;
- }
+ ErrorCode result = GenerateAttestKey(auth_set_builder, attest_key_opt, &key_blob_list[i],
+ &attested_key_characteristics, &cert_chain_list[i]);
ASSERT_EQ(ErrorCode::OK, result);
deleters.push_back(KeyBlobDeleter(keymint_, key_blob_list[i]));
- AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
- AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
- ASSERT_GT(cert_chain_list[i].size(), 0);
- ASSERT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced, hw_enforced,
- SecLevel(),
- cert_chain_list[i][0].encodedCertificate));
+ if (!isRkpOnly() || i > 0) {
+ AuthorizationSet hw_enforced = HwEnforcedAuthorizations(attested_key_characteristics);
+ AuthorizationSet sw_enforced = SwEnforcedAuthorizations(attested_key_characteristics);
+ ASSERT_GT(cert_chain_list[i].size(), 0);
+ ASSERT_TRUE(verify_attestation_record(AidlVersion(), "foo", "bar", sw_enforced,
+ hw_enforced, SecLevel(),
+ cert_chain_list[i][0].encodedCertificate));
+ }
if (i > 0) {
/*
@@ -630,7 +621,7 @@
}
EXPECT_TRUE(ChainSignaturesAreValid(cert_chain_list[i]));
- EXPECT_GT(cert_chain_list[i].size(), i + 1);
+ EXPECT_GT(cert_chain_list[i].size(), i + (isRkpOnly() ? 0 : 1));
verify_subject_and_serial(cert_chain_list[i][0], serial_int, subject, false);
}
}
diff --git a/security/keymint/aidl/vts/functional/AuthTest.cpp b/security/keymint/aidl/vts/functional/AuthTest.cpp
index eb5db68..f435513 100644
--- a/security/keymint/aidl/vts/functional/AuthTest.cpp
+++ b/security/keymint/aidl/vts/functional/AuthTest.cpp
@@ -455,18 +455,7 @@
.Authorization(TAG_AUTH_TIMEOUT, timeout_secs);
vector<uint8_t> keyblob;
vector<KeyCharacteristics> key_characteristics;
- vector<Certificate> cert_chain;
- auto result = GenerateKey(builder, std::nullopt, &keyblob, &key_characteristics, &cert_chain);
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(),
- builder, &keyblob, &key_characteristics,
- &cert_chain);
- }
- }
+ auto result = GenerateKey(builder, &keyblob, &key_characteristics);
ASSERT_EQ(ErrorCode::OK, result);
// Verify first user to get a HAT that should work.
diff --git a/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp b/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp
index 808ed18..c1f6aee 100644
--- a/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp
+++ b/security/keymint/aidl/vts/functional/BootloaderStateTest.cpp
@@ -54,18 +54,6 @@
.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.
diff --git a/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp b/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp
index 8e9aded..f669110 100644
--- a/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp
+++ b/security/keymint/aidl/vts/functional/DeviceUniqueAttestationTest.cpp
@@ -73,20 +73,22 @@
vector<KeyCharacteristics> key_characteristics;
// Check RSA implementation
- auto result = GenerateKey(AuthorizationSetBuilder()
- .Authorization(TAG_NO_AUTH_REQUIRED)
- .RsaSigningKey(2048, 65537)
- .Digest(Digest::SHA_2_256)
- .Padding(PaddingMode::RSA_PKCS1_1_5_SIGN)
- .Authorization(TAG_INCLUDE_UNIQUE_ID)
- .Authorization(TAG_CREATION_DATETIME, 1619621648000)
- .SetDefaultValidity()
- .AttestationChallenge("challenge")
- .AttestationApplicationId("foo")
- .Authorization(TAG_DEVICE_UNIQUE_ATTESTATION),
- &key_blob, &key_characteristics);
+ auto result =
+ GenerateKey(AuthorizationSetBuilder()
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .RsaSigningKey(2048, 65537)
+ .Digest(Digest::SHA_2_256)
+ .Padding(PaddingMode::RSA_PKCS1_1_5_SIGN)
+ .Authorization(TAG_INCLUDE_UNIQUE_ID)
+ .Authorization(TAG_CREATION_DATETIME, 1619621648000)
+ .SetDefaultValidity()
+ .AttestationChallenge("challenge")
+ .AttestationApplicationId("foo")
+ .Authorization(TAG_DEVICE_UNIQUE_ATTESTATION),
+ /*attest_key=*/std::nullopt, &key_blob, &key_characteristics, &cert_chain_);
- ASSERT_TRUE(result == ErrorCode::INVALID_ARGUMENT || result == ErrorCode::UNSUPPORTED_TAG);
+ ASSERT_TRUE(result == ErrorCode::INVALID_ARGUMENT || result == ErrorCode::UNSUPPORTED_TAG)
+ << "Result: " << result;
}
/*
@@ -104,19 +106,21 @@
vector<KeyCharacteristics> key_characteristics;
// Check Ecdsa implementation
- auto result = GenerateKey(AuthorizationSetBuilder()
- .Authorization(TAG_NO_AUTH_REQUIRED)
- .EcdsaSigningKey(EcCurve::P_256)
- .Digest(Digest::SHA_2_256)
- .Authorization(TAG_INCLUDE_UNIQUE_ID)
- .Authorization(TAG_CREATION_DATETIME, 1619621648000)
- .SetDefaultValidity()
- .AttestationChallenge("challenge")
- .AttestationApplicationId("foo")
- .Authorization(TAG_DEVICE_UNIQUE_ATTESTATION),
- &key_blob, &key_characteristics);
+ auto result =
+ GenerateKey(AuthorizationSetBuilder()
+ .Authorization(TAG_NO_AUTH_REQUIRED)
+ .EcdsaSigningKey(EcCurve::P_256)
+ .Digest(Digest::SHA_2_256)
+ .Authorization(TAG_INCLUDE_UNIQUE_ID)
+ .Authorization(TAG_CREATION_DATETIME, 1619621648000)
+ .SetDefaultValidity()
+ .AttestationChallenge("challenge")
+ .AttestationApplicationId("foo")
+ .Authorization(TAG_DEVICE_UNIQUE_ATTESTATION),
+ /*attest_key=*/std::nullopt, &key_blob, &key_characteristics, &cert_chain_);
- ASSERT_TRUE(result == ErrorCode::INVALID_ARGUMENT || result == ErrorCode::UNSUPPORTED_TAG);
+ ASSERT_TRUE(result == ErrorCode::INVALID_ARGUMENT || result == ErrorCode::UNSUPPORTED_TAG)
+ << "Result: " << result;
}
/*
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
index 087f763..332fcd4 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.cpp
@@ -20,6 +20,10 @@
#include <fstream>
#include <unordered_set>
#include <vector>
+#include "aidl/android/hardware/security/keymint/AttestationKey.h"
+#include "aidl/android/hardware/security/keymint/ErrorCode.h"
+#include "keymint_support/authorization_set.h"
+#include "keymint_support/keymint_tags.h"
#include <android-base/logging.h>
#include <android/binder_manager.h>
@@ -245,6 +249,13 @@
return AidlVersion() >= 3 && property_get_int32("ro.vendor.api_level", 0) > __ANDROID_API_T__;
}
+bool KeyMintAidlTestBase::isRkpOnly() {
+ if (SecLevel() == SecurityLevel::STRONGBOX) {
+ return property_get_bool("remote_provisioning.strongbox.rkp_only", false);
+ }
+ return property_get_bool("remote_provisioning.tee.rkp_only", false);
+}
+
bool KeyMintAidlTestBase::Curve25519Supported() {
// Strongbox never supports curve 25519.
if (SecLevel() == SecurityLevel::STRONGBOX) {
@@ -295,6 +306,40 @@
}
}
+ErrorCode KeyMintAidlTestBase::GenerateKey(const AuthorizationSet& key_desc) {
+ return GenerateKey(key_desc, &key_blob_, &key_characteristics_);
+}
+
+ErrorCode KeyMintAidlTestBase::GenerateKey(const AuthorizationSet& key_desc,
+ vector<uint8_t>* key_blob,
+ vector<KeyCharacteristics>* key_characteristics) {
+ std::optional<AttestationKey> attest_key = std::nullopt;
+ vector<Certificate> attest_cert_chain;
+ // If an attestation is requested, but the system is RKP-only, we need to supply an explicit
+ // attestation key. Else the result is a key without an attestation.
+ if (isRkpOnly() && key_desc.Contains(TAG_ATTESTATION_CHALLENGE)) {
+ skipAttestKeyTestIfNeeded();
+ AuthorizationSet attest_key_desc =
+ AuthorizationSetBuilder().EcdsaKey(EcCurve::P_256).AttestKey().SetDefaultValidity();
+ attest_key.emplace();
+ vector<KeyCharacteristics> attest_key_characteristics;
+ auto error = GenerateAttestKey(attest_key_desc, std::nullopt, &attest_key.value().keyBlob,
+ &attest_key_characteristics, &attest_cert_chain);
+ EXPECT_EQ(error, ErrorCode::OK);
+ EXPECT_EQ(attest_cert_chain.size(), 1);
+ attest_key.value().issuerSubjectName = make_name_from_str("Android Keystore Key");
+ }
+
+ ErrorCode error =
+ GenerateKey(key_desc, attest_key, key_blob, key_characteristics, &cert_chain_);
+
+ if (error == ErrorCode::OK && attest_cert_chain.size() > 0) {
+ cert_chain_.push_back(attest_cert_chain[0]);
+ }
+
+ return error;
+}
+
ErrorCode KeyMintAidlTestBase::GenerateKey(const AuthorizationSet& key_desc,
const optional<AttestationKey>& attest_key,
vector<uint8_t>* key_blob,
@@ -335,36 +380,6 @@
return GetReturnErrorCode(result);
}
-ErrorCode KeyMintAidlTestBase::GenerateKey(const AuthorizationSet& key_desc,
- const optional<AttestationKey>& attest_key) {
- return GenerateKey(key_desc, attest_key, &key_blob_, &key_characteristics_, &cert_chain_);
-}
-
-ErrorCode KeyMintAidlTestBase::GenerateKeyWithSelfSignedAttestKey(
- 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 = GenerateAttestKey(attest_key_desc, std::nullopt, &attest_key.keyBlob,
- &attest_key_characteristics, &attest_cert_chain);
- if (error != ErrorCode::OK) {
- return error;
- }
-
- attest_key.issuerSubjectName = make_name_from_str("Android Keystore Key");
- // Generate a key, by passing the above self signed attestation key as attest key.
- error = GenerateKey(key_desc, attest_key, key_blob, key_characteristics, cert_chain);
- if (error == ErrorCode::OK) {
- // Append the attest_cert_chain to the attested cert_chain to yield a valid cert chain.
- cert_chain->push_back(attest_cert_chain[0]);
- }
- return error;
-}
-
ErrorCode KeyMintAidlTestBase::ImportKey(const AuthorizationSet& key_desc, KeyFormat format,
const string& key_material, vector<uint8_t>* key_blob,
vector<KeyCharacteristics>* key_characteristics) {
@@ -1663,7 +1678,7 @@
// Skip a test that involves use of the ATTEST_KEY feature in specific configurations
// where ATTEST_KEY is not supported (for either StrongBox or TEE).
-void KeyMintAidlTestBase::skipAttestKeyTest(void) const {
+void KeyMintAidlTestBase::skipAttestKeyTestIfNeeded() const {
if (shouldSkipAttestKeyTest()) {
GTEST_SKIP() << "Test using ATTEST_KEY is not applicable on waivered device";
}
@@ -2024,7 +2039,7 @@
}
}
- if (KeyMintAidlTestBase::dump_Attestations) std::cout << cert_data.str();
+ if (KeyMintAidlTestBase::dump_Attestations) std::cout << "cert chain:\n" << cert_data.str();
return AssertionSuccess();
}
diff --git a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
index 4ed7698..b884cc7 100644
--- a/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
+++ b/security/keymint/aidl/vts/functional/KeyMintAidlTestBase.h
@@ -104,35 +104,19 @@
uint32_t boot_patch_level();
bool isDeviceIdAttestationRequired();
bool isSecondImeiIdAttestationRequired();
+ bool isRkpOnly();
bool Curve25519Supported();
+ ErrorCode GenerateKey(const AuthorizationSet& key_desc);
+
ErrorCode GenerateKey(const AuthorizationSet& key_desc, vector<uint8_t>* key_blob,
- vector<KeyCharacteristics>* key_characteristics) {
- return GenerateKey(key_desc, std::nullopt /* attest_key */, key_blob, key_characteristics,
- &cert_chain_);
- }
+ vector<KeyCharacteristics>* key_characteristics);
+
ErrorCode GenerateKey(const AuthorizationSet& key_desc,
const optional<AttestationKey>& attest_key, vector<uint8_t>* key_blob,
vector<KeyCharacteristics>* key_characteristics,
vector<Certificate>* cert_chain);
- ErrorCode GenerateKey(const AuthorizationSet& key_desc,
- const optional<AttestationKey>& attest_key = std::nullopt);
-
- // Generate key for implementations which do not support factory attestation.
- ErrorCode GenerateKeyWithSelfSignedAttestKey(const AuthorizationSet& attest_key_desc,
- const AuthorizationSet& key_desc,
- vector<uint8_t>* key_blob,
- vector<KeyCharacteristics>* key_characteristics,
- vector<Certificate>* cert_chain);
-
- ErrorCode GenerateKeyWithSelfSignedAttestKey(const AuthorizationSet& attest_key_desc,
- const AuthorizationSet& key_desc,
- vector<uint8_t>* key_blob,
- vector<KeyCharacteristics>* key_characteristics) {
- return GenerateKeyWithSelfSignedAttestKey(attest_key_desc, key_desc, key_blob,
- key_characteristics, &cert_chain_);
- }
ErrorCode ImportKey(const AuthorizationSet& key_desc, KeyFormat format,
const string& key_material, vector<uint8_t>* key_blob,
@@ -372,7 +356,7 @@
bool is_strongbox_enabled(void) const;
bool is_chipset_allowed_km4_strongbox(void) const;
bool shouldSkipAttestKeyTest(void) const;
- void skipAttestKeyTest(void) const;
+ void skipAttestKeyTestIfNeeded() const;
void assert_mgf_digests_present_or_not_in_key_characteristics(
const vector<KeyCharacteristics>& key_characteristics,
diff --git a/security/keymint/aidl/vts/functional/KeyMintTest.cpp b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
index e098aca..b65218f 100644
--- a/security/keymint/aidl/vts/functional/KeyMintTest.cpp
+++ b/security/keymint/aidl/vts/functional/KeyMintTest.cpp
@@ -37,6 +37,7 @@
#include <aidl/android/hardware/security/keymint/IRemotelyProvisionedComponent.h>
#include <aidl/android/hardware/security/keymint/KeyFormat.h>
+#include <keymint_support/authorization_set.h>
#include <keymint_support/key_param_output.h>
#include <keymint_support/openssl_utils.h>
@@ -1064,32 +1065,54 @@
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);
+ vector<uint64_t> test_vector_not_before_millis = {
+ 458046000000, /* 1984-07-07T11:00:00Z */
+ 1183806000000, /* 2007-07-07T11:00:00Z */
+ 1924991999000, /* 2030-12-31T23:59:59Z */
+ 3723753599000, /* 2087-12-31T23:59:59Z */
+ 26223868799000, /* 2800-12-31T23:59:59Z */
+ 45157996799000, /* 3400-12-31T23:59:59Z */
+ 60719587199000, /* 3894-02-15T23:59:59Z */
+ 95302051199000, /* 4989-12-31T23:59:59Z */
+ 86182012799000, /* 4700-12-31T23:59:59Z */
+ 111427574399000, /* 5500-12-31T23:59:59Z */
+ 136988668799000, /* 6310-12-31T23:59:59Z */
+ 139828895999000, /* 6400-12-31T23:59:59Z */
+ 169839503999000, /* 7351-12-31T23:59:59Z */
+ 171385804799000, /* 7400-12-31T23:59:59Z */
+ 190320019199000, /* 8000-12-31T23:59:59Z */
+ 193475692799000, /* 8100-12-31T23:59:59Z */
+ 242515209599000, /* 9654-12-31T23:59:59Z */
+ 250219065599000, /* 9899-02-15T23:59:59Z */
+ };
+ for (auto notBefore : test_vector_not_before_millis) {
+ uint64_t notAfter = notBefore + 378691200000 /* 12 years milliseconds*/;
+ SCOPED_TRACE(testing::Message() << "notBefore: " << notBefore << " notAfter: " << notAfter);
+ ASSERT_EQ(ErrorCode::OK,
+ GenerateKey(AuthorizationSetBuilder()
+ .RsaSigningKey(2048, 65537)
+ .Digest(Digest::NONE)
+ .Padding(PaddingMode::NONE)
+ .Authorization(TAG_CERTIFICATE_NOT_BEFORE, notBefore)
+ .Authorization(TAG_CERTIFICATE_NOT_AFTER, notAfter),
+ &key_blob, &key_characteristics));
+ ASSERT_GT(cert_chain_.size(), 0);
- X509_Ptr cert(parse_cert_blob(cert_chain_[0].encodedCertificate));
- ASSERT_TRUE(!!cert.get());
+ 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_before = X509_get0_notBefore(cert.get());
+ ASSERT_NE(not_before, nullptr);
+ int64_t not_before_time;
+ ASSERT_EQ(ASN1_TIME_to_posix(not_before, ¬_before_time), 1);
+ EXPECT_EQ(not_before_time, (notBefore / 1000));
- 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);
+ const ASN1_TIME* not_after = X509_get0_notAfter(cert.get());
+ ASSERT_NE(not_after, nullptr);
+ int64_t not_after_time;
+ ASSERT_EQ(ASN1_TIME_to_posix(not_after, ¬_after_time), 1);
+ EXPECT_EQ(not_after_time, (notAfter / 1000));
+ }
}
/*
@@ -1124,17 +1147,6 @@
.SetDefaultValidity();
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .RsaKey(key_size, 65537)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(ErrorCode::OK, result);
KeyBlobDeleter deleter(keymint_, key_blob);
ASSERT_GT(key_blob.size(), 0U);
@@ -1347,17 +1359,6 @@
.SetDefaultValidity();
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .RsaKey(key_size, 65537)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(ErrorCode::OK, result);
KeyBlobDeleter deleter(keymint_, key_blob);
@@ -1468,17 +1469,6 @@
.SetDefaultValidity();
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .RsaKey(2048, 65537)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(ErrorCode::ATTESTATION_APPLICATION_ID_MISSING, result);
}
@@ -1603,17 +1593,6 @@
.SetDefaultValidity();
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .RsaKey(key_size, 65537)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(ErrorCode::OK, result);
KeyBlobDeleter deleter(keymint_, key_blob);
@@ -1855,17 +1834,6 @@
.SetDefaultValidity();
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(curve)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(ErrorCode::OK, result);
KeyBlobDeleter deleter(keymint_, key_blob);
ASSERT_GT(key_blob.size(), 0U);
@@ -1998,17 +1966,6 @@
// Tag not required to be supported by all KeyMint implementations.
continue;
}
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(result, ErrorCode::OK);
KeyBlobDeleter deleter(keymint_, key_blob);
ASSERT_GT(key_blob.size(), 0U);
@@ -2060,18 +2017,6 @@
builder.push_back(tag);
auto error = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (error == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- error = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
-
device_id_attestation_check_acceptable_error(tag.tag, error);
}
}
@@ -2116,10 +2061,6 @@
AuthorizationSetBuilder builder = base_builder;
builder.push_back(tag);
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) return;
- }
if (result == ErrorCode::CANNOT_ATTEST_IDS && !isDeviceIdAttestationRequired()) {
// ID attestation was optional till api level 32, from api level 33 it is mandatory.
continue;
@@ -2177,16 +2118,6 @@
builder.Authorization(TAG_RESET_SINCE_ID_ROTATION);
}
auto result = GenerateKey(builder);
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob_, &key_characteristics_, &cert_chain_);
- }
- }
ASSERT_EQ(ErrorCode::OK, result);
ASSERT_GT(key_blob_.size(), 0U);
@@ -2287,17 +2218,6 @@
.SetDefaultValidity();
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(result, ErrorCode::OK);
KeyBlobDeleter deleter(keymint_, key_blob);
ASSERT_GT(key_blob.size(), 0U);
@@ -2382,17 +2302,6 @@
.SetDefaultValidity();
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(ErrorCode::ATTESTATION_APPLICATION_ID_MISSING, result);
}
@@ -2460,17 +2369,6 @@
.SetDefaultValidity();
auto result = GenerateKey(builder, &key_blob, &key_characteristics);
- // Strongbox may not support factory provisioned attestation key.
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob, &key_characteristics);
- }
- }
ASSERT_EQ(ErrorCode::OK, result);
KeyBlobDeleter deleter(keymint_, key_blob);
ASSERT_GT(key_blob.size(), 0U);
@@ -2696,7 +2594,8 @@
.AttestationChallenge(challenge)
.AttestationApplicationId(app_id)
.Authorization(TAG_MIN_MAC_LENGTH, 128),
- &key_blob, &key_characteristics));
+ /*attest_key=*/std::nullopt, &key_blob,
+ &key_characteristics, &cert_chain_));
KeyBlobDeleter deleter(keymint_, key_blob);
ASSERT_GT(key_blob.size(), 0U);
@@ -2885,7 +2784,9 @@
.EcbMode()
.Padding(PaddingMode::PKCS7)
.AttestationChallenge(challenge)
- .AttestationApplicationId(app_id)));
+ .AttestationApplicationId(app_id),
+ /*attest_key=*/std::nullopt, &key_blob_,
+ &key_characteristics_, &cert_chain_));
ASSERT_EQ(cert_chain_.size(), 0);
}
@@ -2906,7 +2807,9 @@
.Authorization(TAG_NO_AUTH_REQUIRED)
.Padding(PaddingMode::NONE)
.AttestationChallenge(challenge)
- .AttestationApplicationId(app_id)));
+ .AttestationApplicationId(app_id),
+ /*attest_key=*/std::nullopt, &key_blob_,
+ &key_characteristics_, &cert_chain_));
ASSERT_EQ(cert_chain_.size(), 0);
}
@@ -5200,6 +5103,149 @@
.Padding(PaddingMode::RSA_OAEP)));
}
+auto wrapped_rsa_key = hex2str(
+ "308206230201000482010060f81b63ae53aa4be2e91b0b7cbdabd108125836139e5b991f3e3c9a98eca6cb7188"
+ "fba1c1232605747ed118975870c886e583a0ff766fc32b789a17029955caaff39a9c6c439be168e24b51046683"
+ "ce16110e0df115ccabbadcbe7ea9118b9589e4cccf240b6f0a506dfee57e19738c3cabb7dbf63b43e1b9ab058b"
+ "41b9480f2797210ef2bfbecb82526ac60ac006ebe0a053e825ad996d0ce8a98dc1ebf6ad889e491e03e9ddcc05"
+ "63f31921b55a54c61aa7f846d814dfe548f2c7939940bc6cf20489733203732df924b2b2a5aa9b54d31e7e42b9"
+ "e6cf107182edd33cb8e41db88167a79a264bbf883e69300ac82aac8de9dca0a13900150111efead81b74040c78"
+ "01d20b1547cfef40de45da30350201013030a1083106020102020103a203020101a30402020800a40531030201"
+ "01a5053103020104a6053103020103bf8377020500048204c126cd1642e83dea941151d872de12b8aaa835446e"
+ "94d2c1ea99c030225c5cad125dabe2341d9aba63e4df7fefc51e8e6f623ffae2aab9927113562b674b3cc2d7fc"
+ "fc34f199151a56ab114e792e6a21bd3b31fbf0d93050b9f90fb8e6cad3a067a4033848c4380184990f19a141d9"
+ "527177fdc13d802c33d222206c36404518285fe7e631aaeb6072c22c351c8c9db06e0b24e11aecef305f6abefb"
+ "4f31111534f7c55da8cf0d33882edbb43765304d1d45545c5207a858ea8d4369393bf1c54624df03da86c0ed47"
+ "b9ce1297149622069d51d2512f656ad0d421e6ff746ce8f79920df6a204c31732414a2f7eb24f8c2950348187a"
+ "4ba20b88a72355a4ec2b383be9f9b5b9ad564aa4c81de47dd95d77a8156ed0901d005a26f523b2a82c2d25d64d"
+ "f7660a6d3a720a6ba1eafe71da9fed0265d37a475193525620e705a543a928827accad93aba90556da859808be"
+ "dc2a8105af252e883892f41679d0600ddefb84415145bc28a2d9b0c60cea1ed3876486950ae0532cc1e953b0b5"
+ "81314c74250550741b24e4221ebb2804428caa2f08356a7de853ccfc5b18c2179147a883fa5763dd54f0d45388"
+ "c72f1bea19675d14014a725e125cdfac98d1701d9562be9d75362ea238b93244f46306cee4d77cbb8cbe7bf22d"
+ "fe677bbb103c00a204e49a0731660a2b23ee73ec7297a17822d4c4468e271029f8f1e8995f1a37cdc38324ead3"
+ "2474e6ee3ff671803d8a98a870324364d408c4d966d3cf0b9bbcbdbdff34a3e9666705362bc78beb96df4b8964"
+ "d141022250f62d1433cba5d1f510859eff688e46ce65dea00f5ebcfe7a79081ef1f0f5584dba14b79bc5a5f309"
+ "a1e48fe2bd9e94fcd9793d9b3632ccc51f18f7453e897e33b729abd2d34be324acbc22dfbf1d089aa93a178f79"
+ "23344140a468ac120b2f0055c284576b968e1d5148c6879b207b6cdb4eb513bccca619ae12ef156a9df03d6d8c"
+ "2c1c2ea7109dbcb61e5a74b36d0a7529f38b9ea742a956376da823251a6126693e2e1dab55b643c4e9783db835"
+ "f64d91069a2de1cda55539da52cadeeba2d3278da9005d89b4de4c5571600823f53d9cab1b55f65a560479d9ee"
+ "edeb361ab80ccedd0a067ddf5de639d115ffb3acf07fbba1cba6daa524b99db0b785273f7b6c15c4237ce1dce8"
+ "1b81622f35f116b638c75f0e0b26ba6bd9c5caee60c8b4f9198052b25e8c101638598946cb02c14db0a21b46c6"
+ "61ea123b2a2b5a51eb059715ce26940c977715a32e288b713013d66d0dae398d546abcd8c80966190b77732a7c"
+ "e2b8fc83e0cd83f69adef2b24b69fba19c546362087c08c8dab941a8573a084be3407d45a318c9a299f69d79f6"
+ "fae0859d6f08ee7708cf6041cccd815c3515f792aefc23a624e8e58bd9c6fe2f8f1ca6dcf04c6fdfa23eb3ff74"
+ "c5e5c7388f9faa32c86b6cd7438774e6cf06cb23a32cddb04c30f7d11e221db306c7937796e70a4dcfb7415c04"
+ "7823b965bedeaea196dc30fe648c52f3c1bcee62b19d4cccdb740ca35c3f3daad998c99dc117fffb7d150d500f"
+ "812b60ebec8b2067b13938250d078768e77f898fcdfc5f3554b6eda9df3b42bef38bb4d67cb63b7ede01e93b4d"
+ "c7768b52aa8ad8fb7fb288a529b84671f1ff9e44bb7c8f05d99806b65eb8e90b530fef3817f9fc4c921d0d46af"
+ "11aee8252407adc6c54589e9f6e6c1e25fc7510cfe499ea20465610410bf575efdbeb5af763920c3b4cdc8401"
+ "2");
+
+auto wrapped_ec_key = hex2str(
+ "308201dd020100048201000bb910602f88b1419ada400c8ab7602cf2fdbb4ef5e36881255fd5f85d49c4110c52"
+ "c75eab5e27a1732c1afa17bfe2cd393dea0a78a77ee08759e984411d1c7f0dbdcb6b77e05556694534be4434d8"
+ "596a7152aec71481522c85f0cc4635df2875d58dc29a78317b2aedd3586055e6e2227616f6a8ac4b9db5a2ad0e"
+ "10f5c4b43374bd6c9f57f79a103e64084414cfab3d3e0b7c2f26eb00a62105b7d1c7f41b7292fd6fce9395f39c"
+ "e0b6da0b5bf0d29d8952b958bd29b47c5ebd20d53ade370f463e35a166c04af71e3d5ce550019d3d20a5544896"
+ "65d169875d0e6a52348b7ec39b674f818e9b60dfa284d7ae4188471d05b9b2d9a5f750f5a00af999c568040c31"
+ "4144bde8ada6279d32e61530270201013022a1083106020102020103a203020103a30402020100a50531030201"
+ "04bf837702050004818a96e0f8be5a263616b506371d3c2ff3a3c2bcffc3ce067b242af66e30d5cd975b9546eb"
+ "32216d4f083f08fde246ab05fd7e930a0f05701067b44840c01a6722e1b2408be5b6acd0b39a0329cb2f357515"
+ "876433b193382c0b18aed9ed244dcbef5d61d98ca480f99a6cf2a00efda22eb8750db1725e30f64770ac6862ac"
+ "44cfd08a2c55812b512a0b92f704105c80b6a23cf339b2b10c677613510b1b");
+
+auto wrapping_key_for_asym_keys = hex2str(
+ "308204bd020100300d06092a864886f70d0101010500048204a7308204a30201000282010100a7f521fe024ebc"
+ "659db8e7a32b41dba27c5d446cb3d064d594b811d4856c3a583d155b0ff9300df3745738c32c4c4cd15adb6090"
+ "72ca870364bb7f3485784fde12e598b486c91950b9c45016bcb73c3842747c871be02dfc5f0e4b96d1ff5c8a09"
+ "7ae77b27e46dc60f1f574d1bb5e97487c1c3f9b493509e07318e1a0f0e9fdae401f4a62a5dd54daa09bf88ef42"
+ "9923f6f6f55d239908f227676d0f0b618238728dc4babd2a1f7d15fa9827346a1a160ab9427461533006fdf34d"
+ "4efec9aeefcea80b3a7d4ee4a4550055f0030700c5d20abcc32ce74d90ffabf83e02a759ce9074809936564f3d"
+ "3039af9c5e8a6afd9aa5459ab35c3eb851f10b3ae88ba91f0203010001028201001885515124451a7c3b6aa366"
+ "cf09ee66ea81335c2b6461544d42125854a258624988b4a2c05ea3aac77174780a1f9997770c502cc6958ae093"
+ "f44bbdff3e716a9a97aa93b099eb783da6cb8a8642ba27fc8bc522748f66275239640fc0d8e749bfd891b3093f"
+ "f046da2e593088bb263a3d17ace4e7d81a0cf83fe3df2a139882bff509523a3f886922200168ddd8fb7b4c9f26"
+ "62ff941c37937cebbbfeba24dd78d5ccd42025cb0276fa5661965f529274520bbb9faf36c501cafb48e5e47ae0"
+ "6980334fa36b6c62e2da733a8c7f01067de17e38d32d4a0721a6d184405bceaebb39ed3838633e6fbe43ac8b23"
+ "337bfe33cdf0b67ac3938ddccc37d775ad150102818100d538885135037730fad28e987d7562c1ef8ca58f95f7"
+ "ed81cb165ca63e15e810552eb9d487c9b9cde563fb29d1de22a60d54a856385719a4028cf386bcdc88e858d963"
+ "6d644cea25e0ee54ad1237983d9a06a66ea2f764eb540a4992ba2291ea96d20dfbd98bf5b313322cda4eb6710d"
+ "020139e085beb8e52a3e69bd05c71c7b02818100c9a7c89b11fcf8d99eb41995b5641472ef972e5aaa1f1446d7"
+ "ea57a9979e8e64f72ef1cde358649b71be7f21dc19dab52814f9a521d8620bd994a9bb621a8182a250066a0728"
+ "f0b16ab93a106ed79bc19cd519e83196157a8c6f82b5144a285b9384415394905fe18863b0988b27e77c969a81"
+ "c34a074e8fef5908fdf3c51ead02818019d5e8c6963ade45640f01523ed96b66fe64b766e7900c0a4f165d9193"
+ "324a55384d1a1d437ad0f5bed6d78720b3ded4ea069903217e844fd833460acc75986d36ded86a57ddedfd3afd"
+ "05eb96aa7fdaeeffe148c49c5f711854cac769a068b7d92088ab3c97f5e485eded7b62503ef0898ea679ab1b0a"
+ "0252950f70e4f35463028181008ff4c027bb8aad17a5cd0a2aaea83854e8a73347340525d38115e0e8c7bd4007"
+ "e1d1d87ad35e69cbf2423cbdae43a2b70a5b16f0849dd53882663758f6aad763ab7d97669f9fe15bb6456ea706"
+ "89d2be3fb87d5b1df2f77859c2cd3b79b58ae3fd0640206b813981667d4c3749b7fdf01a0f48ad622e9f2def7e"
+ "cf0583bd67ad0281805bd8f20cc82cb5e08dc2e7eea977d4180a5ef4c558e01255b8475feb9084475e20328c93"
+ "5a2247a775c941d64372d01abb27c95ee7d4336b6cbce190808b2f7a8d314d785336397dd6edc0c778f563d37e"
+ "0057b13695600b92fececc3edb067f69b374f9b9c343220a8b927deb6104768edc72b87751e0a3fb1585e679c9"
+ "8564");
+
+TEST_P(ImportWrappedKeyTest, RsaKey) {
+ int vsr_api_level = get_vsr_api_level();
+ if (vsr_api_level < __ANDROID_API_V__) {
+ /*
+ * The Keymaster v4 spec introduced `importWrappedKey()` and did not restrict it to
+ * just symmetric keys. However, the import of asymmetric wrapped keys was not tested
+ * at the time, so we can only be strict about checking this for implementations claiming
+ * support for VSR API level 35 and above.
+ */
+ GTEST_SKIP() << "Applies only to VSR API level 35, this device is: " << vsr_api_level;
+ }
+
+ auto wrapping_key_desc = AuthorizationSetBuilder()
+ .RsaEncryptionKey(2048, 65537)
+ .Digest(Digest::SHA_2_256)
+ .Padding(PaddingMode::RSA_OAEP)
+ .Authorization(TAG_PURPOSE, KeyPurpose::WRAP_KEY)
+ .SetDefaultValidity();
+
+ ASSERT_EQ(ErrorCode::OK, ImportWrappedKey(wrapped_rsa_key, wrapping_key_for_asym_keys,
+ wrapping_key_desc, zero_masking_key,
+ AuthorizationSetBuilder()
+ .Digest(Digest::SHA_2_256)
+ .Padding(PaddingMode::RSA_OAEP)));
+
+ string message = "Hello World!";
+ auto params = AuthorizationSetBuilder().Digest(Digest::SHA_2_256).Padding(PaddingMode::RSA_PSS);
+ string signature = SignMessage(message, params);
+ LocalVerifyMessage(message, signature, params);
+}
+
+TEST_P(ImportWrappedKeyTest, EcKey) {
+ int vsr_api_level = get_vsr_api_level();
+ if (vsr_api_level < __ANDROID_API_V__) {
+ /*
+ * The Keymaster v4 spec introduced `importWrappedKey()` and did not restrict it to
+ * just symmetric keys. However, the import of asymmetric wrapped keys was not tested
+ * at the time, so we can only be strict about checking this for implementations claiming
+ * support for VSR API level 35 and above.
+ */
+ GTEST_SKIP() << "Applies only to VSR API level 35, this device is: " << vsr_api_level;
+ }
+
+ auto wrapping_key_desc = AuthorizationSetBuilder()
+ .RsaEncryptionKey(2048, 65537)
+ .Digest(Digest::SHA_2_256)
+ .Padding(PaddingMode::RSA_OAEP)
+ .Authorization(TAG_PURPOSE, KeyPurpose::WRAP_KEY)
+ .SetDefaultValidity();
+
+ ASSERT_EQ(ErrorCode::OK, ImportWrappedKey(wrapped_ec_key, wrapping_key_for_asym_keys,
+ wrapping_key_desc, zero_masking_key,
+ AuthorizationSetBuilder()
+ .Digest(Digest::SHA_2_256)
+ .Padding(PaddingMode::RSA_OAEP)));
+
+ string message = "Hello World!";
+ auto params = AuthorizationSetBuilder().Digest(Digest::SHA_2_256);
+ string signature = SignMessage(message, params);
+ LocalVerifyMessage(message, signature, params);
+}
+
INSTANTIATE_KEYMINT_AIDL_TEST(ImportWrappedKeyTest);
typedef KeyMintAidlTestBase EncryptionOperationsTest;
@@ -8345,17 +8391,6 @@
.Authorization(TAG_ATTESTATION_CHALLENGE, challenge)
.SetDefaultValidity();
ErrorCode result = GenerateKey(builder);
-
- if (SecLevel() == SecurityLevel::STRONGBOX) {
- if (result == ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED) {
- result = GenerateKeyWithSelfSignedAttestKey(
- AuthorizationSetBuilder()
- .EcdsaKey(EcCurve::P_256)
- .AttestKey()
- .SetDefaultValidity(), /* attest key params */
- builder, &key_blob_, &key_characteristics_, &cert_chain_);
- }
- }
ASSERT_EQ(ErrorCode::OK, result) << "Failed to generate key";
ASSERT_GT(cert_chain_.size(), 0);
X509_Ptr kmKeyCert(parse_cert_blob(cert_chain_[0].encodedCertificate));
@@ -8646,11 +8681,6 @@
KeyBlobDeleter ecdsa_deleter(keymint_, ecdsaKeyData.blob);
for (const auto& keyData : {aesKeyData, hmacKeyData, rsaKeyData, ecdsaKeyData}) {
- // Strongbox may not support factory attestation. Key creation might fail with
- // ErrorCode::ATTESTATION_KEYS_NOT_PROVISIONED
- if (SecLevel() == SecurityLevel::STRONGBOX && keyData.blob.size() == 0U) {
- continue;
- }
ASSERT_GT(keyData.blob.size(), 0U);
AuthorizationSet crypto_params = SecLevelAuthorizations(keyData.characteristics);
EXPECT_TRUE(crypto_params.Contains(TAG_EARLY_BOOT_ONLY)) << crypto_params;
@@ -8739,40 +8769,6 @@
INSTANTIATE_KEYMINT_AIDL_TEST(EarlyBootKeyTest);
-using UnlockedDeviceRequiredTest = KeyMintAidlTestBase;
-
-// This may be a problematic test. It can't be run repeatedly without unlocking the device in
-// between runs... and on most test devices there are no enrolled credentials so it can't be
-// unlocked at all, meaning the only way to get the test to pass again on a properly-functioning
-// device is to reboot it. For that reason, this is disabled by default. It can be used as part of
-// a manual test process, which includes unlocking between runs, which is why it's included here.
-// Well, that and the fact that it's the only test we can do without also making calls into the
-// Gatekeeper HAL. We haven't written any cross-HAL tests, and don't know what all of the
-// implications might be, so that may or may not be a solution.
-TEST_P(UnlockedDeviceRequiredTest, DISABLED_KeysBecomeUnusable) {
- auto [aesKeyData, hmacKeyData, rsaKeyData, ecdsaKeyData] =
- CreateTestKeys(TAG_UNLOCKED_DEVICE_REQUIRED, ErrorCode::OK);
- KeyBlobDeleter aes_deleter(keymint_, aesKeyData.blob);
- KeyBlobDeleter hmac_deleter(keymint_, hmacKeyData.blob);
- KeyBlobDeleter rsa_deleter(keymint_, rsaKeyData.blob);
- KeyBlobDeleter ecdsa_deleter(keymint_, ecdsaKeyData.blob);
-
- EXPECT_EQ(ErrorCode::OK, UseAesKey(aesKeyData.blob));
- EXPECT_EQ(ErrorCode::OK, UseHmacKey(hmacKeyData.blob));
- EXPECT_EQ(ErrorCode::OK, UseRsaKey(rsaKeyData.blob));
- EXPECT_EQ(ErrorCode::OK, UseEcdsaKey(ecdsaKeyData.blob));
-
- ErrorCode rc = GetReturnErrorCode(
- keyMint().deviceLocked(false /* passwordOnly */, {} /* timestampToken */));
- ASSERT_EQ(ErrorCode::OK, rc);
- EXPECT_EQ(ErrorCode::DEVICE_LOCKED, UseAesKey(aesKeyData.blob));
- EXPECT_EQ(ErrorCode::DEVICE_LOCKED, UseHmacKey(hmacKeyData.blob));
- EXPECT_EQ(ErrorCode::DEVICE_LOCKED, UseRsaKey(rsaKeyData.blob));
- EXPECT_EQ(ErrorCode::DEVICE_LOCKED, UseEcdsaKey(ecdsaKeyData.blob));
-}
-
-INSTANTIATE_KEYMINT_AIDL_TEST(UnlockedDeviceRequiredTest);
-
using VsrRequirementTest = KeyMintAidlTestBase;
// @VsrTest = VSR-3.10-008
diff --git a/security/keymint/aidl/vts/performance/Android.bp b/security/keymint/aidl/vts/performance/Android.bp
index 7e3a3e5..6179c99 100644
--- a/security/keymint/aidl/vts/performance/Android.bp
+++ b/security/keymint/aidl/vts/performance/Android.bp
@@ -41,7 +41,7 @@
],
static_libs: [
"android.hardware.security.secureclock-V1-ndk",
- "libcppbor_external",
+ "libcppbor",
"libchrome",
],
}
diff --git a/security/keymint/support/Android.bp b/security/keymint/support/Android.bp
index 1a8695b..5c9efef 100644
--- a/security/keymint/support/Android.bp
+++ b/security/keymint/support/Android.bp
@@ -72,7 +72,7 @@
shared_libs: [
"libbase",
"libbinder_ndk",
- "libcppbor_external",
+ "libcppbor",
"libcppcose_rkp",
"libcrypto",
"libkeymaster_portable",
@@ -94,7 +94,7 @@
],
shared_libs: [
"libbase",
- "libcppbor_external",
+ "libcppbor",
"libcppcose_rkp",
"libcrypto",
"libjsoncpp",
diff --git a/security/keymint/support/include/remote_prov/remote_prov_utils.h b/security/keymint/support/include/remote_prov/remote_prov_utils.h
index b8c69eb..1d7db6a 100644
--- a/security/keymint/support/include/remote_prov/remote_prov_utils.h
+++ b/security/keymint/support/include/remote_prov/remote_prov_utils.h
@@ -183,4 +183,7 @@
const cppbor::Array& keysToSign, const std::vector<uint8_t>& csr,
IRemotelyProvisionedComponent* provisionable, const std::vector<uint8_t>& challenge);
+/** Checks whether the CSR has a proper DICE chain. */
+ErrMsgOr<bool> isCsrWithProperDiceChain(const std::vector<uint8_t>& csr);
+
} // namespace aidl::android::hardware::security::keymint::remote_prov
diff --git a/security/keymint/support/remote_prov_utils.cpp b/security/keymint/support/remote_prov_utils.cpp
index a830041..b74fd59 100644
--- a/security/keymint/support/remote_prov_utils.cpp
+++ b/security/keymint/support/remote_prov_utils.cpp
@@ -1081,4 +1081,40 @@
return verifyCsr(keysToSign, csr, provisionable, challenge, /*isFactory=*/false);
}
+ErrMsgOr<bool> isCsrWithProperDiceChain(const std::vector<uint8_t>& csr) {
+ auto [parsedRequest, _, csrErrMsg] = cppbor::parse(csr);
+ if (!parsedRequest) {
+ return csrErrMsg;
+ }
+ if (!parsedRequest->asArray()) {
+ return "AuthenticatedRequest is not a CBOR array.";
+ }
+ if (parsedRequest->asArray()->size() != 4U) {
+ return "AuthenticatedRequest must contain version, UDS certificates, DICE chain, and "
+ "signed data. However, the parsed AuthenticatedRequest has " +
+ std::to_string(parsedRequest->asArray()->size()) + " entries.";
+ }
+
+ auto version = parsedRequest->asArray()->get(0)->asUint();
+ auto diceCertChain = parsedRequest->asArray()->get(2)->asArray();
+
+ if (!version || version->value() != 1U) {
+ return "AuthenticatedRequest version must be an unsigned integer and must be equal to 1.";
+ }
+ if (!diceCertChain) {
+ return "AuthenticatedRequest DiceCertChain must be an Array.";
+ }
+
+ // DICE chain is [ pubkey, + DiceChainEntry ].
+ auto diceChainKind = getDiceChainKind();
+ if (!diceChainKind) {
+ return diceChainKind.message();
+ }
+
+ auto encodedDiceChain = diceCertChain->encode();
+ auto chain = hwtrust::DiceChain::Verify(encodedDiceChain, *diceChainKind);
+ if (!chain.ok()) return chain.error().message();
+ return chain->IsProper();
+}
+
} // namespace aidl::android::hardware::security::keymint::remote_prov
diff --git a/security/keymint/support/remote_prov_utils_test.cpp b/security/keymint/support/remote_prov_utils_test.cpp
index 630f7bb..89469f1 100644
--- a/security/keymint/support/remote_prov_utils_test.cpp
+++ b/security/keymint/support/remote_prov_utils_test.cpp
@@ -14,20 +14,23 @@
* limitations under the License.
*/
-#include "cppbor.h"
-#include "keymaster/cppcose/cppcose.h"
#include <aidl/android/hardware/security/keymint/RpcHardwareInfo.h>
#include <android-base/properties.h>
+#include <cppbor.h>
#include <cppbor_parse.h>
-#include <cstdint>
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <keymaster/android_keymaster_utils.h>
+#include <keymaster/cppcose/cppcose.h>
#include <keymaster/logger.h>
#include <keymaster/remote_provisioning_utils.h>
#include <openssl/curve25519.h>
#include <remote_prov/remote_prov_utils.h>
+#include <algorithm>
+#include <cstdint>
+#include <span>
+
namespace aidl::android::hardware::security::keymint::remote_prov {
namespace {
@@ -36,7 +39,11 @@
using ::keymaster::kStatusInvalidEek;
using ::keymaster::StatusOr;
using ::testing::ElementsAreArray;
-using byte_view = std::basic_string_view<uint8_t>;
+using byte_view = std::span<const uint8_t>;
+
+inline bool equal_byte_views(const byte_view& view1, const byte_view& view2) {
+ return std::equal(view1.begin(), view1.end(), view2.begin(), view2.end());
+}
struct KeyInfoEcdsa {
CoseKeyCurve curve;
@@ -44,7 +51,8 @@
byte_view pubKeyY;
bool operator==(const KeyInfoEcdsa& other) const {
- return curve == other.curve && pubKeyX == other.pubKeyX && pubKeyY == other.pubKeyY;
+ return curve == other.curve && equal_byte_views(pubKeyX, other.pubKeyX) &&
+ equal_byte_views(pubKeyY, other.pubKeyY);
}
};
diff --git a/security/rkp/aidl/android/hardware/security/keymint/DeviceInfo.aidl b/security/rkp/aidl/android/hardware/security/keymint/DeviceInfo.aidl
index f668536..98cf023 100644
--- a/security/rkp/aidl/android/hardware/security/keymint/DeviceInfo.aidl
+++ b/security/rkp/aidl/android/hardware/security/keymint/DeviceInfo.aidl
@@ -28,8 +28,9 @@
parcelable DeviceInfo {
/**
* DeviceInfo is a CBOR Map structure described by the following CDDL. DeviceInfo must be
- * canonicalized according to the specification in RFC 7049. The ordering presented here is
- * non-canonical to group similar entries semantically.
+ * ordered according to the Length-First Map Key Ordering specified in RFC 8949,
+ * Section 4.2.3. Please note that the ordering presented here groups similar entries
+ * semantically, and not in the correct order per RFC 8949, Section 4.2.3.
*
* The DeviceInfo has changed across versions 1, 2, and 3 of the HAL. All versions of the
* DeviceInfo CDDL are described in the DeviceInfoV*.cddl files. Please refer to the CDDL
diff --git a/security/rkp/aidl/vts/functional/Android.bp b/security/rkp/aidl/vts/functional/Android.bp
index 9c2b6e1..2cce8db 100644
--- a/security/rkp/aidl/vts/functional/Android.bp
+++ b/security/rkp/aidl/vts/functional/Android.bp
@@ -32,7 +32,7 @@
"libcrypto",
],
static_libs: [
- "libcppbor_external",
+ "libcppbor",
"libgmock_ndk",
"libkeymint_vts_test_utils",
],
diff --git a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
index 68b966c..2a8fd96 100644
--- a/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
+++ b/security/rkp/aidl/vts/functional/VtsRemotelyProvisionedComponentTests.cpp
@@ -55,8 +55,12 @@
constexpr uint8_t MIN_CHALLENGE_SIZE = 0;
constexpr uint8_t MAX_CHALLENGE_SIZE = 64;
+const string DEFAULT_INSTANCE_NAME =
+ "android.hardware.security.keymint.IRemotelyProvisionedComponent/default";
const string RKP_VM_INSTANCE_NAME =
"android.hardware.security.keymint.IRemotelyProvisionedComponent/avf";
+const string KEYMINT_STRONGBOX_INSTANCE_NAME =
+ "android.hardware.security.keymint.IKeyMintDevice/strongbox";
#define INSTANTIATE_REM_PROV_AIDL_TEST(name) \
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(name); \
@@ -230,6 +234,37 @@
}
}
+/**
+ * Verify that the default implementation supports DICE if there is a StrongBox KeyMint instance
+ * on the device.
+ */
+// @VsrTest = 3.10-015
+TEST(NonParameterizedTests, requireDiceOnDefaultInstanceIfStrongboxPresent) {
+ int vsr_api_level = get_vsr_api_level();
+ if (vsr_api_level < 35) {
+ GTEST_SKIP() << "Applies only to VSR API level 35 or newer, this device is: "
+ << vsr_api_level;
+ }
+
+ if (!AServiceManager_isDeclared(KEYMINT_STRONGBOX_INSTANCE_NAME.c_str())) {
+ GTEST_SKIP() << "Strongbox is not present on this device.";
+ }
+
+ ::ndk::SpAIBinder binder(AServiceManager_waitForService(DEFAULT_INSTANCE_NAME.c_str()));
+ std::shared_ptr<IRemotelyProvisionedComponent> rpc =
+ IRemotelyProvisionedComponent::fromBinder(binder);
+ ASSERT_NE(rpc, nullptr);
+
+ bytevec challenge = randomBytes(64);
+ bytevec csr;
+ auto status = rpc->generateCertificateRequestV2({} /* keysToSign */, challenge, &csr);
+ EXPECT_TRUE(status.isOk()) << status.getDescription();
+
+ auto result = isCsrWithProperDiceChain(csr);
+ ASSERT_TRUE(result) << result.message();
+ ASSERT_TRUE(*result);
+}
+
using GetHardwareInfoTests = VtsRemotelyProvisionedComponentTests;
INSTANTIATE_REM_PROV_AIDL_TEST(GetHardwareInfoTests);
diff --git a/security/secretkeeper/aidl/Android.bp b/security/secretkeeper/aidl/Android.bp
index ac923ca..48ce365 100644
--- a/security/secretkeeper/aidl/Android.bp
+++ b/security/secretkeeper/aidl/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_virtualization",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -27,7 +28,8 @@
frozen: false,
backend: {
java: {
- enabled: false,
+ enabled: true,
+ platform_apis: true,
},
ndk: {
enabled: true,
diff --git a/security/secretkeeper/aidl/vts/Android.bp b/security/secretkeeper/aidl/vts/Android.bp
index 0061e88..be07a7b 100644
--- a/security/secretkeeper/aidl/vts/Android.bp
+++ b/security/secretkeeper/aidl/vts/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_virtualization",
default_applicable_licenses: ["Android-Apache-2.0"],
}
@@ -26,6 +27,7 @@
"libciborium",
"libcoset",
"libdiced_open_dice",
+ "libhex",
"liblog_rust",
"libsecretkeeper_client",
],
@@ -46,6 +48,7 @@
"android.hardware.security.secretkeeper-V1-rust",
"libauthgraph_boringssl",
"libauthgraph_core",
+ "libauthgraph_wire",
"libauthgraph_vts_test",
"libbinder_rs",
"libciborium",
diff --git a/security/secretkeeper/aidl/vts/dice_sample.rs b/security/secretkeeper/aidl/vts/dice_sample.rs
index 97b4789..4ef396a 100644
--- a/security/secretkeeper/aidl/vts/dice_sample.rs
+++ b/security/secretkeeper/aidl/vts/dice_sample.rs
@@ -28,10 +28,11 @@
use coset::{
iana, Algorithm, AsCborValue, CborSerializable, CoseKey, KeyOperation, KeyType, Label,
};
+pub use diced_open_dice::CDI_SIZE;
use diced_open_dice::{
derive_cdi_private_key_seed, keypair_from_seed, retry_bcc_format_config_descriptor,
retry_bcc_main_flow, retry_dice_main_flow, Config, DiceArtifacts, DiceConfigValues, DiceError,
- DiceMode, InputValues, OwnedDiceArtifacts, CDI_SIZE, HASH_SIZE, HIDDEN_SIZE,
+ DiceMode, InputValues, OwnedDiceArtifacts, HASH_SIZE, HIDDEN_SIZE,
};
use log::error;
use secretkeeper_client::dice::OwnedDiceArtifactsWithExplicitKey;
@@ -110,12 +111,36 @@
/// The `security_version` is included in the Android certificate as well as each subcomponent
/// of AVB certificate.
pub fn make_explicit_owned_dice(security_version: u64) -> OwnedDiceArtifactsWithExplicitKey {
- let dice = make_sample_bcc_and_cdis(security_version);
+ make_explicit_owned_dice_for_uds(security_version, UDS)
+}
+
+/// Makes a DICE chain (BCC) from the sample input for the given UDS.
+pub fn make_explicit_owned_dice_for_uds(
+ security_version: u64,
+ uds: &[u8; CDI_SIZE],
+) -> OwnedDiceArtifactsWithExplicitKey {
+ let dice = make_sample_bcc_and_cdis(security_version, uds, Subcomponents::Minimal);
OwnedDiceArtifactsWithExplicitKey::from_owned_artifacts(dice).unwrap()
}
-fn make_sample_bcc_and_cdis(security_version: u64) -> OwnedDiceArtifacts {
- let private_key_seed = derive_cdi_private_key_seed(UDS).unwrap();
+/// Makes an XXL DICE chain.
+pub fn make_large_explicit_owned_dice(security_version: u64) -> OwnedDiceArtifactsWithExplicitKey {
+ let dice = make_sample_bcc_and_cdis(security_version, UDS, Subcomponents::CompOs);
+ OwnedDiceArtifactsWithExplicitKey::from_owned_artifacts(dice).unwrap()
+}
+
+/// Indicate which subcomponent DICE information to include.
+enum Subcomponents {
+ Minimal,
+ CompOs,
+}
+
+fn make_sample_bcc_and_cdis(
+ security_version: u64,
+ uds: &[u8; CDI_SIZE],
+ subcomponents: Subcomponents,
+) -> OwnedDiceArtifacts {
+ let private_key_seed = derive_cdi_private_key_seed(uds).unwrap();
// Gets the root public key in DICE chain (BCC).
let (public_key, _) = keypair_from_seed(private_key_seed.as_array()).unwrap();
@@ -136,18 +161,16 @@
DiceMode::kDiceModeNormal,
HIDDEN_ABL,
);
- let (cdi_values, cert) = retry_dice_main_flow(UDS, UDS, &input_values).unwrap();
+ let (cdi_values, cert) = retry_dice_main_flow(uds, uds, &input_values).unwrap();
let bcc_value =
Value::Array(vec![ed25519_public_key_value, de::from_reader(&cert[..]).unwrap()]);
let mut bcc: Vec<u8> = vec![];
ser::into_writer(&bcc_value, &mut bcc).unwrap();
// Appends AVB certificate to DICE chain.
- let config_desc = cbor!({
- COMPONENT_NAME => "AVB",
- COMPONENT_VERSION => 1,
- COMPONENT_RESETTABLE => null,
- SUBCOMPONENT_DESCRIPTORS => [
+ let subcomponents = match subcomponents {
+ Subcomponents::CompOs => compos_subcomponent_descriptors(),
+ Subcomponents::Minimal => cbor!([
{
SUBCOMPONENT_NAME => "sub_1",
SUBCOMPONENT_SECURITY_VERSION => security_version,
@@ -160,7 +183,14 @@
SUBCOMPONENT_CODE_HASH => b"xoxo",
SUBCOMPONENT_AUTHORITY_HASH => b"oxox",
}
- ]
+ ])
+ .unwrap(),
+ };
+ let config_desc = cbor!({
+ COMPONENT_NAME => "AVB",
+ COMPONENT_VERSION => 1,
+ COMPONENT_RESETTABLE => null,
+ SUBCOMPONENT_DESCRIPTORS => subcomponents,
})
.unwrap()
.to_vec()
@@ -206,3 +236,177 @@
)
.unwrap()
}
+
+fn compos_subcomponent_descriptors() -> Value {
+ // Subcomponent descriptors taken from a CompOS chain.
+ cbor!([
+ {
+ SUBCOMPONENT_NAME => "apk:com.android.compos.payload",
+ SUBCOMPONENT_SECURITY_VERSION => 34,
+ SUBCOMPONENT_CODE_HASH => hex::decode("9f9a7ca6367a602ee8aeb83c783ae37d1028e4e7fe7492c53ca6b0ac3a5a4918").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("5216ccb62004c4534f35c780ad7c582f4ee528371e27d4151f0553325de9ccbe6b34ec4233f5f640703581053abfea303977272d17958704d89b7711292a4569").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apk:com.android.security.fsverity_metadata.system",
+ SUBCOMPONENT_SECURITY_VERSION => 34,
+ SUBCOMPONENT_CODE_HASH => hex::decode("c5f0a71179daa76d5897e391ea882a2f22911b5c2c81794ed6bcd2366dfc6474").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("5216ccb62004c4534f35c780ad7c582f4ee528371e27d4151f0553325de9ccbe6b34ec4233f5f640703581053abfea303977272d17958704d89b7711292a4569").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apk:com.android.security.fsverity_metadata.system_ext",
+ SUBCOMPONENT_SECURITY_VERSION => 34,
+ SUBCOMPONENT_CODE_HASH => hex::decode("d043740bc1b45ef8eecb093714321f458f1df17e4d76652a02f3b6c038da8305").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("5216ccb62004c4534f35c780ad7c582f4ee528371e27d4151f0553325de9ccbe6b34ec4233f5f640703581053abfea303977272d17958704d89b7711292a4569").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.adbd",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("fa4d9b37ff0b534c02865357cce0e2fb5e39a00da00880b438de9a8dd13e79f7").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("4df2b359bfe246a1301166dfa9d9a74ae7c11eebe2b6edc360fcc7630974533c4ac28b216af7af3c8c88de2869d0f7b043872eaf75964e311c10bc1beb1cb89c").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.adservices",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("debbb6f029c92dcb23b8589b751e945855bdff2cb903fed1e8f9f3ee4740bc00").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("2f85397ad0e9c7e7afa3add6c18d18a1a2b9501d2dc51f481ae57fa789f381228ca905459e871b5bfcb300e5a101260ffb6bf58a920e6b7dfc17941ab7a565c4").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.appsearch",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("44dd279b861339cfcf92d55b7d4aa1cc21a856a8b0a0bf1bfe66574fdd681194").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("e326a8d1cf4a3b18b45c530e153bd310b9bff04949e37a8886b526dc546e2baf403c3384fef01c18341b3e5de0566c294c8373aa8f7b92e07dd9c938a96f7e35").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.art",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("e4a8eae20cee7fd98dd202b32321a5feaae73cf125b880763d810edbf6b394dd").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("ed255ae9ea98826f3f3a966849f0aaaf356d140c766a869048016e0ba10141af039fec5c53658ddebdad9c2339587c5ef5487bde89237ca79802238d91aebba8").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.btservices",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("d7aa86dfdf92e662d2210cd2b3ad4e4522c917e9e287268363aa90e20f9ae16c").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("a0d577d4a56cfad09aaa7abcd2355cd78872df85672f2faf9ac2fdf15c06147394e704c7473f28bed737803581a3d097275cc26d8095a4a896ee76167f9ee40e").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.compos",
+ SUBCOMPONENT_SECURITY_VERSION => 2,
+ SUBCOMPONENT_CODE_HASH => hex::decode("64c4b31c7de83ecb31632aff1fb6433741b5f870b1d9f258673787715b83e785").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("3e2691174d210a6479c586ef655ee5af1ee53ff960f6291d7b695237d56f73027c5cb30a6d6df07848a0c0b65b6d697e31ed98ba0711a0cb39002c4186b4ad95").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.configinfrastructure",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("69d589bcd38decdee64f5bdd359af461e95a5f9c9cf7e6c767db25f0ab81b5e7").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("13cde315955806bb1f9ec00714166255148e6baa43f3473bcbe5082bc35d3525605470a6c7ac208337dd79d2250e4adcd4f89f09036f2cbbb553f387c622be07").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.conscrypt",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("a91183cc1c12e2d0c9f2b0cd9c97c4592246035c2b07f080d9921fa57ed42900").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("4d76d909dd77ee0f8299880b27215a327dda261fb4504125d730fc4f78b105b0947c4103b4bcf49ea9a44d6d04e3c4d385d9ca02a2ef43b8850fca0d91b11e57").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.devicelock",
+ SUBCOMPONENT_SECURITY_VERSION => 1,
+ SUBCOMPONENT_CODE_HASH => hex::decode("85f7bdd116f9c2069f5bfb0039ec1ea165ccaaa517f340440b8eb8f58d044fa8").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("2949543df13e57c5dfa49aa3ade0c450514432a7e2710bbb1fd4b768e158bbadf17be6f1446be7d321960e13f2f10f648d2ee551ec41475169e629ed71f2cc5f").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.healthfitness",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("ad38a1e8186cb62ac75e47592496582ef7ab26b3f0dd405340cee2fe8d73dc47").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("2273e8a7113a103d2b7461c9ae8149ba4cfabe5edeb48b1703c4b4f2fab1a4e9c5a66bf75a9f2063f27df6390d310f1091e9511ad2e41baae822fde1fb022f4f").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.i18n",
+ SUBCOMPONENT_SECURITY_VERSION => 1,
+ SUBCOMPONENT_CODE_HASH => hex::decode("2107e7972afeb70f6653643aebf5e0198c5bf13d71b4c792960f78344bf7e439").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("668ac67e4b8a00bf5863ee175db92aefa64138eccbc86a7f528d6fdabec3443e781f4f4c5c3db123994d45696e13e07aa207da25bc70709dcaba3a740b679f7b").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.ipsec",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("dfc3ff28eaf429535b651bdb675fbc6d6a7e2834919c02ce56bc20f736562c2c").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("8ae0b721d55d3d3f80a1bce694dd85fbbbbba990b0479864c694a47912d4f42a60ca328f76b462a6624b89d1d8b1212fe06fc7749e2c2b0cccd9d86f1058dee2").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.media",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("cb1288d098962dbe0d069e78512138e6031d4f1bb4052fea30866f0d8226c541").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("7a374d48802077d032daa41fb60123e470808d4bae5d7fd87e6f6e6039fee67cf9cb37b960edb5014247ffc57f4673a0d6a52a07e477c9c7d570594ce0a867af").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.mediaprovider",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("bf343bfbe145a81974f05244b523b47d5ecc606c534a65723bb5b7a5f40ab4e1").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("272c2cbde4cdd914978246bf6150e30db54f603ee5602a1a48e0b31aa9569a533ff9eedab10bcb852c988d1d46f09de28fc2f0596b070adc38fed9edc12270d8").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.nfcservices",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("ff0caa7f86efd179fda394b387e2ef875272d7035138ca1309229fe80dc3dd3a").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("26af902c55fa92240fa15f060849e29803775249b5d53a02f7c4a57b039c0be6570809c2d81d63d6d6a923bc58ace14b05d64dcf0f9fdce0f99e6ef18ea292b4").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.ondevicepersonalization",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("9a339ac3a29bf2852dde9318575799c23c144515cca129eed5055a589d8da33d").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("96c20dbd0a57864a6aa055ebc5611da744c969d37838e7c75712c3f6f37bdbf9eda0dfc240d8f545f9b6fb500edd6d8ca5f48a70acde9a7121e545187df8705d").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.os.statsd",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("523e068e66be46eb3789d82aecfba7f58287a9cbc4bcf3c45fd32291db3da048").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("431db3773485c432e706fc8040373a373f0dac5a96ba0150ac813d80c00f351496dfe789c6c88dd673aaf642a64c0e09754fb0bb2c12bb12b62968427f9d3f87").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.permission",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("2f3de015ab80900579db7935d425ee228ea597ac07ef47b8e7e6366a91d93be9").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("0bcf05c42dcff0d2f5dc151369681179b0489749b27c5d2dff9ce69c990e7f299fd9782be1d46698101758f39bf18804e1043e3bd8e3da6c3554a6cccc34a891").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.rkpd",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("acb4c10a0f01065b787cf8349e7f371d91dda352d51a25e08fca229375de2ef1").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("56854df8c24c9670413396120c89bf18d5f6e2d5ade48b14a102be3bb29751fad1da3b754588da27f33ec5187258a8ec806a323ecf3e99cf8f051499e8cc8b5b").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.scheduling",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("b802e45078bbff1648ef97c38743005983d25ba47261b9e9fb7c758defec920e").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("d8e3c0f8501b639074c003fd1a45424756a91a79f326e2b50a66f39c9ced5bc0cd0811f6055b5f2c8330a845f95bd26d6f6d3962e3436f65fdfda3343f26cb69").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.sdkext",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("fb2a3d5437766135838d7ce078870a403ae6929937d58ec8b40182057587af21").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("6bdc69078b58bc524648ce606c8050ffd6a88a8e169c23cbce7a6cfc444cde58a2a9a77968e3f1454a0eaeb0ad00bb846e5447473b0730bbd28e0b71189af808").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.tethering",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("d352cfd92179ec854ae30c9ce54562b1a31f01738524ba11ceae10db6207c995").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("1af6fe33f7035ea7a4353a02ed40fd7b72f2668b58794d2bbccce8b61aa9878eb817cdcc813e1eab1a2f287c2f15e8b2bb620cf024e55210a659f27c3064bd7f").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.uwb",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("bfc970bc51670ade054b5fcafa6ed9fb90f0aa14168ea5a97d20d5b236ffac00").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("993f35bbdbad1db72f17382058b10020bb1c932cef8f540c240cb26e867ea03bab4ade22f41823a8be3ea5e82306f47368e294e153328ba38ad35b3aafabdf84").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.virt",
+ SUBCOMPONENT_SECURITY_VERSION => 2,
+ SUBCOMPONENT_CODE_HASH => hex::decode("efff05a5354236dc3efca323bf25d0488f7c8212a393349f9a7d329f7db88e73").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("a279d6d530ae0cea2b2f2c1d3dee1e5b59dbdac861e137995eaf44b1a57c5cfb02b7892f00e7fe647756fd2cfef66e74350b517c4d79463c6e6a6f96eb01693b").unwrap(),
+ },
+ {
+ SUBCOMPONENT_NAME => "apex:com.android.wifi",
+ SUBCOMPONENT_SECURITY_VERSION => 990090000,
+ SUBCOMPONENT_CODE_HASH => hex::decode("2d6db7bcfb436ff9a8f22788e4666071d18e03063422d5b58e378530d304e0af").unwrap(),
+ SUBCOMPONENT_AUTHORITY_HASH => hex::decode("29b3ef73b51aff982b3136c944add0ee40a12eba762ca69ae9646c4f08fd8145e593c8b1fe4208e52f87e0735134c573612ec0566ebbf5ab08b2054a5954b599").unwrap(),
+ },
+ ]).unwrap()
+}
diff --git a/security/secretkeeper/aidl/vts/secretkeeper_cli.rs b/security/secretkeeper/aidl/vts/secretkeeper_cli.rs
index d02bfe6..377ed37 100644
--- a/security/secretkeeper/aidl/vts/secretkeeper_cli.rs
+++ b/security/secretkeeper/aidl/vts/secretkeeper_cli.rs
@@ -120,7 +120,7 @@
fn new(instance: &str, dice_artifacts: OwnedDiceArtifactsWithExplicitKey) -> Self {
let sk: binder::Strong<dyn ISecretkeeper> =
binder::get_interface(&format!("{SECRETKEEPER_SERVICE}/{instance}")).unwrap();
- let session = SkSession::new(sk.clone(), &dice_artifacts).unwrap();
+ let session = SkSession::new(sk.clone(), &dice_artifacts, None).unwrap();
Self { sk, session, dice_artifacts }
}
diff --git a/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs b/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
index 72d3e57..595dc7a 100644
--- a/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
+++ b/security/secretkeeper/aidl/vts/secretkeeper_test_client.rs
@@ -19,11 +19,11 @@
use authgraph_vts_test as ag_vts;
use authgraph_boringssl as boring;
use authgraph_core::key;
-use coset::{CborSerializable, CoseEncrypt0};
+use coset::{CborOrdering, CborSerializable, CoseEncrypt0, CoseKey};
use dice_policy_builder::{CertIndex, ConstraintSpec, ConstraintType, MissingAction, WILDCARD_FULL_ARRAY, policy_for_dice_chain};
use rdroidtest::{ignore_if, rdroidtest};
use secretkeeper_client::dice::OwnedDiceArtifactsWithExplicitKey;
-use secretkeeper_client::SkSession;
+use secretkeeper_client::{SkSession, Error as SkClientError};
use secretkeeper_core::cipher;
use secretkeeper_comm::data_types::error::SecretkeeperError;
use secretkeeper_comm::data_types::request::Request;
@@ -36,11 +36,16 @@
use secretkeeper_test::{
AUTHORITY_HASH, MODE, CONFIG_DESC, SECURITY_VERSION, SUBCOMPONENT_AUTHORITY_HASH,
SUBCOMPONENT_DESCRIPTORS, SUBCOMPONENT_SECURITY_VERSION,
- dice_sample::make_explicit_owned_dice
+ dice_sample::{make_explicit_owned_dice_for_uds, make_explicit_owned_dice, make_large_explicit_owned_dice, CDI_SIZE}
};
+use std::fs;
+use std::path::Path;
const SECRETKEEPER_SERVICE: &str = "android.hardware.security.secretkeeper.ISecretkeeper";
const CURRENT_VERSION: u64 = 1;
+const SECRETKEEPER_KEY_HOST_DT: &str =
+ "/proc/device-tree/avf/reference/avf/secretkeeper_public_key";
+
// Random bytes (of ID_SIZE/SECRET_SIZE) generated for tests.
const ID_EXAMPLE: Id = Id([
0xF1, 0xB2, 0xED, 0x3B, 0xD1, 0xBD, 0xF0, 0x7D, 0xE1, 0xF0, 0x01, 0xFC, 0x61, 0x71, 0xD3, 0x42,
@@ -65,6 +70,22 @@
0x06, 0xAC, 0x36, 0x8B, 0x3C, 0x95, 0x50, 0x16, 0x67, 0x71, 0x65, 0x26, 0xEB, 0xD0, 0xC3, 0x98,
]);
+// Android expects the public key of Secretkeeper instance to be present in the Linux device tree.
+// This allows clients to (cryptographically) verify that they are indeed talking to the real
+// secretkeeper.
+// Note that this is the identity of the `default` instance (and not `nonsecure`)!
+fn get_secretkeeper_identity() -> Option<CoseKey> {
+ let path = Path::new(SECRETKEEPER_KEY_HOST_DT);
+ if path.exists() {
+ let key = fs::read(path).unwrap();
+ let mut key = CoseKey::from_slice(&key).unwrap();
+ key.canonicalize(CborOrdering::Lexicographic);
+ Some(key)
+ } else {
+ None
+ }
+}
+
fn get_instances() -> Vec<(String, String)> {
// Determine which instances are available.
binder::get_declared_instances(SECRETKEEPER_SERVICE)
@@ -80,6 +101,7 @@
}
/// Secretkeeper client information.
+#[derive(Debug)]
struct SkClient {
sk: binder::Strong<dyn ISecretkeeper>,
session: SkSession,
@@ -95,19 +117,40 @@
impl SkClient {
/// Create an `SkClient` using the default `OwnedDiceArtifactsWithExplicitKey` for identity.
- fn new(instance: &str) -> Self {
+ fn new(instance: &str) -> Result<Self, SkClientError> {
let default_dice = make_explicit_owned_dice(/*Security version in a node */ 5);
- Self::with_identity(instance, default_dice)
+ Self::create(instance, default_dice, None)
}
- /// Create an `SkClient` using the given `OwnedDiceArtifactsWithExplicitKey` for identity.
- fn with_identity(instance: &str, dice_artifacts: OwnedDiceArtifactsWithExplicitKey) -> Self {
+ /// Create an `SkClient` using given `OwnedDiceArtifactsWithExplicitKey` as client identity.
+ fn with_identity(
+ instance: &str,
+ dice_artifacts: OwnedDiceArtifactsWithExplicitKey,
+ ) -> Result<Self, SkClientError> {
+ Self::create(instance, dice_artifacts, None)
+ }
+
+ /// Create an `SkClient` with default client identity, requiring Secretkeeper's identity to be
+ /// matched against given `expected_sk_key`.
+ fn with_expected_sk_identity(
+ instance: &str,
+ expected_sk_key: coset::CoseKey,
+ ) -> Result<Self, SkClientError> {
+ let default_dice = make_explicit_owned_dice(/*Security version in a node */ 5);
+ Self::create(instance, default_dice, Some(expected_sk_key))
+ }
+
+ fn create(
+ instance: &str,
+ dice_artifacts: OwnedDiceArtifactsWithExplicitKey,
+ expected_sk_key: Option<coset::CoseKey>,
+ ) -> Result<Self, SkClientError> {
let sk = get_connection(instance);
- Self {
+ Ok(Self {
sk: sk.clone(),
- session: SkSession::new(sk, &dice_artifacts).unwrap(),
+ session: SkSession::new(sk, &dice_artifacts, expected_sk_key)?,
dice_artifacts,
- }
+ })
}
/// This method is wrapper that use `SkSession::secret_management_request` which handles
@@ -246,9 +289,22 @@
}
}
-// Assert that the error is EntryNotFound
+// Assert that the error is `EntryNotFound`.
fn assert_entry_not_found(res: Result<Secret, Error>) {
- assert!(matches!(res.unwrap_err(), Error::SecretkeeperError(SecretkeeperError::EntryNotFound)))
+ assert_result_matches(res, SecretkeeperError::EntryNotFound)
+}
+
+// Assert that the error is `DicePolicyError`.
+fn assert_dice_policy_error(res: Result<Secret, Error>) {
+ assert_result_matches(res, SecretkeeperError::DicePolicyError)
+}
+
+fn assert_result_matches(res: Result<Secret, Error>, want: SecretkeeperError) {
+ match res {
+ Err(Error::SecretkeeperError(e)) if e == want => {}
+ Err(got) => panic!("unexpected error {got:?}, expected {want:?}"),
+ Ok(_) => panic!("unexpected success instead of {want:?}"),
+ }
}
/// Construct a sealing policy on the dice chain. This method uses the following set of
@@ -347,7 +403,7 @@
#[rdroidtest(get_instances())]
fn secret_management_get_version(instance: String) {
- let mut sk_client = SkClient::new(&instance);
+ let mut sk_client = SkClient::new(&instance).unwrap();
let request = GetVersionRequest {};
let request_packet = request.serialize_to_packet();
@@ -364,7 +420,7 @@
#[rdroidtest(get_instances())]
fn secret_management_malformed_request(instance: String) {
- let mut sk_client = SkClient::new(&instance);
+ let mut sk_client = SkClient::new(&instance).unwrap();
let request = GetVersionRequest {};
let request_packet = request.serialize_to_packet();
@@ -383,7 +439,7 @@
#[rdroidtest(get_instances())]
fn secret_management_store_get_secret_found(instance: String) {
- let mut sk_client = SkClient::new(&instance);
+ let mut sk_client = SkClient::new(&instance).unwrap();
sk_client.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
@@ -393,7 +449,7 @@
#[rdroidtest(get_instances())]
fn secret_management_store_get_secret_not_found(instance: String) {
- let mut sk_client = SkClient::new(&instance);
+ let mut sk_client = SkClient::new(&instance).unwrap();
// Store a secret (corresponding to an id).
sk_client.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
@@ -402,9 +458,45 @@
assert_entry_not_found(sk_client.get(&ID_NOT_STORED));
}
+/// A secret stored in one session should be accessible from a different session
+/// as long as the client has the same identity.
+#[rdroidtest(get_instances())]
+fn secretkeeper_get_secret_across_sessions_with_same_identity(instance: String) {
+ // Store a secret with one session. Note that we need to hang on to the
+ // test client because it auto-deletes entries on drop.
+ let mut sk_client1 = SkClient::new(&instance).unwrap();
+ sk_client1.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
+ assert_eq!(sk_client1.get(&ID_EXAMPLE).unwrap(), SECRET_EXAMPLE);
+
+ // Retrieve the secret using a different session (that has the same identity).
+ let mut sk_client2 = SkClient::new(&instance).unwrap();
+ assert_eq!(sk_client2.get(&ID_EXAMPLE).unwrap(), SECRET_EXAMPLE);
+}
+
+/// A secret stored in one session should not be accessible from a different session
+/// if the client has a different identity.
+#[rdroidtest(get_instances())]
+fn secretkeeper_no_secret_across_sessions_with_different_identity(instance: String) {
+ // Store a secret with one session. Note that we need to hang on to the
+ // test client because it auto-deletes entries on drop.
+ let mut sk_client1 = SkClient::new(&instance).unwrap();
+ sk_client1.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
+ assert_eq!(sk_client1.get(&ID_EXAMPLE).unwrap(), SECRET_EXAMPLE);
+
+ // Fail to retrieve the secret using a different session that has a different identity.
+ pub const ALT_UDS: &[u8; CDI_SIZE] = &[
+ 0x66, 0x4f, 0xab, 0xa9, 0xa5, 0xad, 0x0f, 0x5e, 0x15, 0xc3, 0x12, 0xf7, 0x77, 0x45, 0xfa,
+ 0x56, 0x18, 0x6a, 0xa6, 0x34, 0xb6, 0x7c, 0x82, 0x7b, 0x89, 0x4c, 0xc5, 0x52, 0xd3, 0x27,
+ 0x36, 0x8e,
+ ];
+ let alt_identity = make_explicit_owned_dice_for_uds(5, ALT_UDS);
+ let mut sk_client2 = SkClient::with_identity(&instance, alt_identity).unwrap();
+ assert_dice_policy_error(sk_client2.get(&ID_EXAMPLE));
+}
+
#[rdroidtest(get_instances())]
fn secretkeeper_store_delete_ids(instance: String) {
- let mut sk_client = SkClient::new(&instance);
+ let mut sk_client = SkClient::new(&instance).unwrap();
sk_client.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
sk_client.store(&ID_EXAMPLE_2, &SECRET_EXAMPLE).unwrap();
@@ -420,7 +512,7 @@
#[rdroidtest(get_instances())]
fn secretkeeper_store_delete_multiple_ids(instance: String) {
- let mut sk_client = SkClient::new(&instance);
+ let mut sk_client = SkClient::new(&instance).unwrap();
sk_client.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
sk_client.store(&ID_EXAMPLE_2, &SECRET_EXAMPLE).unwrap();
@@ -431,7 +523,7 @@
}
#[rdroidtest(get_instances())]
fn secretkeeper_store_delete_duplicate_ids(instance: String) {
- let mut sk_client = SkClient::new(&instance);
+ let mut sk_client = SkClient::new(&instance).unwrap();
sk_client.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
sk_client.store(&ID_EXAMPLE_2, &SECRET_EXAMPLE).unwrap();
@@ -444,7 +536,7 @@
#[rdroidtest(get_instances())]
fn secretkeeper_store_delete_nonexistent(instance: String) {
- let mut sk_client = SkClient::new(&instance);
+ let mut sk_client = SkClient::new(&instance).unwrap();
sk_client.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
sk_client.store(&ID_EXAMPLE_2, &SECRET_EXAMPLE).unwrap();
@@ -459,7 +551,7 @@
#[rdroidtest(get_instances())]
#[ignore_if(|p| p != "nonsecure")]
fn secretkeeper_store_delete_all(instance: String) {
- let mut sk_client = SkClient::new(&instance);
+ let mut sk_client = SkClient::new(&instance).unwrap();
sk_client.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
sk_client.store(&ID_EXAMPLE_2, &SECRET_EXAMPLE).unwrap();
@@ -479,6 +571,69 @@
assert_entry_not_found(sk_client.get(&ID_NOT_STORED));
}
+// This tests creates lots of sessions one after another, to confirm that the Secretkeeper
+// instance doesn't have unbounded internal state. (Instead, it should drop older sessions
+// and the clients using those sessions would need to re-establish a new session.)
+#[rdroidtest(get_instances())]
+fn secretkeeper_many_sessions_serial(instance: String) {
+ const SESSION_COUNT: usize = 32;
+ let mut sk_clients = Vec::new();
+ for idx in 0..SESSION_COUNT {
+ let identity = make_large_explicit_owned_dice(5);
+ let mut sk_client = SkClient::with_identity(&instance, identity)
+ .expect(&format!("failed to establish session {idx}"));
+ sk_client.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
+ sk_clients.push(sk_client);
+ }
+}
+
+// This tests creates lots of sessions in parallel. Some of these session are expected
+// to fail, but the Secretkeeper TA should survive the experience.
+#[rdroidtest(get_instances())]
+fn secretkeeper_many_sessions_parallel(instance: String) {
+ const SESSION_COUNT: usize = 32;
+
+ let mut handles = Vec::<std::thread::JoinHandle<()>>::new();
+ for idx in 0..SESSION_COUNT {
+ let instance = instance.clone();
+ handles.push(std::thread::spawn(move || {
+ // In each thread, create a session and use it. This may (legitimately) fail at any
+ // moment.
+ let _result = use_sk_may_fail(instance, idx);
+ }));
+ }
+
+ // Wait for all activity to quiesce.
+ for handle in handles {
+ let _result = handle.join();
+ }
+
+ // Now that all the parallel activity is done, should still be able to interact with
+ // Secretkeeper.
+ let mut sk_client = SkClient::new(&instance).unwrap();
+ sk_client.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
+ assert_eq!(sk_client.get(&ID_EXAMPLE).unwrap(), SECRET_EXAMPLE);
+
+ // Remove any IDs that might have been stored in the test.
+ for idx in 0..SESSION_COUNT {
+ let mut id = ID_EXAMPLE.clone();
+ id.0[0] = idx as u8;
+ sk_client.delete(&[&id]);
+ }
+}
+
+fn use_sk_may_fail(instance: String, idx: usize) -> Result<(), Error> {
+ let identity = make_large_explicit_owned_dice(5);
+ let mut sk_client = SkClient::with_identity(&instance, identity)?;
+ let mut id = ID_EXAMPLE.clone();
+ id.0[0] = idx as u8;
+
+ sk_client.store(&id, &SECRET_EXAMPLE)?;
+ let result = sk_client.get(&id)?;
+ assert_eq!(result, SECRET_EXAMPLE);
+ Ok(())
+}
+
// This test checks that Secretkeeper uses the expected [`RequestSeqNum`] as aad while
// decrypting requests and the responses are encrypted with correct [`ResponseSeqNum`] for the
// first few messages.
@@ -486,7 +641,7 @@
fn secret_management_replay_protection_seq_num(instance: String) {
let dice_chain = make_explicit_owned_dice(/*Security version in a node */ 5);
let sealing_policy = sealing_policy(dice_chain.explicit_key_dice_chain().unwrap());
- let sk_client = SkClient::with_identity(&instance, dice_chain);
+ let sk_client = SkClient::with_identity(&instance, dice_chain).unwrap();
// Construct encoded request packets for the test
let (req_1, req_2, req_3) = construct_secret_management_requests(sealing_policy);
@@ -522,7 +677,7 @@
fn secret_management_replay_protection_seq_num_per_session(instance: String) {
let dice_chain = make_explicit_owned_dice(/*Security version in a node */ 5);
let sealing_policy = sealing_policy(dice_chain.explicit_key_dice_chain().unwrap());
- let sk_client = SkClient::with_identity(&instance, dice_chain);
+ let sk_client = SkClient::with_identity(&instance, dice_chain).unwrap();
// Construct encoded request packets for the test
let (req_1, _, _) = construct_secret_management_requests(sealing_policy);
@@ -538,7 +693,7 @@
assert_eq!(res.response_type().unwrap(), ResponseType::Success);
// Start another session
- let sk_client_diff = SkClient::new(&instance);
+ let sk_client_diff = SkClient::new(&instance).unwrap();
// Check first request/response is with seq_0 is successful
let res = ResponsePacket::from_slice(
&sk_client_diff.secret_management_request_custom_aad(&req_1, &seq_0, &seq_0).unwrap(),
@@ -553,7 +708,7 @@
fn secret_management_replay_protection_out_of_seq_req_not_accepted(instance: String) {
let dice_chain = make_explicit_owned_dice(/*Security version in a node */ 5);
let sealing_policy = sealing_policy(dice_chain.explicit_key_dice_chain().unwrap());
- let sk_client = SkClient::with_identity(&instance, dice_chain);
+ let sk_client = SkClient::with_identity(&instance, dice_chain).unwrap();
// Construct encoded request packets for the test
let (req_1, req_2, _) = construct_secret_management_requests(sealing_policy);
@@ -578,22 +733,20 @@
#[rdroidtest(get_instances())]
fn secret_management_policy_gate(instance: String) {
let dice_chain = make_explicit_owned_dice(/*Security version in a node */ 100);
- let mut sk_client_original = SkClient::with_identity(&instance, dice_chain);
+ let mut sk_client_original = SkClient::with_identity(&instance, dice_chain).unwrap();
sk_client_original.store(&ID_EXAMPLE, &SECRET_EXAMPLE).unwrap();
assert_eq!(sk_client_original.get(&ID_EXAMPLE).unwrap(), SECRET_EXAMPLE);
// Start a session with higher security_version & get the stored secret.
let dice_chain_upgraded = make_explicit_owned_dice(/*Security version in a node */ 101);
- let mut sk_client_upgraded = SkClient::with_identity(&instance, dice_chain_upgraded);
+ let mut sk_client_upgraded = SkClient::with_identity(&instance, dice_chain_upgraded).unwrap();
assert_eq!(sk_client_upgraded.get(&ID_EXAMPLE).unwrap(), SECRET_EXAMPLE);
// Start a session with lower security_version (This should be denied access to the secret).
let dice_chain_downgraded = make_explicit_owned_dice(/*Security version in a node */ 99);
- let mut sk_client_downgraded = SkClient::with_identity(&instance, dice_chain_downgraded);
- assert!(matches!(
- sk_client_downgraded.get(&ID_EXAMPLE).unwrap_err(),
- Error::SecretkeeperError(SecretkeeperError::DicePolicyError)
- ));
+ let mut sk_client_downgraded =
+ SkClient::with_identity(&instance, dice_chain_downgraded).unwrap();
+ assert_dice_policy_error(sk_client_downgraded.get(&ID_EXAMPLE));
// Now get the secret with the later version, and upgrade the sealing policy along the way.
let sealing_policy =
@@ -604,9 +757,30 @@
);
// The original version of the client should no longer be able to retrieve the secret.
+ assert_dice_policy_error(sk_client_original.get(&ID_EXAMPLE));
+}
+
+// This test checks that the identity of Secretkeeper (in context of AuthGraph key exchange) is
+// same as the one advertized in Linux device tree. This is only expected from `default` instance.
+#[rdroidtest(get_instances())]
+#[ignore_if(|p| p != "default")]
+fn secretkeeper_check_identity(instance: String) {
+ let sk_key = get_secretkeeper_identity()
+ .expect("Failed to extract identity of default instance from device tree");
+ // Create a session with this expected identity. This succeeds only if the identity used by
+ // Secretkeeper is sk_key.
+ let _ = SkClient::with_expected_sk_identity(&instance, sk_key).unwrap();
+ // Create a session using any other expected sk identity, this should fail. Note that the
+ // failure arises from validation which happens at the local participant.
+ let mut any_other_key = CoseKey::default();
+ any_other_key.canonicalize(CborOrdering::Lexicographic);
+ let err = SkClient::with_expected_sk_identity(&instance, any_other_key).unwrap_err();
assert!(matches!(
- sk_client_original.get(&ID_EXAMPLE).unwrap_err(),
- Error::SecretkeeperError(SecretkeeperError::DicePolicyError)
+ err,
+ SkClientError::AuthgraphError(authgraph_core::error::Error(
+ authgraph_wire::ErrorCode::InvalidPeerKeKey,
+ _
+ ))
));
}
diff --git a/security/secretkeeper/default/Android.bp b/security/secretkeeper/default/Android.bp
index d8ccb63..799188f 100644
--- a/security/secretkeeper/default/Android.bp
+++ b/security/secretkeeper/default/Android.bp
@@ -15,6 +15,7 @@
*/
package {
+ default_team: "trendy_team_virtualization",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/security/sharedsecret/aidl/android/hardware/security/sharedsecret/ISharedSecret.aidl b/security/sharedsecret/aidl/android/hardware/security/sharedsecret/ISharedSecret.aidl
index eca8d87..b0dd284 100644
--- a/security/sharedsecret/aidl/android/hardware/security/sharedsecret/ISharedSecret.aidl
+++ b/security/sharedsecret/aidl/android/hardware/security/sharedsecret/ISharedSecret.aidl
@@ -81,14 +81,9 @@
* defined in the standard. The counter is prefixed and length L appended, as shown
* in the construction on page 12 of the standard. The label string is UTF-8 encoded.
*
- * ``K'' is a pre-established shared secret, set up during factory reset. The mechanism for
- * establishing this shared secret is implementation-defined.Any method of securely
- * establishing K that ensures that an attacker cannot obtain or derive its value is
- * acceptable.
- *
- * CRITICAL SECURITY REQUIREMENT: All keys created by a IKeymintDevice instance must
- * be cryptographically bound to the value of K, such that establishing a new K
- * permanently destroys them.
+ * ``K'' is a pre-established shared secret. The mechanism for establishing this shared
+ * secret is implementation-defined. Any method of securely establishing K that
+ * ensures that an attacker cannot obtain or derive its value is acceptable.
*
* ``||'' represents concatenation.
*
diff --git a/sensors/2.1/vts/functional/AndroidTest.xml b/sensors/2.1/vts/functional/AndroidTest.xml
index 2ef8dc6..2d21c7f 100644
--- a/sensors/2.1/vts/functional/AndroidTest.xml
+++ b/sensors/2.1/vts/functional/AndroidTest.xml
@@ -22,13 +22,13 @@
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
<option name="cleanup" value="true" />
- <option name="push" value="VtsHalSensorsV2_1TargetTest->/data/local/tmp/VtsHalSensorsV2_1TargetTest" />
+ <option name="push" value="VtsHalSensorsV2_1TargetTest->/data/local/tests/unrestricted/VtsHalSensorsV2_1TargetTest" />
</target_preparer>
<test class="com.android.tradefed.testtype.GTest" >
<option name="native-test-timeout" value="900000" />
<option name="runtime-hint" value="300000"/>
- <option name="native-test-device-path" value="/data/local/tmp" />
+ <option name="native-test-device-path" value="/data/local/tests/unrestricted" />
<option name="module-name" value="VtsHalSensorsV2_1TargetTest" />
</test>
</configuration>
diff --git a/sensors/2.1/vts/functional/TEST_MAPPING b/sensors/2.1/vts/functional/TEST_MAPPING
new file mode 100644
index 0000000..0129f39
--- /dev/null
+++ b/sensors/2.1/vts/functional/TEST_MAPPING
@@ -0,0 +1,12 @@
+{
+ "presubmit": [
+ {
+ "name": "VtsHalSensorsV2_1TargetTest"
+ }
+ ],
+ "kernel-presubmit": [
+ {
+ "name": "VtsHalSensorsV2_1TargetTest"
+ }
+ ]
+}
diff --git a/sensors/OWNERS b/sensors/OWNERS
index e7ebd3e..5017a9a 100644
--- a/sensors/OWNERS
+++ b/sensors/OWNERS
@@ -1,5 +1,3 @@
# Bug component: 62965
-arthuri@google.com
bduddie@google.com
-stange@google.com
diff --git a/sensors/aidl/TEST_MAPPING b/sensors/aidl/TEST_MAPPING
new file mode 100644
index 0000000..6de4549
--- /dev/null
+++ b/sensors/aidl/TEST_MAPPING
@@ -0,0 +1,12 @@
+{
+ "presubmit": [
+ {
+ "name": "VtsAidlHalSensorsTargetTest"
+ }
+ ],
+ "kernel-presubmit": [
+ {
+ "name": "VtsAidlHalSensorsTargetTest"
+ }
+ ]
+}
diff --git a/sensors/aidl/vts/AndroidTest.xml b/sensors/aidl/vts/AndroidTest.xml
index 99caf28..2d3382e 100644
--- a/sensors/aidl/vts/AndroidTest.xml
+++ b/sensors/aidl/vts/AndroidTest.xml
@@ -22,13 +22,13 @@
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
<option name="cleanup" value="true" />
- <option name="push" value="VtsAidlHalSensorsTargetTest->/data/local/tmp/VtsAidlHalSensorsTargetTest" />
+ <option name="push" value="VtsAidlHalSensorsTargetTest->/data/local/tests/unrestricted/VtsAidlHalSensorsTargetTest" />
</target_preparer>
<test class="com.android.tradefed.testtype.GTest" >
<option name="native-test-timeout" value="900000" />
<option name="runtime-hint" value="300000"/>
- <option name="native-test-device-path" value="/data/local/tmp" />
+ <option name="native-test-device-path" value="/data/local/tests/unrestricted" />
<option name="module-name" value="VtsAidlHalSensorsTargetTest" />
</test>
</configuration>
diff --git a/sensors/aidl/vts/SensorsAidlTestSharedMemory.h b/sensors/aidl/vts/SensorsAidlTestSharedMemory.h
index 4b5916a..200f26f 100644
--- a/sensors/aidl/vts/SensorsAidlTestSharedMemory.h
+++ b/sensors/aidl/vts/SensorsAidlTestSharedMemory.h
@@ -17,7 +17,11 @@
#ifndef ANDROID_SENSORS_AIDL_TEST_SHARED_MEMORY_H
#define ANDROID_SENSORS_AIDL_TEST_SHARED_MEMORY_H
-#include "sensors-vts-utils/GrallocWrapper.h"
+#include <aidl/android/hardware/graphics/common/BufferUsage.h>
+#include <aidl/android/hardware/graphics/common/PixelFormat.h>
+#include <ui/GraphicBuffer.h>
+#include <ui/GraphicBufferAllocator.h>
+#include <ui/GraphicBufferMapper.h>
#include <aidlcommonsupport/NativeHandle.h>
#include <android-base/macros.h>
@@ -28,6 +32,8 @@
#include <cutils/ashmem.h>
+using ::aidl::android::hardware::graphics::common::BufferUsage;
+using ::aidl::android::hardware::graphics::common::PixelFormat;
using ::aidl::android::hardware::sensors::BnSensors;
using ::aidl::android::hardware::sensors::Event;
using ::aidl::android::hardware::sensors::ISensors;
@@ -53,12 +59,22 @@
}
ISensors::SharedMemInfo getSharedMemInfo() const {
- ISensors::SharedMemInfo mem = {
- .type = mType,
- .format = ISensors::SharedMemInfo::SharedMemFormat::SENSORS_EVENT,
- .size = static_cast<int32_t>(mSize),
- .memoryHandle = android::dupToAidl(mNativeHandle)};
- return mem;
+ if (mType == ISensors::SharedMemInfo::SharedMemType::GRALLOC) {
+ ISensors::SharedMemInfo mem = {
+ .type = mType,
+ .format = ISensors::SharedMemInfo::SharedMemFormat::SENSORS_EVENT,
+ .size = static_cast<int32_t>(mSize),
+ .memoryHandle = android::dupToAidl(mBufferHandle)};
+ return mem;
+
+ } else {
+ ISensors::SharedMemInfo mem = {
+ .type = mType,
+ .format = ISensors::SharedMemInfo::SharedMemFormat::SENSORS_EVENT,
+ .size = static_cast<int32_t>(mSize),
+ .memoryHandle = android::dupToAidl(mNativeHandle)};
+ return mem;
+ }
}
char* getBuffer() const { return mBuffer; }
size_t getSize() const { return mSize; }
@@ -141,17 +157,26 @@
}
case ISensors::SharedMemInfo::SharedMemType::GRALLOC: {
if (mSize != 0) {
- mGrallocWrapper->freeBuffer(mNativeHandle);
- mNativeHandle = nullptr;
+ android::status_t status =
+ android::GraphicBufferAllocator::get().free(mBufferHandle);
+ if (status != android::OK) {
+ ALOGE("SensorsAidlTestSharedMemory Gralloc failed to free buffer. Status: "
+ "%s",
+ android::statusToString(status).c_str());
+ }
+ mBufferHandle = nullptr;
+ mBuffer = nullptr;
mSize = 0;
}
break;
}
default: {
- if (mNativeHandle != nullptr || mSize != 0 || mBuffer != nullptr) {
+ if (mNativeHandle != nullptr || mSize != 0 || mBuffer != nullptr ||
+ mBufferHandle != nullptr) {
ALOGE("SensorsAidlTestSharedMemory %p not properly destructed: "
- "type %d, native handle %p, size %zu, buffer %p",
- this, static_cast<int>(mType), mNativeHandle, mSize, mBuffer);
+ "type %d, native handle %p, size %zu, buffer %p, buffer handle %p",
+ this, static_cast<int>(mType), mNativeHandle, mSize, mBuffer,
+ mBufferHandle);
}
break;
}
@@ -185,14 +210,33 @@
break;
}
case ISensors::SharedMemInfo::SharedMemType::GRALLOC: {
- mGrallocWrapper = std::make_unique<::android::GrallocWrapper>();
- if (!mGrallocWrapper->isInitialized()) {
+ static constexpr uint64_t kBufferUsage =
+ static_cast<uint64_t>(BufferUsage::SENSOR_DIRECT_DATA) |
+ static_cast<uint64_t>(BufferUsage::CPU_READ_OFTEN) |
+ static_cast<uint64_t>(BufferUsage::CPU_WRITE_RARELY);
+
+ uint32_t stride = 0;
+ buffer_handle_t bufferHandle;
+ android::status_t status = android::GraphicBufferAllocator::get().allocate(
+ size, 1, static_cast<int>(PixelFormat::BLOB), 1, kBufferUsage,
+ &bufferHandle, &stride, "SensorVts");
+ if (status != android::OK) {
+ ALOGE("SensorsAidlTestSharedMemory failed to allocate memory. Status: %s",
+ android::statusToString(status).c_str());
break;
}
-
- std::pair<native_handle_t*, void*> buf = mGrallocWrapper->allocate(size);
- handle = buf.first;
- buffer = static_cast<char*>(buf.second);
+ // Per the HAL, all-zeros Rect means the entire buffer
+ android::Rect rect = {0, 0, 0, 0};
+ void* ret;
+ status = android::GraphicBufferMapper::get().lock(bufferHandle, kBufferUsage, rect,
+ &ret);
+ if (status != android::OK) {
+ ALOGE("SensorsAidlTestSharedMemory failed to import buffer: Status: %s",
+ android::statusToString(status).c_str());
+ } else {
+ buffer = static_cast<char*>(ret);
+ mBufferHandle = bufferHandle;
+ }
break;
}
default:
@@ -208,9 +252,9 @@
ISensors::SharedMemInfo::SharedMemType mType;
native_handle_t* mNativeHandle;
+ buffer_handle_t mBufferHandle;
size_t mSize;
char* mBuffer;
- std::unique_ptr<::android::GrallocWrapper> mGrallocWrapper;
DISALLOW_COPY_AND_ASSIGN(SensorsAidlTestSharedMemory);
};
diff --git a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp
index be11b87..0b15d12 100644
--- a/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp
+++ b/sensors/aidl/vts/VtsAidlHalSensorsTargetTest.cpp
@@ -931,9 +931,15 @@
continue;
}
+ // Skip sensors with no events
+ const std::vector<Event> events = callback.getEvents(sensor.sensorHandle);
+ if (events.empty()) {
+ continue;
+ }
+
// Ensure that the first event received is not stale by ensuring that its timestamp is
// sufficiently different from the previous event
- const Event newEvent = callback.getEvents(sensor.sensorHandle).front();
+ const Event newEvent = events.front();
std::chrono::milliseconds delta =
duration_cast<std::chrono::milliseconds>(std::chrono::nanoseconds(
newEvent.timestamp - lastEventTimestampMap[sensor.sensorHandle]));
diff --git a/sensors/common/convert/Android.bp b/sensors/common/convert/Android.bp
index 230665e..5c6aba3 100644
--- a/sensors/common/convert/Android.bp
+++ b/sensors/common/convert/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_sensors",
default_applicable_licenses: ["Android-Apache-2.0"],
}
diff --git a/sensors/common/default/2.X/Android.bp b/sensors/common/default/2.X/Android.bp
index 82c942f..300598f 100644
--- a/sensors/common/default/2.X/Android.bp
+++ b/sensors/common/default/2.X/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_sensors",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/sensors/common/default/2.X/multihal/Android.bp b/sensors/common/default/2.X/multihal/Android.bp
index b0ad934..c25b17a 100644
--- a/sensors/common/default/2.X/multihal/Android.bp
+++ b/sensors/common/default/2.X/multihal/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_sensors",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/sensors/common/default/2.X/multihal/tests/Android.bp b/sensors/common/default/2.X/multihal/tests/Android.bp
index 21d1d77..d743d1e 100644
--- a/sensors/common/default/2.X/multihal/tests/Android.bp
+++ b/sensors/common/default/2.X/multihal/tests/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_sensors",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/sensors/common/utils/Android.bp b/sensors/common/utils/Android.bp
index 97e857c..2aeeb14 100644
--- a/sensors/common/utils/Android.bp
+++ b/sensors/common/utils/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_android_sensors",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/sensors/common/vts/2_X/Android.bp b/sensors/common/vts/2_X/Android.bp
index 4cf6a08..e7cab6d 100644
--- a/sensors/common/vts/2_X/Android.bp
+++ b/sensors/common/vts/2_X/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_sensors",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h b/sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h
index aa6e881..becc93c 100644
--- a/sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h
+++ b/sensors/common/vts/2_X/VtsHalSensorsV2_XTargetTest.h
@@ -52,8 +52,6 @@
using ::android::hardware::sensors::V1_0::Vec3;
using ::android::hardware::sensors::V2_1::implementation::convertToOldSensorInfos;
using std::chrono::duration_cast;
-using std::chrono::microseconds;
-using std::chrono::milliseconds;
using std::chrono::nanoseconds;
using EventV1_0 = ::android::hardware::sensors::V1_0::Event;
@@ -91,7 +89,7 @@
}
void waitForFlushEvents(const std::vector<SensorInfoType>& sensorsToWaitFor,
- int32_t numCallsToFlush, milliseconds timeout) {
+ int32_t numCallsToFlush, std::chrono::milliseconds timeout) {
std::unique_lock<std::recursive_mutex> lock(mFlushMutex);
mFlushCV.wait_for(lock, timeout,
[&] { return flushesReceived(sensorsToWaitFor, numCallsToFlush); });
@@ -102,7 +100,8 @@
return mEventMap[sensorHandle];
}
- void waitForEvents(const std::vector<SensorInfoType>& sensorsToWaitFor, milliseconds timeout) {
+ void waitForEvents(const std::vector<SensorInfoType>& sensorsToWaitFor,
+ std::chrono::milliseconds timeout) {
std::unique_lock<std::recursive_mutex> lock(mEventMutex);
mEventCV.wait_for(lock, timeout, [&] { return eventsReceived(sensorsToWaitFor); });
}
@@ -472,7 +471,7 @@
}
// Wait for events to be written back to the Event FMQ
- callback.waitForEvents(sensors, milliseconds(1000) /* timeout */);
+ callback.waitForEvents(sensors, std::chrono::milliseconds(1000) /* timeout */);
getEnvironment()->unregisterCallback();
for (const auto& s : sensors) {
@@ -623,7 +622,7 @@
}
// Wait up to one second for the flush events
- callback.waitForFlushEvents(sensors, flushCalls, milliseconds(1000) /* timeout */);
+ callback.waitForFlushEvents(sensors, flushCalls, std::chrono::milliseconds(1000) /* timeout */);
// Deactivate all sensors after waiting for flush events so pending flush events are not
// abandoned by the HAL.
@@ -748,8 +747,8 @@
}
TEST_P(SensorsHidlTest, NoStaleEvents) {
- constexpr milliseconds kFiveHundredMs(500);
- constexpr milliseconds kOneSecond(1000);
+ constexpr std::chrono::milliseconds kFiveHundredMs(500);
+ constexpr std::chrono::milliseconds kOneSecond(1000);
// Register the callback to receive sensor events
EventCallback callback;
@@ -757,10 +756,11 @@
// This test is not valid for one-shot, on-change or special-report-mode sensors
const std::vector<SensorInfoType> sensors = getNonOneShotAndNonOnChangeAndNonSpecialSensors();
- milliseconds maxMinDelay(0);
+ std::chrono::milliseconds maxMinDelay(0);
for (const SensorInfoType& sensor : sensors) {
- milliseconds minDelay = duration_cast<milliseconds>(microseconds(sensor.minDelay));
- maxMinDelay = milliseconds(std::max(maxMinDelay.count(), minDelay.count()));
+ std::chrono::milliseconds minDelay = duration_cast<std::chrono::milliseconds>(
+ std::chrono::microseconds(sensor.minDelay));
+ maxMinDelay = std::chrono::milliseconds(std::max(maxMinDelay.count(), minDelay.count()));
}
// Activate the sensors so that they start generating events
@@ -787,7 +787,7 @@
}
// Allow some time to pass, reset the callback, then reactivate the sensors
- usleep(duration_cast<microseconds>(kOneSecond + (5 * maxMinDelay)).count());
+ usleep(duration_cast<std::chrono::microseconds>(kOneSecond + (5 * maxMinDelay)).count());
callback.reset();
activateAllSensors(true);
callback.waitForEvents(sensors, kFiveHundredMs + (5 * maxMinDelay));
@@ -806,12 +806,19 @@
continue;
}
+ // Skip sensors with no events
+ const std::vector<EventType> events = callback.getEvents(sensor.sensorHandle);
+ if (events.empty()) {
+ continue;
+ }
+
// Ensure that the first event received is not stale by ensuring that its timestamp is
// sufficiently different from the previous event
- const EventType newEvent = callback.getEvents(sensor.sensorHandle).front();
- milliseconds delta = duration_cast<milliseconds>(
+ const EventType newEvent = events.front();
+ std::chrono::milliseconds delta = duration_cast<std::chrono::milliseconds>(
nanoseconds(newEvent.timestamp - lastEventTimestampMap[sensor.sensorHandle]));
- milliseconds sensorMinDelay = duration_cast<milliseconds>(microseconds(sensor.minDelay));
+ std::chrono::milliseconds sensorMinDelay = duration_cast<std::chrono::milliseconds>(
+ std::chrono::microseconds(sensor.minDelay));
ASSERT_GE(delta, kFiveHundredMs + (3 * sensorMinDelay));
}
}
diff --git a/sensors/common/vts/utils/Android.bp b/sensors/common/vts/utils/Android.bp
index b35280a..69b1224 100644
--- a/sensors/common/vts/utils/Android.bp
+++ b/sensors/common/vts/utils/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_sensors",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -35,6 +36,7 @@
"libbinder_ndk",
"libutils",
"libvndksupport",
+ "libui",
],
static_libs: [
"libaidlcommonsupport",
@@ -50,9 +52,6 @@
"android.hardware.graphics.common-ndk_shared",
],
cflags: ["-DLOG_TAG=\"sensors_hidl_hal_test\""],
- srcs: [
- "GrallocWrapper.cpp",
- ],
export_include_dirs: [
"include",
],
@@ -64,6 +63,7 @@
"libbinder_ndk",
"libutils",
"libvndksupport",
+ "libui",
],
static_libs: [
"android.hardware.sensors@1.0",
@@ -71,13 +71,4 @@
"android.hardware.sensors@2.1",
"libaidlcommonsupport",
],
- whole_static_libs: [
- "android.hardware.graphics.allocator@2.0",
- "android.hardware.graphics.allocator@3.0",
- "android.hardware.graphics.allocator@4.0",
- "android.hardware.graphics.mapper@2.0",
- "android.hardware.graphics.mapper@2.1",
- "android.hardware.graphics.mapper@3.0",
- "android.hardware.graphics.mapper@4.0",
- ],
}
diff --git a/sensors/common/vts/utils/GrallocWrapper.cpp b/sensors/common/vts/utils/GrallocWrapper.cpp
deleted file mode 100644
index a15e7fe..0000000
--- a/sensors/common/vts/utils/GrallocWrapper.cpp
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * Copyright (C) 2017 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 "GrallocWrapper.h"
-
-#include <aidl/android/hardware/graphics/allocator/IAllocator.h>
-#include <aidlcommonsupport/NativeHandle.h>
-#include <android/binder_manager.h>
-#include <android/hardware/graphics/allocator/2.0/IAllocator.h>
-#include <android/hardware/graphics/allocator/3.0/IAllocator.h>
-#include <android/hardware/graphics/allocator/4.0/IAllocator.h>
-#include <android/hardware/graphics/mapper/2.0/IMapper.h>
-#include <android/hardware/graphics/mapper/2.1/IMapper.h>
-#include <android/hardware/graphics/mapper/3.0/IMapper.h>
-#include <android/hardware/graphics/mapper/4.0/IMapper.h>
-
-#include <utils/Log.h>
-
-#include <cinttypes>
-#include <memory>
-#include <type_traits>
-
-using IAllocatorAidl = ::aidl::android::hardware::graphics::allocator::IAllocator;
-using IAllocator2 = ::android::hardware::graphics::allocator::V2_0::IAllocator;
-using IAllocator3 = ::android::hardware::graphics::allocator::V3_0::IAllocator;
-using IAllocator4 = ::android::hardware::graphics::allocator::V4_0::IAllocator;
-using IMapper2 = ::android::hardware::graphics::mapper::V2_0::IMapper;
-using IMapper2_1 = ::android::hardware::graphics::mapper::V2_1::IMapper;
-using IMapper3 = ::android::hardware::graphics::mapper::V3_0::IMapper;
-using IMapper4 = ::android::hardware::graphics::mapper::V4_0::IMapper;
-
-using Error2 = ::android::hardware::graphics::mapper::V2_0::Error;
-using Error3 = ::android::hardware::graphics::mapper::V3_0::Error;
-using Error4 = ::android::hardware::graphics::mapper::V4_0::Error;
-
-using ::aidl::android::hardware::common::NativeHandle;
-using ::aidl::android::hardware::graphics::allocator::AllocationResult;
-
-using ::android::hardware::graphics::common::V1_0::BufferUsage;
-using ::android::hardware::graphics::common::V1_0::PixelFormat;
-
-using ::android::hardware::hidl_handle;
-using ::android::hardware::hidl_string;
-using ::android::hardware::hidl_vec;
-
-namespace android {
-
-// Since we use the same APIs across allocator/mapper HALs but they have major
-// version differences (meaning they are not related through inheritance), we
-// create a common interface abstraction for the IAllocator + IMapper combination
-// (major versions need to match in the current HALs, e.g. IAllocator 3.0 needs to
-// be paired with IMapper 3.0, so these are tied together)
-class IGrallocHalWrapper {
- public:
- virtual ~IGrallocHalWrapper() = default;
-
- // IAllocator
- virtual native_handle_t* allocate(uint32_t size) = 0;
- virtual void freeBuffer(native_handle_t* bufferHandle) = 0;
-
- // IMapper
- virtual void* lock(native_handle_t* bufferHandle) = 0;
- virtual void unlock(native_handle_t* bufferHandle) = 0;
-};
-
-namespace {
-
-bool failed(Error2 error) {
- return (error != Error2::NONE);
-}
-bool failed(Error3 error) {
- return (error != Error3::NONE);
-}
-bool failed(Error4 error) {
- return (error != Error4::NONE);
-}
-
-template <typename>
-struct FirstArg;
-
-// Template specialization for pointer to a non-static member function, which exposes
-// the type of the first argument given to said function
-template <typename ReturnType, typename ClassT, typename Arg1, typename... OtherArgs>
-struct FirstArg<ReturnType (ClassT::*)(Arg1, OtherArgs...)> {
- using type = Arg1;
-};
-
-// Alias to FirstArg which also removes any reference type and const associated
-template <typename T>
-using BaseTypeOfFirstArg = typename std::remove_const<
- typename std::remove_reference<typename FirstArg<T>::type>::type>::type;
-
-// Since all the type and function names are the same for the things we use across the major HAL
-// versions, we use template magic to avoid repeating ourselves.
-template <typename AllocatorT, typename MapperT,
- template <typename> typename AllocatorWrapperT = sp>
-class GrallocHalWrapper : public IGrallocHalWrapper {
- public:
- GrallocHalWrapper(const AllocatorWrapperT<AllocatorT>& allocator, const sp<MapperT>& mapper)
- : mAllocator(allocator), mMapper(mapper) {
- if (mapper->isRemote()) {
- ALOGE("Mapper is in passthrough mode");
- }
- }
-
- virtual native_handle_t* allocate(uint32_t size) override;
- virtual void freeBuffer(native_handle_t* bufferHandle) override;
-
- virtual void* lock(native_handle_t* bufferHandle) override;
- virtual void unlock(native_handle_t* bufferHandle) override;
-
- private:
- static constexpr uint64_t kBufferUsage =
- static_cast<uint64_t>(BufferUsage::SENSOR_DIRECT_DATA | BufferUsage::CPU_READ_OFTEN |
- BufferUsage::CPU_WRITE_RARELY);
- AllocatorWrapperT<AllocatorT> mAllocator;
- sp<MapperT> mMapper;
-
- // v2.0 and v3.0 use vec<uint32_t> for BufferDescriptor, but v4.0 uses vec<uint8_t>, so use
- // some template magic to deduce the right type based off of the first argument to allocate(),
- // which is always the version-specific BufferDescriptor type
- typedef BaseTypeOfFirstArg<decltype(&AllocatorT::allocate)> BufferDescriptorT;
-
- BufferDescriptorT getDescriptor(uint32_t size);
- native_handle_t* importBuffer(const hidl_handle& rawHandle);
-};
-
-template <>
-native_handle_t* GrallocHalWrapper<IAllocatorAidl, IMapper4, std::shared_ptr>::allocate(
- uint32_t size) {
- constexpr uint32_t kBufferCount = 1;
- BufferDescriptorT descriptor = getDescriptor(size);
- native_handle_t* bufferHandle = nullptr;
-
- AllocationResult result;
- auto status = mAllocator->allocate(descriptor, kBufferCount, &result);
- if (!status.isOk()) {
- status_t error = status.getExceptionCode();
- ALOGE("Failed to allocate buffer: %" PRId32, static_cast<int32_t>(error));
- } else if (result.buffers.size() != kBufferCount) {
- ALOGE("Invalid buffer array size (got %zu, expected %" PRIu32 ")", result.buffers.size(),
- kBufferCount);
- } else {
- // Convert from AIDL NativeHandle to native_handle_t to hidl_handle
- hidl_handle hidlHandle;
- hidlHandle.setTo(dupFromAidl(result.buffers[0]), /*shouldOwn*/ true);
- bufferHandle = importBuffer(hidlHandle);
- }
-
- return bufferHandle;
-}
-
-template <typename AllocatorT, typename MapperT, template <typename> typename AllocatorWrapperT>
-native_handle_t* GrallocHalWrapper<AllocatorT, MapperT, AllocatorWrapperT>::allocate(
- uint32_t size) {
- constexpr uint32_t kBufferCount = 1;
- BufferDescriptorT descriptor = getDescriptor(size);
- native_handle_t* bufferHandle = nullptr;
-
- auto callback = [&](auto error, uint32_t /*stride*/, const hidl_vec<hidl_handle>& buffers) {
- if (failed(error)) {
- ALOGE("Failed to allocate buffer: %" PRId32, static_cast<int32_t>(error));
- } else if (buffers.size() != kBufferCount) {
- ALOGE("Invalid buffer array size (got %zu, expected %" PRIu32 ")", buffers.size(),
- kBufferCount);
- } else {
- bufferHandle = importBuffer(buffers[0]);
- }
- };
-
- mAllocator->allocate(descriptor, kBufferCount, callback);
- return bufferHandle;
-}
-
-template <typename AllocatorT, typename MapperT, template <typename> typename AllocatorWrapperT>
-void GrallocHalWrapper<AllocatorT, MapperT, AllocatorWrapperT>::freeBuffer(
- native_handle_t* bufferHandle) {
- auto error = mMapper->freeBuffer(bufferHandle);
- if (!error.isOk() || failed(error)) {
- ALOGE("Failed to free buffer %p", bufferHandle);
- }
-}
-
-template <typename AllocatorT, typename MapperT, template <typename> typename AllocatorWrapperT>
-typename GrallocHalWrapper<AllocatorT, MapperT, AllocatorWrapperT>::BufferDescriptorT
-GrallocHalWrapper<AllocatorT, MapperT, AllocatorWrapperT>::getDescriptor(uint32_t size) {
- typename MapperT::BufferDescriptorInfo descriptorInfo = {
- .width = size,
- .height = 1,
- .layerCount = 1,
- .format = static_cast<decltype(descriptorInfo.format)>(PixelFormat::BLOB),
- .usage = kBufferUsage,
- };
-
- BufferDescriptorT descriptor;
- auto callback = [&](auto error, const BufferDescriptorT& tmpDescriptor) {
- if (failed(error)) {
- ALOGE("Failed to create descriptor: %" PRId32, static_cast<int32_t>(error));
- } else {
- descriptor = tmpDescriptor;
- }
- };
-
- mMapper->createDescriptor(descriptorInfo, callback);
- return descriptor;
-}
-
-template <typename AllocatorT, typename MapperT, template <typename> typename AllocatorWrapperT>
-native_handle_t* GrallocHalWrapper<AllocatorT, MapperT, AllocatorWrapperT>::importBuffer(
- const hidl_handle& rawHandle) {
- native_handle_t* bufferHandle = nullptr;
-
- mMapper->importBuffer(rawHandle, [&](auto error, void* tmpBuffer) {
- if (failed(error)) {
- ALOGE("Failed to import buffer %p: %" PRId32, rawHandle.getNativeHandle(),
- static_cast<int32_t>(error));
- } else {
- bufferHandle = static_cast<native_handle_t*>(tmpBuffer);
- }
- });
-
- return bufferHandle;
-}
-
-template <typename AllocatorT, typename MapperT, template <typename> typename AllocatorWrapperT>
-void* GrallocHalWrapper<AllocatorT, MapperT, AllocatorWrapperT>::lock(
- native_handle_t* bufferHandle) {
- // Per the HAL, all-zeros Rect means the entire buffer
- typename MapperT::Rect accessRegion = {};
- hidl_handle acquireFenceHandle; // No fence needed, already safe to lock
-
- void* data = nullptr;
- mMapper->lock(bufferHandle, kBufferUsage, accessRegion, acquireFenceHandle,
- [&](auto error, void* tmpData, ...) { // V3/4 pass extra args we don't use
- if (failed(error)) {
- ALOGE("Failed to lock buffer %p: %" PRId32, bufferHandle,
- static_cast<int32_t>(error));
- } else {
- data = tmpData;
- }
- });
-
- return data;
-}
-
-template <typename AllocatorT, typename MapperT, template <typename> typename AllocatorWrapperT>
-void GrallocHalWrapper<AllocatorT, MapperT, AllocatorWrapperT>::unlock(
- native_handle_t* bufferHandle) {
- mMapper->unlock(bufferHandle, [&](auto error, const hidl_handle& /*releaseFence*/) {
- if (failed(error)) {
- ALOGE("Failed to unlock buffer %p: %" PRId32, bufferHandle,
- static_cast<int32_t>(error));
- }
- });
-}
-
-} // anonymous namespace
-
-GrallocWrapper::GrallocWrapper() {
- sp<IAllocator4> allocator4 = IAllocator4::getService();
- sp<IMapper4> mapper4 = IMapper4::getService();
-
- const auto kAllocatorSvc = std::string(IAllocatorAidl::descriptor) + "/default";
- std::shared_ptr<IAllocatorAidl> allocatorAidl;
- if (AServiceManager_isDeclared(kAllocatorSvc.c_str())) {
- allocatorAidl = IAllocatorAidl::fromBinder(
- ndk::SpAIBinder(AServiceManager_checkService(kAllocatorSvc.c_str())));
- }
-
- // As of T, AIDL Allocator is supported only with HIDL Mapper4
- // (ref: VtsHalGraphicsAllocatorAidl_TargetTest.cpp)
- if (allocatorAidl != nullptr && mapper4 != nullptr) {
- ALOGD("Using AIDL IAllocator + HIDL IMapper v4.0");
- mGrallocHal = std::unique_ptr<IGrallocHalWrapper>(
- new GrallocHalWrapper<IAllocatorAidl, IMapper4, std::shared_ptr>(allocatorAidl,
- mapper4));
- } else if (allocator4 != nullptr && mapper4 != nullptr) {
- ALOGD("AIDL IAllocator not found, using HIDL IAllocator/IMapper v4.0");
- mGrallocHal = std::unique_ptr<IGrallocHalWrapper>(
- new GrallocHalWrapper<IAllocator4, IMapper4>(allocator4, mapper4));
- } else {
- ALOGD("Graphics HALs 4.0 not found (allocator %d mapper %d), falling back to 3.0",
- (allocator4 != nullptr), (mapper4 != nullptr));
-
- sp<IAllocator3> allocator3 = IAllocator3::getService();
- sp<IMapper3> mapper3 = IMapper3::getService();
-
- if (allocator3 != nullptr && mapper3 != nullptr) {
- mGrallocHal = std::unique_ptr<IGrallocHalWrapper>(
- new GrallocHalWrapper<IAllocator3, IMapper3>(allocator3, mapper3));
- } else {
- ALOGD("Graphics HALs 3.0 not found (allocator %d mapper %d), falling back to 2.x",
- (allocator3 != nullptr), (mapper3 != nullptr));
-
- sp<IAllocator2> allocator2 = IAllocator2::getService();
- sp<IMapper2> mapper2 = IMapper2_1::getService();
- if (mapper2 == nullptr) {
- mapper2 = IMapper2::getService();
- }
-
- if (allocator2 != nullptr && mapper2 != nullptr) {
- mGrallocHal = std::unique_ptr<IGrallocHalWrapper>(
- new GrallocHalWrapper<IAllocator2, IMapper2>(allocator2, mapper2));
- } else {
- ALOGE("Couldn't open graphics HALs (2.x allocator %d mapper %d)",
- (allocator2 != nullptr), (mapper2 != nullptr));
- }
- }
- }
-}
-
-GrallocWrapper::~GrallocWrapper() {
- for (auto bufferHandle : mAllocatedBuffers) {
- mGrallocHal->unlock(bufferHandle);
- mGrallocHal->freeBuffer(bufferHandle);
- }
- mAllocatedBuffers.clear();
-}
-
-std::pair<native_handle_t*, void*> GrallocWrapper::allocate(uint32_t size) {
- native_handle_t* bufferHandle = mGrallocHal->allocate(size);
- void* buffer = nullptr;
- if (bufferHandle) {
- buffer = mGrallocHal->lock(bufferHandle);
- if (buffer) {
- mAllocatedBuffers.insert(bufferHandle);
- } else {
- mGrallocHal->freeBuffer(bufferHandle);
- bufferHandle = nullptr;
- }
- }
- return std::make_pair<>(bufferHandle, buffer);
-}
-
-void GrallocWrapper::freeBuffer(native_handle_t* bufferHandle) {
- if (mAllocatedBuffers.erase(bufferHandle)) {
- mGrallocHal->unlock(bufferHandle);
- mGrallocHal->freeBuffer(bufferHandle);
- }
-}
-
-} // namespace android
diff --git a/sensors/common/vts/utils/include/sensors-vts-utils/GrallocWrapper.h b/sensors/common/vts/utils/include/sensors-vts-utils/GrallocWrapper.h
deleted file mode 100644
index ebbcb2c..0000000
--- a/sensors/common/vts/utils/include/sensors-vts-utils/GrallocWrapper.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2017 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 <utils/NativeHandle.h>
-
-#include <memory>
-#include <string>
-#include <unordered_set>
-#include <utility>
-
-namespace android {
-
-class IGrallocHalWrapper;
-
-// Reference: hardware/interfaces/graphics/mapper/2.0/vts/functional/
-class GrallocWrapper {
- public:
- GrallocWrapper();
- ~GrallocWrapper();
-
- // After constructing this object, this function must be called to check the result. If it
- // returns false, other methods are not safe to call.
- bool isInitialized() const { return (mGrallocHal != nullptr); };
-
- // Allocates a gralloc buffer suitable for direct channel sensors usage with the given size.
- // The buffer should be freed using freeBuffer when it's not needed anymore; otherwise it'll
- // be freed when this object is destroyed.
- // Returns a handle to the buffer, and a CPU-accessible pointer for reading. On failure, both
- // will be set to nullptr.
- std::pair<native_handle_t*, void*> allocate(uint32_t size);
-
- // Releases a gralloc buffer previously returned by allocate()
- void freeBuffer(native_handle_t* bufferHandle);
-
- private:
- std::unique_ptr<IGrallocHalWrapper> mGrallocHal;
-
- // Keep track of all cloned and imported handles. When a test fails with
- // ASSERT_*, the destructor will free the handles for the test.
- std::unordered_set<native_handle_t*> mAllocatedBuffers;
-};
-
-} // namespace android
diff --git a/sensors/common/vts/utils/include/sensors-vts-utils/SensorsTestSharedMemory.h b/sensors/common/vts/utils/include/sensors-vts-utils/SensorsTestSharedMemory.h
index 39084a4..b96adb3 100644
--- a/sensors/common/vts/utils/include/sensors-vts-utils/SensorsTestSharedMemory.h
+++ b/sensors/common/vts/utils/include/sensors-vts-utils/SensorsTestSharedMemory.h
@@ -17,7 +17,11 @@
#ifndef ANDROID_SENSORS_TEST_SHARED_MEMORY_H
#define ANDROID_SENSORS_TEST_SHARED_MEMORY_H
-#include "GrallocWrapper.h"
+#include <aidl/android/hardware/graphics/common/BufferUsage.h>
+#include <aidl/android/hardware/graphics/common/PixelFormat.h>
+#include <ui/GraphicBuffer.h>
+#include <ui/GraphicBufferAllocator.h>
+#include <ui/GraphicBufferMapper.h>
#include <android-base/macros.h>
#include <log/log.h>
@@ -28,6 +32,8 @@
#include <cutils/ashmem.h>
using namespace ::android::hardware::sensors::V1_0;
+using ::aidl::android::hardware::graphics::common::BufferUsage;
+using ::aidl::android::hardware::graphics::common::PixelFormat;
template <class SensorTypeVersion, class EventType>
class SensorsTestSharedMemory {
@@ -48,11 +54,20 @@
}
SharedMemInfo getSharedMemInfo() const {
- SharedMemInfo mem = {.type = mType,
- .format = SharedMemFormat::SENSORS_EVENT,
- .size = static_cast<uint32_t>(mSize),
- .memoryHandle = mNativeHandle};
- return mem;
+ if (mType == SharedMemType::GRALLOC) {
+ SharedMemInfo mem = {.type = mType,
+ .format = SharedMemFormat::SENSORS_EVENT,
+ .size = static_cast<uint32_t>(mSize),
+ .memoryHandle = mBufferHandle};
+ return mem;
+
+ } else {
+ SharedMemInfo mem = {.type = mType,
+ .format = SharedMemFormat::SENSORS_EVENT,
+ .size = static_cast<uint32_t>(mSize),
+ .memoryHandle = mNativeHandle};
+ return mem;
+ }
}
char* getBuffer() const { return mBuffer; }
size_t getSize() const { return mSize; }
@@ -128,17 +143,26 @@
}
case SharedMemType::GRALLOC: {
if (mSize != 0) {
- mGrallocWrapper->freeBuffer(mNativeHandle);
- mNativeHandle = nullptr;
+ android::status_t status =
+ android::GraphicBufferAllocator::get().free(mBufferHandle);
+ if (status != android::OK) {
+ ALOGE("SensorsAidlTestSharedMemory Gralloc failed to free buffer. Status: "
+ "%s",
+ android::statusToString(status).c_str());
+ }
+ mBufferHandle = nullptr;
+ mBuffer = nullptr;
mSize = 0;
}
break;
}
default: {
- if (mNativeHandle != nullptr || mSize != 0 || mBuffer != nullptr) {
- ALOGE("SensorsTestSharedMemory %p not properly destructed: "
- "type %d, native handle %p, size %zu, buffer %p",
- this, static_cast<int>(mType), mNativeHandle, mSize, mBuffer);
+ if (mNativeHandle != nullptr || mSize != 0 || mBuffer != nullptr ||
+ mBufferHandle != nullptr) {
+ ALOGE("SensorsAidlTestSharedMemory %p not properly destructed: "
+ "type %d, native handle %p, size %zu, buffer %p, buffer handle %p",
+ this, static_cast<int>(mType), mNativeHandle, mSize, mBuffer,
+ mBufferHandle);
}
break;
}
@@ -171,14 +195,33 @@
break;
}
case SharedMemType::GRALLOC: {
- mGrallocWrapper = std::make_unique<::android::GrallocWrapper>();
- if (!mGrallocWrapper->isInitialized()) {
+ static constexpr uint64_t kBufferUsage =
+ static_cast<uint64_t>(BufferUsage::SENSOR_DIRECT_DATA) |
+ static_cast<uint64_t>(BufferUsage::CPU_READ_OFTEN) |
+ static_cast<uint64_t>(BufferUsage::CPU_WRITE_RARELY);
+
+ uint32_t stride = 0;
+ buffer_handle_t bufferHandle;
+ android::status_t status = android::GraphicBufferAllocator::get().allocate(
+ size, 1, static_cast<int>(PixelFormat::BLOB), 1, kBufferUsage,
+ &bufferHandle, &stride, "SensorVts");
+ if (status != android::OK) {
+ ALOGE("SensorsAidlTestSharedMemory failed to allocate memory. Status: %s",
+ android::statusToString(status).c_str());
break;
}
-
- std::pair<native_handle_t*, void*> buf = mGrallocWrapper->allocate(size);
- handle = buf.first;
- buffer = static_cast<char*>(buf.second);
+ // Per the HAL, all-zeros Rect means the entire buffer
+ android::Rect rect = {0, 0, 0, 0};
+ void* ret;
+ status = android::GraphicBufferMapper::get().lock(bufferHandle, kBufferUsage, rect,
+ &ret);
+ if (status != android::OK) {
+ ALOGE("SensorsAidlTestSharedMemory failed to import buffer: Status: %s",
+ android::statusToString(status).c_str());
+ } else {
+ buffer = static_cast<char*>(ret);
+ mBufferHandle = bufferHandle;
+ }
break;
}
default:
@@ -194,9 +237,9 @@
SharedMemType mType;
native_handle_t* mNativeHandle;
+ buffer_handle_t mBufferHandle;
size_t mSize;
char* mBuffer;
- std::unique_ptr<::android::GrallocWrapper> mGrallocWrapper;
DISALLOW_COPY_AND_ASSIGN(SensorsTestSharedMemory);
};
diff --git a/soundtrigger/2.0/Android.bp b/soundtrigger/2.0/Android.bp
index 996105c..828b9ec 100644
--- a/soundtrigger/2.0/Android.bp
+++ b/soundtrigger/2.0/Android.bp
@@ -12,9 +12,6 @@
hidl_interface {
name: "android.hardware.soundtrigger@2.0",
root: "android.hardware",
- vndk: {
- enabled: true,
- },
srcs: [
"types.hal",
"ISoundTriggerHw.hal",
diff --git a/soundtrigger/2.0/default/Android.bp b/soundtrigger/2.0/default/Android.bp
index 8236e30..2cbf041 100644
--- a/soundtrigger/2.0/default/Android.bp
+++ b/soundtrigger/2.0/default/Android.bp
@@ -26,9 +26,6 @@
name: "android.hardware.soundtrigger@2.0-core",
defaults: ["hidl_defaults"],
vendor_available: true,
- vndk: {
- enabled: true,
- },
srcs: [
"SoundTriggerHalImpl.cpp",
],
diff --git a/soundtrigger/aidl/Android.bp b/soundtrigger/aidl/Android.bp
index aa400c1..fcbaf6b 100644
--- a/soundtrigger/aidl/Android.bp
+++ b/soundtrigger/aidl/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/soundtrigger/aidl/cli/Android.bp b/soundtrigger/aidl/cli/Android.bp
index 935e438..2d01b0b 100644
--- a/soundtrigger/aidl/cli/Android.bp
+++ b/soundtrigger/aidl/cli/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_media_audio_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java b/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java
index 127f062..41e2533 100644
--- a/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java
+++ b/soundtrigger/aidl/cli/java/android/hardware/soundtrigger3/cli/SthalCli.java
@@ -289,6 +289,8 @@
Properties properties = new Properties();
properties.implementor = "Android";
properties.description = "Mock STHAL";
+ properties.uuid = "a5af2d2a-4cc4-4b69-a22f-c9d5b6d492c3";
+ properties.supportedModelArch = "Mock arch";
properties.maxSoundModels = 2;
properties.maxKeyPhrases = 1;
properties.recognitionModes =
diff --git a/staging/security/OWNERS b/staging/security/OWNERS
new file mode 100644
index 0000000..ba4df18
--- /dev/null
+++ b/staging/security/OWNERS
@@ -0,0 +1,8 @@
+armellel@google.com
+arve@android.com
+swillden@google.com
+paulcrowley@google.com
+hasinitg@google.com
+cukie@google.com
+westoncarvalho@google.com
+oarbildo@google.com
diff --git a/staging/security/see/hwcrypto/aidl/Android.bp b/staging/security/see/hwcrypto/aidl/Android.bp
new file mode 100644
index 0000000..3e7ee9e
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/Android.bp
@@ -0,0 +1,29 @@
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+aidl_interface {
+ name: "android.hardware.security.see",
+ unstable: false,
+ host_supported: true,
+ srcs: [
+ "android/hardware/security/see/hwcrypto/*.aidl",
+ "android/hardware/security/see/hwcrypto/types/*.aidl",
+ ],
+ backend: {
+ java: {
+ enabled: false,
+ },
+ cpp: {
+ enabled: false,
+ },
+ rust: {
+ enabled: true,
+ },
+ },
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperation.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
new file mode 100644
index 0000000..0a7e7a2
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+union CryptoOperation {
+ android.hardware.security.see.hwcrypto.MemoryBufferParameter setMemoryBuffer;
+ android.hardware.security.see.hwcrypto.OperationParameters setOperationParameters;
+ android.hardware.security.see.hwcrypto.PatternParameters setPattern;
+ android.hardware.security.see.hwcrypto.types.OperationData copyData;
+ android.hardware.security.see.hwcrypto.types.OperationData aadInput;
+ android.hardware.security.see.hwcrypto.types.OperationData dataInput;
+ android.hardware.security.see.hwcrypto.types.OperationData dataOutput;
+ @nullable android.hardware.security.see.hwcrypto.types.Void finish;
+ @nullable android.hardware.security.see.hwcrypto.types.Void destroyContext;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
new file mode 100644
index 0000000..05780e1
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+parcelable CryptoOperationErrorAdditionalInfo {
+ long failingCommandIndex;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
new file mode 100644
index 0000000..1088e27
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+parcelable CryptoOperationResult {
+ @nullable android.hardware.security.see.hwcrypto.ICryptoOperationContext context;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
new file mode 100644
index 0000000..f3b9b43
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+parcelable CryptoOperationSet {
+ @nullable android.hardware.security.see.hwcrypto.ICryptoOperationContext context;
+ android.hardware.security.see.hwcrypto.CryptoOperation[] operations;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
new file mode 100644
index 0000000..472215f
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+interface ICryptoOperationContext {
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
new file mode 100644
index 0000000..7efcdd6
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
@@ -0,0 +1,71 @@
+/*
+ * Copyright 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.security.see.hwcrypto;
+interface IHwCryptoKey {
+ android.hardware.security.see.hwcrypto.IHwCryptoKey.DiceCurrentBoundKeyResult deriveCurrentDicePolicyBoundKey(in android.hardware.security.see.hwcrypto.IHwCryptoKey.DiceBoundDerivationKey derivationKey);
+ android.hardware.security.see.hwcrypto.IHwCryptoKey.DiceBoundKeyResult deriveDicePolicyBoundKey(in android.hardware.security.see.hwcrypto.IHwCryptoKey.DiceBoundDerivationKey derivationKey, in byte[] dicePolicyForKeyVersion);
+ android.hardware.security.see.hwcrypto.IHwCryptoKey.DerivedKey deriveKey(in android.hardware.security.see.hwcrypto.IHwCryptoKey.DerivedKeyParameters parameters);
+ enum DeviceKeyId {
+ DEVICE_BOUND_KEY,
+ BATCH_KEY,
+ }
+ union DiceBoundDerivationKey {
+ android.hardware.security.see.hwcrypto.IOpaqueKey opaqueKey;
+ android.hardware.security.see.hwcrypto.IHwCryptoKey.DeviceKeyId keyId;
+ }
+ parcelable DiceCurrentBoundKeyResult {
+ android.hardware.security.see.hwcrypto.IOpaqueKey diceBoundKey;
+ byte[] dicePolicyForKeyVersion;
+ }
+ parcelable DiceBoundKeyResult {
+ android.hardware.security.see.hwcrypto.IOpaqueKey diceBoundKey;
+ boolean dicePolicyWasCurrent;
+ }
+ parcelable ClearKeyPolicy {
+ int keySizeBytes;
+ }
+ union DerivedKeyPolicy {
+ android.hardware.security.see.hwcrypto.KeyPolicy opaqueKey;
+ android.hardware.security.see.hwcrypto.IHwCryptoKey.ClearKeyPolicy clearKey;
+ }
+ parcelable DerivedKeyParameters {
+ android.hardware.security.see.hwcrypto.IOpaqueKey derivationKey;
+ android.hardware.security.see.hwcrypto.IHwCryptoKey.DerivedKeyPolicy keyPolicy;
+ byte[] context;
+ }
+ union DerivedKey {
+ byte[] explicitKey = {};
+ android.hardware.security.see.hwcrypto.IOpaqueKey opaque;
+ }
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
new file mode 100644
index 0000000..5c26cc2
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+interface IHwCryptoOperations {
+ android.hardware.security.see.hwcrypto.CryptoOperationResult[] processCommandList(inout android.hardware.security.see.hwcrypto.CryptoOperationSet[] operations, out android.hardware.security.see.hwcrypto.CryptoOperationErrorAdditionalInfo additionalErrorInfo);
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
new file mode 100644
index 0000000..9cbf272
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+interface IOpaqueKey {
+ byte[] exportWrappedKey(in android.hardware.security.see.hwcrypto.IOpaqueKey wrappingKey);
+ android.hardware.security.see.hwcrypto.KeyPolicy getKeyPolicy();
+ byte[] getPublicKey();
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/KeyPolicy.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
new file mode 100644
index 0000000..0e3896e
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+parcelable KeyPolicy {
+ android.hardware.security.see.hwcrypto.types.KeyUse usage;
+ android.hardware.security.see.hwcrypto.types.KeyLifetime keyLifetime = android.hardware.security.see.hwcrypto.types.KeyLifetime.EPHEMERAL;
+ android.hardware.security.see.hwcrypto.types.KeyPermissions[] keyPermissions;
+ boolean keyManagementKey;
+ android.hardware.security.see.hwcrypto.types.KeyType keyType = android.hardware.security.see.hwcrypto.types.KeyType.AES_256_GCM;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
new file mode 100644
index 0000000..d88d5c8
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+parcelable MemoryBufferParameter {
+ android.hardware.security.see.hwcrypto.MemoryBufferParameter.MemoryBuffer bufferHandle;
+ int sizeBytes;
+ union MemoryBuffer {
+ ParcelFileDescriptor input;
+ ParcelFileDescriptor output;
+ }
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/OperationParameters.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/OperationParameters.aidl
new file mode 100644
index 0000000..017e51c
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/OperationParameters.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+union OperationParameters {
+ android.hardware.security.see.hwcrypto.types.SymmetricAuthOperationParameters symmetricAuthCrypto;
+ android.hardware.security.see.hwcrypto.types.SymmetricOperationParameters symmetricCrypto;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/PatternParameters.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/PatternParameters.aidl
new file mode 100644
index 0000000..0fd1ee7
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/PatternParameters.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto;
+parcelable PatternParameters {
+ long numberBlocksProcess;
+ long numberBlocksCopy;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
new file mode 100644
index 0000000..e7501ff
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+union AesCipherMode {
+ android.hardware.security.see.hwcrypto.types.CipherModeParameters cbc;
+ android.hardware.security.see.hwcrypto.types.CipherModeParameters ctr;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
new file mode 100644
index 0000000..4084abb
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+union AesGcmMode {
+ android.hardware.security.see.hwcrypto.types.AesGcmMode.AesGcmModeParameters gcmTag16;
+ parcelable AesGcmModeParameters {
+ byte[12] nonce;
+ }
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
new file mode 100644
index 0000000..7a77521
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+parcelable CipherModeParameters {
+ byte[16] nonce;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
new file mode 100644
index 0000000..cd8b3c6
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+parcelable HalErrorCode {
+ const int NO_ERROR = 0;
+ const int GENERIC_ERROR = (-1) /* -1 */;
+ const int BAD_STATE = (-2) /* -2 */;
+ const int UNSUPPORTED = (-3) /* -3 */;
+ const int SERIALIZATION_ERROR = (-4) /* -4 */;
+ const int ALLOCATION_ERROR = (-5) /* -5 */;
+ const int INVALID_KEY = (-6) /* -6 */;
+ const int BAD_PARAMETER = (-7) /* -7 */;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
new file mode 100644
index 0000000..db5964c
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+@Backing(type="byte")
+enum KeyLifetime {
+ EPHEMERAL,
+ HARDWARE,
+ PORTABLE,
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
new file mode 100644
index 0000000..ea3a173
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+enum KeyPermissions {
+ ALLOW_EPHEMERAL_KEY_WRAPPING,
+ ALLOW_HARDWARE_KEY_WRAPPING,
+ ALLOW_PORTABLE_KEY_WRAPPING,
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyType.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyType.aidl
new file mode 100644
index 0000000..59b83c4
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyType.aidl
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+enum KeyType {
+ AES_128_CBC_NO_PADDING,
+ AES_128_CBC_PKCS7_PADDING,
+ AES_128_CTR,
+ AES_128_GCM,
+ AES_128_CMAC,
+ AES_256_CBC_NO_PADDING,
+ AES_256_CBC_PKCS7_PADDING,
+ AES_256_CTR,
+ AES_256_GCM,
+ AES_256_CMAC,
+ HMAC_SHA256,
+ HMAC_SHA512,
+ RSA2048_PSS_SHA256,
+ RSA2048_PKCS1_5_SHA256,
+ ECC_NIST_P256_SIGN_NO_PADDING,
+ ECC_NIST_P256_SIGN_SHA256,
+ ECC_NIST_P521_SIGN_NO_PADDING,
+ ECC_NIST_P521_SIGN_SHA512,
+ ECC_ED25519_SIGN,
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyUse.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
new file mode 100644
index 0000000..e888bdf
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+@Backing(type="int")
+enum KeyUse {
+ ENCRYPT = 1,
+ DECRYPT = 2,
+ ENCRYPT_DECRYPT = (ENCRYPT | DECRYPT) /* 3 */,
+ SIGN = 4,
+ DERIVE = 8,
+ WRAP = 16,
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
new file mode 100644
index 0000000..eaa8dd7
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+parcelable MemoryBufferReference {
+ int startOffset;
+ int sizeBytes;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationData.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationData.aidl
new file mode 100644
index 0000000..aad3ac1
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationData.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+union OperationData {
+ android.hardware.security.see.hwcrypto.types.MemoryBufferReference memoryBufferReference;
+ byte[] dataBuffer;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationType.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationType.aidl
new file mode 100644
index 0000000..ca8b3eb
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/OperationType.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+enum OperationType {
+ READ,
+ WRITE,
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
new file mode 100644
index 0000000..d3d1763
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+union SymmetricAuthCryptoParameters {
+ android.hardware.security.see.hwcrypto.types.AesGcmMode aes;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
new file mode 100644
index 0000000..8a8ef09
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+parcelable SymmetricAuthOperationParameters {
+ android.hardware.security.see.hwcrypto.IOpaqueKey key;
+ android.hardware.security.see.hwcrypto.types.SymmetricOperation direction;
+ android.hardware.security.see.hwcrypto.types.SymmetricAuthCryptoParameters parameters;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
new file mode 100644
index 0000000..cc93094
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+union SymmetricCryptoParameters {
+ android.hardware.security.see.hwcrypto.types.AesCipherMode aes;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
new file mode 100644
index 0000000..1a17525
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+enum SymmetricOperation {
+ ENCRYPT,
+ DECRYPT,
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
new file mode 100644
index 0000000..769833b
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+parcelable SymmetricOperationParameters {
+ android.hardware.security.see.hwcrypto.IOpaqueKey key;
+ android.hardware.security.see.hwcrypto.types.SymmetricOperation direction;
+ android.hardware.security.see.hwcrypto.types.SymmetricCryptoParameters parameters;
+}
diff --git a/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/Void.aidl b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/Void.aidl
new file mode 100644
index 0000000..b37848b
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/aidl_api/android.hardware.security.see/current/android/hardware/security/see/hwcrypto/types/Void.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 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.security.see.hwcrypto.types;
+parcelable Void {
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperation.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
new file mode 100644
index 0000000..2fdbc78
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperation.aidl
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.MemoryBufferParameter;
+import android.hardware.security.see.hwcrypto.OperationParameters;
+import android.hardware.security.see.hwcrypto.PatternParameters;
+import android.hardware.security.see.hwcrypto.types.OperationData;
+import android.hardware.security.see.hwcrypto.types.Void;
+
+/*
+ * Type that describes the different operations that can be performed along with its required
+ * parameters. It will be used to construct a vector of operation that are executed sequentially.
+ */
+union CryptoOperation {
+ /*
+ * Sets a memory buffer to operate on. References to positions of this memory buffer can be used
+ * when setting the parameters for <code>UpdateAad</code>, <code>UpdateData</code>,
+ * <code>Finish</code> and <code>CopyData</code>.
+ */
+ MemoryBufferParameter setMemoryBuffer;
+
+ /*
+ * Sets the parameters for the current operation, for more info on specific parameters see
+ * <code>OperationParameters</code>.
+ */
+ OperationParameters setOperationParameters;
+
+ /*
+ * Sets the pattern for a decrypt type operation. A pattern is used to describe that the Input
+ * data provided is not completely encrypted, but that it has some blocks encrypted followed by
+ * some blocks in the clear. Currently it shall only be supported for cbcs mode as defined on
+ * IEC 23001-7:2016.
+ */
+ PatternParameters setPattern;
+
+ /*
+ * Copies data from input to output.
+ */
+ OperationData copyData;
+
+ /*
+ * Adds additional authenticated data. This type is only valid after a
+ * <code>SetOperationParameters</code> of type <code>SymmetricAuthOperationParameters</code>.
+ */
+ OperationData aadInput;
+
+ /*
+ * Adds data to the operation for processing. This type is only valid after a
+ * <code>SetOperationParameters</code> and it will trigger the operation, so output buffers
+ * need to be set first.
+ */
+ OperationData dataInput;
+
+ /*
+ * Adds output buffers to store results form the operation. This type is only valid after a
+ * <code>SetOperationParameters</code> and it needs to be done before calling
+ * <code>DataInput</code>
+ */
+ OperationData dataOutput;
+
+ /*
+ * Finalizes a cryptographic operation in flight. Because operations are initiated with a call
+ * to <code>SetOperationParameters</code>, a <code>finish</code> element is only valid after a
+ * <code>SetOperationParameters</code> element.
+ */
+ @nullable Void finish;
+
+ /*
+ * Specifies that we do not want to continue using this context anymore. The result of this
+ * call is that all resources are freed after finishing operating on the set of commands and no
+ * context is returned to the caller.
+ */
+ @nullable Void destroyContext;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
new file mode 100644
index 0000000..f3ac8ea
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationErrorAdditionalInfo.aidl
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto;
+
+/*
+ * Type that provides more information about failures when processing a list of commands.
+ */
+parcelable CryptoOperationErrorAdditionalInfo {
+ /*
+ * Index indicating the first step of <code>CryptoOperationSet::operations</code> that failed
+ * when executing a set of commands. No more commands would have been executed after this.
+ */
+ long failingCommandIndex;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
new file mode 100644
index 0000000..07c2983
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationResult.aidl
@@ -0,0 +1,29 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.ICryptoOperationContext;
+
+/*
+ * Type that describes the result of a set of crypto operations.
+ */
+parcelable CryptoOperationResult {
+ /*
+ * Token that can be passed on a CryptoOperationSet to issue more operations on the same context
+ * on future calls.
+ */
+ @nullable ICryptoOperationContext context;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
new file mode 100644
index 0000000..9aff1e8
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/CryptoOperationSet.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.CryptoOperation;
+import android.hardware.security.see.hwcrypto.ICryptoOperationContext;
+
+/*
+ * Type that describes a set of crypto operations to execute
+ */
+parcelable CryptoOperationSet {
+ /*
+ * Token to be used to issue the operations. If NULL, a new context will be created and
+ * returned.
+ */
+ @nullable ICryptoOperationContext context;
+
+ /*
+ * Set of operations to execute.
+ */
+ CryptoOperation[] operations;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
new file mode 100644
index 0000000..68d0c03
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/ICryptoOperationContext.aidl
@@ -0,0 +1,25 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto;
+
+/*
+ * Token that can be used to execute more commands when passed as an input on a
+ * <code>CryptoOperationSet::context</code> parcelable. It represents an operation being executed
+ * and is valid until a <code>CryptoOperation::Finish</code> is issued using the token. The
+ * operation in progress context includes any memory buffer previously mapped by a
+ * <code>CryptoOperation::SetMemoryBuffer</code> call.
+ */
+interface ICryptoOperationContext {}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
new file mode 100644
index 0000000..939014a
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoKey.aidl
@@ -0,0 +1,186 @@
+/*
+ * Copyright 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.
+ */
+package android.hardware.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.IOpaqueKey;
+import android.hardware.security.see.hwcrypto.KeyPolicy;
+
+/*
+ * Higher level interface to access and generate keys.
+ */
+interface IHwCryptoKey {
+ /*
+ * Identifier for the requested device provided key. The currently supported identifiers are:
+ *
+ * DEVICE_BOUND_KEY:
+ * This is a key unique to the device.
+ * BATCH_KEY:
+ * This is a shared by a set of devices.
+ */
+ enum DeviceKeyId {
+ DEVICE_BOUND_KEY,
+ BATCH_KEY,
+ }
+ union DiceBoundDerivationKey {
+ /*
+ * Opaque to be used to derive the DICE bound key.
+ */
+ IOpaqueKey opaqueKey;
+
+ /*
+ * Device provided key to be used to derive the DICE bound key.
+ */
+ DeviceKeyId keyId;
+ }
+
+ parcelable DiceCurrentBoundKeyResult {
+ /*
+ * Key cryptographically bound to a DICE policy.
+ */
+ IOpaqueKey diceBoundKey;
+
+ /*
+ * Current dice policy which was used to generate the returned key. This policy is
+ * opaque from this service perspective (it will be sent to an Authentication Manager
+ * Service to be verified). It follows the structure defined on DicePolicy.cddl, located
+ * under hardware/interfaces/security/authgraph/aidl/android/hardware/security/authgraph/
+ * with the caveat that it could be encrypted if the client does not have enough permissions
+ * to see the device dice policy information.
+ */
+ byte[] dicePolicyForKeyVersion;
+ }
+
+ parcelable DiceBoundKeyResult {
+ /*
+ * Key cryptographically bound to a DICE policy.
+ */
+ IOpaqueKey diceBoundKey;
+
+ /*
+ * Indicates if the diceBoundKey returned was created using a current DICE policy. The
+ * caller can use this to detect if an old policy was provided and rotate its keys if so
+ * desired. Old, valid policies remain usable, but care needs to be taken to not continue to
+ * use a potentially compromised key.
+ */
+ boolean dicePolicyWasCurrent;
+ }
+
+ parcelable ClearKeyPolicy {
+ /*
+ * Indicates the desired key size. It will be used to calculate how many bytes of key
+ * material should be returned.
+ */
+ int keySizeBytes;
+ }
+
+ union DerivedKeyPolicy {
+ /*
+ * Policy for the newly derived opaque key. Defines how the key can be used and its type.
+ */
+ KeyPolicy opaqueKey;
+
+ /*
+ * If used we will derive a clear key and pass it back as an array of bytes on
+ * <code>HwCryptoKeyMaterial::explicitKey</code>.
+ */
+ ClearKeyPolicy clearKey;
+ }
+
+ parcelable DerivedKeyParameters {
+ /*
+ * Key to be used to derive the new key using HKDF.
+ */
+ IOpaqueKey derivationKey;
+
+ /*
+ * Policy for the newly derived key. Depending on its type, either a clear or opaque key
+ * will be derived.
+ */
+ DerivedKeyPolicy keyPolicy;
+
+ /*
+ * An arbitrary set of bytes incorporated into the key derivation. May have
+ * an implementation-specific maximum length, but it is guaranteed to accept
+ * at least 32 bytes.
+ */
+ byte[] context;
+ }
+
+ union DerivedKey {
+ /*
+ * Derived key in clear format.
+ */
+ byte[] explicitKey = {};
+
+ /*
+ * Derived key as a key token to be used only through the HWCrypto service.
+ */
+ IOpaqueKey opaque;
+ }
+
+ /*
+ * deriveCurrentDicePolicyBoundKey() - Derives a versioned key tied to the caller's current DICE
+ * policy. It will return this current policy back to the caller
+ * along with the generated key.
+ *
+ * @derivationKey:
+ * Key to be used to derive the new key using HKDF.
+ *
+ * Return:
+ * Ok(DiceCurrentBoundKeyResult) on success, service specific error based on
+ * <code>HalErrorCode</code> otherwise.
+ */
+ DiceCurrentBoundKeyResult deriveCurrentDicePolicyBoundKey(
+ in DiceBoundDerivationKey derivationKey);
+
+ /*
+ * deriveDicePolicyBoundKey() - Derive a versioned key by checking the provided DICE policy
+ * against the caller and then using it as a context for deriving
+ * the returned key.
+ *
+ * @derivationKey:
+ * Key to be used to derive the new key using HKDF.
+ *
+ * @dicePolicyForKeyVersion:
+ * Policy used to derive keys tied to specific versions. Using this parameter
+ * the caller can tie a derived key to a minimum version of itself, so in the future only
+ * itself or a more recent version can derive the same key. This parameter is opaque to the
+ * caller and it could be encrypted in the case the client doesn't have permission to know
+ * the dice chain.
+ * When implementing this function, this parameter shall be one of the components fed
+ * to the KDF context and it needs to be checked against the caller DICE certificate before
+ * being used.
+ *
+ * Return:
+ * Ok(DiceBoundKeyResult) on success, service specific error based on
+ * <code>HalErrorCode</code> otherwise.
+ */
+ DiceBoundKeyResult deriveDicePolicyBoundKey(
+ in DiceBoundDerivationKey derivationKey, in byte[] dicePolicyForKeyVersion);
+
+ /*
+ * deriveKey() - Derive a new key based on the given key, policy and context.
+ *
+ * @parameters:
+ * Parameters used for the key derivation. See <code>DerivedKeyParameters</code> on this
+ * file for more information.
+ *
+ * Return:
+ * Ok(HwCryptoKeyMaterial) on success, service specific error based on
+ * <code>HalErrorCode</code> otherwise.
+ */
+ DerivedKey deriveKey(in DerivedKeyParameters parameters);
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
new file mode 100644
index 0000000..4d394ed
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IHwCryptoOperations.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.CryptoOperationErrorAdditionalInfo;
+import android.hardware.security.see.hwcrypto.CryptoOperationResult;
+import android.hardware.security.see.hwcrypto.CryptoOperationSet;
+
+/*
+ * Interface used that provides cryptographic services, including the generation and use of
+ * cryptographic keys. Interactions with this interface are done through a command-base API,
+ * which allow callers to execute a large set of operations on a single call.
+ */
+interface IHwCryptoOperations {
+ /*
+ * processCommandList() - Executes a list of cryptographic commands in order
+ *
+ * @operations:
+ * Parameter containing 1 or more set of commands to execute. Additionally, each set can
+ * also contain a context on which the commands will be executed.
+ * @additionalErrorInfo:
+ * Structure containing additional info when errors are encountered. Only valid if the
+ * function failed its execution.
+ * Return:
+ * CryptoOperationResult[] on success, which can contain a context to continue executing
+ * each of the provided operations sets, service specific error based on
+ * <code>HalErrorCode</code> otherwise.
+ */
+ CryptoOperationResult[] processCommandList(inout CryptoOperationSet[] operations,
+ out CryptoOperationErrorAdditionalInfo additionalErrorInfo);
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
new file mode 100644
index 0000000..0d0f613
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/IOpaqueKey.aidl
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.KeyPolicy;
+import android.hardware.security.see.hwcrypto.types.OperationType;
+
+interface IOpaqueKey {
+ /*
+ * exportWrappedKey() - Exports this key as a wrapped (encrypted) blob.
+ *
+ * @wrapping_key:
+ * wrapping key. It needs to be an opaque key and its policy needs to indicate that it can
+ * be used for key wrapping.
+ *
+ * Return:
+ * Wrapped key blob as a byte array on success. Format of the blob is opaque to the service
+ * but has to match the command accepted by
+ * <code>IHwCryptoKeyGeneration::importWrappedKey</code>, service specific error based on
+ * <code>HalErrorCode</code> otherwise.
+ */
+ byte[] exportWrappedKey(in IOpaqueKey wrappingKey);
+
+ /*
+ * getKeyPolicy() - Returns the key policy.
+ *
+ * Return:
+ * A <code>KeyPolicy</code> on success, service specific error based on
+ * <code>HalErrorCode</code> otherwise.
+ */
+ KeyPolicy getKeyPolicy();
+
+ /*
+ * getPublicKey() - Returns the public key portion of this OpaqueKey. This operation is only
+ * valid for asymmetric keys
+ *
+ * Return:
+ * public key as a byte array on success, service specific error based on
+ * <code>HalErrorCode</code> otherwise. Format used for the returned public key is COSE.
+ */
+ byte[] getPublicKey();
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/KeyPolicy.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
new file mode 100644
index 0000000..9266bfa
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/KeyPolicy.aidl
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.types.KeyLifetime;
+import android.hardware.security.see.hwcrypto.types.KeyPermissions;
+import android.hardware.security.see.hwcrypto.types.KeyType;
+import android.hardware.security.see.hwcrypto.types.KeyUse;
+
+/*
+ * Parcelable that specified how a key can be used.
+ */
+parcelable KeyPolicy {
+ /*
+ * Enum specifying the operations the key can perform (encryption, decryption, etc.).
+ */
+ KeyUse usage;
+
+ /*
+ * Enum that describes the key lifetime characteristics. See the docstring on
+ * <code>KeyLifetime</code> for more details.
+ */
+ KeyLifetime keyLifetime = KeyLifetime.EPHEMERAL;
+
+ /*
+ * Additional permissions of the key (e.g. key types allowed to wrap the key, boot binding,
+ * etc.). See the docstring on <code>KeyPermissions</code> for more details.
+ */
+ KeyPermissions[] keyPermissions;
+
+ /*
+ * Key can be used to wrap or derive other keys.
+ */
+ boolean keyManagementKey;
+
+ /*
+ * Enum that specifies the key type.
+ */
+ KeyType keyType = KeyType.AES_256_GCM;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
new file mode 100644
index 0000000..c5a6a5c
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/MemoryBufferParameter.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto;
+
+/*
+ * Parcelable representing a memory buffer.
+ */
+parcelable MemoryBufferParameter {
+ union MemoryBuffer {
+ ParcelFileDescriptor input;
+ ParcelFileDescriptor output;
+ }
+
+ /*
+ * Handle used to access this memory area.
+ */
+ MemoryBuffer bufferHandle;
+
+ /*
+ * Total size of the memory buffer.
+ */
+ int sizeBytes;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/OperationParameters.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/OperationParameters.aidl
new file mode 100644
index 0000000..9e2fc6c
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/OperationParameters.aidl
@@ -0,0 +1,34 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto;
+
+import android.hardware.security.see.hwcrypto.types.SymmetricAuthOperationParameters;
+import android.hardware.security.see.hwcrypto.types.SymmetricOperationParameters;
+
+/*
+ * Type that describes the parameters for the different operations that can be performed.
+ */
+union OperationParameters {
+ /*
+ * Parameters for authenticated symmetric cryptography (AES GCM).
+ */
+ SymmetricAuthOperationParameters symmetricAuthCrypto;
+
+ /*
+ * Parameters for non-authenticated symmetric cryptography (AES/TDES).
+ */
+ SymmetricOperationParameters symmetricCrypto;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/PatternParameters.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/PatternParameters.aidl
new file mode 100644
index 0000000..3f62abe
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/PatternParameters.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto;
+
+/*
+ * Parcelable that specifies a pattern to process data.
+ */
+parcelable PatternParameters {
+ /*
+ * Number of blocks that will be processed. The size of the block matches the size of the
+ * cipher used (e.g. for AES this parameter indicates the number of 16 bytes blocks to be
+ * processed).
+ */
+ long numberBlocksProcess;
+
+ /*
+ * Number of blocks that will be copied. The size of the block matches the size of the cipher
+ * used to process the encrypted areas (e.g. for AES this parameter indicates the number of 16
+ * bytes blocks to be copied).
+ */
+ long numberBlocksCopy;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
new file mode 100644
index 0000000..ac31557
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesCipherMode.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto.types;
+
+import android.hardware.security.see.hwcrypto.types.CipherModeParameters;
+import android.hardware.security.see.hwcrypto.types.Void;
+
+/*
+ * Type used for the parameters needed to run a non-authenticated AES operation.
+ */
+union AesCipherMode {
+ /*
+ * Cipher Block Chaining mode. Padding will either be none or PKCS#7 depending on the key policy
+ * padding parameter. It contains the nonce for the operation.
+ */
+ CipherModeParameters cbc;
+
+ /*
+ * Counter mode. Type contains the nonce for the operation.
+ */
+ CipherModeParameters ctr;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
new file mode 100644
index 0000000..4025553
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/AesGcmMode.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto.types;
+
+/*
+ * Type used for the parameters needed to run an authenticated AES operation (GCM).
+ */
+union AesGcmMode {
+ parcelable AesGcmModeParameters {
+ /*
+ * Galois Counter Mode nonce. Only 12-bytes nonce are supported.
+ */
+ byte[12] nonce;
+ }
+
+ /*
+ * Galois Counter Mode with an authentication Tag that has a length of 16 bytes.
+ */
+ AesGcmModeParameters gcmTag16;
+}
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
similarity index 66%
copy from automotive/vehicle/aidl/impl/utils/test/Android.bp
copy to staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
index ad9954f..bfa5daa 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/CipherModeParameters.aidl
@@ -1,5 +1,6 @@
+
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2024 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.
@@ -13,14 +14,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package android.hardware.security.see.hwcrypto.types;
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
+/*
+ * Type encapsulating nonce used on non-authenticated AES symmetric encryption.
+ */
+parcelable CipherModeParameters {
+ byte[16] nonce;
}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
new file mode 100644
index 0000000..e8e8539
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/HalErrorCode.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto.types;
+
+/*
+ * Service error codes. Will be returned as service specific errors.
+ */
+parcelable HalErrorCode {
+ /* Success */
+ const int NO_ERROR = 0;
+
+ /* Generic error */
+ const int GENERIC_ERROR = -1;
+
+ /* Desired operation cannot be performed because of the server current state */
+ const int BAD_STATE = -2;
+
+ /* Operation or parameters are not supported by the server */
+ const int UNSUPPORTED = -3;
+
+ /* Error encountered when parsing parameters */
+ const int SERIALIZATION_ERROR = -4;
+
+ /* Server ran out of memory when performing operation */
+ const int ALLOCATION_ERROR = -5;
+
+ /* Provided key is not compatible with the operation */
+ const int INVALID_KEY = -6;
+
+ /* Bad parameter supplied for the desired operation */
+ const int BAD_PARAMETER = -7;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
new file mode 100644
index 0000000..9958a0b
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyLifetime.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto.types;
+
+/*
+ * Enum that gives more information about the lifetime characteristics of the key. They are
+ * represented as a bitmask to allow us to internally combine them on a single property to describe
+ * a set of allowed lifetimes.
+ */
+@Backing(type="byte")
+enum KeyLifetime {
+ /*
+ * Hardware keys with limited validity (until key is erased or power cycle occurs).
+ */
+ EPHEMERAL,
+
+ /*
+ * Key only lives or was derived from a key that only lives in hardware. This key cannot be
+ * retrieved in the clear.
+ */
+ HARDWARE,
+
+ /*
+ * Key could have been at some point of its lifetime in the clear on a software component.
+ */
+ PORTABLE,
+
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
new file mode 100644
index 0000000..a1e4f21
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyPermissions.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto.types;
+
+/*
+ * Additional characteristics and permissions of the key.
+ */
+enum KeyPermissions {
+ /*
+ * Key can be wrapped by an ephemeral key.
+ */
+ ALLOW_EPHEMERAL_KEY_WRAPPING,
+
+ /*
+ * Key can be wrapped by a hardware key. Notice that ephemeral keys cannot be wrapped by
+ * hardware keys.
+ */
+ ALLOW_HARDWARE_KEY_WRAPPING,
+
+ /*
+ * Key can be wrapped by a portable key. Notice that neither ephemeral keys nor hardware keys
+ * can be wrapped by portable keys.
+ */
+ ALLOW_PORTABLE_KEY_WRAPPING,
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyType.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyType.aidl
new file mode 100644
index 0000000..3cf4670
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyType.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto.types;
+
+/*
+ * Enum describing all supported key types. Key types are strongly bound to the algorithm to
+ * prevent reusing the same key on different algorithms (e.g. using the same key for 2 different AES
+ * 128 Cipher modes).
+ */
+enum KeyType {
+ AES_128_CBC_NO_PADDING,
+ AES_128_CBC_PKCS7_PADDING,
+ AES_128_CTR,
+ AES_128_GCM,
+ AES_128_CMAC,
+ AES_256_CBC_NO_PADDING,
+ AES_256_CBC_PKCS7_PADDING,
+ AES_256_CTR,
+ AES_256_GCM,
+ AES_256_CMAC,
+ HMAC_SHA256,
+ HMAC_SHA512,
+ RSA2048_PSS_SHA256,
+ RSA2048_PKCS1_5_SHA256,
+ ECC_NIST_P256_SIGN_NO_PADDING,
+ ECC_NIST_P256_SIGN_SHA256,
+ ECC_NIST_P521_SIGN_NO_PADDING,
+ ECC_NIST_P521_SIGN_SHA512,
+ ECC_ED25519_SIGN,
+}
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
similarity index 61%
copy from automotive/vehicle/aidl/impl/utils/test/Android.bp
copy to staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
index ad9954f..76bfd62 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/KeyUse.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2024 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.
@@ -13,14 +13,17 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package android.hardware.security.see.hwcrypto.types;
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
+/*
+ * Enum describing the allowed operations that can be performed with the given key.
+ */
+@Backing(type="int")
+enum KeyUse {
+ ENCRYPT = 1,
+ DECRYPT = 2,
+ ENCRYPT_DECRYPT = ENCRYPT | DECRYPT,
+ SIGN = 4,
+ DERIVE = 8,
+ WRAP = 16,
}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
new file mode 100644
index 0000000..5b90d9c
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/MemoryBufferReference.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto.types;
+
+/*
+ * Structure representing a section of a memory buffer.
+ */
+parcelable MemoryBufferReference {
+ /*
+ * Start of the memory buffer section measured from the start of the memory buffer set for this
+ * operation.
+ */
+ int startOffset;
+
+ /*
+ * Total size of the memory buffer section.
+ */
+ int sizeBytes;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationData.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationData.aidl
new file mode 100644
index 0000000..642d05e
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationData.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto.types;
+
+import android.hardware.security.see.hwcrypto.types.MemoryBufferReference;
+
+/*
+ * Union holding buffers to be used by the cryptographic operation.
+ */
+union OperationData {
+ /*
+ * Reference (offset, size) to the active operations' MemoryBuffer.
+ */
+ MemoryBufferReference memoryBufferReference;
+
+ /*
+ * Vector of data to use for the operation.
+ */
+ byte[] dataBuffer;
+}
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationType.aidl
similarity index 66%
copy from automotive/vehicle/aidl/impl/utils/test/Android.bp
copy to staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationType.aidl
index ad9954f..76878a3 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/OperationType.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2024 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.
@@ -13,14 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package android.hardware.security.see.hwcrypto.types;
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
+/*
+ * Enum describing the different types of operations allowed on a buffer.
+ */
+enum OperationType {
+ READ,
+ WRITE,
}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
new file mode 100644
index 0000000..278e48d
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthCryptoParameters.aidl
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto.types;
+
+import android.hardware.security.see.hwcrypto.types.AesGcmMode;
+
+/*
+ * Data needed to perform authenticated symmetric cryptographic operations.
+ */
+union SymmetricAuthCryptoParameters {
+ /*
+ * AES (Advanced Encryption Standard) GCM parameters.
+ */
+ AesGcmMode aes;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
new file mode 100644
index 0000000..46568c3
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricAuthOperationParameters.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto.types;
+
+import android.hardware.security.see.hwcrypto.IOpaqueKey;
+import android.hardware.security.see.hwcrypto.types.SymmetricAuthCryptoParameters;
+import android.hardware.security.see.hwcrypto.types.SymmetricOperation;
+
+/*
+ * Parameters needed to perform an authenticated symmetric cryptographic operation. Currently only
+ * AES-GCM is supported.
+ */
+parcelable SymmetricAuthOperationParameters {
+ /*
+ * Key to be used on the operation.
+ */
+ IOpaqueKey key;
+
+ /*
+ * Encryption or Decryption.
+ */
+ SymmetricOperation direction;
+
+ /*
+ * Parameters that specify the desired authenticated cryptographic operation.
+ */
+ SymmetricAuthCryptoParameters parameters;
+}
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
new file mode 100644
index 0000000..2350242
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricCryptoParameters.aidl
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto.types;
+
+import android.hardware.security.see.hwcrypto.types.AesCipherMode;
+
+/*
+ * Data needed to perform non-authenticated symmetric cryptographic operations.
+ */
+union SymmetricCryptoParameters {
+ /*
+ * AES (Advanced Encryption Standard) parameters.
+ */
+ AesCipherMode aes;
+}
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
similarity index 65%
copy from automotive/vehicle/aidl/impl/utils/test/Android.bp
copy to staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
index ad9954f..2717472 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperation.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2024 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.
@@ -13,14 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package android.hardware.security.see.hwcrypto.types;
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
-}
+/*
+ * Enum describing the type of symmetric operation desired.
+ */
+enum SymmetricOperation { ENCRYPT, DECRYPT }
diff --git a/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
new file mode 100644
index 0000000..1d1554d
--- /dev/null
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/SymmetricOperationParameters.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.hwcrypto.types;
+
+import android.hardware.security.see.hwcrypto.IOpaqueKey;
+import android.hardware.security.see.hwcrypto.types.SymmetricCryptoParameters;
+import android.hardware.security.see.hwcrypto.types.SymmetricOperation;
+
+/*
+ * Parameters needed to perform a non-authenticated symmetric cryptographic operation.
+ */
+parcelable SymmetricOperationParameters {
+ /*
+ * Key to be used on the operation.
+ */
+ IOpaqueKey key;
+
+ /*
+ * Encryption or Decryption.
+ */
+ SymmetricOperation direction;
+
+ /*
+ * Parameters that specify the desired non-authenticated symmetric cryptographic operation.
+ */
+ SymmetricCryptoParameters parameters;
+}
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl
similarity index 65%
copy from automotive/vehicle/aidl/impl/utils/test/Android.bp
copy to staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl
index ad9954f..f9f608d 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/staging/security/see/hwcrypto/aidl/android/hardware/security/see/hwcrypto/types/Void.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2024 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.
@@ -13,14 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package android.hardware.security.see.hwcrypto.types;
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
-
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
-}
+parcelable Void {}
diff --git a/staging/security/see/storage/aidl/Android.bp b/staging/security/see/storage/aidl/Android.bp
new file mode 100644
index 0000000..f669be8
--- /dev/null
+++ b/staging/security/see/storage/aidl/Android.bp
@@ -0,0 +1,26 @@
+package {
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+aidl_interface {
+ name: "android.hardware.security.see.storage",
+ unstable: true,
+ host_supported: true,
+ srcs: [
+ "android/hardware/security/see/storage/*.aidl",
+ ],
+ backend: {
+ java: {
+ enabled: false,
+ },
+ cpp: {
+ enabled: true,
+ },
+ ndk: {
+ enabled: true,
+ },
+ rust: {
+ enabled: true,
+ },
+ },
+}
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/staging/security/see/storage/aidl/android/hardware/security/see/storage/CreationMode.aidl
similarity index 60%
copy from automotive/vehicle/aidl/impl/utils/test/Android.bp
copy to staging/security/see/storage/aidl/android/hardware/security/see/storage/CreationMode.aidl
index ad9954f..1c65038 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/staging/security/see/storage/aidl/android/hardware/security/see/storage/CreationMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2024 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.
@@ -13,14 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package android.hardware.security.see.storage;
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
+enum CreationMode {
+ /** Returns an error if the file does not already exist. */
+ NO_CREATE,
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
+ /** Creates the file or returns an error if it already exists. */
+ CREATE_EXCLUSIVE,
+
+ /** Creates the file if it does not already exist. */
+ CREATE,
}
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/DeleteOptions.aidl b/staging/security/see/storage/aidl/android/hardware/security/see/storage/DeleteOptions.aidl
new file mode 100644
index 0000000..1a94eb2
--- /dev/null
+++ b/staging/security/see/storage/aidl/android/hardware/security/see/storage/DeleteOptions.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.storage;
+
+import android.hardware.security.see.storage.ReadIntegrity;
+
+parcelable DeleteOptions {
+ /**
+ * Set to acknowledge possible files tampering.
+ *
+ * If unacknowledged tampering is detected, the operation will fail with an ERR_FS_*
+ * service-specific code.
+ */
+ ReadIntegrity readIntegrity = ReadIntegrity.NO_TAMPER;
+
+ /**
+ * Allow writes to succeed while the filesystem is in the middle of an A/B update.
+ *
+ * If the A/B update fails, the operation will be rolled back. This rollback will not
+ * cause subsequent operations fail with any ERR_FS_* code nor will need to be
+ * acknowledged by setting the `readIntegrity`.
+ */
+ boolean allowWritesDuringAbUpdate = false;
+}
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/staging/security/see/storage/aidl/android/hardware/security/see/storage/FileAvailability.aidl
similarity index 60%
copy from automotive/vehicle/aidl/impl/utils/test/Android.bp
copy to staging/security/see/storage/aidl/android/hardware/security/see/storage/FileAvailability.aidl
index ad9954f..d339170 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/staging/security/see/storage/aidl/android/hardware/security/see/storage/FileAvailability.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2024 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.
@@ -13,14 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package android.hardware.security.see.storage;
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
+/** Determines how early during the boot process file is able to be accessed. */
+enum FileAvailability {
+ /** Available before userdata is mounted, but after android has booted. */
+ BEFORE_USERDATA,
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
+ /** Available after userdata is mounted. */
+ AFTER_USERDATA,
}
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/FileIntegrity.aidl b/staging/security/see/storage/aidl/android/hardware/security/see/storage/FileIntegrity.aidl
new file mode 100644
index 0000000..1879b16
--- /dev/null
+++ b/staging/security/see/storage/aidl/android/hardware/security/see/storage/FileIntegrity.aidl
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.storage;
+
+enum FileIntegrity {
+ /** REE may prevent operations, but cannot alter data once written. */
+ TAMPER_PROOF_AT_REST,
+
+ /**
+ * REE may alter written data, but changes will be detected and reported as
+ * an error on read.
+ */
+ TAMPER_DETECT,
+
+ /**
+ * REE may alter written data. Changes other than full filesystem resets will be detected and
+ * reported.
+ */
+ TAMPER_DETECT_IGNORE_RESET,
+}
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/staging/security/see/storage/aidl/android/hardware/security/see/storage/FileMode.aidl
similarity index 64%
copy from automotive/vehicle/aidl/impl/utils/test/Android.bp
copy to staging/security/see/storage/aidl/android/hardware/security/see/storage/FileMode.aidl
index ad9954f..18a2eae 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/staging/security/see/storage/aidl/android/hardware/security/see/storage/FileMode.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * Copyright 2024 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.
@@ -13,14 +13,15 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+package android.hardware.security.see.storage;
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
+enum FileMode {
+ /** The file may only be read from. */
+ READ_ONLY,
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
+ /** The file may only be written to. */
+ WRITE_ONLY,
+
+ /** The file may be both read from and written to. */
+ READ_WRITE,
}
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/FileProperties.aidl b/staging/security/see/storage/aidl/android/hardware/security/see/storage/FileProperties.aidl
new file mode 100644
index 0000000..733b5b0
--- /dev/null
+++ b/staging/security/see/storage/aidl/android/hardware/security/see/storage/FileProperties.aidl
@@ -0,0 +1,27 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.storage;
+
+import android.hardware.security.see.storage.FileAvailability;
+import android.hardware.security.see.storage.FileIntegrity;
+
+parcelable FileProperties {
+ FileIntegrity integrity = FileIntegrity.TAMPER_PROOF_AT_REST;
+ FileAvailability availability = FileAvailability.BEFORE_USERDATA;
+
+ /** Whether the file is reset when user data is wiped. */
+ boolean persistent;
+}
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/IDir.aidl b/staging/security/see/storage/aidl/android/hardware/security/see/storage/IDir.aidl
new file mode 100644
index 0000000..a0a9f3d
--- /dev/null
+++ b/staging/security/see/storage/aidl/android/hardware/security/see/storage/IDir.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.storage;
+
+/** The interface for an open directory */
+interface IDir {
+ /**
+ * Gets the next batch of filenames in this directory.
+ *
+ * Calling multiple times will return different results as the IDir iterates through all the
+ * files it contains. When all filenames have been returned, all successive calls will return an
+ * empty list.
+ *
+ * @maxCount:
+ * the maximum number of filenames to return. A @maxCount of 0 signifies no limit on the
+ * number of filenames returned.
+ *
+ * Returns:
+ * An ordered list of filenames. If @maxCount > 0, the length of the returned list will be
+ * less than or equal to @maxCount.
+ *
+ * May return service-specific errors:
+ * - ERR_FS_* if the filesystem has been tampered with in a way that the `readIntegrity` the
+ * dir was opened with does not acknowledge
+ */
+ @utf8InCpp String[] readNextFilenames(int maxCount);
+}
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/IFile.aidl b/staging/security/see/storage/aidl/android/hardware/security/see/storage/IFile.aidl
new file mode 100644
index 0000000..ff26aa4
--- /dev/null
+++ b/staging/security/see/storage/aidl/android/hardware/security/see/storage/IFile.aidl
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.storage;
+
+import android.hardware.security.see.storage.CreationMode;
+
+/** The interface for an open file */
+interface IFile {
+ /**
+ * Read bytes from this file.
+ *
+ * @size:
+ * the size (in bytes) of the segment to read. If @size is larger than the service's maximum
+ * read size, the call will return an error (EX_ILLEGAL_ARGUMENT).
+ * @offset:
+ * the offset (in bytes) at which to start reading
+ *
+ * Return:
+ * the sequence of bytes at [offset, offset + size) in the file
+ *
+ * May return service-specific errors:
+ * - ERR_FS_* if the filesystem has been tampered with in a way that the `readIntegrity` the
+ * file was opened with does not acknowledge
+ */
+ byte[] read(long size, long offset);
+
+ /**
+ * Write the bytes in `buffer` to this file.
+ *
+ * @offset:
+ * the offset (in bytes) at which to start writing
+ *
+ * Return:
+ * the number of bytes written successfully
+ *
+ * May return service-specific errors:
+ * - ERR_FS_* if the filesystem has been tampered with in a way that the `readIntegrity` the
+ * file was opened with does not acknowledge
+ */
+ long write(long offset, in byte[] buffer);
+
+ /**
+ * Reads this file's size.
+ *
+ * May return service-specific errors:
+ * - ERR_FS_* if the filesystem has been tampered with in a way that the `readIntegrity` the
+ * file was opened with does not acknowledge
+ */
+ long getSize();
+
+ /**
+ * Sets this file's size.
+ *
+ * Truncates the file if `new_size` is less than the current size. If `new_size` is greater than
+ * the current size, the file will be extended with zeroed data.
+ *
+ * @newSize:
+ * the file's new size
+ *
+ * May return service-specific errors:
+ * - ERR_FS_* if the filesystem has been tampered with in a way that the `readIntegrity` the
+ * file was opened with does not acknowledge
+ */
+ void setSize(long newSize);
+
+ /**
+ * Renames this file.
+ *
+ * @destPath:
+ * the file's new path, relative to filesystem root
+ * @destCreateMode:
+ * controls creation behavior of the dest file
+ *
+ * May return service-specific errors:
+ * - ERR_NOT_FOUND if no file exists at @destPath and @destCreateMode is `NO_CREATE`
+ * - ERR_ALREADY_EXISTS if a file already exists at @destPath and @destCreateMode is
+ * `CREATE_EXCLUSIVE`
+ * - ERR_FS_* if the filesystem has been tampered with in a way that the `readIntegrity` the
+ * file was opened with does not acknowledge
+ */
+ void rename(in @utf8InCpp String destPath, in CreationMode destCreateMode);
+}
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/ISecureStorage.aidl b/staging/security/see/storage/aidl/android/hardware/security/see/storage/ISecureStorage.aidl
new file mode 100644
index 0000000..be3c045
--- /dev/null
+++ b/staging/security/see/storage/aidl/android/hardware/security/see/storage/ISecureStorage.aidl
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.storage;
+
+import android.hardware.security.see.storage.FileProperties;
+import android.hardware.security.see.storage.IStorageSession;
+
+/**
+ * Interface for the Secure Storage HAL
+ *
+ * Creates sessions which can be used to access storage.
+ */
+interface ISecureStorage {
+ const int ERR_UNSUPPORTED_PROPERTIES = 1;
+ const int ERR_NOT_FOUND = 2;
+ const int ERR_ALREADY_EXISTS = 3;
+ const int ERR_BAD_TRANSACTION = 4;
+
+ const int ERR_FS_RESET = 5;
+ const int ERR_FS_ROLLED_BACK = 6;
+ const int ERR_FS_TAMPERED = 7;
+
+ /**
+ * Starts a storage session for a filesystem.
+ *
+ * @properties:
+ * the minimum filesystem properties requested for the session.
+ *
+ * May return service-specific errors:
+ * - ERR_UNSUPPORTED_PROPERTIES if no filesystems exist which meet the minimum requested
+ * requirements
+ */
+ IStorageSession startSession(in FileProperties properties);
+}
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/IStorageSession.aidl b/staging/security/see/storage/aidl/android/hardware/security/see/storage/IStorageSession.aidl
new file mode 100644
index 0000000..cd126b8
--- /dev/null
+++ b/staging/security/see/storage/aidl/android/hardware/security/see/storage/IStorageSession.aidl
@@ -0,0 +1,129 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.storage;
+
+import android.hardware.security.see.storage.DeleteOptions;
+import android.hardware.security.see.storage.IDir;
+import android.hardware.security.see.storage.IFile;
+import android.hardware.security.see.storage.OpenOptions;
+import android.hardware.security.see.storage.ReadIntegrity;
+import android.hardware.security.see.storage.RenameOptions;
+
+/**
+ * Interface for a Secure Storage session
+ *
+ * When the connection is opened, it will start a transaction and any changes made through this
+ * session or the interfaces this session returns will be added to this transaction's pending
+ * changes. Calling `CommitChanges`/`AbandonChanges` will commit/abandon these pending changes, and
+ * start a new, empty transaction. The interfaces this session returns _remain_ valid across
+ * transactions; it is not necessary, for example, to reopen a file after a commit.
+ *
+ * Any changes still pending when the session is dropped will be abandoned.
+ */
+interface IStorageSession {
+ /**
+ * Commits any pending changes made through this session to storage.
+ *
+ * The session will no longer have pending changes after this call returns. Files may then still
+ * be modified through this session to create another commit.
+ *
+ * May return service-specific errors:
+ * - ERR_BAD_TRANSACTION
+ */
+ void commitChanges();
+
+ /**
+ * Abandons any pending changes made through this session.
+ *
+ * The session can then be reused to make new changes.
+ */
+ void abandonChanges();
+
+ /**
+ * Opens a secure file for writing and/or reading.
+ *
+ * Changes made to the file are part of the current transaction. Dropping this session
+ * invalidates the returned `IFile` interface
+ *
+ * @filePath:
+ * path to the file, relative to filesystem root
+ * @options:
+ * options controlling opening behavior
+ *
+ * May return service-specific errors:
+ * - ERR_NOT_FOUND
+ * - ERR_ALREADY_EXISTS
+ * - ERR_FS_* if the filesystem has been tampered with in a way that @options.readIntegrity
+ * does not acknowledge
+ */
+ IFile openFile(in @utf8InCpp String filePath, in OpenOptions options);
+
+ /**
+ * Delete a file.
+ *
+ * @filePath:
+ * path to the file, relative to filesystem root
+ * @options:
+ * options controlling deletion behavior
+ *
+ * May return service-specific errors:
+ * - ERR_NOT_FOUND
+ * - ERR_FS_* if the filesystem has been tampered with in a way that @options.readIntegrity
+ * does not acknowledge
+ */
+ void deleteFile(in @utf8InCpp String filePath, in DeleteOptions options);
+
+ /**
+ * Renames an existing file.
+ *
+ * The file must not already be opened. (If it is, use `IFile::rename`.)
+ *
+ * @currentPath:
+ * path to the file, relative to filesystem root
+ * @destPath:
+ * the file's new path, relative to filesystem root
+ * @options:
+ * options controlling rename behavior
+ *
+ * May return service-specific errors:
+ * - ERR_NOT_FOUND if no file exists at @currentPath, or if @options.destCreateMode is
+ * `NO_CREATE` and no file exists at @destPath
+ * - ERR_ALREADY_EXISTS if @options.destCreateMode is `CREATE_EXCLUSIVE` and a file exists at
+ * @destPath
+ * - ERR_FS_* if the filesystem has been tampered with in a way that @options.readIntegrity
+ * does not acknowledge
+ */
+ void renameFile(in @utf8InCpp String currentPath, in @utf8InCpp String destPath,
+ in RenameOptions options);
+
+ /**
+ * Opens a directory from a filesystem with the given properties.
+ *
+ * Dropping this session invalidates the returned `IDir` interface.
+ *
+ * @path:
+ * path to the directory, relative to filesystem root
+ * @readIntegrity:
+ * allow opening (and subsequent read/write operations) despite possible tampering for the
+ * directory
+ *
+ * May return service-specific errors:
+ * - ERR_NOT_FOUND
+ * - ERR_FS_* if the filesystem has been tampered with in a way that @readIntegrity does not
+ * acknowledge
+ */
+ IDir openDir(in @utf8InCpp String path, in ReadIntegrity readIntegrity);
+}
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/OpenOptions.aidl b/staging/security/see/storage/aidl/android/hardware/security/see/storage/OpenOptions.aidl
new file mode 100644
index 0000000..997ca62
--- /dev/null
+++ b/staging/security/see/storage/aidl/android/hardware/security/see/storage/OpenOptions.aidl
@@ -0,0 +1,51 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.storage;
+
+import android.hardware.security.see.storage.CreationMode;
+import android.hardware.security.see.storage.FileMode;
+import android.hardware.security.see.storage.ReadIntegrity;
+
+parcelable OpenOptions {
+ /** Controls creation behavior of the to-be-opened file. See `CreationMode` docs for details. */
+ CreationMode createMode = CreationMode.NO_CREATE;
+
+ /** Controls access behavior of the to-be-opened file. See `FileMode` docs for details. */
+ FileMode accessMode = FileMode.READ_WRITE;
+
+ /**
+ * Set to acknowledge possible files tampering.
+ *
+ * If unacknowledged tampering is detected, the operation will fail with an ERR_FS_*
+ * service-specific code.
+ */
+ ReadIntegrity readIntegrity = ReadIntegrity.NO_TAMPER;
+
+ /**
+ * If this file already exists, discard existing content and open
+ * it as a new file. No semantic change if the file does not exist.
+ */
+ boolean truncateOnOpen;
+
+ /**
+ * Allow writes to succeed while the filesystem is in the middle of an A/B update.
+ *
+ * If the A/B update fails, the operation will be rolled back. This rollback will not
+ * cause subsequent operations fail with any ERR_FS_* code nor will need to be
+ * acknowledged by setting the `readIntegrity`.
+ */
+ boolean allowWritesDuringAbUpdate = false;
+}
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/ReadIntegrity.aidl b/staging/security/see/storage/aidl/android/hardware/security/see/storage/ReadIntegrity.aidl
new file mode 100644
index 0000000..cc0e4f9
--- /dev/null
+++ b/staging/security/see/storage/aidl/android/hardware/security/see/storage/ReadIntegrity.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.storage;
+
+enum ReadIntegrity {
+ /**
+ * Return an error on reads if any REE alteration of the written data
+ * has been detected.
+ */
+ NO_TAMPER,
+
+ /**
+ * Return an error on reads if any REE alteration other than a reset
+ * has been detected.
+ */
+ IGNORE_RESET,
+
+ /**
+ * Return an error if any REE alteration other than a rollback to a
+ * valid checkpoint has been detected. (What makes a checkpoint valid is
+ * implementation defined; an implementation might take a checkpoint on its
+ * first post-factory boot. A reset is a rollback to the initial state.)
+ */
+ IGNORE_ROLLBACK,
+
+ // There's no `IGNORE_ALL` because if REE has done any alteration other
+ // than a rollback, the file contents will be known-bad data.
+}
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/RenameOptions.aidl b/staging/security/see/storage/aidl/android/hardware/security/see/storage/RenameOptions.aidl
new file mode 100644
index 0000000..f55ea7f
--- /dev/null
+++ b/staging/security/see/storage/aidl/android/hardware/security/see/storage/RenameOptions.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.storage;
+
+import android.hardware.security.see.storage.CreationMode;
+import android.hardware.security.see.storage.ReadIntegrity;
+
+parcelable RenameOptions {
+ /** Controls creation behavior of the dest file. See `CreationMode` docs for details. */
+ CreationMode destCreateMode = CreationMode.CREATE_EXCLUSIVE;
+
+ /**
+ * Set to acknowledge possible files tampering.
+ *
+ * If unacknowledged tampering is detected, the operation will fail with an ERR_FS_*
+ * service-specific code.
+ */
+ ReadIntegrity readIntegrity = ReadIntegrity.NO_TAMPER;
+
+ /**
+ * Allow writes to succeed while the filesystem is in the middle of an A/B update.
+ *
+ * If the A/B update fails, the operation will be rolled back. This rollback will not
+ * cause subsequent operations fail with any ERR_FS_* code nor will need to be
+ * acknowledged by setting the `readIntegrity`.
+ */
+ boolean allowWritesDuringAbUpdate = false;
+}
diff --git a/staging/security/see/storage/aidl/android/hardware/security/see/storage/Tamper.aidl b/staging/security/see/storage/aidl/android/hardware/security/see/storage/Tamper.aidl
new file mode 100644
index 0000000..0a39fdd
--- /dev/null
+++ b/staging/security/see/storage/aidl/android/hardware/security/see/storage/Tamper.aidl
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2024 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 android.hardware.security.see.storage;
+
+/** Specifies types of REE tampering the filesystem may detect */
+enum Tamper {
+ /** REE has reset this file or the containing file system. */
+ RESET,
+
+ /** REE has rolled back this file or the containing file system to a previous state. */
+ ROLLBACK,
+
+ /** REE has made some other modification to the file. */
+ OTHER,
+}
diff --git a/tests/msgq/1.0/default/mq_test_service.cpp b/tests/msgq/1.0/default/mq_test_service.cpp
index 72ffe41..66ad12f 100644
--- a/tests/msgq/1.0/default/mq_test_service.cpp
+++ b/tests/msgq/1.0/default/mq_test_service.cpp
@@ -21,13 +21,15 @@
#include <android/binder_manager.h>
#include <android/binder_process.h>
#include <android/hardware/tests/msgq/1.0/ITestMsgQ.h>
+#include <hidl/ServiceManagement.h>
using aidl::android::fmq::test::TestAidlMsgQ;
#include <hidl/LegacySupport.h>
-using android::hardware::tests::msgq::V1_0::ITestMsgQ;
using android::hardware::defaultPassthroughServiceImplementation;
+using android::hardware::isHidlSupported;
+using android::hardware::tests::msgq::V1_0::ITestMsgQ;
int main() {
android::hardware::details::setTrebleTestingOverride(true);
@@ -39,8 +41,10 @@
LOG(INFO) << "instance: " << instance;
CHECK(AServiceManager_addService(store->asBinder().get(), instance.c_str()) == STATUS_OK);
- // Register HIDL service
- CHECK(defaultPassthroughServiceImplementation<ITestMsgQ>() == android::OK);
+ if (isHidlSupported()) {
+ // Register HIDL service
+ CHECK(defaultPassthroughServiceImplementation<ITestMsgQ>() == android::OK);
+ }
ABinderProcess_joinThreadPool();
return EXIT_FAILURE; // should not reach
diff --git a/thermal/aidl/Android.bp b/thermal/aidl/Android.bp
index efc763c..734aab7 100644
--- a/thermal/aidl/Android.bp
+++ b/thermal/aidl/Android.bp
@@ -35,6 +35,9 @@
java: {
platform_apis: true,
},
+ rust: {
+ enabled: true,
+ },
},
versions_with_info: [
{
@@ -42,6 +45,6 @@
imports: [],
},
],
- frozen: true,
+ frozen: false,
}
diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/CoolingType.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/CoolingType.aidl
index 1f87cf2..5e88aa0 100644
--- a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/CoolingType.aidl
+++ b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/CoolingType.aidl
@@ -46,4 +46,8 @@
POWER_AMPLIFIER,
DISPLAY,
SPEAKER,
+ WIFI,
+ CAMERA,
+ FLASHLIGHT,
+ USB_PORT,
}
diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/TemperatureType.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/TemperatureType.aidl
index e9710a7..665a36e 100644
--- a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/TemperatureType.aidl
+++ b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/TemperatureType.aidl
@@ -35,7 +35,7 @@
/* @hide */
@Backing(type="int") @VintfStability
enum TemperatureType {
- UNKNOWN = (-1),
+ UNKNOWN = (-1) /* -1 */,
CPU = 0,
GPU = 1,
BATTERY = 2,
@@ -50,4 +50,10 @@
DISPLAY = 11,
MODEM = 12,
SOC = 13,
+ WIFI = 14,
+ CAMERA = 15,
+ FLASHLIGHT = 16,
+ SPEAKER = 17,
+ AMBIENT = 18,
+ POGO = 19,
}
diff --git a/thermal/aidl/android/hardware/thermal/CoolingType.aidl b/thermal/aidl/android/hardware/thermal/CoolingType.aidl
index 08beb55..c00028d 100644
--- a/thermal/aidl/android/hardware/thermal/CoolingType.aidl
+++ b/thermal/aidl/android/hardware/thermal/CoolingType.aidl
@@ -34,4 +34,8 @@
POWER_AMPLIFIER,
DISPLAY,
SPEAKER,
+ WIFI,
+ CAMERA,
+ FLASHLIGHT,
+ USB_PORT,
}
diff --git a/thermal/aidl/android/hardware/thermal/TemperatureType.aidl b/thermal/aidl/android/hardware/thermal/TemperatureType.aidl
index 467d096..ce2a9fc 100644
--- a/thermal/aidl/android/hardware/thermal/TemperatureType.aidl
+++ b/thermal/aidl/android/hardware/thermal/TemperatureType.aidl
@@ -44,4 +44,10 @@
DISPLAY = 11,
MODEM = 12,
SOC = 13,
+ WIFI = 14,
+ CAMERA = 15,
+ FLASHLIGHT = 16,
+ SPEAKER = 17,
+ AMBIENT = 18,
+ POGO = 19,
}
diff --git a/thermal/aidl/default/Android.bp b/thermal/aidl/default/Android.bp
index 451e1e2..9fe62ce 100644
--- a/thermal/aidl/default/Android.bp
+++ b/thermal/aidl/default/Android.bp
@@ -27,7 +27,7 @@
vendor: true,
stl: "c++_static",
static_libs: [
- "android.hardware.thermal-V1-ndk",
+ "android.hardware.thermal-V2-ndk",
"libbase",
],
shared_libs: [
diff --git a/thermal/aidl/default/thermal-example.xml b/thermal/aidl/default/thermal-example.xml
index bdee744..08dc68c 100644
--- a/thermal/aidl/default/thermal-example.xml
+++ b/thermal/aidl/default/thermal-example.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.thermal</name>
- <version>1</version>
+ <version>2</version>
<fqname>IThermal/default</fqname>
</hal>
</manifest>
diff --git a/thermal/aidl/vts/Android.bp b/thermal/aidl/vts/Android.bp
index b00eb33..0812811 100644
--- a/thermal/aidl/vts/Android.bp
+++ b/thermal/aidl/vts/Android.bp
@@ -32,7 +32,7 @@
"libbinder_ndk",
],
static_libs: [
- "android.hardware.thermal-V1-ndk",
+ "android.hardware.thermal-V2-ndk",
],
test_suites: [
"vts",
diff --git a/thermal/aidl/vts/VtsHalThermalTargetTest.cpp b/thermal/aidl/vts/VtsHalThermalTargetTest.cpp
index 835fbfa..4b0eb65 100644
--- a/thermal/aidl/vts/VtsHalThermalTargetTest.cpp
+++ b/thermal/aidl/vts/VtsHalThermalTargetTest.cpp
@@ -128,7 +128,8 @@
ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode());
// Expect to fail with null callback
status = mThermal->registerThermalChangedCallback(nullptr);
- ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode());
+ ASSERT_TRUE(status.getExceptionCode() == EX_ILLEGAL_ARGUMENT
+ || status.getExceptionCode() == EX_NULL_POINTER);
std::shared_ptr<ThermalCallback> localThermalCallback =
ndk::SharedRefBase::make<ThermalCallback>();
// Expect to succeed with different callback
@@ -139,7 +140,8 @@
ASSERT_TRUE(status.isOk()) << status.getMessage();
// Expect to fail with null callback
status = mThermal->unregisterThermalChangedCallback(nullptr);
- ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode());
+ ASSERT_TRUE(status.getExceptionCode() == EX_ILLEGAL_ARGUMENT
+ || status.getExceptionCode() == EX_NULL_POINTER);
}
// Test Thermal->registerThermalChangedCallbackWithType.
@@ -150,7 +152,8 @@
ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode());
// Expect to fail with null callback
status = mThermal->registerThermalChangedCallbackWithType(nullptr, TemperatureType::SKIN);
- ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode());
+ ASSERT_TRUE(status.getExceptionCode() == EX_ILLEGAL_ARGUMENT
+ || status.getExceptionCode() == EX_NULL_POINTER);
std::shared_ptr<ThermalCallback> localThermalCallback =
ndk::SharedRefBase::make<ThermalCallback>();
// Expect to succeed with different callback
@@ -162,7 +165,8 @@
ASSERT_TRUE(status.isOk()) << status.getMessage();
// Expect to fail with null callback
status = mThermal->unregisterThermalChangedCallback(nullptr);
- ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode());
+ ASSERT_TRUE(status.getExceptionCode() == EX_ILLEGAL_ARGUMENT
+ || status.getExceptionCode() == EX_NULL_POINTER);
}
// Test Thermal->getCurrentTemperatures().
diff --git a/threadnetwork/aidl/default/socket_interface.cpp b/threadnetwork/aidl/default/socket_interface.cpp
index f874209..0544502 100644
--- a/threadnetwork/aidl/default/socket_interface.cpp
+++ b/threadnetwork/aidl/default/socket_interface.cpp
@@ -23,6 +23,7 @@
#include "socket_interface.hpp"
#include <errno.h>
+#include <linux/limits.h>
#include <openthread/logging.h>
#include <sys/inotify.h>
#include <sys/socket.h>
@@ -42,6 +43,8 @@
namespace hardware {
namespace threadnetwork {
+const char SocketInterface::kLogModuleName[] = "SocketIntface";
+
SocketInterface::SocketInterface(const ot::Url::Url& aRadioUrl)
: mReceiveFrameCallback(nullptr),
mReceiveFrameContext(nullptr),
@@ -157,7 +160,7 @@
} else if (rval < 0) {
DieNow(OT_EXIT_ERROR_ERRNO);
} else {
- otLogCritPlat("Socket connection is closed by remote.");
+ LogCrit("Socket connection is closed by remote.");
exit(OT_EXIT_FAILURE);
}
}
@@ -192,7 +195,7 @@
mReceiveFrameCallback(mReceiveFrameContext);
} else {
mReceiveFrameBuffer->DiscardFrame();
- otLogWarnPlat("Process socket frame failed: %s", otThreadErrorToString(aError));
+ LogWarn("Process socket frame failed: %s", otThreadErrorToString(aError));
}
exit:
@@ -204,16 +207,16 @@
sockaddr_un serverAddress;
VerifyOrExit(sizeof(serverAddress.sun_path) > strlen(aRadioUrl.GetPath()),
- otLogCritPlat("Invalid file path length"));
+ LogCrit("Invalid file path length"));
strncpy(serverAddress.sun_path, aRadioUrl.GetPath(), sizeof(serverAddress.sun_path));
serverAddress.sun_family = AF_UNIX;
fd = socket(AF_UNIX, SOCK_SEQPACKET, 0);
- VerifyOrExit(fd != -1, otLogCritPlat("open(): errno=%s", strerror(errno)));
+ VerifyOrExit(fd != -1, LogCrit("open(): errno=%s", strerror(errno)));
if (connect(fd, reinterpret_cast<struct sockaddr*>(&serverAddress), sizeof(serverAddress)) ==
-1) {
- otLogCritPlat("connect(): errno=%s", strerror(errno));
+ LogCrit("connect(): errno=%s", strerror(errno));
close(fd);
fd = -1;
}
@@ -225,9 +228,9 @@
void SocketInterface::CloseFile(void) {
VerifyOrExit(mSockFd != -1);
- VerifyOrExit(0 == close(mSockFd), otLogCritPlat("close(): errno=%s", strerror(errno)));
+ VerifyOrExit(0 == close(mSockFd), LogCrit("close(): errno=%s", strerror(errno)));
VerifyOrExit(wait(nullptr) != -1 || errno == ECHILD,
- otLogCritPlat("wait(): errno=%s", strerror(errno)));
+ LogCrit("wait(): errno=%s", strerror(errno)));
mSockFd = -1;
@@ -254,7 +257,7 @@
wd = inotify_add_watch(inotifyFd, folderPath.c_str(), IN_CREATE);
VerifyOrDie(wd != -1, OT_EXIT_ERROR_ERRNO);
- otLogInfoPlat("Waiting for socket file %s be created...", aPath);
+ LogInfo("Waiting for socket file %s be created...", aPath);
while (true) {
fd_set fds;
@@ -271,7 +274,7 @@
}
if (FD_ISSET(inotifyFd, &fds)) {
- char buffer[sizeof(struct inotify_event)];
+ char buffer[sizeof(struct inotify_event) + NAME_MAX + 1];
ssize_t bytesRead = read(inotifyFd, buffer, sizeof(buffer));
VerifyOrDie(bytesRead >= 0, OT_EXIT_ERROR_ERRNO);
@@ -286,7 +289,7 @@
close(inotifyFd);
exit:
- otLogInfoPlat("Socket file: %s is created", aPath);
+ LogInfo("Socket file: %s is created", aPath);
return;
}
diff --git a/threadnetwork/aidl/default/socket_interface.hpp b/threadnetwork/aidl/default/socket_interface.hpp
index f88e926..6f3be7f 100644
--- a/threadnetwork/aidl/default/socket_interface.hpp
+++ b/threadnetwork/aidl/default/socket_interface.hpp
@@ -22,6 +22,7 @@
#include "lib/spinel/spinel_interface.hpp"
#include "lib/url/url.hpp"
+#include "logger.hpp"
namespace aidl {
namespace android {
@@ -32,8 +33,11 @@
* Defines a Socket interface to the Radio Co-processor (RCP)
*
*/
-class SocketInterface : public ot::Spinel::SpinelInterface {
+class SocketInterface : public ot::Spinel::SpinelInterface,
+ public ot::Posix::Logger<SocketInterface> {
public:
+ static const char kLogModuleName[]; ///< Module name used for logging.
+
/**
* Initializes the object.
*
diff --git a/threadnetwork/aidl/default/utils.cpp b/threadnetwork/aidl/default/utils.cpp
index 1cb42ec..3552b3a 100644
--- a/threadnetwork/aidl/default/utils.cpp
+++ b/threadnetwork/aidl/default/utils.cpp
@@ -20,6 +20,20 @@
#include <openthread/platform/alarm-milli.h>
#include <utils/Log.h>
+void otLogPlatArgs(otLogLevel aLogLevel, const char* aPlatModuleName, const char* aFormat,
+ va_list aArgs) {
+ OT_UNUSED_VARIABLE(aPlatModuleName);
+ static const android_LogPriority kLogPriorities[] = {ANDROID_LOG_SILENT, ANDROID_LOG_FATAL,
+ ANDROID_LOG_WARN, ANDROID_LOG_INFO,
+ ANDROID_LOG_INFO, ANDROID_LOG_DEBUG};
+
+ if (aLogLevel >= sizeof(kLogPriorities) / sizeof(android_LogPriority)) {
+ return;
+ }
+
+ __android_log_vprint(kLogPriorities[aLogLevel], LOG_TAG, aFormat, aArgs);
+}
+
void otLogCritPlat(const char* format, ...) {
va_list args;
@@ -28,38 +42,6 @@
va_end(args);
}
-void otLogWarnPlat(const char* format, ...) {
- va_list args;
-
- va_start(args, format);
- __android_log_vprint(ANDROID_LOG_WARN, LOG_TAG, format, args);
- va_end(args);
-}
-
-void otLogNotePlat(const char* format, ...) {
- va_list args;
-
- va_start(args, format);
- __android_log_vprint(ANDROID_LOG_INFO, LOG_TAG, format, args);
- va_end(args);
-}
-
-void otLogInfoPlat(const char* format, ...) {
- va_list args;
-
- va_start(args, format);
- __android_log_vprint(ANDROID_LOG_INFO, LOG_TAG, format, args);
- va_end(args);
-}
-
-void otLogDebgPlat(const char* format, ...) {
- va_list args;
-
- va_start(args, format);
- __android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, format, args);
- va_end(args);
-}
-
void otDumpDebgPlat(const char* aText, const void* aData, uint16_t aDataLength) {
constexpr uint16_t kBufSize = 512;
char buf[kBufSize];
diff --git a/tv/cec/1.0/Android.bp b/tv/cec/1.0/Android.bp
index 889399a..836f265 100644
--- a/tv/cec/1.0/Android.bp
+++ b/tv/cec/1.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_tv_os",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/tv/cec/1.0/default/Android.bp b/tv/cec/1.0/default/Android.bp
index e4c226d..abde1f2 100644
--- a/tv/cec/1.0/default/Android.bp
+++ b/tv/cec/1.0/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_tv_os",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/tv/cec/1.0/vts/functional/Android.bp b/tv/cec/1.0/vts/functional/Android.bp
index 9a2c714..4022043 100644
--- a/tv/cec/1.0/vts/functional/Android.bp
+++ b/tv/cec/1.0/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_tv_os",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/tv/cec/1.1/Android.bp b/tv/cec/1.1/Android.bp
index 27b4f03..bdfb64c 100644
--- a/tv/cec/1.1/Android.bp
+++ b/tv/cec/1.1/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_tv_os",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/tv/cec/1.1/default/Android.bp b/tv/cec/1.1/default/Android.bp
index b536d23..0b93cf3 100644
--- a/tv/cec/1.1/default/Android.bp
+++ b/tv/cec/1.1/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_tv_os",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/tv/cec/1.1/vts/functional/Android.bp b/tv/cec/1.1/vts/functional/Android.bp
index 5a6548d..f8ca804 100644
--- a/tv/cec/1.1/vts/functional/Android.bp
+++ b/tv/cec/1.1/vts/functional/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_tv_os",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/tv/hdmi/cec/aidl/default/HdmiCecMock.cpp b/tv/hdmi/cec/aidl/default/HdmiCecMock.cpp
index 8a3c6f0..4dbd339 100644
--- a/tv/hdmi/cec/aidl/default/HdmiCecMock.cpp
+++ b/tv/hdmi/cec/aidl/default/HdmiCecMock.cpp
@@ -35,8 +35,7 @@
void HdmiCecMock::serviceDied(void* cookie) {
ALOGE("HdmiCecMock died");
auto hdmiCecMock = static_cast<HdmiCecMock*>(cookie);
- hdmiCecMock->mCecThreadRun = false;
- pthread_join(hdmiCecMock->mThreadId, NULL);
+ hdmiCecMock->closeCallback();
}
ScopedAStatus HdmiCecMock::addLogicalAddress(CecLogicalAddress addr, Result* _aidl_return) {
@@ -86,10 +85,10 @@
}
ScopedAStatus HdmiCecMock::setCallback(const std::shared_ptr<IHdmiCecCallback>& callback) {
- // If callback is null, mCallback is also set to null so we do not call the old callback.
- mCallback = callback;
+ closeCallback();
if (callback != nullptr) {
+ mCallback = callback;
mDeathRecipient =
ndk::ScopedAIBinder_DeathRecipient(AIBinder_DeathRecipient_new(serviceDied));
AIBinder_linkToDeath(callback->asBinder().get(), mDeathRecipient.get(), this /* cookie */);
@@ -104,8 +103,8 @@
ScopedAStatus HdmiCecMock::setLanguage(const std::string& language) {
if (language.size() != 3) {
- LOG(ERROR) << "Wrong language code: expected 3 letters, but it was " << language.size()
- << ".";
+ ALOGE("[halimp_aidl] Wrong language code: expected 3 letters, but it was %zu",
+ language.size());
return ScopedAStatus::ok();
}
// TODO Validate if language is a valid language code
@@ -169,7 +168,7 @@
// Open the output pipe for writing outgoing cec message
mOutputFile = open(CEC_MSG_OUT_FIFO, O_WRONLY | O_CLOEXEC);
if (mOutputFile < 0) {
- ALOGD("[halimp_aidl] file open failed for writing");
+ ALOGE("[halimp_aidl] file open failed for writing");
return -1;
}
@@ -258,17 +257,24 @@
}
HdmiCecMock::HdmiCecMock() {
- ALOGE("[halimp_aidl] Opening a virtual CEC HAL for testing and virtual machine.");
+ ALOGD("[halimp_aidl] Opening a virtual CEC HAL for testing and virtual machine.");
mCallback = nullptr;
mDeathRecipient = ndk::ScopedAIBinder_DeathRecipient(nullptr);
}
+void HdmiCecMock::closeCallback() {
+ if (mCallback != nullptr) {
+ ALOGD("[halimp_aidl] HdmiCecMock close the current callback.");
+ mCallback = nullptr;
+ mDeathRecipient = ndk::ScopedAIBinder_DeathRecipient(nullptr);
+ mCecThreadRun = false;
+ pthread_join(mThreadId, NULL);
+ }
+}
+
HdmiCecMock::~HdmiCecMock() {
- ALOGE("[halimp_aidl] HdmiCecMock shutting down.");
- mCallback = nullptr;
- mDeathRecipient = ndk::ScopedAIBinder_DeathRecipient(nullptr);
- mCecThreadRun = false;
- pthread_join(mThreadId, NULL);
+ ALOGD("[halimp_aidl] HdmiCecMock shutting down.");
+ closeCallback();
}
} // namespace implementation
diff --git a/tv/hdmi/cec/aidl/default/HdmiCecMock.h b/tv/hdmi/cec/aidl/default/HdmiCecMock.h
index e78b1cf..ef392bb 100644
--- a/tv/hdmi/cec/aidl/default/HdmiCecMock.h
+++ b/tv/hdmi/cec/aidl/default/HdmiCecMock.h
@@ -55,6 +55,7 @@
::ndk::ScopedAStatus enableCec(bool value) override;
::ndk::ScopedAStatus enableSystemCecControl(bool value) override;
void printCecMsgBuf(const char* msg_buf, int len);
+ void closeCallback();
private:
static void* __threadLoop(void* data);
@@ -62,9 +63,8 @@
int readMessageFromFifo(unsigned char* buf, int msgCount);
int sendMessageToFifo(const CecMessage& message);
void handleCecMessage(unsigned char* msgBuf, int length);
-
- private:
static void serviceDied(void* cookie);
+
std::shared_ptr<IHdmiCecCallback> mCallback;
// Variables for the virtual cec hal impl
diff --git a/tv/input/aidl/Android.bp b/tv/input/aidl/Android.bp
index 5543901..2326549 100644
--- a/tv/input/aidl/Android.bp
+++ b/tv/input/aidl/Android.bp
@@ -36,6 +36,5 @@
],
},
],
- frozen: true,
-
+ frozen: false,
}
diff --git a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEvent.aidl b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEvent.aidl
index 94fe665..3c1cb74 100644
--- a/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEvent.aidl
+++ b/tv/input/aidl/aidl_api/android.hardware.tv.input/current/android/hardware/tv/input/TvMessageEvent.aidl
@@ -37,4 +37,5 @@
android.hardware.tv.input.TvMessageEventType type;
int streamId;
android.hardware.tv.input.TvMessage[] messages;
+ int deviceId;
}
diff --git a/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl b/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl
index a3afd41..4121fc7 100644
--- a/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl
+++ b/tv/input/aidl/android/hardware/tv/input/ITvInputCallback.aidl
@@ -32,17 +32,20 @@
* Notifies the client that an TV message event has occurred. For possible event types,
* check {@link android.hardware.tv.input.TvMessageEventType}.
*
- * The first message in a list of messages contained in a
+ * <p> For implementations of version 1, The first message in a list of messages contained in a
* {@link android.hardware.tv.input.TvMessageEvent} should always have a
* {@link android.hardware.tv.input.TvMessage#subType} of "device_id",
* otherwise the event is discarded. When the subType of a message is "device_id", the ID of
* the device that sent the message should be contained in
- * {@link android.hardware.tv.input.TvMessage#groupId}
+ * {@link android.hardware.tv.input.TvMessage#groupId}.
*
- * Invoking this callback for the first time immediately triggers
+ * <p> For version 2 and beyond, the device ID should be contained in
+ * {@link android.hardware.tv.input.TvMessageEvent#deviceId}.
+ *
+ * <p> Invoking this callback for the first time immediately triggers
* {@link android.hardware.tv.input.ITvInput#getTvMessageQueueDesc}. It is
- * expected for the queue to be ready with
- * the relevant messages for the event before this callback is called.
+ * expected for the queue to be ready with the relevant messages for the event before this
+ * callback is called.
*
* @param event Event passed to the client.
*/
diff --git a/tv/input/aidl/android/hardware/tv/input/TvMessageEvent.aidl b/tv/input/aidl/android/hardware/tv/input/TvMessageEvent.aidl
index 74a078a..e04a725 100644
--- a/tv/input/aidl/android/hardware/tv/input/TvMessageEvent.aidl
+++ b/tv/input/aidl/android/hardware/tv/input/TvMessageEvent.aidl
@@ -25,4 +25,5 @@
int streamId;
TvMessage[] messages;
+ int deviceId;
}
diff --git a/tv/input/aidl/default/TvInput.cpp b/tv/input/aidl/default/TvInput.cpp
index 2ee8bcf..f6a64c4 100644
--- a/tv/input/aidl/default/TvInput.cpp
+++ b/tv/input/aidl/default/TvInput.cpp
@@ -43,6 +43,9 @@
new TvStreamConfigWrapper(11, 360, 480, false))}};
mStreamConfigs[3] = {{5, shared_ptr<TvStreamConfigWrapper>(
new TvStreamConfigWrapper(5, 1080, 1920, false))}};
+
+ mQueue = shared_ptr<AidlMessageQueue<int8_t, SynchronizedReadWrite>>(
+ new (std::nothrow) AidlMessageQueue<int8_t, SynchronizedReadWrite>(8));
}
::ndk::ScopedAStatus TvInput::setCallback(const shared_ptr<ITvInputCallback>& in_callback) {
@@ -74,7 +77,9 @@
return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_ARGUMENTS);
}
+ // When calling notifyTvMessage, make sure to verify against this map.
mTvMessageEventEnabled[deviceId][streamId][in_type] = enabled;
+
return ::ndk::ScopedAStatus::ok();
}
@@ -82,11 +87,17 @@
MQDescriptor<int8_t, SynchronizedReadWrite>* out_queue, int32_t in_deviceId,
int32_t in_streamId) {
ALOGV("%s", __FUNCTION__);
+ ::ndk::ScopedAStatus status = ::ndk::ScopedAStatus::ok();
if (mStreamConfigs.count(in_deviceId) == 0) {
ALOGW("Device with id %d isn't available", in_deviceId);
- return ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_ARGUMENTS);
+ status = ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_ARGUMENTS);
+ } else if (!mQueue->isValid()) {
+ ALOGE("Tv Message Queue was not properly initialized");
+ status = ::ndk::ScopedAStatus::fromServiceSpecificError(STATUS_INVALID_STATE);
+ } else {
+ *out_queue = mQueue->dupeDesc();
}
- return ::ndk::ScopedAStatus::ok();
+ return status;
}
::ndk::ScopedAStatus TvInput::getStreamConfigurations(int32_t in_deviceId,
diff --git a/tv/input/aidl/default/TvInput.h b/tv/input/aidl/default/TvInput.h
index 5776961..595f017 100644
--- a/tv/input/aidl/default/TvInput.h
+++ b/tv/input/aidl/default/TvInput.h
@@ -66,6 +66,7 @@
map<int32_t, shared_ptr<TvInputDeviceInfoWrapper>> mDeviceInfos;
map<int32_t, map<int32_t, shared_ptr<TvStreamConfigWrapper>>> mStreamConfigs;
TvMessageEnabledMap mTvMessageEventEnabled;
+ shared_ptr<AidlMessageQueue<int8_t, SynchronizedReadWrite>> mQueue;
};
} // namespace input
diff --git a/tv/input/aidl/vts/functional/Android.bp b/tv/input/aidl/vts/functional/Android.bp
index ccbce7d..c472e24 100644
--- a/tv/input/aidl/vts/functional/Android.bp
+++ b/tv/input/aidl/vts/functional/Android.bp
@@ -33,7 +33,7 @@
"libvndksupport",
"libfmq",
"android.hardware.common.fmq-V1-ndk",
- "android.hardware.tv.input-V1-ndk",
+ "android.hardware.tv.input-V2-ndk",
],
require_root: true,
}
diff --git a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp
index 8d3395b..746ae1e 100644
--- a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp
+++ b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp
@@ -355,8 +355,12 @@
}
int32_t stream_id = streamConfigs[0].streamId;
ALOGD("GetTvMessageQueueTest: device_id=%d, stream_id=%d", device_id, stream_id);
- MQDescriptor<int8_t, SynchronizedReadWrite> queue;
- tv_input_->getTvMessageQueueDesc(&queue, device_id, stream_id);
+ MQDescriptor<int8_t, SynchronizedReadWrite> queueDescriptor;
+ AidlMessageQueue<int8_t, SynchronizedReadWrite>* queue;
+ tv_input_->getTvMessageQueueDesc(&queueDescriptor, device_id, stream_id);
+ queue = new (std::nothrow) AidlMessageQueue<int8_t, SynchronizedReadWrite>(queueDescriptor);
+ ASSERT_TRUE(queue->isValid());
+ delete queue;
}
INSTANTIATE_TEST_SUITE_P(PerInstance, TvInputAidlTest,
diff --git a/tv/tuner/aidl/default/Android.bp b/tv/tuner/aidl/default/Android.bp
index 65fa821..ed97d9c 100644
--- a/tv/tuner/aidl/default/Android.bp
+++ b/tv/tuner/aidl/default/Android.bp
@@ -23,6 +23,7 @@
"TimeFilter.cpp",
"Tuner.cpp",
"service.cpp",
+ "dtv_plugin.cpp",
],
static_libs: [
"libaidlcommonsupport",
diff --git a/tv/tuner/aidl/default/Demux.cpp b/tv/tuner/aidl/default/Demux.cpp
index 11e7131..de94467 100644
--- a/tv/tuner/aidl/default/Demux.cpp
+++ b/tv/tuner/aidl/default/Demux.cpp
@@ -20,7 +20,9 @@
#include <aidl/android/hardware/tv/tuner/DemuxQueueNotifyBits.h>
#include <aidl/android/hardware/tv/tuner/Result.h>
+#include <fmq/AidlMessageQueue.h>
#include <utils/Log.h>
+#include <thread>
#include "Demux.h"
namespace aidl {
@@ -29,6 +31,15 @@
namespace tv {
namespace tuner {
+using ::aidl::android::hardware::common::fmq::MQDescriptor;
+using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite;
+using ::android::AidlMessageQueue;
+using ::android::hardware::EventFlag;
+
+using FilterMQ = AidlMessageQueue<int8_t, SynchronizedReadWrite>;
+using AidlMQ = AidlMessageQueue<int8_t, SynchronizedReadWrite>;
+using AidlMQDesc = MQDescriptor<int8_t, SynchronizedReadWrite>;
+
#define WAIT_TIMEOUT 3000000000
Demux::Demux(int32_t demuxId, uint32_t filterTypes) {
@@ -42,9 +53,128 @@
Demux::~Demux() {
ALOGV("%s", __FUNCTION__);
+ if (mDemuxIptvReadThread.joinable()) {
+ mDemuxIptvReadThread.join();
+ }
close();
}
+::ndk::ScopedAStatus Demux::openDvr(DvrType in_type, int32_t in_bufferSize,
+ const std::shared_ptr<IDvrCallback>& in_cb,
+ std::shared_ptr<IDvr>* _aidl_return) {
+ ALOGV("%s", __FUNCTION__);
+
+ if (in_cb == nullptr) {
+ ALOGW("[Demux] DVR callback can't be null");
+ *_aidl_return = nullptr;
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::INVALID_ARGUMENT));
+ }
+
+ set<int64_t>::iterator it;
+ switch (in_type) {
+ case DvrType::PLAYBACK:
+ mDvrPlayback = ndk::SharedRefBase::make<Dvr>(in_type, in_bufferSize, in_cb,
+ this->ref<Demux>());
+ if (!mDvrPlayback->createDvrMQ()) {
+ ALOGE("[Demux] cannot create dvr message queue");
+ mDvrPlayback = nullptr;
+ *_aidl_return = mDvrPlayback;
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::UNKNOWN_ERROR));
+ }
+
+ for (it = mPlaybackFilterIds.begin(); it != mPlaybackFilterIds.end(); it++) {
+ if (!mDvrPlayback->addPlaybackFilter(*it, mFilters[*it])) {
+ ALOGE("[Demux] Can't get filter info for DVR playback");
+ mDvrPlayback = nullptr;
+ *_aidl_return = mDvrPlayback;
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::UNKNOWN_ERROR));
+ }
+ }
+
+ ALOGI("Playback normal case");
+
+ *_aidl_return = mDvrPlayback;
+ return ::ndk::ScopedAStatus::ok();
+ case DvrType::RECORD:
+ mDvrRecord = ndk::SharedRefBase::make<Dvr>(in_type, in_bufferSize, in_cb,
+ this->ref<Demux>());
+ if (!mDvrRecord->createDvrMQ()) {
+ mDvrRecord = nullptr;
+ *_aidl_return = mDvrRecord;
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::UNKNOWN_ERROR));
+ }
+
+ *_aidl_return = mDvrRecord;
+ return ::ndk::ScopedAStatus::ok();
+ default:
+ *_aidl_return = nullptr;
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::INVALID_ARGUMENT));
+ }
+}
+
+void Demux::setIptvThreadRunning(bool isIptvThreadRunning) {
+ std::unique_lock<std::mutex> lock(mIsIptvThreadRunningMutex);
+ mIsIptvReadThreadRunning = isIptvThreadRunning;
+ mIsIptvThreadRunningCv.notify_all();
+}
+
+void Demux::readIptvThreadLoop(dtv_plugin* interface, dtv_streamer* streamer, size_t buf_size,
+ int timeout_ms, int buffer_timeout) {
+ Timer *timer, *fullBufferTimer;
+ while (true) {
+ std::unique_lock<std::mutex> lock(mIsIptvThreadRunningMutex);
+ mIsIptvThreadRunningCv.wait(lock, [this] { return mIsIptvReadThreadRunning; });
+ if (mIsIptvDvrFMQFull && fullBufferTimer->get_elapsed_time_ms() > buffer_timeout) {
+ ALOGE("DVR FMQ has not been flushed within timeout of %d ms", buffer_timeout);
+ delete fullBufferTimer;
+ break;
+ }
+ timer = new Timer();
+ void* buf = malloc(sizeof(char) * IPTV_BUFFER_SIZE);
+ if (buf == nullptr) ALOGI("Buffer allocation failed");
+ ssize_t bytes_read = interface->read_stream(streamer, buf, buf_size, timeout_ms);
+ if (bytes_read == 0) {
+ double elapsed_time = timer->get_elapsed_time_ms();
+ if (elapsed_time > timeout_ms) {
+ ALOGE("[Demux] timeout reached - elapsed_time: %f, timeout: %d", elapsed_time,
+ timeout_ms);
+ }
+ ALOGE("[Demux] Cannot read data from the socket");
+ delete timer;
+ break;
+ }
+
+ delete timer;
+ ALOGI("Number of bytes read: %zd", bytes_read);
+ int result = mDvrPlayback->writePlaybackFMQ(buf, bytes_read);
+
+ switch (result) {
+ case DVR_WRITE_FAILURE_REASON_FMQ_FULL:
+ if (!mIsIptvDvrFMQFull) {
+ mIsIptvDvrFMQFull = true;
+ fullBufferTimer = new Timer();
+ }
+ ALOGI("Waiting for client to flush DVR FMQ.");
+ break;
+ case DVR_WRITE_FAILURE_REASON_UNKNOWN:
+ ALOGE("Failed to write data into DVR FMQ for unknown reason");
+ break;
+ case DVR_WRITE_SUCCESS:
+ ALOGI("Wrote %zd bytes to DVR FMQ", bytes_read);
+ break;
+ default:
+ ALOGI("Invalid DVR Status");
+ }
+
+ free(buf);
+ }
+}
+
::ndk::ScopedAStatus Demux::setFrontendDataSource(int32_t in_frontendId) {
ALOGV("%s", __FUNCTION__);
@@ -52,7 +182,6 @@
return ::ndk::ScopedAStatus::fromServiceSpecificError(
static_cast<int32_t>(Result::NOT_INITIALIZED));
}
-
mFrontend = mTuner->getFrontendById(in_frontendId);
if (mFrontend == nullptr) {
return ::ndk::ScopedAStatus::fromServiceSpecificError(
@@ -61,6 +190,49 @@
mTuner->setFrontendAsDemuxSource(in_frontendId, mDemuxId);
+ // if mFrontend is an IPTV frontend, create streamer to read TS data from socket
+ if (mFrontend->getFrontendType() == FrontendType::IPTV) {
+ // create a DVR instance on the demux
+ shared_ptr<IDvr> iptvDvr;
+
+ std::shared_ptr<IDvrCallback> dvrPlaybackCallback =
+ ::ndk::SharedRefBase::make<DvrPlaybackCallback>();
+
+ ::ndk::ScopedAStatus status =
+ openDvr(DvrType::PLAYBACK, IPTV_BUFFER_SIZE, dvrPlaybackCallback, &iptvDvr);
+ if (status.isOk()) {
+ ALOGI("DVR instance created");
+ }
+
+ // get plugin interface from frontend
+ dtv_plugin* interface = mFrontend->getIptvPluginInterface();
+ if (interface == nullptr) {
+ ALOGE("[Demux] getIptvPluginInterface(): plugin interface is null");
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::INVALID_STATE));
+ }
+ ALOGI("[Demux] getIptvPluginInterface(): plugin interface is not null");
+
+ // get streamer object from Frontend instance
+ dtv_streamer* streamer = mFrontend->getIptvPluginStreamer();
+ if (streamer == nullptr) {
+ ALOGE("[Demux] getIptvPluginStreamer(): streamer is null");
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::INVALID_STATE));
+ }
+ ALOGI("[Demux] getIptvPluginStreamer(): streamer is not null");
+
+ // get transport description from frontend
+ string transport_desc = mFrontend->getIptvTransportDescription();
+ ALOGI("[Demux] getIptvTransportDescription(): transport_desc: %s", transport_desc.c_str());
+
+ // call read_stream on the socket to populate the buffer with TS data
+ // while thread is alive, keep reading data
+ int timeout_ms = 20;
+ int buffer_timeout = 10000; // 10s
+ mDemuxIptvReadThread = std::thread(&Demux::readIptvThreadLoop, this, interface, streamer,
+ IPTV_BUFFER_SIZE, timeout_ms, buffer_timeout);
+ }
return ::ndk::ScopedAStatus::ok();
}
@@ -193,61 +365,6 @@
return ::ndk::ScopedAStatus::ok();
}
-::ndk::ScopedAStatus Demux::openDvr(DvrType in_type, int32_t in_bufferSize,
- const std::shared_ptr<IDvrCallback>& in_cb,
- std::shared_ptr<IDvr>* _aidl_return) {
- ALOGV("%s", __FUNCTION__);
-
- if (in_cb == nullptr) {
- ALOGW("[Demux] DVR callback can't be null");
- *_aidl_return = nullptr;
- return ::ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(Result::INVALID_ARGUMENT));
- }
-
- set<int64_t>::iterator it;
- switch (in_type) {
- case DvrType::PLAYBACK:
- mDvrPlayback = ndk::SharedRefBase::make<Dvr>(in_type, in_bufferSize, in_cb,
- this->ref<Demux>());
- if (!mDvrPlayback->createDvrMQ()) {
- mDvrPlayback = nullptr;
- *_aidl_return = mDvrPlayback;
- return ::ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(Result::UNKNOWN_ERROR));
- }
-
- for (it = mPlaybackFilterIds.begin(); it != mPlaybackFilterIds.end(); it++) {
- if (!mDvrPlayback->addPlaybackFilter(*it, mFilters[*it])) {
- ALOGE("[Demux] Can't get filter info for DVR playback");
- mDvrPlayback = nullptr;
- *_aidl_return = mDvrPlayback;
- return ::ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(Result::UNKNOWN_ERROR));
- }
- }
-
- *_aidl_return = mDvrPlayback;
- return ::ndk::ScopedAStatus::ok();
- case DvrType::RECORD:
- mDvrRecord = ndk::SharedRefBase::make<Dvr>(in_type, in_bufferSize, in_cb,
- this->ref<Demux>());
- if (!mDvrRecord->createDvrMQ()) {
- mDvrRecord = nullptr;
- *_aidl_return = mDvrRecord;
- return ::ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(Result::UNKNOWN_ERROR));
- }
-
- *_aidl_return = mDvrRecord;
- return ::ndk::ScopedAStatus::ok();
- default:
- *_aidl_return = nullptr;
- return ::ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(Result::INVALID_ARGUMENT));
- }
-}
-
::ndk::ScopedAStatus Demux::connectCiCam(int32_t in_ciCamId) {
ALOGV("%s", __FUNCTION__);
diff --git a/tv/tuner/aidl/default/Demux.h b/tv/tuner/aidl/default/Demux.h
index 7d7aee4..ad7b7a7 100644
--- a/tv/tuner/aidl/default/Demux.h
+++ b/tv/tuner/aidl/default/Demux.h
@@ -17,6 +17,7 @@
#pragma once
#include <aidl/android/hardware/tv/tuner/BnDemux.h>
+#include <aidl/android/hardware/tv/tuner/BnDvrCallback.h>
#include <fmq/AidlMessageQueue.h>
#include <math.h>
@@ -28,7 +29,9 @@
#include "Filter.h"
#include "Frontend.h"
#include "TimeFilter.h"
+#include "Timer.h"
#include "Tuner.h"
+#include "dtv_plugin.h"
using namespace std;
@@ -44,6 +47,8 @@
using ::android::hardware::EventFlag;
using FilterMQ = AidlMessageQueue<int8_t, SynchronizedReadWrite>;
+using AidlMQ = AidlMessageQueue<int8_t, SynchronizedReadWrite>;
+using AidlMQDesc = MQDescriptor<int8_t, SynchronizedReadWrite>;
class Dvr;
class Filter;
@@ -51,6 +56,19 @@
class TimeFilter;
class Tuner;
+class DvrPlaybackCallback : public BnDvrCallback {
+ public:
+ virtual ::ndk::ScopedAStatus onPlaybackStatus(PlaybackStatus status) override {
+ ALOGD("demux.h: playback status %d", status);
+ return ndk::ScopedAStatus::ok();
+ }
+
+ virtual ::ndk::ScopedAStatus onRecordStatus(RecordStatus status) override {
+ ALOGD("Record Status %hhd", status);
+ return ndk::ScopedAStatus::ok();
+ }
+};
+
class Demux : public BnDemux {
public:
Demux(int32_t demuxId, uint32_t filterTypes);
@@ -85,6 +103,8 @@
void setIsRecording(bool isRecording);
bool isRecording();
void startFrontendInputLoop();
+ void readIptvThreadLoop(dtv_plugin* interface, dtv_streamer* streamer, size_t size,
+ int timeout_ms, int buffer_timeout);
/**
* A dispatcher to read and dispatch input data to all the started filters.
@@ -104,6 +124,11 @@
void setInUse(bool inUse);
void setTunerService(std::shared_ptr<Tuner> tuner);
+ /**
+ * Setter for IPTV Reading thread
+ */
+ void setIptvThreadRunning(bool isIptvThreadRunning);
+
private:
// Tuner service
std::shared_ptr<Tuner> mTuner;
@@ -167,6 +192,10 @@
// Thread handlers
std::thread mFrontendInputThread;
+ std::thread mDemuxIptvReadThread;
+
+ // track whether the DVR FMQ for IPTV Playback is full
+ bool mIsIptvDvrFMQFull = false;
/**
* If a specific filter's writing loop is still running
@@ -175,6 +204,13 @@
std::atomic<bool> mKeepFetchingDataFromFrontend;
/**
+ * Controls IPTV reading thread status
+ */
+ bool mIsIptvReadThreadRunning;
+ std::mutex mIsIptvThreadRunningMutex;
+ std::condition_variable mIsIptvThreadRunningCv;
+
+ /**
* If the dvr recording is running.
*/
bool mIsRecording = false;
diff --git a/tv/tuner/aidl/default/Dvr.cpp b/tv/tuner/aidl/default/Dvr.cpp
index c046ae3..393200c 100644
--- a/tv/tuner/aidl/default/Dvr.cpp
+++ b/tv/tuner/aidl/default/Dvr.cpp
@@ -236,6 +236,25 @@
ALOGD("[Dvr] playback thread ended.");
}
+void Dvr::maySendIptvPlaybackStatusCallback() {
+ lock_guard<mutex> lock(mPlaybackStatusLock);
+ int availableToRead = mDvrMQ->availableToRead();
+ int availableToWrite = mDvrMQ->availableToWrite();
+
+ PlaybackStatus newStatus = checkPlaybackStatusChange(availableToWrite, availableToRead,
+ IPTV_PLAYBACK_STATUS_THRESHOLD_HIGH,
+ IPTV_PLAYBACK_STATUS_THRESHOLD_LOW);
+ if (mPlaybackStatus != newStatus) {
+ map<int64_t, std::shared_ptr<Filter>>::iterator it;
+ for (it = mFilters.begin(); it != mFilters.end(); it++) {
+ std::shared_ptr<Filter> currentFilter = it->second;
+ currentFilter->setIptvDvrPlaybackStatus(newStatus);
+ }
+ mCallback->onPlaybackStatus(newStatus);
+ mPlaybackStatus = newStatus;
+ }
+}
+
void Dvr::maySendPlaybackStatusCallback() {
lock_guard<mutex> lock(mPlaybackStatusLock);
int availableToRead = mDvrMQ->availableToRead();
@@ -379,7 +398,7 @@
// Read es raw data from the FMQ per meta data built previously
vector<int8_t> frameData;
- map<int64_t, std::shared_ptr<IFilter>>::iterator it;
+ map<int64_t, std::shared_ptr<Filter>>::iterator it;
int pid = 0;
for (int i = 0; i < totalFrames; i++) {
frameData.resize(esMeta[i].len);
@@ -411,7 +430,7 @@
}
void Dvr::startTpidFilter(vector<int8_t> data) {
- map<int64_t, std::shared_ptr<IFilter>>::iterator it;
+ map<int64_t, std::shared_ptr<Filter>>::iterator it;
for (it = mFilters.begin(); it != mFilters.end(); it++) {
uint16_t pid = ((data[1] & 0x1f) << 8) | ((data[2] & 0xff));
if (DEBUG_DVR) {
@@ -432,7 +451,7 @@
}
}
- map<int64_t, std::shared_ptr<IFilter>>::iterator it;
+ map<int64_t, std::shared_ptr<Filter>>::iterator it;
// Handle the output data per filter type
for (it = mFilters.begin(); it != mFilters.end(); it++) {
if (!mDemux->startFilterHandler(it->first).isOk()) {
@@ -443,6 +462,24 @@
return true;
}
+int Dvr::writePlaybackFMQ(void* buf, size_t size) {
+ lock_guard<mutex> lock(mWriteLock);
+ ALOGI("Playback status: %d", mPlaybackStatus);
+ if (mPlaybackStatus == PlaybackStatus::SPACE_FULL) {
+ ALOGW("[Dvr] stops writing and wait for the client side flushing.");
+ return DVR_WRITE_FAILURE_REASON_FMQ_FULL;
+ }
+ ALOGI("availableToWrite before: %zu", mDvrMQ->availableToWrite());
+ if (mDvrMQ->write((int8_t*)buf, size)) {
+ mDvrEventFlag->wake(static_cast<uint32_t>(DemuxQueueNotifyBits::DATA_READY));
+ ALOGI("availableToWrite: %zu", mDvrMQ->availableToWrite());
+ maySendIptvPlaybackStatusCallback();
+ return DVR_WRITE_SUCCESS;
+ }
+ maySendIptvPlaybackStatusCallback();
+ return DVR_WRITE_FAILURE_REASON_UNKNOWN;
+}
+
bool Dvr::writeRecordFMQ(const vector<int8_t>& data) {
lock_guard<mutex> lock(mWriteLock);
if (mRecordStatus == RecordStatus::OVERFLOW) {
@@ -486,7 +523,7 @@
return mRecordStatus;
}
-bool Dvr::addPlaybackFilter(int64_t filterId, std::shared_ptr<IFilter> filter) {
+bool Dvr::addPlaybackFilter(int64_t filterId, std::shared_ptr<Filter> filter) {
mFilters[filterId] = filter;
return true;
}
diff --git a/tv/tuner/aidl/default/Dvr.h b/tv/tuner/aidl/default/Dvr.h
index 293c533..07f95ad 100644
--- a/tv/tuner/aidl/default/Dvr.h
+++ b/tv/tuner/aidl/default/Dvr.h
@@ -43,6 +43,19 @@
using DvrMQ = AidlMessageQueue<int8_t, SynchronizedReadWrite>;
+const int DVR_WRITE_SUCCESS = 0;
+const int DVR_WRITE_FAILURE_REASON_FMQ_FULL = 1;
+const int DVR_WRITE_FAILURE_REASON_UNKNOWN = 2;
+
+const int TS_SIZE = 188;
+const int IPTV_BUFFER_SIZE = TS_SIZE * 7 * 8; // defined in service_streamer_udp in cbs v3 project
+
+// Thresholds are defined to indicate how full the buffers are.
+const double HIGH_THRESHOLD_PERCENT = 0.90;
+const double LOW_THRESHOLD_PERCENT = 0.15;
+const int IPTV_PLAYBACK_STATUS_THRESHOLD_HIGH = IPTV_BUFFER_SIZE * HIGH_THRESHOLD_PERCENT;
+const int IPTV_PLAYBACK_STATUS_THRESHOLD_LOW = IPTV_BUFFER_SIZE * LOW_THRESHOLD_PERCENT;
+
struct MediaEsMetaData {
bool isAudio;
int startIndex;
@@ -80,8 +93,9 @@
* Return false is any of the above processes fails.
*/
bool createDvrMQ();
+ int writePlaybackFMQ(void* buf, size_t size);
bool writeRecordFMQ(const std::vector<int8_t>& data);
- bool addPlaybackFilter(int64_t filterId, std::shared_ptr<IFilter> filter);
+ bool addPlaybackFilter(int64_t filterId, std::shared_ptr<Filter> filter);
bool removePlaybackFilter(int64_t filterId);
bool readPlaybackFMQ(bool isVirtualFrontend, bool isRecording);
bool processEsDataOnPlayback(bool isVirtualFrontend, bool isRecording);
@@ -96,12 +110,13 @@
DvrType mType;
uint32_t mBufferSize;
std::shared_ptr<IDvrCallback> mCallback;
- std::map<int64_t, std::shared_ptr<IFilter>> mFilters;
+ std::map<int64_t, std::shared_ptr<Filter>> mFilters;
void deleteEventFlag();
bool readDataFromMQ();
void getMetaDataValue(int& index, int8_t* dataOutputBuffer, int& value);
void maySendPlaybackStatusCallback();
+ void maySendIptvPlaybackStatusCallback();
void maySendRecordStatusCallback();
PlaybackStatus checkPlaybackStatusChange(uint32_t availableToWrite, uint32_t availableToRead,
int64_t highThreshold, int64_t lowThreshold);
diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp
index ba9602e..212d329 100644
--- a/tv/tuner/aidl/default/Filter.cpp
+++ b/tv/tuner/aidl/default/Filter.cpp
@@ -326,6 +326,10 @@
ALOGV("%s", __FUNCTION__);
mFilterThreadRunning = true;
std::vector<DemuxFilterEvent> events;
+
+ mFilterCount += 1;
+ mDemux->setIptvThreadRunning(true);
+
// All the filter event callbacks in start are for testing purpose.
switch (mType.mainType) {
case DemuxFilterMainType::TS:
@@ -362,6 +366,11 @@
::ndk::ScopedAStatus Filter::stop() {
ALOGV("%s", __FUNCTION__);
+ mFilterCount -= 1;
+ if (mFilterCount == 0) {
+ mDemux->setIptvThreadRunning(false);
+ }
+
mFilterThreadRunning = false;
if (mFilterThread.joinable()) {
mFilterThread.join();
@@ -565,6 +574,8 @@
ALOGD("[Filter] filter %" PRIu64 " threadLoop start.", mFilterId);
+ ALOGI("IPTV DVR Playback status on Filter: %d", mIptvDvrPlaybackStatus);
+
// For the first time of filter output, implementation needs to send the filter
// Event Callback without waiting for the DATA_CONSUMED to init the process.
while (mFilterThreadRunning) {
diff --git a/tv/tuner/aidl/default/Filter.h b/tv/tuner/aidl/default/Filter.h
index 0985296..e2a0c7a 100644
--- a/tv/tuner/aidl/default/Filter.h
+++ b/tv/tuner/aidl/default/Filter.h
@@ -147,6 +147,7 @@
bool isMediaFilter() { return mIsMediaFilter; };
bool isPcrFilter() { return mIsPcrFilter; };
bool isRecordFilter() { return mIsRecordFilter; };
+ void setIptvDvrPlaybackStatus(PlaybackStatus newStatus) { mIptvDvrPlaybackStatus = newStatus; };
private:
// Demux service
@@ -286,6 +287,9 @@
int mStartId = 0;
uint8_t mScramblingStatusMonitored = 0;
uint8_t mIpCidMonitored = 0;
+
+ PlaybackStatus mIptvDvrPlaybackStatus;
+ std::atomic<int> mFilterCount = 0;
};
} // namespace tuner
diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp
index cd072bf..57ed1ba 100644
--- a/tv/tuner/aidl/default/Frontend.cpp
+++ b/tv/tuner/aidl/default/Frontend.cpp
@@ -34,6 +34,8 @@
mTuner = nullptr;
// Init callback to nullptr
mCallback = nullptr;
+ mIptvPluginInterface = nullptr;
+ mIptvPluginStreamer = nullptr;
switch (mType) {
case FrontendType::ISDBS: {
@@ -213,20 +215,82 @@
return ::ndk::ScopedAStatus::ok();
}
-::ndk::ScopedAStatus Frontend::tune(const FrontendSettings& /* in_settings */) {
- ALOGV("%s", __FUNCTION__);
+void Frontend::readTuneByte(dtv_streamer* streamer, void* buf, size_t buf_size, int timeout_ms) {
+ ssize_t bytes_read = mIptvPluginInterface->read_stream(streamer, buf, buf_size, timeout_ms);
+ if (bytes_read <= 0) {
+ ALOGI("[ ERROR ] Tune byte couldn't be read.");
+ return;
+ }
+ mCallback->onEvent(FrontendEventType::LOCKED);
+ mIsLocked = true;
+}
+
+::ndk::ScopedAStatus Frontend::tune(const FrontendSettings& in_settings) {
if (mCallback == nullptr) {
- ALOGW("[ WARN ] Frontend callback is not set when tune");
+ ALOGW("[ WARN ] Frontend callback is not set for tunin0g");
return ::ndk::ScopedAStatus::fromServiceSpecificError(
static_cast<int32_t>(Result::INVALID_STATE));
}
if (mType != FrontendType::IPTV) {
mTuner->frontendStartTune(mId);
- }
+ mCallback->onEvent(FrontendEventType::LOCKED);
+ mIsLocked = true;
+ } else {
+ // This is a reference implementation for IPTV. It uses an additional socket buffer.
+ // Vendors can use hardware memory directly to make the implementation more performant.
+ ALOGI("[ INFO ] Frontend type is set to IPTV, tag = %d id=%d", in_settings.getTag(),
+ mId);
- mCallback->onEvent(FrontendEventType::LOCKED);
- mIsLocked = true;
+ // load udp plugin for reading TS data
+ const char* path = "/vendor/lib/iptv_udp_plugin.so";
+ DtvPlugin* plugin = new DtvPlugin(path);
+ if (!plugin) {
+ ALOGE("Failed to create DtvPlugin, plugin_path is invalid");
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::INVALID_ARGUMENT));
+ }
+ bool plugin_loaded = plugin->load();
+ if (!plugin_loaded) {
+ ALOGE("Failed to load plugin");
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::INVALID_ARGUMENT));
+ }
+ mIptvPluginInterface = plugin->interface();
+
+ // validate content_url format
+ std::string content_url = in_settings.get<FrontendSettings::Tag::iptv>()->contentUrl;
+ std::string transport_desc = "{ \"uri\": \"" + content_url + "\"}";
+ ALOGI("[ INFO ] transport_desc: %s", transport_desc.c_str());
+ bool is_transport_desc_valid = plugin->validate(transport_desc.c_str());
+ if (!is_transport_desc_valid) { // not of format protocol://ip:port
+ ALOGE("[ INFO ] transport_desc is not valid");
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::INVALID_ARGUMENT));
+ }
+ mIptvTransportDescription = transport_desc;
+
+ // create a streamer and open it for reading data
+ dtv_streamer* streamer = mIptvPluginInterface->create_streamer();
+ mIptvPluginStreamer = streamer;
+ int open_fd = mIptvPluginInterface->open_stream(streamer, transport_desc.c_str());
+ if (open_fd < 0) {
+ ALOGE("[ INFO ] could not open stream");
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::INVALID_ARGUMENT));
+ }
+ ALOGI("[ INFO ] open_stream successful, open_fd=%d", open_fd);
+
+ size_t buf_size = 1;
+ int timeout_ms = 2000;
+ void* buf = malloc(sizeof(char) * buf_size);
+ if (buf == nullptr) ALOGI("malloc buf failed [TUNE]");
+ ALOGI("[ INFO ] [Tune] Allocated buffer of size %zu", buf_size);
+ mIptvFrontendTuneThread =
+ std::thread(&Frontend::readTuneByte, this, streamer, buf, buf_size, timeout_ms);
+ if (mIptvFrontendTuneThread.joinable()) mIptvFrontendTuneThread.join();
+ free(buf);
+ }
return ::ndk::ScopedAStatus::ok();
}
@@ -1002,6 +1066,18 @@
return mId;
}
+dtv_plugin* Frontend::getIptvPluginInterface() {
+ return mIptvPluginInterface;
+}
+
+string Frontend::getIptvTransportDescription() {
+ return mIptvTransportDescription;
+}
+
+dtv_streamer* Frontend::getIptvPluginStreamer() {
+ return mIptvPluginStreamer;
+}
+
bool Frontend::supportsSatellite() {
return mType == FrontendType::DVBS || mType == FrontendType::ISDBS ||
mType == FrontendType::ISDBS3;
diff --git a/tv/tuner/aidl/default/Frontend.h b/tv/tuner/aidl/default/Frontend.h
index 85bd636..17a1aee 100644
--- a/tv/tuner/aidl/default/Frontend.h
+++ b/tv/tuner/aidl/default/Frontend.h
@@ -21,6 +21,7 @@
#include <iostream>
#include <thread>
#include "Tuner.h"
+#include "dtv_plugin.h"
using namespace std;
@@ -60,6 +61,10 @@
FrontendType getFrontendType();
int32_t getFrontendId();
string getSourceFile();
+ dtv_plugin* getIptvPluginInterface();
+ string getIptvTransportDescription();
+ dtv_streamer* getIptvPluginStreamer();
+ void readTuneByte(dtv_streamer* streamer, void* buf, size_t size, int timeout_ms);
bool isLocked();
void getFrontendInfo(FrontendInfo* _aidl_return);
void setTunerService(std::shared_ptr<Tuner> tuner);
@@ -81,6 +86,10 @@
std::ifstream mFrontendData;
FrontendCapabilities mFrontendCaps;
vector<FrontendStatusType> mFrontendStatusCaps;
+ dtv_plugin* mIptvPluginInterface;
+ string mIptvTransportDescription;
+ dtv_streamer* mIptvPluginStreamer;
+ std::thread mIptvFrontendTuneThread;
};
} // namespace tuner
diff --git a/tv/tuner/aidl/default/Timer.h b/tv/tuner/aidl/default/Timer.h
new file mode 100644
index 0000000..c6327cb
--- /dev/null
+++ b/tv/tuner/aidl/default/Timer.h
@@ -0,0 +1,17 @@
+#include <chrono>
+using namespace std::chrono;
+class Timer {
+ public:
+ Timer() { start_time = steady_clock::now(); }
+
+ ~Timer() { stop_time = steady_clock::now(); }
+
+ double get_elapsed_time_ms() {
+ auto current_time = std::chrono::steady_clock::now();
+ return duration_cast<milliseconds>(current_time - start_time).count();
+ }
+
+ private:
+ time_point<steady_clock> start_time;
+ time_point<steady_clock> stop_time;
+};
\ No newline at end of file
diff --git a/tv/tuner/aidl/default/dtv_plugin.cpp b/tv/tuner/aidl/default/dtv_plugin.cpp
new file mode 100644
index 0000000..4e73ee5
--- /dev/null
+++ b/tv/tuner/aidl/default/dtv_plugin.cpp
@@ -0,0 +1,130 @@
+#include "dtv_plugin.h"
+#include <dlfcn.h>
+#include <libgen.h>
+#include <utils/Log.h>
+
+DtvPlugin::DtvPlugin(const char* plugin_path) {
+ path_ = plugin_path;
+ basename_ = basename(path_);
+ module_ = NULL;
+ interface_ = NULL;
+ loaded_ = false;
+}
+
+DtvPlugin::~DtvPlugin() {
+ if (module_ != NULL) {
+ if (dlclose(module_)) ALOGE("DtvPlugin: Failed to close plugin '%s'", basename_);
+ }
+}
+
+bool DtvPlugin::load() {
+ ALOGI("Loading plugin '%s' from path '%s'", basename_, path_);
+
+ module_ = dlopen(path_, RTLD_LAZY);
+ if (module_ == NULL) {
+ ALOGE("DtvPlugin::Load::Failed to load plugin '%s'", basename_);
+ ALOGE("dlopen error: %s", dlerror());
+ return false;
+ }
+
+ interface_ = (dtv_plugin*)dlsym(module_, "plugin_entry");
+
+ if (interface_ == NULL) {
+ ALOGE("plugin_entry is NULL.");
+ goto error;
+ }
+
+ if (!interface_->get_transport_types || !interface_->get_streamer_count ||
+ !interface_->validate || !interface_->create_streamer || !interface_->destroy_streamer ||
+ !interface_->open_stream || !interface_->close_stream || !interface_->read_stream) {
+ ALOGW("Plugin: missing one or more callbacks");
+ goto error;
+ }
+
+ loaded_ = true;
+
+ return true;
+
+error:
+ if (dlclose(module_)) ALOGE("Failed to close plugin '%s'", basename_);
+
+ return false;
+}
+
+int DtvPlugin::getStreamerCount() {
+ if (!loaded_) {
+ ALOGE("DtvPlugin::GetStreamerCount: Plugin '%s' not loaded!", basename_);
+ return 0;
+ }
+
+ return interface_->get_streamer_count();
+}
+
+bool DtvPlugin::isTransportTypeSupported(const char* transport_type) {
+ const char** transport;
+
+ if (!loaded_) {
+ ALOGE("Plugin '%s' not loaded!", basename_);
+ return false;
+ }
+
+ transport = interface_->get_transport_types();
+ if (transport == NULL) return false;
+
+ while (*transport) {
+ if (strcmp(transport_type, *transport) == 0) return true;
+ transport++;
+ }
+
+ return false;
+}
+
+bool DtvPlugin::validate(const char* transport_desc) {
+ if (!loaded_) {
+ ALOGE("Plugin '%s' is not loaded!", basename_);
+ return false;
+ }
+
+ return interface_->validate(transport_desc);
+}
+
+bool DtvPlugin::getProperty(const char* key, void* value, int* size) {
+ if (!loaded_) {
+ ALOGE("Plugin '%s' is not loaded!", basename_);
+ return false;
+ }
+
+ if (!interface_->get_property) return false;
+
+ *size = interface_->get_property(NULL, key, value, *size);
+
+ return *size < 0 ? false : true;
+}
+
+bool DtvPlugin::setProperty(const char* key, const void* value, int size) {
+ int ret;
+
+ if (!loaded_) {
+ ALOGE("Plugin '%s': not loaded!", basename_);
+ return false;
+ }
+
+ if (!interface_->set_property) return false;
+
+ ret = interface_->set_property(NULL, key, value, size);
+
+ return ret < 0 ? false : true;
+}
+
+struct dtv_plugin* DtvPlugin::interface() {
+ if (!loaded_) {
+ ALOGE("Plugin '%s' is not loaded!", basename_);
+ return NULL;
+ }
+
+ return interface_;
+}
+
+const char* DtvPlugin::pluginBasename() {
+ return basename_;
+}
diff --git a/tv/tuner/aidl/default/dtv_plugin.h b/tv/tuner/aidl/default/dtv_plugin.h
new file mode 100644
index 0000000..0ee5489
--- /dev/null
+++ b/tv/tuner/aidl/default/dtv_plugin.h
@@ -0,0 +1,31 @@
+#ifndef LIVE_DTV_PLUGIN_H_
+#define LIVE_DTV_PLUGIN_H_
+
+#include <fstream>
+#include "dtv_plugin_api.h"
+
+class DtvPlugin {
+ public:
+ DtvPlugin(const char* plugin_path);
+ ~DtvPlugin();
+
+ bool load();
+ int getStreamerCount();
+ bool validate(const char* transport_desc);
+ bool isTransportTypeSupported(const char* transport_type);
+ // /* plugin-wide properties */
+ bool getProperty(const char* key, void* value, int* size);
+ bool setProperty(const char* key, const void* value, int size);
+
+ struct dtv_plugin* interface();
+ const char* pluginBasename();
+
+ protected:
+ const char* path_;
+ char* basename_;
+ void* module_;
+ struct dtv_plugin* interface_;
+ bool loaded_;
+};
+
+#endif // LIVE_DTV_PLUGIN_H_
diff --git a/tv/tuner/aidl/default/dtv_plugin_api.h b/tv/tuner/aidl/default/dtv_plugin_api.h
new file mode 100644
index 0000000..8fe7c1d
--- /dev/null
+++ b/tv/tuner/aidl/default/dtv_plugin_api.h
@@ -0,0 +1,137 @@
+#ifndef LIVE_DTV_PLUGIN_API_H_
+#define LIVE_DTV_PLUGIN_API_H_
+
+#include <stdint.h>
+
+struct dtv_streamer;
+
+struct dtv_plugin {
+ uint32_t version;
+
+ /**
+ * get_transport_types() - Retrieve a list of supported transport types.
+ *
+ * Return: A NULL-terminated list of supported transport types.
+ */
+ const char** (*get_transport_types)(void);
+
+ /**
+ * get_streamer_count() - Get number of streamers that can be created.
+ *
+ * Return: The number of streamers that can be created.
+ */
+ int (*get_streamer_count)(void);
+
+ /**
+ * validate() - Check if transport description is valid.
+ * @transport_desc: NULL-terminated transport description in json format.
+ *
+ * Return: 1 if valid, 0 otherwise.
+ */
+ int (*validate)(const char* transport_desc);
+
+ /**
+ * create_streamer() - Create a streamer object.
+ *
+ * Return: A pointer to a new streamer object.
+ */
+ struct dtv_streamer* (*create_streamer)(void);
+
+ /**
+ * destroy_streamer() - Free a streamer object and all associated resources.
+ * @st: Pointer to a streamer object
+ */
+ void (*destroy_streamer)(struct dtv_streamer* streamer);
+
+ /**
+ * set_property() - Set a key/value pair property.
+ * @streamer: Pointer to a streamer object (may be NULL for plugin-wide properties).
+ * @key: NULL-terminated property name.
+ * @value: Property value.
+ * @size: Property value size.
+ *
+ * Return: 0 if success, -1 otherwise.
+ */
+ int (*set_property)(struct dtv_streamer* streamer, const char* key, const void* value,
+ size_t size);
+
+ /**
+ * get_property() - Get a property's value.
+ * @streamer: Pointer to a streamer (may be NULL for plugin-wide properties).
+ * @key: NULL-terminated property name.
+ * @value: Property value.
+ * @size: Property value size.
+ *
+ * Return: >= 0 if success, -1 otherwise.
+ *
+ * If size is 0, get_property will return the size needed to hold the value.
+ */
+ int (*get_property)(struct dtv_streamer* streamer, const char* key, void* value, size_t size);
+
+ /**
+ * add_pid() - Add a TS filter on a given pid.
+ * @streamer: The streamer that outputs the TS.
+ * @pid: The pid to add to the TS output.
+ *
+ * Return: 0 if success, -1 otherwise.
+ *
+ * This function is optional but can be useful if a hardware remux is
+ * available.
+ */
+ int (*add_pid)(struct dtv_streamer* streamer, int pid);
+
+ /**
+ * remove_pid() - Remove a TS filter on a given pid.
+ * @streamer: The streamer that outputs the TS.
+ * @pid: The pid to remove from the TS output.
+ *
+ * Return: 0 if success, -1 otherwise.
+ *
+ * This function is optional.
+ */
+ int (*remove_pid)(struct dtv_streamer* streamer, int pid);
+
+ /**
+ * open_stream() - Open a stream from a transport description.
+ * @streamer: The streamer which will handle the stream.
+ * @transport_desc: NULL-terminated transport description in json format.
+ *
+ * The streamer will allocate the resources and make the appropriate
+ * connections to handle this transport.
+ * This function returns a file descriptor that can be polled for events.
+ *
+ * Return: A file descriptor if success, -1 otherwise.
+ */
+ int (*open_stream)(struct dtv_streamer* streamer, const char* transport_desc);
+
+ /**
+ * close_stream() - Release an open stream.
+ * @streamer: The streamer from which the stream should be released.
+ */
+ void (*close_stream)(struct dtv_streamer* streamer);
+
+ /**
+ * read_stream() - Read stream data.
+ * @streamer: The streamer to read from.
+ * @buf: The destination buffer.
+ * @count: The number of bytes to read.
+ * @timeout_ms: Timeout in ms.
+ *
+ * Return: The number of bytes read, -1 if error.
+ */
+ ssize_t (*read_stream)(struct dtv_streamer* streamer, void* buf, size_t count, int timeout_ms);
+};
+
+struct dtv_plugin_event {
+ int id;
+ char data[0];
+};
+
+enum {
+ DTV_PLUGIN_EVENT_SIGNAL_LOST = 1,
+ DTV_PLUGIN_EVENT_SIGNAL_READY,
+};
+
+#define PROPERTY_STATISTICS "statistics"
+
+#endif // LIVE_DTV_PLUGIN_API_H_
diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
index b0f614e..e28e6fd 100644
--- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp
+++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
@@ -353,8 +353,7 @@
break;
}
case FrontendStatusType::UEC: {
- ASSERT_TRUE(realStatuses[i].get<FrontendStatus::Tag::uec>() ==
- expectStatuses[i].get<FrontendStatus::Tag::uec>());
+ ASSERT_TRUE(realStatuses[i].get<FrontendStatus::Tag::uec>() >= 0);
break;
}
case FrontendStatusType::T2_SYSTEM_ID: {
diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h
index 8ad6ee0..491a79b 100644
--- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h
+++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.h
@@ -17,6 +17,7 @@
#pragma once
#include <android/binder_manager.h>
+#include <cutils/properties.h>
#include "DemuxTests.h"
#include "DescramblerTests.h"
@@ -29,6 +30,17 @@
namespace {
bool initConfiguration() {
+ std::array<char, PROPERTY_VALUE_MAX> variant;
+ auto res = property_get("ro.vendor.vts_tuner_configuration_variant", variant.data(), "");
+ if (res <= 0) {
+ ALOGE("[vts] failed to read system property ro.vendor.vts_tuner_configuration_variant");
+ return false;
+ }
+ string configFilePath = "/vendor/etc/tuner_vts_config_aidl_V1";
+ if (variant.size() != 0) {
+ configFilePath = configFilePath + "." + variant.data();
+ }
+ configFilePath = configFilePath + ".xml";
TunerTestingConfigAidlReader1_0::setConfigFilePath(configFilePath);
if (!TunerTestingConfigAidlReader1_0::checkConfigFileExists()) {
return false;
diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h
index ff94639..29d2f18 100644
--- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h
+++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTestConfigurations.h
@@ -52,8 +52,6 @@
const int32_t FMQ_SIZE_4M = 0x400000;
const int32_t FMQ_SIZE_16M = 0x1000000;
-const string configFilePath = "/vendor/etc/tuner_vts_config_aidl_V1.xml";
-
#define FILTER_MAIN_TYPE_BIT_COUNT 5
#define STATUS_CHECK_INTERVAL_MS 100L
diff --git a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
index 5ffb38f..45d8ee6 100644
--- a/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
+++ b/tv/tuner/config/TunerTestingConfigAidlReaderV1_0.h
@@ -273,16 +273,10 @@
vector<FrontendStatusType> types;
vector<FrontendStatus> statuses;
- types.push_back(FrontendStatusType::DEMOD_LOCK);
types.push_back(FrontendStatusType::UEC);
- types.push_back(FrontendStatusType::IS_MISO);
FrontendStatus status;
- status.set<FrontendStatus::Tag::isDemodLocked>(true);
- statuses.push_back(status);
- status.set<FrontendStatus::Tag::uec>(4);
- statuses.push_back(status);
- status.set<FrontendStatus::Tag::isMiso>(true);
+ status.set<FrontendStatus::Tag::uec>(0);
statuses.push_back(status);
auto frontends = *hardwareConfig.getFirstFrontends();
diff --git a/usb/aidl/Android.bp b/usb/aidl/Android.bp
index b82f6d5..b61576d 100644
--- a/usb/aidl/Android.bp
+++ b/usb/aidl/Android.bp
@@ -45,6 +45,6 @@
},
],
- frozen: true,
+ frozen: false,
}
diff --git a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ComplianceWarning.aidl b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ComplianceWarning.aidl
index 8b67070..c7c9103 100644
--- a/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ComplianceWarning.aidl
+++ b/usb/aidl/aidl_api/android.hardware.usb/current/android/hardware/usb/ComplianceWarning.aidl
@@ -38,4 +38,9 @@
DEBUG_ACCESSORY = 2,
BC_1_2 = 3,
MISSING_RP = 4,
+ INPUT_POWER_LIMITED = 5,
+ MISSING_DATA_LINES = 6,
+ ENUMERATION_FAIL = 7,
+ FLAKY_CONNECTION = 8,
+ UNRELIABLE_IO = 9,
}
diff --git a/usb/aidl/android/hardware/usb/ComplianceWarning.aidl b/usb/aidl/android/hardware/usb/ComplianceWarning.aidl
index 4c18a31..bf79399 100644
--- a/usb/aidl/android/hardware/usb/ComplianceWarning.aidl
+++ b/usb/aidl/android/hardware/usb/ComplianceWarning.aidl
@@ -56,4 +56,29 @@
* Type-C Cable and Connector Specification.
*/
MISSING_RP = 4,
+ /**
+ * Used to indicate the charging setups on the USB ports are unable to
+ * deliver negotiated power.
+ */
+ INPUT_POWER_LIMITED = 5,
+ /**
+ * Used to indicate the cable/connector on the USB ports are missing
+ * the required wires on the data pins to make data transfer.
+ */
+ MISSING_DATA_LINES = 6,
+ /**
+ * Used to indicate enumeration failures on the USB ports, potentially due to
+ * signal integrity issues or other causes.
+ */
+ ENUMERATION_FAIL = 7,
+ /**
+ * Used to indicate unexpected data disconnection on the USB ports,
+ * potentially due to signal integrity issues or other causes.
+ */
+ FLAKY_CONNECTION = 8,
+ /**
+ * Used to indicate unreliable or slow data transfer on the USB ports,
+ * potentially due to signal integrity issues or other causes.
+ */
+ UNRELIABLE_IO = 9,
}
diff --git a/usb/aidl/default/Android.bp b/usb/aidl/default/Android.bp
index 2c6ed07..ee8e479 100644
--- a/usb/aidl/default/Android.bp
+++ b/usb/aidl/default/Android.bp
@@ -34,7 +34,7 @@
"Usb.cpp",
],
shared_libs: [
- "android.hardware.usb-V2-ndk",
+ "android.hardware.usb-V3-ndk",
"libbase",
"libbinder_ndk",
"libcutils",
diff --git a/usb/aidl/default/android.hardware.usb-service.example.xml b/usb/aidl/default/android.hardware.usb-service.example.xml
index c3f07f5..7ac2067 100644
--- a/usb/aidl/default/android.hardware.usb-service.example.xml
+++ b/usb/aidl/default/android.hardware.usb-service.example.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.usb</name>
- <version>2</version>
+ <version>3</version>
<interface>
<name>IUsb</name>
<instance>default</instance>
diff --git a/usb/aidl/vts/Android.bp b/usb/aidl/vts/Android.bp
index d0e0eec..cf9299e 100644
--- a/usb/aidl/vts/Android.bp
+++ b/usb/aidl/vts/Android.bp
@@ -34,7 +34,7 @@
"libbinder_ndk",
],
static_libs: [
- "android.hardware.usb-V2-ndk",
+ "android.hardware.usb-V3-ndk",
],
test_suites: [
"general-tests",
diff --git a/usb/aidl/vts/VtsAidlUsbTargetTest.cpp b/usb/aidl/vts/VtsAidlUsbTargetTest.cpp
index e9aa65b..7b7269d 100644
--- a/usb/aidl/vts/VtsAidlUsbTargetTest.cpp
+++ b/usb/aidl/vts/VtsAidlUsbTargetTest.cpp
@@ -654,11 +654,18 @@
EXPECT_EQ(2, usb_last_cookie);
EXPECT_EQ(transactionId, last_transactionId);
- // Current compliance values range from [1, 4]
if (usb_last_port_status.supportsComplianceWarnings) {
for (auto warning : usb_last_port_status.complianceWarnings) {
EXPECT_TRUE((int)warning >= (int)ComplianceWarning::OTHER);
- EXPECT_TRUE((int)warning <= (int)ComplianceWarning::MISSING_RP);
+ /*
+ * Version 2 compliance values range from [1, 4]
+ * Version 3 compliance values range from [1, 9]
+ */
+ if (usb_version < 3) {
+ EXPECT_TRUE((int)warning <= (int)ComplianceWarning::MISSING_RP);
+ } else {
+ EXPECT_TRUE((int)warning <= (int)ComplianceWarning::UNRELIABLE_IO);
+ }
}
}
diff --git a/uwb/aidl/Android.bp b/uwb/aidl/Android.bp
index 3e71913..abd6a23 100755
--- a/uwb/aidl/Android.bp
+++ b/uwb/aidl/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_fwk_uwb",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/uwb/aidl/default/Android.bp b/uwb/aidl/default/Android.bp
index 8af1678..eba18cf 100644
--- a/uwb/aidl/default/Android.bp
+++ b/uwb/aidl/default/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_fwk_uwb",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/uwb/aidl/default/src/uwb_chip.rs b/uwb/aidl/default/src/uwb_chip.rs
index d1c3c67..878aa64 100644
--- a/uwb/aidl/default/src/uwb_chip.rs
+++ b/uwb/aidl/default/src/uwb_chip.rs
@@ -180,6 +180,8 @@
let mut reader = AsyncFd::new(reader).unwrap();
loop {
+ const MESSAGE_TYPE_MASK: u8 = 0b11100000;
+ const DATA_MESSAGE_TYPE: u8 = 0b000;
const UWB_HEADER_SIZE: usize = 4;
let mut buffer = vec![0; UWB_HEADER_SIZE];
@@ -224,12 +226,22 @@
// Read the remaining header bytes, if truncated.
read_exact(reader.get_mut(), &mut buffer[read_len..]).unwrap();
- let length = buffer[3] as usize + UWB_HEADER_SIZE;
+ let common_header = buffer[0];
+ let mt = (common_header & MESSAGE_TYPE_MASK) >> 5;
+ let payload_length = if mt == DATA_MESSAGE_TYPE {
+ let payload_length_fields: [u8; 2] = buffer[2..=3].try_into().unwrap();
+ u16::from_le_bytes(payload_length_fields) as usize
+ } else {
+ buffer[3] as usize
+ };
+
+ let length = payload_length + UWB_HEADER_SIZE;
buffer.resize(length, 0);
// Read the payload bytes.
read_exact(reader.get_mut(), &mut buffer[UWB_HEADER_SIZE..]).unwrap();
+ log::debug!(" <-- {:?}", buffer);
client_callbacks.onUciMessage(&buffer).unwrap();
}
});
@@ -284,10 +296,13 @@
log::debug!("sendUciMessage");
if let State::Opened { ref mut serial, .. } = &mut *self.state.lock().await {
- serial
- .write(data)
- .map(|written| written as i32)
- .map_err(|_| binder::StatusCode::UNKNOWN_ERROR.into())
+ log::debug!(" --> {:?}", data);
+ let result = serial
+ .write_all(data)
+ .map(|_| data.len() as i32)
+ .map_err(|_| binder::StatusCode::UNKNOWN_ERROR.into());
+ log::debug!(" status: {:?}", result);
+ result
} else {
Err(binder::ExceptionCode::ILLEGAL_STATE.into())
}
diff --git a/uwb/aidl/vts/Android.bp b/uwb/aidl/vts/Android.bp
index 4d9f653..1beaa6e 100644
--- a/uwb/aidl/vts/Android.bp
+++ b/uwb/aidl/vts/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_fwk_uwb",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/uwb/aidl/vts/VtsHalUwbTargetTest.cpp b/uwb/aidl/vts/VtsHalUwbTargetTest.cpp
index 81d26ba..548cae0 100644
--- a/uwb/aidl/vts/VtsHalUwbTargetTest.cpp
+++ b/uwb/aidl/vts/VtsHalUwbTargetTest.cpp
@@ -39,6 +39,8 @@
namespace {
constexpr static int kCallbackTimeoutMs = 250;
+// this timeout should be same as AOSP stack timeout (HAL_OPEN_TIMEOUT_MS)
+constexpr static int kOpenCallbackTimeoutMs = 20000;
} // namespace
class UwbClientCallback : public BnUwbClientCallback {
@@ -105,7 +107,7 @@
open_cb_promise.set_value();
}
});
- std::chrono::milliseconds timeout{kCallbackTimeoutMs};
+ std::chrono::milliseconds timeout{kOpenCallbackTimeoutMs};
const auto iuwb_chip = getAnyChip();
EXPECT_TRUE(iuwb_chip->open(callback).isOk());
EXPECT_EQ(open_cb_future.wait_for(timeout), std::future_status::ready);
@@ -137,7 +139,7 @@
open_cb_promise.set_value();
}
});
- std::chrono::milliseconds timeout{kCallbackTimeoutMs};
+ std::chrono::milliseconds timeout{kOpenCallbackTimeoutMs};
const auto iuwb_chip = getAnyChip();
EXPECT_TRUE(iuwb_chip->open(callback).isOk());
EXPECT_EQ(open_cb_future.wait_for(timeout), std::future_status::ready);
@@ -158,12 +160,13 @@
close_cb_promise.set_value();
}
});
- std::chrono::milliseconds timeout{kCallbackTimeoutMs};
+ std::chrono::milliseconds open_timeout{kOpenCallbackTimeoutMs};
+ std::chrono::milliseconds close_timeout{kCallbackTimeoutMs};
const auto iuwb_chip = getAnyChip();
EXPECT_TRUE(iuwb_chip->open(callback).isOk());
- EXPECT_EQ(open_cb_future.wait_for(timeout), std::future_status::ready);
+ EXPECT_EQ(open_cb_future.wait_for(open_timeout), std::future_status::ready);
EXPECT_TRUE(iuwb_chip->close().isOk());
- EXPECT_EQ(close_cb_future.wait_for(timeout), std::future_status::ready);
+ EXPECT_EQ(close_cb_future.wait_for(close_timeout), std::future_status::ready);
}
TEST_P(UwbAidl, ChipCoreInit) {
@@ -216,5 +219,12 @@
::testing::InitGoogleTest(&argc, argv);
ProcessState::self()->setThreadPoolMaxThreadCount(1);
ProcessState::self()->startThreadPool();
- return RUN_ALL_TESTS();
+ // UWB HAL only allows 1 client, make sure framework
+ // does not have UWB HAL open before running
+ std::system("/system/bin/cmd uwb disable-uwb");
+ sleep(3);
+ auto status = RUN_ALL_TESTS();
+ sleep(3);
+ std::system("/system/bin/cmd uwb enable-uwb");
+ return status;
}
diff --git a/vibrator/bench/Android.bp b/vibrator/bench/Android.bp
index 73e274f..87bdab4 100644
--- a/vibrator/bench/Android.bp
+++ b/vibrator/bench/Android.bp
@@ -14,6 +14,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_haptics_framework",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/weaver/aidl/Android.bp b/weaver/aidl/Android.bp
index 38d017f..c494d29 100644
--- a/weaver/aidl/Android.bp
+++ b/weaver/aidl/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_android_hardware_backed_security",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/weaver/aidl/default/Android.bp b/weaver/aidl/default/Android.bp
index 494cb1b..2a62b99 100644
--- a/weaver/aidl/default/Android.bp
+++ b/weaver/aidl/default/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_hardware_backed_security",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/weaver/vts/Android.bp b/weaver/vts/Android.bp
index ee03b28..4139a28 100644
--- a/weaver/vts/Android.bp
+++ b/weaver/vts/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_android_hardware_backed_security",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/aidl/Android.bp b/wifi/aidl/Android.bp
index 7bc8ae7..8b01d95 100644
--- a/wifi/aidl/Android.bp
+++ b/wifi/aidl/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -27,6 +28,9 @@
srcs: [
"android/hardware/wifi/*.aidl",
],
+ imports: [
+ "android.hardware.wifi.common-V1",
+ ],
stability: "vintf",
backend: {
java: {
@@ -42,6 +46,12 @@
enabled: false,
},
},
+ cpp: {
+ enabled: false,
+ },
+ rust: {
+ enabled: false,
+ },
},
versions_with_info: [
{
@@ -49,6 +59,5 @@
imports: [],
},
],
- frozen: true,
-
+ frozen: false,
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/CachedScanData.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/CachedScanData.aidl
new file mode 100644
index 0000000..cd4a456
--- /dev/null
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/CachedScanData.aidl
@@ -0,0 +1,39 @@
+/*
+ * 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.wifi;
+@VintfStability
+parcelable CachedScanData {
+ int[] scannedFrequenciesMhz;
+ android.hardware.wifi.CachedScanResult[] cachedScanResults;
+}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/CachedScanResult.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/CachedScanResult.aidl
new file mode 100644
index 0000000..1806b0f
--- /dev/null
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/CachedScanResult.aidl
@@ -0,0 +1,44 @@
+/*
+ * 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.wifi;
+@VintfStability
+parcelable CachedScanResult {
+ long timeStampInUs;
+ byte[] ssid;
+ byte[6] bssid;
+ int rssiDbm;
+ int frequencyMhz;
+ android.hardware.wifi.WifiChannelWidthInMhz channelWidthMhz;
+ android.hardware.wifi.WifiRatePreamble preambleType;
+}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl
index 4ea2081..5ed7517 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiChip.aidl
@@ -83,6 +83,8 @@
void triggerSubsystemRestart();
void enableStaChannelForPeerNetwork(in int channelCategoryEnableFlag);
void setMloMode(in android.hardware.wifi.IWifiChip.ChipMloMode mode);
+ @PropagateAllowBlocking android.hardware.wifi.IWifiApIface createApOrBridgedApIface(in android.hardware.wifi.IfaceConcurrencyType iface, in android.hardware.wifi.common.OuiKeyedData[] vendorData);
+ void setVoipMode(in android.hardware.wifi.IWifiChip.VoipMode mode);
const int NO_POWER_CAP_CONSTANT = 0x7FFFFFFF;
@Backing(type="int") @VintfStability
enum FeatureSetMask {
@@ -95,6 +97,7 @@
WIGIG = (1 << 6) /* 64 */,
SET_AFC_CHANNEL_ALLOWANCE = (1 << 7) /* 128 */,
T2LM_NEGOTIATION = (1 << 8) /* 256 */,
+ SET_VOIP_MODE = (1 << 9) /* 512 */,
}
@VintfStability
parcelable ChipConcurrencyCombinationLimit {
@@ -161,6 +164,11 @@
NAN_INSTANT_MODE = (1 << 2) /* 4 */,
}
@Backing(type="int") @VintfStability
+ enum VoipMode {
+ OFF = 0,
+ VOICE = 1,
+ }
+ @Backing(type="int") @VintfStability
enum ChannelCategoryMask {
INDOOR_CHANNEL = (1 << 0) /* 1 */,
DFS_CHANNEL = (1 << 1) /* 2 */,
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl
index 923deff..ccb7876 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIface.aidl
@@ -61,6 +61,14 @@
void stopRssiMonitoring(in int cmdId);
void stopSendingKeepAlivePackets(in int cmdId);
void setDtimMultiplier(in int multiplier);
+ android.hardware.wifi.CachedScanData getCachedScanData();
+ android.hardware.wifi.TwtCapabilities twtGetCapabilities();
+ void twtSessionSetup(in int cmdId, in android.hardware.wifi.TwtRequest twtRequest);
+ void twtSessionUpdate(in int cmdId, in int sessionId, in android.hardware.wifi.TwtRequest twtRequest);
+ void twtSessionSuspend(in int cmdId, in int sessionId);
+ void twtSessionResume(in int cmdId, in int sessionId);
+ void twtSessionTeardown(in int cmdId, in int sessionId);
+ void twtSessionGetStats(in int cmdId, in int sessionId);
@Backing(type="int") @VintfStability
enum FeatureSetMask {
APF = (1 << 0) /* 1 */,
@@ -77,5 +85,7 @@
TDLS_OFFCHANNEL = (1 << 11) /* 2048 */,
ND_OFFLOAD = (1 << 12) /* 4096 */,
KEEP_ALIVE = (1 << 13) /* 8192 */,
+ ROAMING_MODE_CONTROL = (1 << 14) /* 16384 */,
+ CACHED_SCAN_DATA = (1 << 15) /* 32768 */,
}
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl
index 48b85b0..629ca3d 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl
@@ -38,4 +38,31 @@
oneway void onBackgroundScanFailure(in int cmdId);
oneway void onBackgroundScanResults(in int cmdId, in android.hardware.wifi.StaScanData[] scanDatas);
oneway void onRssiThresholdBreached(in int cmdId, in byte[6] currBssid, in int currRssi);
+ oneway void onTwtFailure(in int cmdId, in android.hardware.wifi.IWifiStaIfaceEventCallback.TwtErrorCode error);
+ oneway void onTwtSessionCreate(in int cmdId, in android.hardware.wifi.TwtSession twtSession);
+ oneway void onTwtSessionUpdate(in int cmdId, in android.hardware.wifi.TwtSession twtSession);
+ oneway void onTwtSessionTeardown(in int cmdId, in int twtSessionId, in android.hardware.wifi.IWifiStaIfaceEventCallback.TwtTeardownReasonCode reasonCode);
+ oneway void onTwtSessionStats(in int cmdId, in int twtSessionId, in android.hardware.wifi.TwtSessionStats twtSessionStats);
+ oneway void onTwtSessionSuspend(in int cmdId, in int twtSessionId);
+ oneway void onTwtSessionResume(in int cmdId, in int twtSessionId);
+ @Backing(type="byte") @VintfStability
+ enum TwtErrorCode {
+ FAILURE_UNKNOWN,
+ ALREADY_RESUMED,
+ ALREADY_SUSPENDED,
+ INVALID_PARAMS,
+ MAX_SESSION_REACHED,
+ NOT_AVAILABLE,
+ NOT_SUPPORTED,
+ PEER_NOT_SUPPORTED,
+ PEER_REJECTED,
+ TIMEOUT,
+ }
+ @Backing(type="byte") @VintfStability
+ enum TwtTeardownReasonCode {
+ UNKNOWN,
+ LOCALLY_REQUESTED,
+ INTERNALLY_INITIATED,
+ PEER_INITIATED,
+ }
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl
index dd0a5ed..b5f78b0 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingRequest.aidl
@@ -38,4 +38,6 @@
byte[6] peerDiscMacAddr;
android.hardware.wifi.NanBootstrappingMethod requestBootstrappingMethod;
byte[] cookie;
+ boolean isComeback;
+ byte discoverySessionId;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponse.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponse.aidl
index 6dd9b26..7b17493 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponse.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanBootstrappingResponse.aidl
@@ -36,4 +36,5 @@
parcelable NanBootstrappingResponse {
int bootstrappingInstanceId;
boolean acceptRequest;
+ byte discoverySessionId;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanConfigRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanConfigRequest.aidl
index 5ead651..a3693d6 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanConfigRequest.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanConfigRequest.aidl
@@ -45,4 +45,5 @@
char rssiWindowSize;
int macAddressRandomizationIntervalSec;
android.hardware.wifi.NanBandSpecificConfig[3] bandSpecificConfig;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathSecurityConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathSecurityConfig.aidl
index 635dbce..48e9501 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathSecurityConfig.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanDataPathSecurityConfig.aidl
@@ -39,4 +39,10 @@
byte[32] pmk;
byte[] passphrase;
byte[16] scid;
+ boolean enable16ReplyCountersForTksa;
+ boolean enable16ReplyCountersForGtksa;
+ boolean supportGtkAndIgtk;
+ boolean supportBigtksa;
+ boolean enableNcsBip256;
+ boolean requiresEnhancedFrameProtection;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchInd.aidl
index 317489f..4acc773 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchInd.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanMatchInd.aidl
@@ -51,4 +51,5 @@
byte[] scid;
android.hardware.wifi.NanPairingConfig peerPairingConfig;
android.hardware.wifi.NanIdentityResolutionAttribute peerNira;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingConfirmInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingConfirmInd.aidl
index 8ecf22a..699ecdc 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingConfirmInd.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingConfirmInd.aidl
@@ -40,4 +40,5 @@
android.hardware.wifi.NanPairingRequestType requestType;
boolean enablePairingCache;
android.hardware.wifi.NpkSecurityAssociation npksa;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequest.aidl
index 2a644ae..121b038 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequest.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequest.aidl
@@ -40,4 +40,5 @@
boolean enablePairingCache;
byte[16] pairingIdentityKey;
android.hardware.wifi.NanPairingSecurityConfig securityConfig;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestInd.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestInd.aidl
index 66762b9..57072c0 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestInd.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPairingRequestInd.aidl
@@ -41,4 +41,5 @@
android.hardware.wifi.NanPairingRequestType requestType;
boolean enablePairingCache;
android.hardware.wifi.NanIdentityResolutionAttribute peerNira;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishRequest.aidl
index c49f5f9..bdc8357 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishRequest.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanPublishRequest.aidl
@@ -40,4 +40,5 @@
boolean autoAcceptDataPathRequests;
android.hardware.wifi.NanPairingConfig pairingConfig;
byte[16] identityKey;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl
index a58890c..da81c39 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl
@@ -40,4 +40,5 @@
boolean enablePairingCache;
byte[16] pairingIdentityKey;
android.hardware.wifi.NanPairingSecurityConfig securityConfig;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeRequest.aidl
index 96be096..bf525a9 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeRequest.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/NanSubscribeRequest.aidl
@@ -43,4 +43,5 @@
android.hardware.wifi.MacAddress[] intfAddr;
android.hardware.wifi.NanPairingConfig pairingConfig;
byte[16] identityKey;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl
index cf64687..56ef2d2 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl
@@ -42,4 +42,9 @@
android.hardware.wifi.RttPreamble preambleSupport;
android.hardware.wifi.RttBw bwSupport;
byte mcVersion;
+ android.hardware.wifi.RttPreamble azPreambleSupport;
+ android.hardware.wifi.RttBw azBwSupport;
+ boolean ntbInitiatorSupported;
+ boolean ntbResponderSupported;
+ int maxTxLtfRepetitionCount;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttConfig.aidl
index ccdf2ce..b7830bd 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttConfig.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttConfig.aidl
@@ -48,4 +48,7 @@
int burstDuration;
android.hardware.wifi.RttPreamble preamble;
android.hardware.wifi.RttBw bw;
+ int ntbMinMeasurementTimeMillis;
+ int ntbMaxMeasurementTimeMillis;
+ int txLtfRepetitionCount;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttPreamble.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttPreamble.aidl
index de26f28..2802464 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttPreamble.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttPreamble.aidl
@@ -34,6 +34,7 @@
package android.hardware.wifi;
@Backing(type="int") @VintfStability
enum RttPreamble {
+ INVALID = 0,
LEGACY = 0x1,
HT = 0x2,
VHT = 0x4,
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl
index 8375dcb..30f5f58 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl
@@ -59,4 +59,7 @@
android.hardware.wifi.WifiInformationElement lcr;
int channelFreqMHz;
android.hardware.wifi.RttBw packetBw;
+ int txLtfRepetitionCount;
+ int ntbMinMeasurementTimeMillis;
+ int ntbMaxMeasurementTimeMillis;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttType.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttType.aidl
index 2b6087a..cb25673 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttType.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttType.aidl
@@ -36,4 +36,6 @@
enum RttType {
ONE_SIDED = 1,
TWO_SIDED = 2,
+ TWO_SIDED_11MC = TWO_SIDED /* 2 */,
+ TWO_SIDED_11AZ_NTB = 3,
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaRoamingState.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaRoamingState.aidl
index 1f3d91f..fd7d567 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaRoamingState.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/StaRoamingState.aidl
@@ -36,4 +36,5 @@
enum StaRoamingState {
DISABLED = 0,
ENABLED = 1,
+ AGGRESSIVE = 2,
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtCapabilities.aidl
new file mode 100644
index 0000000..d8e73fb
--- /dev/null
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtCapabilities.aidl
@@ -0,0 +1,45 @@
+/*
+ * 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.wifi;
+@VintfStability
+parcelable TwtCapabilities {
+ boolean isTwtRequesterSupported;
+ boolean isTwtResponderSupported;
+ boolean isBroadcastTwtSupported;
+ boolean isFlexibleTwtScheduleSupported;
+ int minWakeDurationMicros;
+ int maxWakeDurationMicros;
+ int minWakeIntervalMicros;
+ int maxWakeIntervalMicros;
+}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtRequest.aidl
new file mode 100644
index 0000000..3051b94
--- /dev/null
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtRequest.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.wifi;
+@VintfStability
+parcelable TwtRequest {
+ int mloLinkId;
+ int minWakeDurationMicros;
+ int maxWakeDurationMicros;
+ int minWakeIntervalMicros;
+ int maxWakeIntervalMicros;
+}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSession.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSession.aidl
new file mode 100644
index 0000000..92c2533
--- /dev/null
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSession.aidl
@@ -0,0 +1,54 @@
+/*
+ * 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.wifi;
+@VintfStability
+parcelable TwtSession {
+ int sessionId;
+ int mloLinkId;
+ int wakeDurationMicros;
+ int wakeIntervalMicros;
+ android.hardware.wifi.TwtSession.TwtNegotiationType negotiationType;
+ boolean isTriggerEnabled;
+ boolean isAnnounced;
+ boolean isImplicit;
+ boolean isProtected;
+ boolean isUpdatable;
+ boolean isSuspendable;
+ boolean isResponderPmModeEnabled;
+ @Backing(type="byte") @VintfStability
+ enum TwtNegotiationType {
+ INDIVIDUAL = 0,
+ BROADCAST = 1,
+ }
+}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSessionStats.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSessionStats.aidl
new file mode 100644
index 0000000..528444a
--- /dev/null
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSessionStats.aidl
@@ -0,0 +1,43 @@
+/*
+ * 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.wifi;
+@VintfStability
+parcelable TwtSessionStats {
+ int avgTxPktCount;
+ int avgRxPktCount;
+ int avgTxPktSize;
+ int avgRxPktSize;
+ int avgEospDurationMicros;
+ int eospCount;
+}
diff --git a/wifi/aidl/android/hardware/wifi/CachedScanData.aidl b/wifi/aidl/android/hardware/wifi/CachedScanData.aidl
new file mode 100644
index 0000000..feda079
--- /dev/null
+++ b/wifi/aidl/android/hardware/wifi/CachedScanData.aidl
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+package android.hardware.wifi;
+
+import android.hardware.wifi.CachedScanResult;
+
+/**
+ * Scan data cached in Wifi firmware
+ */
+@VintfStability
+parcelable CachedScanData {
+ /**
+ * List of scanned frequencies in MHz.
+ */
+ int[] scannedFrequenciesMhz;
+
+ /**
+ * List of scan results.
+ */
+ CachedScanResult[] cachedScanResults;
+}
diff --git a/wifi/aidl/android/hardware/wifi/CachedScanResult.aidl b/wifi/aidl/android/hardware/wifi/CachedScanResult.aidl
new file mode 100644
index 0000000..9c9dbc7
--- /dev/null
+++ b/wifi/aidl/android/hardware/wifi/CachedScanResult.aidl
@@ -0,0 +1,55 @@
+/*
+ * 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.
+ */
+
+package android.hardware.wifi;
+
+import android.hardware.wifi.WifiChannelWidthInMhz;
+import android.hardware.wifi.WifiRatePreamble;
+
+/**
+ * Scan result cached in Wifi firmware
+ */
+@VintfStability
+parcelable CachedScanResult {
+ /**
+ * Time in micro seconds since boot when the scan was done
+ */
+ long timeStampInUs;
+ /**
+ * SSID of beacon excluding null.
+ */
+ byte[] ssid;
+ /**
+ * BSSID of beacon
+ */
+ byte[6] bssid;
+ /**
+ * Beacon received signal stength indicatior (RSSI), in dbm
+ */
+ int rssiDbm;
+ /**
+ * Frequency of beacon, in MHz
+ */
+ int frequencyMhz;
+ /**
+ * Channel bandwidth of found network
+ */
+ WifiChannelWidthInMhz channelWidthMhz;
+ /**
+ * Supported rate and preamble type
+ */
+ WifiRatePreamble preambleType;
+}
diff --git a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
index c1caa7e..d12d26c 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiChip.aidl
@@ -33,6 +33,7 @@
import android.hardware.wifi.WifiIfaceMode;
import android.hardware.wifi.WifiRadioCombination;
import android.hardware.wifi.WifiUsableChannel;
+import android.hardware.wifi.common.OuiKeyedData;
/**
* Interface that represents a chip that must be configured as a single unit.
@@ -82,6 +83,10 @@
* Chip supports Tid-To-Link mapping negotiation.
*/
T2LM_NEGOTIATION = 1 << 8,
+ /**
+ * Chip supports voip mode setting.
+ */
+ SET_VOIP_MODE = 1 << 9,
}
/**
@@ -384,6 +389,16 @@
}
/**
+ * This enum represents the different VoIP mode that can be set through |setVoipMode|.
+ */
+ @VintfStability
+ @Backing(type="int")
+ enum VoipMode {
+ OFF = 0,
+ VOICE = 1,
+ }
+
+ /**
* Configure the Chip.
* This may NOT be called to reconfigure a chip due to an internal
* limitation. Calling this when chip is already configured in a different
@@ -1149,4 +1164,46 @@
*
*/
void setMloMode(in ChipMloMode mode);
+
+ /**
+ * Create an AP or bridged AP iface on the chip using vendor-provided configuration parameters.
+ *
+ * Depending on the mode the chip is configured in, the interface creation
+ * may fail (code: |WifiStatusCode.ERROR_NOT_AVAILABLE|) if we've already
+ * reached the maximum allowed (specified in |ChipIfaceCombination|) number
+ * of ifaces of the AP or AP_BRIDGED type.
+ *
+ * @param iface IfaceConcurrencyType to be created. Takes one of
+ |IfaceConcurrencyType.AP| or |IfaceConcurrencyType.AP_BRIDGED|
+ * @param vendorData Vendor-provided configuration data as a list of |OuiKeyedData|.
+ * @return AIDL interface object representing the iface if
+ * successful, null otherwise.
+ * @throws ServiceSpecificException with one of the following values:
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
+ * |WifiStatusCode.ERROR_INVALID_ARGS|
+ */
+ @PropagateAllowBlocking
+ IWifiApIface createApOrBridgedApIface(
+ in IfaceConcurrencyType iface, in OuiKeyedData[] vendorData);
+
+ /**
+ * API to set the wifi VoIP mode.
+ *
+ * The VoIP mode is a hint to the HAL to enable or disable Wi-Fi VoIP
+ * optimization. The optimization should be enabled if the mode is NOT set to |OFF|.
+ * Furthermore, HAL should implement relevant optimization techniques based on the
+ * current operational mode.
+ *
+ * Note: Wi-Fi VoIP optimization may trade-off power against Wi-Fi
+ * performance but it provides better voice quility.
+ *
+ * @param mode Voip mode as defined by the enum |VoipMode|
+ * @throws ServiceSpecificException with one of the following values:
+ * |WifiStatusCode.ERROR_WIFI_CHIP_INVALID|,
+ * |WifiStatusCode.ERROR_INVALID_ARGS|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ void setVoipMode(in VoipMode mode);
}
diff --git a/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl b/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl
index 6d6afaf..6c5451b 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiStaIface.aidl
@@ -16,6 +16,7 @@
package android.hardware.wifi;
+import android.hardware.wifi.CachedScanData;
import android.hardware.wifi.IWifiStaIfaceEventCallback;
import android.hardware.wifi.StaApfPacketFilterCapabilities;
import android.hardware.wifi.StaBackgroundScanCapabilities;
@@ -24,6 +25,8 @@
import android.hardware.wifi.StaRoamingCapabilities;
import android.hardware.wifi.StaRoamingConfig;
import android.hardware.wifi.StaRoamingState;
+import android.hardware.wifi.TwtCapabilities;
+import android.hardware.wifi.TwtRequest;
import android.hardware.wifi.WifiBand;
import android.hardware.wifi.WifiDebugRxPacketFateReport;
import android.hardware.wifi.WifiDebugTxPacketFateReport;
@@ -99,6 +102,14 @@
* Support for keep alive packet offload.
*/
KEEP_ALIVE = 1 << 13,
+ /**
+ * Support for configuring roaming mode.
+ */
+ ROAMING_MODE_CONTROL = 1 << 14,
+ /**
+ * Support for cached scan data report.
+ */
+ CACHED_SCAN_DATA = 1 << 15,
}
/**
@@ -552,4 +563,125 @@
* |WifiStatusCode.ERROR_UNKNOWN|
*/
void setDtimMultiplier(in int multiplier);
+
+ /**
+ * Get the cached scan data.
+ *
+ * @return Instance of |CachedScanData|.
+ * @throws ServiceSpecificException with one of the following values:
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ CachedScanData getCachedScanData();
+
+ /**
+ * Get Target Wake Time (TWT) local device capabilities for the station interface.
+ *
+ * @return Instance of |TwtCapabilities|.
+ * @throws ServiceSpecificException with one of the following values:
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.ERROR_NOT_AVAILABLE|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ TwtCapabilities twtGetCapabilities();
+
+ /**
+ * Setup a Target Wake Time (TWT) session.
+ *
+ * Supported only if |TwtCapabilities.isTwtRequesterSupported| is set. Results in asynchronous
+ * callback |IWifiStaIfaceEventCallback.onTwtSessionCreate| on success or
+ * |IWifiStaIfaceEventCallback.onTwtFailure| on failure.
+ *
+ * @param cmdId Command Id to use for this invocation. The value 0 is reserved.
+ * @param twtRequest TWT Request parameters.
+ * @throws ServiceSpecificException with one of the following values:
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ void twtSessionSetup(in int cmdId, in TwtRequest twtRequest);
+
+ /**
+ * Update a Target Wake Time (TWT) session.
+ *
+ * Supported only if the TWT session can be updated. See |TwtSession.isUpdatable|. Results in
+ * asynchronous callback |IWifiStaIfaceEventCallback.onTwtSessionUpdate| on success or
+ * |IWifiStaIfaceEventCallback.onTwtFailure| on failure.
+ *
+ * @param cmdId Command Id to use for this invocation. The value 0 is reserved.
+ * @param sessionId TWT session id.
+ * @param twtRequest TWT Request parameters.
+ * @throws ServiceSpecificException with one of the following values:
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ void twtSessionUpdate(in int cmdId, in int sessionId, in TwtRequest twtRequest);
+
+ /**
+ * Suspend a Target Wake Time (TWT) session until a resume is called.
+ *
+ * Supported only if the TWT session supports suspend and resume. See
+ * |TwtSession.isSuspendable|. Results in asynchronous callback
+ * |IWifiStaIfaceEventCallback.onTwtSessionSuspend| on success or
+ * |IWifiStaIfaceEventCallback.onTwtFailure| on failure.
+ *
+ * @param cmdId Command Id to use for this invocation. The value 0 is reserved.
+ * @param sessionId TWT session id.
+ * @throws ServiceSpecificException with one of the following values:
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ void twtSessionSuspend(in int cmdId, in int sessionId);
+
+ /**
+ * Resume a Target Wake Time (TWT) session which is suspended.
+ *
+ * Supported only if the TWT session supports suspend and resume. See
+ * |TwtSession.isSuspendable|. Results in asynchronous callback
+ * |IWifiStaIfaceEventCallback.onTwtSessionResume| on success or
+ * |IWifiStaIfaceEventCallback.onTwtFailure| on failure.
+ *
+ * @param cmdId Command Id to use for this invocation. The value 0 is reserved.
+ * @param sessionId TWT session id.
+ * @throws ServiceSpecificException with one of the following values:
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ void twtSessionResume(in int cmdId, in int sessionId);
+
+ /**
+ * Teardown a Target Wake Time (TWT) session.
+ *
+ * Results in asynchronous callback |IWifiStaIfaceEventCallback.onTwtSessionTeardown| on
+ * success or |IWifiStaIfaceEventCallback.onTwtFailure| on failure.
+ *
+ * @param cmdId Command Id to use for this invocation. The value 0 is reserved.
+ * @param sessionId TWT session id.
+ * @throws ServiceSpecificException with one of the following values:
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ void twtSessionTeardown(in int cmdId, in int sessionId);
+
+ /**
+ * Get stats for a Target Wake Time (TWT) session.
+ *
+ * Results in asynchronous callback |IWifiStaIfaceEventCallback.onTwtSessionStats| on success
+ * or |IWifiStaIfaceEventCallback.onTwtFailure| on failure.
+ *
+ * @param cmdId Command Id to use for this invocation. The value 0 is reserved.
+ * @param sessionId TWT session id.
+ * @throws ServiceSpecificException with one of the following values:
+ * |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
+ * |WifiStatusCode.ERROR_NOT_SUPPORTED|,
+ * |WifiStatusCode.ERROR_UNKNOWN|
+ */
+ void twtSessionGetStats(in int cmdId, in int sessionId);
}
diff --git a/wifi/aidl/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl b/wifi/aidl/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl
index 93a255f..dda7c77 100644
--- a/wifi/aidl/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl
+++ b/wifi/aidl/android/hardware/wifi/IWifiStaIfaceEventCallback.aidl
@@ -18,6 +18,8 @@
import android.hardware.wifi.StaScanData;
import android.hardware.wifi.StaScanResult;
+import android.hardware.wifi.TwtSession;
+import android.hardware.wifi.TwtSessionStats;
@VintfStability
oneway interface IWifiStaIfaceEventCallback {
@@ -61,4 +63,104 @@
* @param currRssi RSSI of the currently connected access point.
*/
void onRssiThresholdBreached(in int cmdId, in byte[6] currBssid, in int currRssi);
+
+ @VintfStability
+ @Backing(type="byte")
+ enum TwtErrorCode {
+ /** Unknown failure */
+ FAILURE_UNKNOWN,
+ /** TWT session is already resumed */
+ ALREADY_RESUMED,
+ /** TWT session is already suspended */
+ ALREADY_SUSPENDED,
+ /** Invalid parameters */
+ INVALID_PARAMS,
+ /** Maximum number of sessions reached */
+ MAX_SESSION_REACHED,
+ /** Requested operation is not available */
+ NOT_AVAILABLE,
+ /** Requested operation is not supported */
+ NOT_SUPPORTED,
+ /** Requested operation is not supported by the peer */
+ PEER_NOT_SUPPORTED,
+ /** Requested operation is rejected by the peer */
+ PEER_REJECTED,
+ /** Requested operation is timed out */
+ TIMEOUT,
+ }
+
+ @VintfStability
+ @Backing(type="byte")
+ enum TwtTeardownReasonCode {
+ /** Unknown reason */
+ UNKNOWN,
+ /** Teardown requested by the framework */
+ LOCALLY_REQUESTED,
+ /** Teardown initiated internally by the firmware or driver */
+ INTERNALLY_INITIATED,
+ /** Teardown initiated by the peer */
+ PEER_INITIATED,
+ }
+
+ /**
+ * Called to indicate a TWT failure. If there is no command associated with this failure cmdId
+ * will be 0.
+ *
+ * @param cmdId Id used to identify the command. The value 0 indicates no associated command.
+ * @param error error code.
+ */
+ void onTwtFailure(in int cmdId, in TwtErrorCode error);
+
+ /**
+ * Called when a Target Wake Time session is created. See |IWifiStaIface.twtSessionSetup|.
+ *
+ * @param cmdId Id used to identify the command.
+ * @param twtSession TWT session.
+ */
+ void onTwtSessionCreate(in int cmdId, in TwtSession twtSession);
+
+ /**
+ * Called when a Target Wake Time session is updated. See |IWifiStaIface.twtSessionUpdate|.
+ *
+ * @param cmdId Id used to identify the command.
+ * @param twtSession TWT session.
+ */
+ void onTwtSessionUpdate(in int cmdId, in TwtSession twtSession);
+
+ /**
+ * Called when the Target Wake Time session is torndown.
+ * See |IWifiStaIface.twtSessionTeardown|.
+ *
+ * @param cmdId Id used to identify the command. The value 0 indicates no associated command.
+ * @param twtSessionId TWT session id.
+ * @param reasonCode reason code for the TWT teardown.
+ */
+ void onTwtSessionTeardown(
+ in int cmdId, in int twtSessionId, in TwtTeardownReasonCode reasonCode);
+
+ /**
+ * Called when TWT session stats available. See |IWifiStaIface.twtSessionGetStats|.
+ *
+ * @param cmdId Id used to identify the command.
+ * @param twtSessionId TWT session id.
+ * @param twtSessionStats TWT session stats.
+ */
+ void onTwtSessionStats(in int cmdId, in int twtSessionId, in TwtSessionStats twtSessionStats);
+
+ /**
+ * Called when the Target Wake Time session is suspended.
+ * See |IWifiStaIface.twtSessionSuspend|.
+ *
+ * @param cmdId Id used to identify the command. The value 0 indicates no associated command.
+ * @param twtSessionId TWT session id.
+ */
+ void onTwtSessionSuspend(in int cmdId, in int twtSessionId);
+
+ /**
+ * Called when the Target Wake Time session is resumed. See |IWifiStaIface.twtSessionResume|.
+ *
+ * @param cmdId Id used to identify the command. The value 0 indicates no associated command.
+ * @param twtSessionId TWT session id.
+ */
+ void onTwtSessionResume(in int cmdId, in int twtSessionId);
}
diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl
index 4b74cd9..e23bd23 100644
--- a/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingRequest.aidl
@@ -45,4 +45,16 @@
* Cookie received from previous |NanBootstrappingConfirmInd| for comeback request.
*/
byte[] cookie;
+
+ /**
+ * Identify if it is a request for come back response
+ */
+ boolean isComeback;
+
+ /**
+ * ID of an active publish or subscribe discovery session. Follow-up message is transmitted in
+ * the context of the discovery session. NAN Spec: Service Descriptor Attribute (SDA) / Instance
+ * ID
+ */
+ byte discoverySessionId;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl b/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl
index dbe8923..a2ee0e6 100644
--- a/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanBootstrappingResponse.aidl
@@ -29,4 +29,11 @@
* True if accept the request, false otherwise.
*/
boolean acceptRequest;
+
+ /**
+ * ID of an active publish or subscribe discovery session. Follow-up message is transmitted in
+ * the context of the discovery session. NAN Spec: Service Descriptor Attribute (SDA) / Instance
+ * ID
+ */
+ byte discoverySessionId;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanConfigRequest.aidl b/wifi/aidl/android/hardware/wifi/NanConfigRequest.aidl
index 82a7b6e..47561dc 100644
--- a/wifi/aidl/android/hardware/wifi/NanConfigRequest.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanConfigRequest.aidl
@@ -17,6 +17,7 @@
package android.hardware.wifi;
import android.hardware.wifi.NanBandSpecificConfig;
+import android.hardware.wifi.common.OuiKeyedData;
/**
* Configuration parameters of NAN. Used when enabling and re-configuring a NAN cluster.
@@ -79,4 +80,9 @@
* Additional configuration provided per band. Indexed by |NanBandIndex|.
*/
NanBandSpecificConfig[3] bandSpecificConfig;
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanDataPathSecurityConfig.aidl b/wifi/aidl/android/hardware/wifi/NanDataPathSecurityConfig.aidl
index 9a2013b..b6c5eef 100644
--- a/wifi/aidl/android/hardware/wifi/NanDataPathSecurityConfig.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanDataPathSecurityConfig.aidl
@@ -58,4 +58,49 @@
* setting up the Secure Data Path.
*/
byte[16] scid;
+
+ /**
+ * Enables the 16 replay counter for ND-TKSA(NAN Data Pairwise Security Association) and
+ * NM-TKSA(NAN managerment Pairwise Security Association), if set to false will use 4 replay
+ * counter as default
+ * Wi-Fi Aware spec 4.0: 9.5.21.2 Cipher Suite Information attribute
+ */
+ boolean enable16ReplyCountersForTksa;
+
+ /**
+ * Enables the 16 replay counter for GTKSA(Group Transient Key security associations), if set to
+ * false will use 4 replay counter as default.
+ * Wi-Fi Aware spec 4.0: 9.5.21.2 Cipher Suite Information attribute
+ */
+ boolean enable16ReplyCountersForGtksa;
+
+ /**
+ * GTK(Group Transient Key) used to protect group addressed data frames,
+ * IGTK(Integrity Group Transient Key) used to protect multicast management frames, set to true
+ * if supported.
+ * Wi-Fi Aware spec 4.0: 9.5.21.2 Cipher Suite Information attribute
+ */
+ boolean supportGtkAndIgtk;
+
+ /**
+ * BIGTK(Beacon Integrity Group Transient Key) used to protect Beacon frames, set to true if
+ * supported.
+ * Ref: Wi-Fi Aware spec 4.0: 9.5.21.2 Cipher Suite Information attribute
+ */
+ boolean supportBigtksa;
+
+ /**
+ * Enables NCS-BIP-256 for IGTKSA(Integrity Group Transient Key security associations)
+ * and BIGTK(Beacon Integrity Group Transient Key security associations), if set to false will
+ * use NCS-BIP-128 as default
+ * Wi-Fi Aware spec 4.0: 9.5.21.2 Cipher Suite Information attribute
+ */
+ boolean enableNcsBip256;
+
+ /**
+ * Require enhanced frame protection if supported, which includes multicast management frame
+ * protection, group addressed data protection and beacon frame protection.
+ * Wi-Fi Aware spec 4.0: 7.3 frame protection
+ */
+ boolean requiresEnhancedFrameProtection;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl b/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
index 58777c5..4bedce0 100644
--- a/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanDiscoveryCommonConfig.aidl
@@ -73,8 +73,9 @@
/**
* Arbitrary information communicated in discovery packets - there is no semantic meaning to
* these bytes. They are passed-through from publisher to subscriber as-is with no parsing. Max
- * length: |NanCapabilities.maxExtendedServiceSpecificInfoLen|. Spec: Service Descriptor
- * Extension Attribute (SDEA) / Service Info
+ * length: |NanCapabilities.maxExtendedServiceSpecificInfoLen|. This info is using Generic
+ * Service Protocol with setting Service Info type to 2 (Generic). NAN Spec: Service
+ * Descriptor Extension Attribute (SDEA) / Service Info
*/
byte[] extendedServiceSpecificInfo;
/**
diff --git a/wifi/aidl/android/hardware/wifi/NanMatchInd.aidl b/wifi/aidl/android/hardware/wifi/NanMatchInd.aidl
index 5a04376..622213c 100644
--- a/wifi/aidl/android/hardware/wifi/NanMatchInd.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanMatchInd.aidl
@@ -19,6 +19,7 @@
import android.hardware.wifi.NanCipherSuiteType;
import android.hardware.wifi.NanIdentityResolutionAttribute;
import android.hardware.wifi.NanPairingConfig;
+import android.hardware.wifi.common.OuiKeyedData;
/**
* Match indication structure.
@@ -137,4 +138,9 @@
* The NIRA from peer for NAN pairing verification
*/
NanIdentityResolutionAttribute peerNira;
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanPairingConfirmInd.aidl b/wifi/aidl/android/hardware/wifi/NanPairingConfirmInd.aidl
index a5670ec..692d3d6 100644
--- a/wifi/aidl/android/hardware/wifi/NanPairingConfirmInd.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanPairingConfirmInd.aidl
@@ -19,6 +19,7 @@
import android.hardware.wifi.NanPairingRequestType;
import android.hardware.wifi.NanStatus;
import android.hardware.wifi.NpkSecurityAssociation;
+import android.hardware.wifi.common.OuiKeyedData;
/**
* NAN pairing confirmation indication structure. Event indication is
@@ -51,4 +52,9 @@
* The security association negotiated for the pairing, can be cached for future verification
*/
NpkSecurityAssociation npksa;
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanPairingRequest.aidl b/wifi/aidl/android/hardware/wifi/NanPairingRequest.aidl
index 0c2080b..950d1e2 100644
--- a/wifi/aidl/android/hardware/wifi/NanPairingRequest.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanPairingRequest.aidl
@@ -18,6 +18,7 @@
import android.hardware.wifi.NanPairingRequestType;
import android.hardware.wifi.NanPairingSecurityConfig;
+import android.hardware.wifi.common.OuiKeyedData;
/**
* NAN pairing initiate request.
@@ -54,4 +55,9 @@
* Security config used for the pairing
*/
NanPairingSecurityConfig securityConfig;
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanPairingRequestInd.aidl b/wifi/aidl/android/hardware/wifi/NanPairingRequestInd.aidl
index ec8548f..7e98bac 100644
--- a/wifi/aidl/android/hardware/wifi/NanPairingRequestInd.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanPairingRequestInd.aidl
@@ -18,6 +18,7 @@
import android.hardware.wifi.NanIdentityResolutionAttribute;
import android.hardware.wifi.NanPairingRequestType;
+import android.hardware.wifi.common.OuiKeyedData;
/**
* NAN pairing request indication message structure.
@@ -58,4 +59,9 @@
* The NIRA from peer for NAN pairing verification
*/
NanIdentityResolutionAttribute peerNira;
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl b/wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl
index 956a7df..ae75caf 100644
--- a/wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanPublishRequest.aidl
@@ -20,6 +20,7 @@
import android.hardware.wifi.NanPairingConfig;
import android.hardware.wifi.NanPublishType;
import android.hardware.wifi.NanTxType;
+import android.hardware.wifi.common.OuiKeyedData;
/**
* Publish request. Specifies a publish discovery operation.
@@ -55,4 +56,9 @@
* The Identity key for pairing, will generate NIRA for verification by the peer
*/
byte[16] identityKey;
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl b/wifi/aidl/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl
index fab2a40..0527f06 100644
--- a/wifi/aidl/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanRespondToPairingIndicationRequest.aidl
@@ -18,6 +18,7 @@
import android.hardware.wifi.NanPairingRequestType;
import android.hardware.wifi.NanPairingSecurityConfig;
+import android.hardware.wifi.common.OuiKeyedData;
/**
* Response to a pairing request from a peer.
@@ -51,4 +52,9 @@
* Security config used for the pairing
*/
NanPairingSecurityConfig securityConfig;
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/android/hardware/wifi/NanSubscribeRequest.aidl b/wifi/aidl/android/hardware/wifi/NanSubscribeRequest.aidl
index 0b246ed..e7094bf 100644
--- a/wifi/aidl/android/hardware/wifi/NanSubscribeRequest.aidl
+++ b/wifi/aidl/android/hardware/wifi/NanSubscribeRequest.aidl
@@ -21,6 +21,7 @@
import android.hardware.wifi.NanPairingConfig;
import android.hardware.wifi.NanSrfType;
import android.hardware.wifi.NanSubscribeType;
+import android.hardware.wifi.common.OuiKeyedData;
/**
* Subscribe request. Specifies a subscribe discovery operation.
@@ -76,4 +77,9 @@
* The Identity key for pairing, will generate NIRA for verification by the peer
*/
byte[16] identityKey;
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl b/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl
index 7c47ed5..0352ec8 100644
--- a/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl
+++ b/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl
@@ -33,24 +33,25 @@
*/
boolean rttFtmSupported;
/**
- * Whether initiator supports LCI request. Applies to 2-sided RTT.
+ * Whether initiator supports Location Configuration Information (LCI) request. Applies to
+ * 2-sided RTT.
*/
boolean lciSupported;
/**
- * Whether initiator supports LCR request. Applies to 2-sided RTT.
+ * Whether initiator supports Location Civic Report (LCR) request. Applies to 2-sided RTT.
*/
boolean lcrSupported;
/**
- * Whether 11mc responder mode is supported.
+ * Whether IEEE 802.11mc responder mode is supported.
*/
boolean responderSupported;
/**
- * Bit mask indicating what preamble is supported by initiator.
+ * Bit mask indicating what preamble is supported by IEEE 802.11mc initiator.
* Combination of |RttPreamble| values.
*/
RttPreamble preambleSupport;
/**
- * Bit mask indicating what BW is supported by initiator.
+ * Bit mask indicating what BW is supported by IEEE 802.11mc initiator.
* Combination of |RttBw| values.
*/
RttBw bwSupport;
@@ -59,4 +60,27 @@
* For instance, version 4.0 must be 40 and version 4.3 must be 43 etc.
*/
byte mcVersion;
+ /**
+ * Bit mask indicating what preamble is supported by IEEE 802.11az initiator.
+ * Combination of |RttPreamble| values.
+ */
+ RttPreamble azPreambleSupport;
+ /**
+ * Bit mask indicating what BW is supported by IEEE 802.11az initiator.
+ * Combination of |RttBw| values.
+ */
+ RttBw azBwSupport;
+ /**
+ * Whether the initiator supports IEEE 802.11az Non-Trigger-based (non-TB) measurement.
+ */
+ boolean ntbInitiatorSupported;
+ /**
+ * Whether IEEE 802.11az Non-Trigger-based (non-TB) responder mode is supported.
+ */
+ boolean ntbResponderSupported;
+ /**
+ * Maximum HE LTF repetitions the IEEE 802.11az initiator is capable of transmitting in the
+ * preamble of I2R NDP.
+ */
+ int maxTxLtfRepetitionCount;
}
diff --git a/wifi/aidl/android/hardware/wifi/RttConfig.aidl b/wifi/aidl/android/hardware/wifi/RttConfig.aidl
index fc2c2e0..e970656 100644
--- a/wifi/aidl/android/hardware/wifi/RttConfig.aidl
+++ b/wifi/aidl/android/hardware/wifi/RttConfig.aidl
@@ -32,7 +32,7 @@
*/
byte[6] addr;
/**
- * 1-sided or 2-sided RTT.
+ * 1-sided or 2-sided RTT (IEEE 802.11mc or IEEE 802. 11az).
*/
RttType type;
/**
@@ -47,6 +47,8 @@
* Time interval between bursts (units: 100 ms).
* Applies to 1-sided and 2-sided RTT multi-burst requests.
* Range: 0-31, 0: no preference by initiator (2-sided RTT).
+ *
+ * Note: Applicable to IEEE 802.11mc only.
*/
int burstPeriod;
/**
@@ -60,6 +62,9 @@
* number of RTT results is the following:
* for 1-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst)
* for 2-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst - 1)
+ *
+ * Note: Applicable to IEEE 802.11mc only. For IEEE 802.11az refer
+ * |RttConfig.txLtfRepetitionCount|.
*/
int numBurst;
/**
@@ -70,6 +75,8 @@
* equals the number of FTM frames that the
* initiator will request that the responder sends
* in a single frame.
+ *
+ * Note: Applicable to IEEE 802.11mc only.
*/
int numFramesPerBurst;
/**
@@ -95,8 +102,8 @@
*/
boolean mustRequestLcr;
/**
- * Applies to 1-sided and 2-sided RTT. Valid values will
- * be 2-11 and 15 as specified by the 802.11mc std for
+ * Applies to 1-sided and 2-sided IEEE 802.11mc RTT. Valid values will
+ * be 2-11 and 15 as specified by the IEEE 802.11mc std for
* the FTM parameter burst duration. In a multi-burst
* request, if responder overrides with larger value,
* the initiator will return failure. In a single-burst
@@ -113,4 +120,17 @@
* RTT BW to be used in the RTT frames.
*/
RttBw bw;
+ /**
+ * IEEE 802.11az Non-Trigger-based (non-TB) minimum measurement time in milliseconds.
+ */
+ int ntbMinMeasurementTimeMillis;
+ /**
+ * IEEE 802.11az Non-Trigger-based (non-TB) maximum measurement time in milliseconds.
+ */
+ int ntbMaxMeasurementTimeMillis;
+ /**
+ * Multiple transmissions of HE-LTF symbols in an HE Ranging NDP. A value of 1 indicates no
+ * repetition.
+ */
+ int txLtfRepetitionCount;
}
diff --git a/wifi/aidl/android/hardware/wifi/RttPreamble.aidl b/wifi/aidl/android/hardware/wifi/RttPreamble.aidl
index e460a94..21df171 100644
--- a/wifi/aidl/android/hardware/wifi/RttPreamble.aidl
+++ b/wifi/aidl/android/hardware/wifi/RttPreamble.aidl
@@ -22,6 +22,7 @@
@VintfStability
@Backing(type="int")
enum RttPreamble {
+ INVALID = 0,
LEGACY = 0x1,
HT = 0x2,
VHT = 0x4,
diff --git a/wifi/aidl/android/hardware/wifi/RttResult.aidl b/wifi/aidl/android/hardware/wifi/RttResult.aidl
index 6c45e2c..2cb0afa 100644
--- a/wifi/aidl/android/hardware/wifi/RttResult.aidl
+++ b/wifi/aidl/android/hardware/wifi/RttResult.aidl
@@ -33,6 +33,8 @@
byte[6] addr;
/**
* Burst number in a multi-burst request.
+ *
+ * Note: Applicable to 1-sided RTT and 2-sided IEEE 802.11mc only.
*/
int burstNum;
/**
@@ -45,7 +47,7 @@
int successNumber;
/**
* Maximum number of "FTM frames per burst" supported by
- * the responder STA. Applies to 2-sided RTT only.
+ * the responder STA. Applies to 2-sided IEEE 802.11mc RTT only.
* If reponder overrides with larger value:
* - for single-burst request, initiator will truncate the
* larger value and send a TMR_STOP after receiving as
@@ -59,10 +61,8 @@
*/
RttStatus status;
/**
- * If status is RTT_STATUS_FAIL_BUSY_TRY_LATER,
- * this will be the time provided by the responder as to
- * when the request can be tried again. Applies to 2-sided
- * RTT only. In sec, 1-31 sec.
+ * If status is RTT_STATUS_FAIL_BUSY_TRY_LATER, this will be the time provided by the responder
+ * as to when the request can be tried again. Applies to 2-sided RTT only. In sec, 1-31 sec.
*/
byte retryAfterDuration;
/**
@@ -104,11 +104,13 @@
*/
int distanceInMm;
/**
- * Standard deviation in mm (optional).
+ * Standard deviation in mm.
*/
int distanceSdInMm;
/**
* Difference between max and min distance recorded in mm (optional).
+ *
+ * Note: Only applicable for IEEE 802.11mc
*/
int distanceSpreadInMm;
/**
@@ -116,21 +118,20 @@
*/
long timeStampInUs;
/**
- * Actual time taken by the FW to finish one burst
- * measurement (in ms). Applies to 1-sided and 2-sided RTT.
+ * Actual time taken by the FW to finish one burst measurement (in ms). Applies to 1-sided
+ * and 2-sided IEEE 802.11mc RTT.
*/
int burstDurationInMs;
/**
- * Number of bursts allowed by the responder. Applies
- * to 2-sided RTT only.
+ * Number of bursts allowed by the responder. Applies to 2-sided IEEE 802.11mc RTT only.
*/
int negotiatedBurstNum;
/**
- * For 11mc only.
+ * For IEEE 802.11mc and IEEE 802.11az only.
*/
WifiInformationElement lci;
/**
- * For 11mc only.
+ * For IEEE 802.11mc and IEEE 802.11az only.
*/
WifiInformationElement lcr;
/**
@@ -140,8 +141,38 @@
int channelFreqMHz;
/**
* RTT packet bandwidth.
- * This value is an average bandwidth of the bandwidths of measurement
- * frames. Cap the average close to a specific valid RttBw.
+ * This value is an average bandwidth of the bandwidths of measurement frames. Cap the average
+ * close to a specific valid RttBw.
*/
RttBw packetBw;
+ /**
+ * IEEE 802.11az Transmit LTF repetitions used to get this result.
+ */
+ int txLtfRepetitionCount;
+ /**
+ * Minimum non-trigger based (non-TB) dynamic measurement time in milliseconds assigned by the
+ * IEEE 802.11az responder.
+ *
+ * After initial non-TB negotiation, if the next ranging request for this peer comes in between
+ * [ntbMinMeasurementTime, ntbMaxMeasurementTime], vendor software shall do the NDPA sounding
+ * sequence for dynamic non-TB measurement.
+ *
+ * If the ranging request for this peer comes sooner than minimum measurement time, vendor
+ * software shall return the cached result of the last measurement including the time stamp
+ * |RttResult.timestamp|.
+ */
+ int ntbMinMeasurementTimeMillis;
+ /**
+ * Maximum non-trigger based (non-TB) dynamic measurement time in milliseconds assigned by the
+ * IEEE 802.11az responder.
+ *
+ * After initial non-TB negotiation, if the next ranging request for this peer comes in between
+ * [ntbMinMeasurementTime, ntbMaxMeasurementTime], vendor software shall do the NDPA sounding
+ * sequence for dynamic non-TB measurement.
+ *
+ * If the ranging request for this peer comes later than the maximum measurement time, vendor
+ * software shall clean up any existing IEEE 802.11ax non-TB ranging session and re-do the
+ * non-TB ranging negotiation.
+ */
+ int ntbMaxMeasurementTimeMillis;
}
diff --git a/wifi/aidl/android/hardware/wifi/RttType.aidl b/wifi/aidl/android/hardware/wifi/RttType.aidl
index e95a928..3f1a2f1 100644
--- a/wifi/aidl/android/hardware/wifi/RttType.aidl
+++ b/wifi/aidl/android/hardware/wifi/RttType.aidl
@@ -23,5 +23,18 @@
@Backing(type="int")
enum RttType {
ONE_SIDED = 1,
+ /**
+ * Two-sided RTT 11mc type.
+ *
+ * Note: TWO_SIDED was used for IEEE 802.11mc. Use TWO_SIDED_11MC for IEEE 802.11mc instead.
+ */
TWO_SIDED = 2,
+ /**
+ * Two-sided RTT 11mc type is same as two-sided.
+ */
+ TWO_SIDED_11MC = TWO_SIDED,
+ /**
+ * Two-sided RTT 11az non trigger based (non-TB) type.
+ */
+ TWO_SIDED_11AZ_NTB = 3,
}
diff --git a/wifi/aidl/android/hardware/wifi/StaRoamingState.aidl b/wifi/aidl/android/hardware/wifi/StaRoamingState.aidl
index d75d323..6872a17 100644
--- a/wifi/aidl/android/hardware/wifi/StaRoamingState.aidl
+++ b/wifi/aidl/android/hardware/wifi/StaRoamingState.aidl
@@ -32,4 +32,9 @@
* the |StaRoamingConfig| parameters set using |configureRoaming|.
*/
ENABLED = 1,
+ /**
+ * Driver/Firmware is allowed to roam more aggressively. For instance,
+ * roaming can be triggered at higher RSSI thresholds than normal.
+ */
+ AGGRESSIVE = 2,
}
diff --git a/wifi/aidl/android/hardware/wifi/TwtCapabilities.aidl b/wifi/aidl/android/hardware/wifi/TwtCapabilities.aidl
new file mode 100644
index 0000000..9007d0e
--- /dev/null
+++ b/wifi/aidl/android/hardware/wifi/TwtCapabilities.aidl
@@ -0,0 +1,56 @@
+/*
+ * 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.
+ */
+
+package android.hardware.wifi;
+
+/**
+ * Target Wake Time (TWT) Capabilities supported.
+ */
+@VintfStability
+parcelable TwtCapabilities {
+ /**
+ * Whether the TWT requester mode supported.
+ */
+ boolean isTwtRequesterSupported;
+ /**
+ * Whether the TWT responder mode supported.
+ */
+ boolean isTwtResponderSupported;
+ /**
+ * Whether the Broadcast TWT mode (TWT scheduling STA) supported.
+ */
+ boolean isBroadcastTwtSupported;
+ /**
+ * Whether supports Flexible TWT schedules.
+ */
+ boolean isFlexibleTwtScheduleSupported;
+ /**
+ * Minimum TWT wake duration in microseconds.
+ */
+ int minWakeDurationMicros;
+ /**
+ * Maximum TWT wake duration in microseconds.
+ */
+ int maxWakeDurationMicros;
+ /**
+ * Minimum TWT wake interval in microseconds.
+ */
+ int minWakeIntervalMicros;
+ /**
+ * Maximum TWT wake interval in microseconds.
+ */
+ int maxWakeIntervalMicros;
+}
diff --git a/wifi/aidl/android/hardware/wifi/TwtRequest.aidl b/wifi/aidl/android/hardware/wifi/TwtRequest.aidl
new file mode 100644
index 0000000..5191713
--- /dev/null
+++ b/wifi/aidl/android/hardware/wifi/TwtRequest.aidl
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+
+package android.hardware.wifi;
+
+/**
+ * Target Wake Time (TWT) Request
+ */
+@VintfStability
+parcelable TwtRequest {
+ /**
+ * MLO Link id in case TWT is requesting for MLO connection. Otherwise -1.
+ */
+ int mloLinkId;
+ /**
+ * Minimum TWT wake duration in microseconds.
+ */
+ int minWakeDurationMicros;
+ /**
+ * Maximum TWT wake duration in microseconds.
+ */
+ int maxWakeDurationMicros;
+ /**
+ * Minimum TWT wake interval in microseconds.
+ */
+ int minWakeIntervalMicros;
+ /**
+ * Maximum TWT wake interval in microseconds.
+ */
+ int maxWakeIntervalMicros;
+}
diff --git a/wifi/aidl/android/hardware/wifi/TwtSession.aidl b/wifi/aidl/android/hardware/wifi/TwtSession.aidl
new file mode 100644
index 0000000..5a7ddb1
--- /dev/null
+++ b/wifi/aidl/android/hardware/wifi/TwtSession.aidl
@@ -0,0 +1,92 @@
+/*
+ * 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.
+ */
+
+package android.hardware.wifi;
+
+/**
+ * Target Wake Time (TWT) Session
+ */
+@VintfStability
+parcelable TwtSession {
+ @VintfStability
+ @Backing(type="byte")
+ enum TwtNegotiationType {
+ INDIVIDUAL = 0,
+ BROADCAST = 1,
+ }
+
+ /**
+ * An unique identifier for the session.
+ */
+ int sessionId;
+
+ /**
+ * MLO Link id in case of MLO connection. Otherwise -1.
+ */
+ int mloLinkId;
+
+ /**
+ * TWT service period in microseconds.
+ */
+ int wakeDurationMicros;
+
+ /**
+ * Time interval in microseconds between two successive TWT service periods.
+ */
+ int wakeIntervalMicros;
+
+ /**
+ * TWT negotiation type.
+ */
+ TwtNegotiationType negotiationType;
+
+ /**
+ * Whether the TWT session is trigger enabled or non-trigger enabled.
+ */
+ boolean isTriggerEnabled;
+
+ /**
+ * Whether the TWT session is announced or unannounced.
+ */
+ boolean isAnnounced;
+
+ /**
+ * Whether the TWT session is implicit or explicit.
+ */
+ boolean isImplicit;
+
+ /**
+ * Whether the TWT session is protected or not.
+ */
+ boolean isProtected;
+
+ /**
+ * Whether the TWT session can be updated.
+ */
+ boolean isUpdatable;
+
+ /**
+ * Whether the TWT session can be suspended and then resumed.
+ */
+ boolean isSuspendable;
+
+ /**
+ * Whether AP (TWT responder) intends to go to doze state outside of TWT Service Periods.
+ *
+ * Refer IEEE 802.11 spec, Section 10.47.7 (TWT Sleep Setup).
+ */
+ boolean isResponderPmModeEnabled;
+}
diff --git a/wifi/aidl/android/hardware/wifi/TwtSessionStats.aidl b/wifi/aidl/android/hardware/wifi/TwtSessionStats.aidl
new file mode 100644
index 0000000..e2e2d12
--- /dev/null
+++ b/wifi/aidl/android/hardware/wifi/TwtSessionStats.aidl
@@ -0,0 +1,53 @@
+/*
+ * 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.
+ */
+
+package android.hardware.wifi;
+
+/**
+ * Target Wake Time (TWT) Session Stats
+ */
+@VintfStability
+parcelable TwtSessionStats {
+ /**
+ * Average number of Tx packets in each wake duration.
+ */
+ int avgTxPktCount;
+
+ /**
+ * Average number of Rx packets in each wake duration.
+ */
+ int avgRxPktCount;
+
+ /**
+ * Average bytes per Tx packets in each wake duration.
+ */
+ int avgTxPktSize;
+
+ /**
+ * Average bytes per Rx packets in each wake duration.
+ */
+ int avgRxPktSize;
+
+ /**
+ * Average End of Service period in microseconds.
+ */
+ int avgEospDurationMicros;
+
+ /**
+ * Count of early terminations.
+ */
+ int eospCount;
+}
diff --git a/wifi/aidl/default/Android.bp b/wifi/aidl/default/Android.bp
index 91d609d..362ef1b 100644
--- a/wifi/aidl/default/Android.bp
+++ b/wifi/aidl/default/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
default_applicable_licenses: ["hardware_interfaces_license"],
}
@@ -105,7 +106,7 @@
"libwifi-hal",
"libwifi-system-iface",
"libxml2",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
],
export_include_dirs: ["."],
@@ -132,7 +133,7 @@
"libwifi-hal",
"libwifi-system-iface",
"libxml2",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
],
static_libs: ["android.hardware.wifi-service-lib"],
init_rc: ["android.hardware.wifi-service.rc"],
@@ -161,7 +162,7 @@
"libwifi-hal",
"libwifi-system-iface",
"libxml2",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
],
static_libs: ["android.hardware.wifi-service-lib"],
init_rc: ["android.hardware.wifi-service-lazy.rc"],
@@ -192,7 +193,8 @@
static_libs: [
"libgmock",
"libgtest",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
+ "android.hardware.wifi.common-V1-ndk",
"android.hardware.wifi-service-lib",
],
shared_libs: [
diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp
index 83e1193..b62b3a0 100644
--- a/wifi/aidl/default/aidl_struct_util.cpp
+++ b/wifi/aidl/default/aidl_struct_util.cpp
@@ -59,6 +59,8 @@
return IWifiChip::FeatureSetMask::P2P_RAND_MAC;
case WIFI_FEATURE_AFC_CHANNEL:
return IWifiChip::FeatureSetMask::SET_AFC_CHANNEL_ALLOWANCE;
+ case WIFI_FEATURE_SET_VOIP_MODE:
+ return IWifiChip::FeatureSetMask::SET_VOIP_MODE;
};
CHECK(false) << "Unknown legacy feature: " << feature;
return {};
@@ -92,6 +94,10 @@
return IWifiStaIface::FeatureSetMask::ND_OFFLOAD;
case WIFI_FEATURE_MKEEP_ALIVE:
return IWifiStaIface::FeatureSetMask::KEEP_ALIVE;
+ case WIFI_FEATURE_ROAMING_MODE_CONTROL:
+ return IWifiStaIface::FeatureSetMask::ROAMING_MODE_CONTROL;
+ case WIFI_FEATURE_CACHED_SCAN_RESULTS:
+ return IWifiStaIface::FeatureSetMask::CACHED_SCAN_DATA;
};
CHECK(false) << "Unknown legacy feature: " << feature;
return {};
@@ -109,7 +115,8 @@
WIFI_FEATURE_INFRA_60G,
WIFI_FEATURE_SET_LATENCY_MODE,
WIFI_FEATURE_P2P_RAND_MAC,
- WIFI_FEATURE_AFC_CHANNEL};
+ WIFI_FEATURE_AFC_CHANNEL,
+ WIFI_FEATURE_SET_VOIP_MODE};
for (const auto feature : features) {
if (feature & legacy_feature_set) {
*aidl_feature_set |= static_cast<uint32_t>(convertLegacyChipFeatureToAidl(feature));
@@ -457,7 +464,8 @@
{WIFI_FEATURE_GSCAN, WIFI_FEATURE_LINK_LAYER_STATS, WIFI_FEATURE_RSSI_MONITOR,
WIFI_FEATURE_CONTROL_ROAMING, WIFI_FEATURE_IE_WHITELIST, WIFI_FEATURE_SCAN_RAND,
WIFI_FEATURE_INFRA_5G, WIFI_FEATURE_HOTSPOT, WIFI_FEATURE_PNO, WIFI_FEATURE_TDLS,
- WIFI_FEATURE_TDLS_OFFCHANNEL, WIFI_FEATURE_CONFIG_NDO, WIFI_FEATURE_MKEEP_ALIVE}) {
+ WIFI_FEATURE_TDLS_OFFCHANNEL, WIFI_FEATURE_CONFIG_NDO, WIFI_FEATURE_MKEEP_ALIVE,
+ WIFI_FEATURE_ROAMING_MODE_CONTROL, WIFI_FEATURE_CACHED_SCAN_RESULTS}) {
if (feature & legacy_feature_set) {
*aidl_feature_set |= static_cast<uint32_t>(convertLegacyStaIfaceFeatureToAidl(feature));
}
@@ -1147,6 +1155,8 @@
return legacy_hal::ROAMING_ENABLE;
case StaRoamingState::DISABLED:
return legacy_hal::ROAMING_DISABLE;
+ case StaRoamingState::AGGRESSIVE:
+ return legacy_hal::ROAMING_AGGRESSIVE;
};
CHECK(false);
}
@@ -2088,6 +2098,17 @@
memcpy(legacy_request->scid, aidl_request.securityConfig.scid.data(), legacy_request->scid_len);
legacy_request->publish_subscribe_id = static_cast<uint8_t>(aidl_request.discoverySessionId);
+ legacy_request->csia_capabilities |=
+ aidl_request.securityConfig.enable16ReplyCountersForTksa ? 0x1 : 0x0;
+ legacy_request->csia_capabilities |=
+ aidl_request.securityConfig.enable16ReplyCountersForGtksa ? 0x8 : 0x0;
+ if (aidl_request.securityConfig.supportGtkAndIgtk) {
+ legacy_request->csia_capabilities |= aidl_request.securityConfig.supportBigtksa ? 0x4 : 0x2;
+ }
+ legacy_request->csia_capabilities |= aidl_request.securityConfig.enableNcsBip256 ? 0x16 : 0x0;
+ legacy_request->gtk_protection =
+ aidl_request.securityConfig.requiresEnhancedFrameProtection ? 1 : 0;
+
return true;
}
@@ -2170,6 +2191,17 @@
memcpy(legacy_request->scid, aidl_request.securityConfig.scid.data(), legacy_request->scid_len);
legacy_request->publish_subscribe_id = static_cast<uint8_t>(aidl_request.discoverySessionId);
+ legacy_request->csia_capabilities |=
+ aidl_request.securityConfig.enable16ReplyCountersForTksa ? 0x1 : 0x0;
+ legacy_request->csia_capabilities |=
+ aidl_request.securityConfig.enable16ReplyCountersForGtksa ? 0x8 : 0x0;
+ if (aidl_request.securityConfig.supportGtkAndIgtk) {
+ legacy_request->csia_capabilities |= aidl_request.securityConfig.supportBigtksa ? 0x4 : 0x2;
+ }
+ legacy_request->csia_capabilities |= aidl_request.securityConfig.enableNcsBip256 ? 0x16 : 0x0;
+ legacy_request->gtk_protection =
+ aidl_request.securityConfig.requiresEnhancedFrameProtection ? 1 : 0;
+
return true;
}
@@ -2394,8 +2426,11 @@
switch (type) {
case RttType::ONE_SIDED:
return legacy_hal::RTT_TYPE_1_SIDED;
- case RttType::TWO_SIDED:
- return legacy_hal::RTT_TYPE_2_SIDED;
+ case RttType::TWO_SIDED_11MC:
+ // Same as RttType::TWO_SIDED
+ return legacy_hal::RTT_TYPE_2_SIDED_11MC;
+ case RttType::TWO_SIDED_11AZ_NTB:
+ return legacy_hal::RTT_TYPE_2_SIDED_11AZ_NTB;
};
CHECK(false);
}
@@ -2404,8 +2439,11 @@
switch (type) {
case legacy_hal::RTT_TYPE_1_SIDED:
return RttType::ONE_SIDED;
- case legacy_hal::RTT_TYPE_2_SIDED:
- return RttType::TWO_SIDED;
+ case legacy_hal::RTT_TYPE_2_SIDED_11MC:
+ // Same as legacy_hal::RTT_TYPE_2_SIDED
+ return RttType::TWO_SIDED_11MC;
+ case legacy_hal::RTT_TYPE_2_SIDED_11AZ_NTB:
+ return RttType::TWO_SIDED_11AZ_NTB;
};
CHECK(false) << "Unknown legacy type: " << type;
}
@@ -2485,6 +2523,8 @@
return legacy_hal::WIFI_RTT_PREAMBLE_HE;
case RttPreamble::EHT:
return legacy_hal::WIFI_RTT_PREAMBLE_EHT;
+ case RttPreamble::INVALID:
+ return legacy_hal::WIFI_RTT_PREAMBLE_INVALID;
};
CHECK(false);
}
@@ -2501,6 +2541,8 @@
return RttPreamble::HE;
case legacy_hal::WIFI_RTT_PREAMBLE_EHT:
return RttPreamble::EHT;
+ case legacy_hal::WIFI_RTT_PREAMBLE_INVALID:
+ return RttPreamble::INVALID;
};
CHECK(false) << "Unknown legacy type: " << type;
}
@@ -2690,6 +2732,21 @@
return true;
}
+bool convertAidlRttConfigToLegacyV3(const RttConfig& aidl_config,
+ legacy_hal::wifi_rtt_config_v3* legacy_config) {
+ if (!legacy_config) {
+ return false;
+ }
+ *legacy_config = {};
+ if (!convertAidlRttConfigToLegacy(aidl_config, &(legacy_config->rtt_config))) {
+ return false;
+ }
+ legacy_config->tx_ltf_repetition_count = aidl_config.txLtfRepetitionCount;
+ legacy_config->ntb_min_measurement_time_millis = aidl_config.ntbMinMeasurementTimeMillis;
+ legacy_config->ntb_max_measurement_time_millis = aidl_config.ntbMaxMeasurementTimeMillis;
+ return true;
+}
+
bool convertAidlVectorOfRttConfigToLegacy(
const std::vector<RttConfig>& aidl_configs,
std::vector<legacy_hal::wifi_rtt_config>* legacy_configs) {
@@ -2699,7 +2756,24 @@
*legacy_configs = {};
for (const auto& aidl_config : aidl_configs) {
legacy_hal::wifi_rtt_config legacy_config;
- if (!convertAidlRttConfigToLegacy(aidl_config, &legacy_config)) {
+ if (!convertAidlRttConfigToLegacy(aidl_config, &(legacy_config))) {
+ return false;
+ }
+ legacy_configs->push_back(legacy_config);
+ }
+ return true;
+}
+
+bool convertAidlVectorOfRttConfigToLegacyV3(
+ const std::vector<RttConfig>& aidl_configs,
+ std::vector<legacy_hal::wifi_rtt_config_v3>* legacy_configs) {
+ if (!legacy_configs) {
+ return false;
+ }
+ *legacy_configs = {};
+ for (const auto& aidl_config : aidl_configs) {
+ legacy_hal::wifi_rtt_config_v3 legacy_config;
+ if (!convertAidlRttConfigToLegacyV3(aidl_config, &legacy_config)) {
return false;
}
legacy_configs->push_back(legacy_config);
@@ -2768,6 +2842,34 @@
return true;
}
+RttPreamble convertLegacyRttPreambleBitmapToAidl(byte legacyPreambleBitmap) {
+ int32_t aidlPreambleBitmap = 0;
+ for (const auto flag : {legacy_hal::WIFI_RTT_PREAMBLE_LEGACY, legacy_hal::WIFI_RTT_PREAMBLE_HT,
+ legacy_hal::WIFI_RTT_PREAMBLE_VHT, legacy_hal::WIFI_RTT_PREAMBLE_HE,
+ legacy_hal::WIFI_RTT_PREAMBLE_EHT}) {
+ if (legacyPreambleBitmap & flag) {
+ aidlPreambleBitmap |= static_cast<std::underlying_type<RttPreamble>::type>(
+ convertLegacyRttPreambleToAidl(flag));
+ }
+ }
+
+ return static_cast<RttPreamble>(aidlPreambleBitmap);
+}
+
+RttBw convertLegacyRttBwBitmapToAidl(byte legacyBwBitmap) {
+ int32_t aidlBwBitmap = 0;
+ for (const auto flag :
+ {legacy_hal::WIFI_RTT_BW_5, legacy_hal::WIFI_RTT_BW_10, legacy_hal::WIFI_RTT_BW_20,
+ legacy_hal::WIFI_RTT_BW_40, legacy_hal::WIFI_RTT_BW_80, legacy_hal::WIFI_RTT_BW_160,
+ legacy_hal::WIFI_RTT_BW_320}) {
+ if (legacyBwBitmap & flag) {
+ aidlBwBitmap |=
+ static_cast<std::underlying_type<RttBw>::type>(convertLegacyRttBwToAidl(flag));
+ }
+ }
+ return static_cast<RttBw>(aidlBwBitmap);
+}
+
bool convertLegacyRttCapabilitiesToAidl(
const legacy_hal::wifi_rtt_capabilities& legacy_capabilities,
RttCapabilities* aidl_capabilities) {
@@ -2780,28 +2882,44 @@
aidl_capabilities->lciSupported = legacy_capabilities.lci_support;
aidl_capabilities->lcrSupported = legacy_capabilities.lcr_support;
aidl_capabilities->responderSupported = legacy_capabilities.responder_supported;
- int32_t preambleSupport = 0;
- for (const auto flag : {legacy_hal::WIFI_RTT_PREAMBLE_LEGACY, legacy_hal::WIFI_RTT_PREAMBLE_HT,
- legacy_hal::WIFI_RTT_PREAMBLE_VHT, legacy_hal::WIFI_RTT_PREAMBLE_HE,
- legacy_hal::WIFI_RTT_PREAMBLE_EHT}) {
- if (legacy_capabilities.preamble_support & flag) {
- preambleSupport |= static_cast<std::underlying_type<RttPreamble>::type>(
- convertLegacyRttPreambleToAidl(flag));
- }
- }
- aidl_capabilities->preambleSupport = static_cast<RttPreamble>(preambleSupport);
- int32_t bwSupport = 0;
- for (const auto flag :
- {legacy_hal::WIFI_RTT_BW_5, legacy_hal::WIFI_RTT_BW_10, legacy_hal::WIFI_RTT_BW_20,
- legacy_hal::WIFI_RTT_BW_40, legacy_hal::WIFI_RTT_BW_80, legacy_hal::WIFI_RTT_BW_160,
- legacy_hal::WIFI_RTT_BW_320}) {
- if (legacy_capabilities.bw_support & flag) {
- bwSupport |=
- static_cast<std::underlying_type<RttBw>::type>(convertLegacyRttBwToAidl(flag));
- }
- }
- aidl_capabilities->bwSupport = static_cast<RttBw>(bwSupport);
+ aidl_capabilities->preambleSupport =
+ convertLegacyRttPreambleBitmapToAidl(legacy_capabilities.preamble_support);
+ aidl_capabilities->bwSupport = convertLegacyRttBwBitmapToAidl(legacy_capabilities.bw_support);
aidl_capabilities->mcVersion = legacy_capabilities.mc_version;
+ // Initialize 11az parameters to default
+ aidl_capabilities->azPreambleSupport = RttPreamble::INVALID;
+ aidl_capabilities->azBwSupport = RttBw::BW_UNSPECIFIED;
+ aidl_capabilities->ntbInitiatorSupported = false;
+ aidl_capabilities->ntbResponderSupported = false;
+ aidl_capabilities->maxTxLtfRepetitionCount = 0;
+ return true;
+}
+
+bool convertLegacyRttCapabilitiesV3ToAidl(
+ const legacy_hal::wifi_rtt_capabilities_v3& legacy_capabilities_v3,
+ RttCapabilities* aidl_capabilities) {
+ if (!aidl_capabilities) {
+ return false;
+ }
+ *aidl_capabilities = {};
+ aidl_capabilities->rttOneSidedSupported =
+ legacy_capabilities_v3.rtt_capab.rtt_one_sided_supported;
+ aidl_capabilities->rttFtmSupported = legacy_capabilities_v3.rtt_capab.rtt_ftm_supported;
+ aidl_capabilities->lciSupported = legacy_capabilities_v3.rtt_capab.lci_support;
+ aidl_capabilities->lcrSupported = legacy_capabilities_v3.rtt_capab.lcr_support;
+ aidl_capabilities->responderSupported = legacy_capabilities_v3.rtt_capab.responder_supported;
+ aidl_capabilities->preambleSupport =
+ convertLegacyRttPreambleBitmapToAidl(legacy_capabilities_v3.rtt_capab.preamble_support);
+ aidl_capabilities->bwSupport =
+ convertLegacyRttBwBitmapToAidl(legacy_capabilities_v3.rtt_capab.bw_support);
+ aidl_capabilities->mcVersion = legacy_capabilities_v3.rtt_capab.mc_version;
+ aidl_capabilities->azPreambleSupport =
+ convertLegacyRttPreambleBitmapToAidl(legacy_capabilities_v3.az_preamble_support);
+ aidl_capabilities->azBwSupport =
+ convertLegacyRttBwBitmapToAidl(legacy_capabilities_v3.az_bw_support);
+ aidl_capabilities->ntbInitiatorSupported = legacy_capabilities_v3.ntb_initiator_supported;
+ aidl_capabilities->ntbResponderSupported = legacy_capabilities_v3.ntb_responder_supported;
+ aidl_capabilities->maxTxLtfRepetitionCount = legacy_capabilities_v3.max_tx_ltf_repetition_count;
return true;
}
@@ -2876,6 +2994,9 @@
}
aidl_result.channelFreqMHz = 0;
aidl_result.packetBw = RttBw::BW_UNSPECIFIED;
+ aidl_result.txLtfRepetitionCount = 0;
+ aidl_result.ntbMinMeasurementTimeMillis = 0;
+ aidl_result.ntbMaxMeasurementTimeMillis = 0;
aidl_results->push_back(aidl_result);
}
return true;
@@ -2896,6 +3017,33 @@
aidl_result.channelFreqMHz =
legacy_result->frequency != UNSPECIFIED ? legacy_result->frequency : 0;
aidl_result.packetBw = convertLegacyRttBwToAidl(legacy_result->packet_bw);
+ aidl_result.txLtfRepetitionCount = 0;
+ aidl_result.ntbMinMeasurementTimeMillis = 0;
+ aidl_result.ntbMaxMeasurementTimeMillis = 0;
+ aidl_results->push_back(aidl_result);
+ }
+ return true;
+}
+
+bool convertLegacyVectorOfRttResultV3ToAidl(
+ const std::vector<const legacy_hal::wifi_rtt_result_v3*>& legacy_results,
+ std::vector<RttResult>* aidl_results) {
+ if (!aidl_results) {
+ return false;
+ }
+ *aidl_results = {};
+ for (const auto legacy_result : legacy_results) {
+ RttResult aidl_result;
+ if (!convertLegacyRttResultToAidl(legacy_result->rtt_result.rtt_result, &aidl_result)) {
+ return false;
+ }
+ aidl_result.channelFreqMHz = legacy_result->rtt_result.frequency != UNSPECIFIED
+ ? legacy_result->rtt_result.frequency
+ : 0;
+ aidl_result.packetBw = convertLegacyRttBwToAidl(legacy_result->rtt_result.packet_bw);
+ aidl_result.txLtfRepetitionCount = legacy_result->tx_ltf_repetition_count;
+ aidl_result.ntbMinMeasurementTimeMillis = legacy_result->ntb_min_measurement_time_millis;
+ aidl_result.ntbMaxMeasurementTimeMillis = legacy_result->ntb_max_measurement_time_millis;
aidl_results->push_back(aidl_result);
}
return true;
@@ -3178,6 +3326,8 @@
legacy_request->cookie_length = aidl_request.cookie.size();
memcpy(legacy_request->cookie, aidl_request.cookie.data(), legacy_request->cookie_length);
+ legacy_request->publish_subscribe_id = static_cast<uint8_t>(aidl_request.discoverySessionId);
+ legacy_request->comeback = aidl_request.isComeback ? 0x1 : 0x0;
return true;
}
@@ -3195,6 +3345,7 @@
legacy_request->service_instance_id = aidl_request.bootstrappingInstanceId;
legacy_request->rsp_code = aidl_request.acceptRequest ? NAN_BOOTSTRAPPING_REQUEST_ACCEPT
: NAN_BOOTSTRAPPING_REQUEST_REJECT;
+ legacy_request->publish_subscribe_id = static_cast<uint8_t>(aidl_request.discoverySessionId);
return true;
}
@@ -3362,6 +3513,195 @@
return true;
}
+bool convertCachedScanReportToAidl(const legacy_hal::WifiCachedScanReport& report,
+ CachedScanData* aidl_scan_data) {
+ if (!aidl_scan_data) {
+ return false;
+ }
+ *aidl_scan_data = {};
+
+ std::vector<CachedScanResult> aidl_scan_results;
+ for (const auto& result : report.results) {
+ CachedScanResult aidl_scan_result;
+ if (!convertCachedScanResultToAidl(result, report.ts, &aidl_scan_result)) {
+ return false;
+ }
+ aidl_scan_results.push_back(aidl_scan_result);
+ }
+ aidl_scan_data->cachedScanResults = aidl_scan_results;
+
+ aidl_scan_data->scannedFrequenciesMhz = report.scanned_freqs;
+ return true;
+}
+
+bool convertCachedScanResultToAidl(const legacy_hal::wifi_cached_scan_result& legacy_scan_result,
+ uint64_t ts_us, CachedScanResult* aidl_scan_result) {
+ if (!aidl_scan_result) {
+ return false;
+ }
+ *aidl_scan_result = {};
+ aidl_scan_result->timeStampInUs = ts_us - legacy_scan_result.age_ms * 1000;
+ if (aidl_scan_result->timeStampInUs < 0) {
+ aidl_scan_result->timeStampInUs = 0;
+ return false;
+ }
+ size_t max_len_excluding_null = sizeof(legacy_scan_result.ssid) - 1;
+ size_t ssid_len = strnlen((const char*)legacy_scan_result.ssid, max_len_excluding_null);
+ aidl_scan_result->ssid =
+ std::vector<uint8_t>(legacy_scan_result.ssid, legacy_scan_result.ssid + ssid_len);
+ aidl_scan_result->bssid = std::array<uint8_t, 6>();
+ std::copy(legacy_scan_result.bssid, legacy_scan_result.bssid + 6,
+ std::begin(aidl_scan_result->bssid));
+ aidl_scan_result->frequencyMhz = legacy_scan_result.chanspec.primary_frequency;
+ aidl_scan_result->channelWidthMhz =
+ convertLegacyWifiChannelWidthToAidl(legacy_scan_result.chanspec.width);
+ aidl_scan_result->rssiDbm = legacy_scan_result.rssi;
+ aidl_scan_result->preambleType = convertScanResultFlagsToPreambleType(legacy_scan_result.flags);
+ return true;
+}
+
+WifiRatePreamble convertScanResultFlagsToPreambleType(int flags) {
+ if ((flags & WIFI_CACHED_SCAN_RESULT_FLAGS_EHT_OPS_PRESENT) > 0) {
+ return WifiRatePreamble::EHT;
+ }
+ if ((flags & WIFI_CACHED_SCAN_RESULT_FLAGS_HE_OPS_PRESENT) > 0) {
+ return WifiRatePreamble::HE;
+ }
+ if ((flags & WIFI_CACHED_SCAN_RESULT_FLAGS_VHT_OPS_PRESENT) > 0) {
+ return WifiRatePreamble::VHT;
+ }
+ if ((flags & WIFI_CACHED_SCAN_RESULT_FLAGS_HT_OPS_PRESENT) > 0) {
+ return WifiRatePreamble::HT;
+ }
+ return WifiRatePreamble::OFDM;
+}
+
+bool convertTwtCapabilitiesToAidl(legacy_hal::wifi_twt_capabilities legacy_twt_capabs,
+ TwtCapabilities* aidl_twt_capabs) {
+ if (!aidl_twt_capabs) {
+ return false;
+ }
+ aidl_twt_capabs->isTwtRequesterSupported = legacy_twt_capabs.is_twt_requester_supported;
+ aidl_twt_capabs->isTwtResponderSupported = legacy_twt_capabs.is_twt_responder_supported;
+ aidl_twt_capabs->isBroadcastTwtSupported = legacy_twt_capabs.is_flexible_twt_supported;
+ if (legacy_twt_capabs.min_wake_duration_micros > legacy_twt_capabs.max_wake_duration_micros) {
+ return false;
+ }
+ aidl_twt_capabs->minWakeDurationMicros = legacy_twt_capabs.min_wake_duration_micros;
+ aidl_twt_capabs->maxWakeDurationMicros = legacy_twt_capabs.max_wake_duration_micros;
+ if (legacy_twt_capabs.min_wake_interval_micros > legacy_twt_capabs.max_wake_interval_micros) {
+ return false;
+ }
+ aidl_twt_capabs->minWakeIntervalMicros = legacy_twt_capabs.min_wake_interval_micros;
+ aidl_twt_capabs->maxWakeIntervalMicros = legacy_twt_capabs.max_wake_interval_micros;
+ return true;
+}
+
+bool convertAidlTwtRequestToLegacy(const TwtRequest aidl_twt_request,
+ legacy_hal::wifi_twt_request* legacy_twt_request) {
+ if (legacy_twt_request == nullptr) {
+ return false;
+ }
+ legacy_twt_request->mlo_link_id = aidl_twt_request.mloLinkId;
+ if (aidl_twt_request.minWakeDurationMicros > aidl_twt_request.maxWakeDurationMicros) {
+ return false;
+ }
+ legacy_twt_request->min_wake_duration_micros = aidl_twt_request.minWakeDurationMicros;
+ legacy_twt_request->max_wake_duration_micros = aidl_twt_request.maxWakeDurationMicros;
+ if (aidl_twt_request.minWakeIntervalMicros > aidl_twt_request.maxWakeIntervalMicros) {
+ return false;
+ }
+ legacy_twt_request->min_wake_interval_micros = aidl_twt_request.minWakeIntervalMicros;
+ legacy_twt_request->max_wake_interval_micros = aidl_twt_request.maxWakeIntervalMicros;
+ return true;
+}
+
+IWifiStaIfaceEventCallback::TwtErrorCode convertLegacyHalTwtErrorCodeToAidl(
+ legacy_hal::wifi_twt_error_code legacy_error_code) {
+ switch (legacy_error_code) {
+ case WIFI_TWT_ERROR_CODE_TIMEOUT:
+ return IWifiStaIfaceEventCallback::TwtErrorCode::TIMEOUT;
+ case WIFI_TWT_ERROR_CODE_PEER_REJECTED:
+ return IWifiStaIfaceEventCallback::TwtErrorCode::PEER_REJECTED;
+ case WIFI_TWT_ERROR_CODE_PEER_NOT_SUPPORTED:
+ return IWifiStaIfaceEventCallback::TwtErrorCode::PEER_NOT_SUPPORTED;
+ case WIFI_TWT_ERROR_CODE_NOT_SUPPORTED:
+ return IWifiStaIfaceEventCallback::TwtErrorCode::NOT_SUPPORTED;
+ case WIFI_TWT_ERROR_CODE_NOT_AVAILABLE:
+ return IWifiStaIfaceEventCallback::TwtErrorCode::NOT_AVAILABLE;
+ case WIFI_TWT_ERROR_CODE_MAX_SESSION_REACHED:
+ return IWifiStaIfaceEventCallback::TwtErrorCode::MAX_SESSION_REACHED;
+ case WIFI_TWT_ERROR_CODE_INVALID_PARAMS:
+ return IWifiStaIfaceEventCallback::TwtErrorCode::INVALID_PARAMS;
+ case WIFI_TWT_ERROR_CODE_ALREADY_SUSPENDED:
+ return IWifiStaIfaceEventCallback::TwtErrorCode::ALREADY_SUSPENDED;
+ case WIFI_TWT_ERROR_CODE_ALREADY_RESUMED:
+ return IWifiStaIfaceEventCallback::TwtErrorCode::ALREADY_RESUMED;
+ default:
+ return IWifiStaIfaceEventCallback::TwtErrorCode::FAILURE_UNKNOWN;
+ }
+}
+
+IWifiStaIfaceEventCallback::TwtTeardownReasonCode convertLegacyHalTwtReasonCodeToAidl(
+ legacy_hal::wifi_twt_teardown_reason_code legacy_reason_code) {
+ switch (legacy_reason_code) {
+ case WIFI_TWT_TEARDOWN_REASON_CODE_LOCALLY_REQUESTED:
+ return IWifiStaIfaceEventCallback::TwtTeardownReasonCode::LOCALLY_REQUESTED;
+ case WIFI_TWT_TEARDOWN_REASON_CODE_INTERNALLY_INITIATED:
+ return IWifiStaIfaceEventCallback::TwtTeardownReasonCode::INTERNALLY_INITIATED;
+ case WIFI_TWT_TEARDOWN_REASON_CODE_PEER_INITIATED:
+ return IWifiStaIfaceEventCallback::TwtTeardownReasonCode::PEER_INITIATED;
+ default:
+ return IWifiStaIfaceEventCallback::TwtTeardownReasonCode::UNKNOWN;
+ }
+}
+
+bool convertLegacyHalTwtSessionToAidl(legacy_hal::wifi_twt_session twt_session,
+ TwtSession* aidl_twt_session) {
+ if (aidl_twt_session == nullptr) {
+ return false;
+ }
+
+ aidl_twt_session->sessionId = twt_session.session_id;
+ aidl_twt_session->mloLinkId = twt_session.mlo_link_id;
+ aidl_twt_session->wakeDurationMicros = twt_session.wake_duration_micros;
+ aidl_twt_session->wakeIntervalMicros = twt_session.wake_interval_micros;
+ switch (twt_session.negotiation_type) {
+ case WIFI_TWT_NEGO_TYPE_INDIVIDUAL:
+ aidl_twt_session->negotiationType = TwtSession::TwtNegotiationType::INDIVIDUAL;
+ break;
+ case WIFI_TWT_NEGO_TYPE_BROADCAST:
+ aidl_twt_session->negotiationType = TwtSession::TwtNegotiationType::BROADCAST;
+ break;
+ default:
+ return false;
+ }
+ aidl_twt_session->isTriggerEnabled = twt_session.is_trigger_enabled;
+ aidl_twt_session->isAnnounced = twt_session.is_announced;
+ aidl_twt_session->isImplicit = twt_session.is_implicit;
+ aidl_twt_session->isProtected = twt_session.is_protected;
+ aidl_twt_session->isUpdatable = twt_session.is_updatable;
+ aidl_twt_session->isSuspendable = twt_session.is_suspendable;
+ aidl_twt_session->isResponderPmModeEnabled = twt_session.is_responder_pm_mode_enabled;
+ return true;
+}
+
+bool convertLegacyHalTwtSessionStatsToAidl(legacy_hal::wifi_twt_session_stats twt_stats,
+ TwtSessionStats* aidl_twt_stats) {
+ if (aidl_twt_stats == nullptr) {
+ return false;
+ }
+
+ aidl_twt_stats->avgTxPktCount = twt_stats.avg_pkt_num_tx;
+ aidl_twt_stats->avgRxPktCount = twt_stats.avg_pkt_num_rx;
+ aidl_twt_stats->avgTxPktSize = twt_stats.avg_tx_pkt_size;
+ aidl_twt_stats->avgRxPktSize = twt_stats.avg_rx_pkt_size;
+ aidl_twt_stats->avgEospDurationMicros = twt_stats.avg_eosp_dur_us;
+ aidl_twt_stats->eospCount = twt_stats.eosp_count;
+
+ return true;
+}
+
} // namespace aidl_struct_util
} // namespace wifi
} // namespace hardware
diff --git a/wifi/aidl/default/aidl_struct_util.h b/wifi/aidl/default/aidl_struct_util.h
index e4ff963..7089363 100644
--- a/wifi/aidl/default/aidl_struct_util.h
+++ b/wifi/aidl/default/aidl_struct_util.h
@@ -148,6 +148,10 @@
// RTT controller conversion methods.
bool convertAidlVectorOfRttConfigToLegacy(const std::vector<RttConfig>& aidl_configs,
std::vector<legacy_hal::wifi_rtt_config>* legacy_configs);
+bool convertAidlVectorOfRttConfigToLegacyV3(
+ const std::vector<RttConfig>& aidl_configs,
+ std::vector<legacy_hal::wifi_rtt_config_v3>* legacy_configs);
+
bool convertAidlRttLciInformationToLegacy(const RttLciInformation& aidl_info,
legacy_hal::wifi_lci_information* legacy_info);
bool convertAidlRttLcrInformationToLegacy(const RttLcrInformation& aidl_info,
@@ -161,12 +165,19 @@
bool convertLegacyRttCapabilitiesToAidl(
const legacy_hal::wifi_rtt_capabilities& legacy_capabilities,
RttCapabilities* aidl_capabilities);
+bool convertLegacyRttCapabilitiesV3ToAidl(
+ const legacy_hal::wifi_rtt_capabilities_v3& legacy_capabilities_v3,
+ RttCapabilities* aidl_capabilities);
+
bool convertLegacyVectorOfRttResultToAidl(
const std::vector<const legacy_hal::wifi_rtt_result*>& legacy_results,
std::vector<RttResult>* aidl_results);
bool convertLegacyVectorOfRttResultV2ToAidl(
const std::vector<const legacy_hal::wifi_rtt_result_v2*>& legacy_results,
std::vector<RttResult>* aidl_results);
+bool convertLegacyVectorOfRttResultV3ToAidl(
+ const std::vector<const legacy_hal::wifi_rtt_result_v3*>& legacy_results,
+ std::vector<RttResult>* aidl_results);
uint32_t convertAidlWifiBandToLegacyMacBand(WifiBand band);
uint32_t convertAidlWifiIfaceModeToLegacy(uint32_t aidl_iface_mask);
uint32_t convertAidlUsableChannelFilterToLegacy(uint32_t aidl_filter_mask);
@@ -202,6 +213,23 @@
const legacy_hal::NanBootstrappingConfirmInd& legacy_ind,
NanBootstrappingConfirmInd* aidl_ind);
uint32_t convertAidlChannelCategoryToLegacy(uint32_t aidl_channel_category_mask);
+bool convertCachedScanReportToAidl(const legacy_hal::WifiCachedScanReport& report,
+ CachedScanData* aidl_scan_data);
+bool convertCachedScanResultToAidl(const legacy_hal::wifi_cached_scan_result& legacy_scan_result,
+ uint64_t ts_us, CachedScanResult* aidl_scan_result);
+WifiRatePreamble convertScanResultFlagsToPreambleType(int flags);
+bool convertTwtCapabilitiesToAidl(const legacy_hal::wifi_twt_capabilities legacy_twt_capabs,
+ TwtCapabilities* aidl_twt_capabs);
+bool convertAidlTwtRequestToLegacy(const TwtRequest aidl_twt_request,
+ legacy_hal::wifi_twt_request* legacy_twt_request);
+IWifiStaIfaceEventCallback::TwtErrorCode convertLegacyHalTwtErrorCodeToAidl(
+ legacy_hal::wifi_twt_error_code legacy_error_code);
+IWifiStaIfaceEventCallback::TwtTeardownReasonCode convertLegacyHalTwtReasonCodeToAidl(
+ legacy_hal::wifi_twt_teardown_reason_code legacy_reason_code);
+bool convertLegacyHalTwtSessionToAidl(legacy_hal::wifi_twt_session twt_session,
+ TwtSession* aidl_twt_session);
+bool convertLegacyHalTwtSessionStatsToAidl(legacy_hal::wifi_twt_session_stats twt_stats,
+ TwtSessionStats* aidl_twt_stats);
} // namespace aidl_struct_util
} // namespace wifi
} // namespace hardware
diff --git a/wifi/aidl/default/android.hardware.wifi-service.xml b/wifi/aidl/default/android.hardware.wifi-service.xml
index 5398ee7..3b68c8e 100644
--- a/wifi/aidl/default/android.hardware.wifi-service.xml
+++ b/wifi/aidl/default/android.hardware.wifi-service.xml
@@ -1,6 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.wifi</name>
+ <version>2</version>
<fqname>IWifi/default</fqname>
</hal>
</manifest>
diff --git a/wifi/aidl/default/tests/aidl_struct_util_unit_tests.cpp b/wifi/aidl/default/tests/aidl_struct_util_unit_tests.cpp
index 995a13d..2a030ee 100644
--- a/wifi/aidl/default/tests/aidl_struct_util_unit_tests.cpp
+++ b/wifi/aidl/default/tests/aidl_struct_util_unit_tests.cpp
@@ -35,6 +35,12 @@
0x2c, 0x00, 0x00, 0x41, 0x06, 0x03, 0x06, 0x00, 0x80};
byte LCR[] = {0x27, 0xE, 0x1, 0x00, 0xB, 0x01, 0x00, 0x0b, 0x00, 0x09,
0x55, 0x53, 0x18, 0x05, 0x39, 0x34, 0x30, 0x34, 0x33};
+
+constexpr int kNumScanResult = 2;
+constexpr int kRssi[] = {-60, -70};
+constexpr uint8_t kBssid[] = {0x12, 0x34, 0x56, 0x78, 0x9a, 0};
+constexpr uint8_t kSsidLen = 6;
+constexpr char kSsid[] = {'a', 'b', 'c', 'd', 'e', '\0'};
} // namespace
namespace aidl {
@@ -883,6 +889,51 @@
}
}
+TEST_F(AidlStructUtilTest, convertCachedScanReportToAidl) {
+ legacy_hal::WifiCachedScanReport hw_report;
+
+ hw_report.ts = 10000000;
+ std::vector<int> scanned_freqs{5260, 2437, 5200};
+ std::vector<wifi_cached_scan_result> results;
+ hw_report.scanned_freqs = scanned_freqs;
+
+ for (int i = 0; i < kNumScanResult; i++) {
+ wifi_cached_scan_result result;
+ result.age_ms = i * 1000;
+ result.capability = i;
+ memcpy(result.ssid, kSsid, kSsidLen);
+ result.ssid_len = kSsidLen;
+ memcpy(result.bssid, kBssid, 6);
+ result.flags = WIFI_CACHED_SCAN_RESULT_FLAGS_HE_OPS_PRESENT;
+ result.rssi = kRssi[i];
+ result.chanspec = {legacy_hal::WIFI_CHAN_WIDTH_40, 0, 0, i};
+ results.push_back(result);
+ }
+ hw_report.results = results;
+
+ CachedScanData aidl_data;
+ aidl_struct_util::convertCachedScanReportToAidl(hw_report, &aidl_data);
+
+ EXPECT_EQ(scanned_freqs.size(), aidl_data.scannedFrequenciesMhz.size());
+ EXPECT_EQ(scanned_freqs[2], aidl_data.scannedFrequenciesMhz[2]);
+ EXPECT_EQ(5260, aidl_data.scannedFrequenciesMhz[0]);
+ EXPECT_EQ(kNumScanResult, (int)aidl_data.cachedScanResults.size());
+ for (int i = 0; i < kNumScanResult; i++) {
+ EXPECT_EQ(hw_report.results[i].rssi, aidl_data.cachedScanResults[i].rssiDbm);
+ EXPECT_EQ(i, aidl_data.cachedScanResults[i].frequencyMhz);
+ int64_t expected_ts = 10000000 - i * 1000 * 1000;
+ EXPECT_EQ(expected_ts, aidl_data.cachedScanResults[i].timeStampInUs);
+ EXPECT_EQ(WifiRatePreamble::HE, aidl_data.cachedScanResults[i].preambleType);
+ EXPECT_EQ(WifiChannelWidthInMhz::WIDTH_40, aidl_data.cachedScanResults[i].channelWidthMhz);
+ for (int k = 0; k < 6; k++) {
+ EXPECT_EQ(kBssid[k], aidl_data.cachedScanResults[i].bssid[k]);
+ }
+ for (int k = 0; k < kSsidLen; k++) {
+ EXPECT_EQ(kSsid[k], aidl_data.cachedScanResults[i].ssid[k]);
+ }
+ }
+}
+
} // namespace wifi
} // namespace hardware
} // namespace android
diff --git a/wifi/aidl/default/wifi.cpp b/wifi/aidl/default/wifi.cpp
index 34a7f35..12017b6 100644
--- a/wifi/aidl/default/wifi.cpp
+++ b/wifi/aidl/default/wifi.cpp
@@ -16,15 +16,153 @@
#include "wifi.h"
+#include <android-base/file.h>
#include <android-base/logging.h>
+#include <cutils/properties.h>
+#include <sys/stat.h>
+#include <sys/sysmacros.h>
#include "aidl_return_util.h"
#include "aidl_sync_util.h"
#include "wifi_status_util.h"
namespace {
+using android::base::unique_fd;
+
// Starting Chip ID, will be assigned to primary chip
static constexpr int32_t kPrimaryChipId = 0;
+constexpr char kCpioMagic[] = "070701";
+constexpr char kTombstoneFolderPath[] = "/data/vendor/tombstones/wifi/";
+
+// Helper function for |cpioArchiveFilesInDir|
+bool cpioWriteHeader(int out_fd, struct stat& st, const char* file_name, size_t file_name_len) {
+ const int buf_size = 32 * 1024;
+ std::array<char, buf_size> read_buf;
+ ssize_t llen = snprintf(
+ read_buf.data(), buf_size, "%s%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X",
+ kCpioMagic, static_cast<int>(st.st_ino), st.st_mode, st.st_uid, st.st_gid,
+ static_cast<int>(st.st_nlink), static_cast<int>(st.st_mtime),
+ static_cast<int>(st.st_size), major(st.st_dev), minor(st.st_dev), major(st.st_rdev),
+ minor(st.st_rdev), static_cast<uint32_t>(file_name_len), 0);
+ if (write(out_fd, read_buf.data(), llen < buf_size ? llen : buf_size - 1) == -1) {
+ PLOG(ERROR) << "Error writing cpio header to file " << file_name;
+ return false;
+ }
+ if (write(out_fd, file_name, file_name_len) == -1) {
+ PLOG(ERROR) << "Error writing filename to file " << file_name;
+ return false;
+ }
+
+ // NUL Pad header up to 4 multiple bytes.
+ llen = (llen + file_name_len) % 4;
+ if (llen != 0) {
+ const uint32_t zero = 0;
+ if (write(out_fd, &zero, 4 - llen) == -1) {
+ PLOG(ERROR) << "Error padding 0s to file " << file_name;
+ return false;
+ }
+ }
+ return true;
+}
+
+// Helper function for |cpioArchiveFilesInDir|
+size_t cpioWriteFileContent(int fd_read, int out_fd, struct stat& st) {
+ // writing content of file
+ std::array<char, 32 * 1024> read_buf;
+ ssize_t llen = st.st_size;
+ size_t n_error = 0;
+ while (llen > 0) {
+ ssize_t bytes_read = read(fd_read, read_buf.data(), read_buf.size());
+ if (bytes_read == -1) {
+ PLOG(ERROR) << "Error reading file";
+ return ++n_error;
+ }
+ llen -= bytes_read;
+ if (write(out_fd, read_buf.data(), bytes_read) == -1) {
+ PLOG(ERROR) << "Error writing data to file";
+ return ++n_error;
+ }
+ if (bytes_read == 0) { // this should never happen, but just in case
+ // to unstuck from while loop
+ PLOG(ERROR) << "Unexpected read result";
+ n_error++;
+ break;
+ }
+ }
+ llen = st.st_size % 4;
+ if (llen != 0) {
+ const uint32_t zero = 0;
+ if (write(out_fd, &zero, 4 - llen) == -1) {
+ PLOG(ERROR) << "Error padding 0s to file";
+ return ++n_error;
+ }
+ }
+ return n_error;
+}
+
+// Helper function for |cpioArchiveFilesInDir|
+bool cpioWriteFileTrailer(int out_fd) {
+ const int buf_size = 4096;
+ std::array<char, buf_size> read_buf;
+ read_buf.fill(0);
+ ssize_t llen = snprintf(read_buf.data(), 4096, "070701%040X%056X%08XTRAILER!!!", 1, 0x0b, 0);
+ if (write(out_fd, read_buf.data(), (llen < buf_size ? llen : buf_size - 1) + 4) == -1) {
+ PLOG(ERROR) << "Error writing trailing bytes";
+ return false;
+ }
+ return true;
+}
+
+// Archives all files in |input_dir| and writes result into |out_fd|
+// Logic obtained from //external/toybox/toys/posix/cpio.c "Output cpio archive"
+// portion
+size_t cpioArchiveFilesInDir(int out_fd, const char* input_dir) {
+ struct dirent* dp;
+ size_t n_error = 0;
+ std::unique_ptr<DIR, decltype(&closedir)> dir_dump(opendir(input_dir), closedir);
+ if (!dir_dump) {
+ PLOG(ERROR) << "Failed to open directory";
+ return ++n_error;
+ }
+ while ((dp = readdir(dir_dump.get()))) {
+ if (dp->d_type != DT_REG) {
+ continue;
+ }
+ std::string cur_file_name(dp->d_name);
+ struct stat st;
+ const std::string cur_file_path = kTombstoneFolderPath + cur_file_name;
+ if (stat(cur_file_path.c_str(), &st) == -1) {
+ PLOG(ERROR) << "Failed to get file stat for " << cur_file_path;
+ n_error++;
+ continue;
+ }
+ const int fd_read = open(cur_file_path.c_str(), O_RDONLY);
+ if (fd_read == -1) {
+ PLOG(ERROR) << "Failed to open file " << cur_file_path;
+ n_error++;
+ continue;
+ }
+ std::string file_name_with_last_modified_time =
+ cur_file_name + "-" + std::to_string(st.st_mtime);
+ // string.size() does not include the null terminator. The cpio FreeBSD
+ // file header expects the null character to be included in the length.
+ const size_t file_name_len = file_name_with_last_modified_time.size() + 1;
+ unique_fd file_auto_closer(fd_read);
+ if (!cpioWriteHeader(out_fd, st, file_name_with_last_modified_time.c_str(),
+ file_name_len)) {
+ return ++n_error;
+ }
+ size_t write_error = cpioWriteFileContent(fd_read, out_fd, st);
+ if (write_error) {
+ return n_error + write_error;
+ }
+ }
+ if (!cpioWriteFileTrailer(out_fd)) {
+ return ++n_error;
+ }
+ return n_error;
+}
+
} // namespace
namespace aidl {
@@ -82,15 +220,18 @@
binder_status_t Wifi::dump(int fd, const char** args, uint32_t numArgs) {
const auto lock = acquireGlobalLock();
LOG(INFO) << "-----------Debug was called----------------";
- if (chips_.size() == 0) {
- LOG(INFO) << "No chips to display.";
- return STATUS_OK;
+ if (chips_.size() != 0) {
+ for (std::shared_ptr<WifiChip> chip : chips_) {
+ if (!chip.get()) continue;
+ chip->dump(fd, args, numArgs);
+ }
}
-
- for (std::shared_ptr<WifiChip> chip : chips_) {
- if (!chip.get()) continue;
- chip->dump(fd, args, numArgs);
+ uint32_t n_error = cpioArchiveFilesInDir(fd, kTombstoneFolderPath);
+ if (n_error != 0) {
+ LOG(ERROR) << n_error << " errors occurred in cpio function";
}
+ ::android::base::WriteStringToFd("\n", fd);
+ fsync(fd);
return STATUS_OK;
}
diff --git a/wifi/aidl/default/wifi_chip.cpp b/wifi/aidl/default/wifi_chip.cpp
index 8265e5b..9b9c565 100644
--- a/wifi/aidl/default/wifi_chip.cpp
+++ b/wifi/aidl/default/wifi_chip.cpp
@@ -20,6 +20,7 @@
#include <android-base/unique_fd.h>
#include <cutils/properties.h>
#include <fcntl.h>
+#include <hardware_legacy/wifi_hal.h>
#include <net/if.h>
#include <sys/stat.h>
#include <sys/sysmacros.h>
@@ -32,13 +33,8 @@
#define P2P_MGMT_DEVICE_PREFIX "p2p-dev-"
namespace {
-using aidl::android::hardware::wifi::IfaceType;
-using aidl::android::hardware::wifi::IWifiChip;
-using CoexRestriction = aidl::android::hardware::wifi::IWifiChip::CoexRestriction;
-using ChannelCategoryMask = aidl::android::hardware::wifi::IWifiChip::ChannelCategoryMask;
using android::base::unique_fd;
-constexpr char kCpioMagic[] = "070701";
constexpr size_t kMaxBufferSizeBytes = 1024 * 1024 * 3;
constexpr uint32_t kMaxRingBufferFileAgeSeconds = 60 * 60 * 10;
constexpr uint32_t kMaxRingBufferFileNum = 20;
@@ -215,135 +211,6 @@
return success;
}
-// Helper function for |cpioArchiveFilesInDir|
-bool cpioWriteHeader(int out_fd, struct stat& st, const char* file_name, size_t file_name_len) {
- const int buf_size = 32 * 1024;
- std::array<char, buf_size> read_buf;
- ssize_t llen = snprintf(
- read_buf.data(), buf_size, "%s%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X",
- kCpioMagic, static_cast<int>(st.st_ino), st.st_mode, st.st_uid, st.st_gid,
- static_cast<int>(st.st_nlink), static_cast<int>(st.st_mtime),
- static_cast<int>(st.st_size), major(st.st_dev), minor(st.st_dev), major(st.st_rdev),
- minor(st.st_rdev), static_cast<uint32_t>(file_name_len), 0);
- if (write(out_fd, read_buf.data(), llen < buf_size ? llen : buf_size - 1) == -1) {
- PLOG(ERROR) << "Error writing cpio header to file " << file_name;
- return false;
- }
- if (write(out_fd, file_name, file_name_len) == -1) {
- PLOG(ERROR) << "Error writing filename to file " << file_name;
- return false;
- }
-
- // NUL Pad header up to 4 multiple bytes.
- llen = (llen + file_name_len) % 4;
- if (llen != 0) {
- const uint32_t zero = 0;
- if (write(out_fd, &zero, 4 - llen) == -1) {
- PLOG(ERROR) << "Error padding 0s to file " << file_name;
- return false;
- }
- }
- return true;
-}
-
-// Helper function for |cpioArchiveFilesInDir|
-size_t cpioWriteFileContent(int fd_read, int out_fd, struct stat& st) {
- // writing content of file
- std::array<char, 32 * 1024> read_buf;
- ssize_t llen = st.st_size;
- size_t n_error = 0;
- while (llen > 0) {
- ssize_t bytes_read = read(fd_read, read_buf.data(), read_buf.size());
- if (bytes_read == -1) {
- PLOG(ERROR) << "Error reading file";
- return ++n_error;
- }
- llen -= bytes_read;
- if (write(out_fd, read_buf.data(), bytes_read) == -1) {
- PLOG(ERROR) << "Error writing data to file";
- return ++n_error;
- }
- if (bytes_read == 0) { // this should never happen, but just in case
- // to unstuck from while loop
- PLOG(ERROR) << "Unexpected read result";
- n_error++;
- break;
- }
- }
- llen = st.st_size % 4;
- if (llen != 0) {
- const uint32_t zero = 0;
- if (write(out_fd, &zero, 4 - llen) == -1) {
- PLOG(ERROR) << "Error padding 0s to file";
- return ++n_error;
- }
- }
- return n_error;
-}
-
-// Helper function for |cpioArchiveFilesInDir|
-bool cpioWriteFileTrailer(int out_fd) {
- const int buf_size = 4096;
- std::array<char, buf_size> read_buf;
- read_buf.fill(0);
- ssize_t llen = snprintf(read_buf.data(), 4096, "070701%040X%056X%08XTRAILER!!!", 1, 0x0b, 0);
- if (write(out_fd, read_buf.data(), (llen < buf_size ? llen : buf_size - 1) + 4) == -1) {
- PLOG(ERROR) << "Error writing trailing bytes";
- return false;
- }
- return true;
-}
-
-// Archives all files in |input_dir| and writes result into |out_fd|
-// Logic obtained from //external/toybox/toys/posix/cpio.c "Output cpio archive"
-// portion
-size_t cpioArchiveFilesInDir(int out_fd, const char* input_dir) {
- struct dirent* dp;
- size_t n_error = 0;
- std::unique_ptr<DIR, decltype(&closedir)> dir_dump(opendir(input_dir), closedir);
- if (!dir_dump) {
- PLOG(ERROR) << "Failed to open directory";
- return ++n_error;
- }
- while ((dp = readdir(dir_dump.get()))) {
- if (dp->d_type != DT_REG) {
- continue;
- }
- std::string cur_file_name(dp->d_name);
- struct stat st;
- const std::string cur_file_path = kTombstoneFolderPath + cur_file_name;
- if (stat(cur_file_path.c_str(), &st) == -1) {
- PLOG(ERROR) << "Failed to get file stat for " << cur_file_path;
- n_error++;
- continue;
- }
- const int fd_read = open(cur_file_path.c_str(), O_RDONLY);
- if (fd_read == -1) {
- PLOG(ERROR) << "Failed to open file " << cur_file_path;
- n_error++;
- continue;
- }
- std::string file_name_with_last_modified_time =
- cur_file_name + "-" + std::to_string(st.st_mtime);
- // string.size() does not include the null terminator. The cpio FreeBSD
- // file header expects the null character to be included in the length.
- const size_t file_name_len = file_name_with_last_modified_time.size() + 1;
- unique_fd file_auto_closer(fd_read);
- if (!cpioWriteHeader(out_fd, st, file_name_with_last_modified_time.c_str(),
- file_name_len)) {
- return ++n_error;
- }
- size_t write_error = cpioWriteFileContent(fd_read, out_fd, st);
- if (write_error) {
- return n_error + write_error;
- }
- }
- if (!cpioWriteFileTrailer(out_fd)) {
- return ++n_error;
- }
- return n_error;
-}
-
// Helper function to create a non-const char*.
std::vector<char> makeCharVec(const std::string& str) {
std::vector<char> vec(str.size() + 1);
@@ -503,6 +370,14 @@
&WifiChip::createBridgedApIfaceInternal, _aidl_return);
}
+ndk::ScopedAStatus WifiChip::createApOrBridgedApIface(
+ IfaceConcurrencyType in_ifaceType, const std::vector<common::OuiKeyedData>& in_vendorData,
+ std::shared_ptr<IWifiApIface>* _aidl_return) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
+ &WifiChip::createApOrBridgedApIfaceInternal, _aidl_return, in_ifaceType,
+ in_vendorData);
+}
+
ndk::ScopedAStatus WifiChip::getApIfaceNames(std::vector<std::string>* _aidl_return) {
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
&WifiChip::getApIfaceNamesInternal, _aidl_return);
@@ -651,7 +526,7 @@
&WifiChip::setLatencyModeInternal, in_mode);
}
-binder_status_t WifiChip::dump(int fd, const char**, uint32_t) {
+binder_status_t WifiChip::dump(int fd __unused, const char**, uint32_t) {
{
std::unique_lock<std::mutex> lk(lock_t);
for (const auto& item : ringbuffer_map_) {
@@ -664,11 +539,6 @@
if (!writeRingbufferFilesInternal()) {
LOG(ERROR) << "Error writing files to flash";
}
- uint32_t n_error = cpioArchiveFilesInDir(fd, kTombstoneFolderPath);
- if (n_error != 0) {
- LOG(ERROR) << n_error << " errors occurred in cpio function";
- }
- fsync(fd);
return STATUS_OK;
}
@@ -736,6 +606,11 @@
&WifiChip::setMloModeInternal, in_mode);
}
+ndk::ScopedAStatus WifiChip::setVoipMode(const VoipMode in_mode) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_CHIP_INVALID,
+ &WifiChip::setVoipModeInternal, in_mode);
+}
+
void WifiChip::invalidateAndRemoveAllIfaces() {
invalidateAndClearBridgedApAll();
invalidateAndClearAll(ap_ifaces_);
@@ -993,6 +868,18 @@
return {iface, ndk::ScopedAStatus::ok()};
}
+std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus>
+WifiChip::createApOrBridgedApIfaceInternal(
+ IfaceConcurrencyType ifaceType, const std::vector<common::OuiKeyedData>& /* vendorData */) {
+ if (ifaceType == IfaceConcurrencyType::AP) {
+ return createApIfaceInternal();
+ } else if (ifaceType == IfaceConcurrencyType::AP_BRIDGED) {
+ return createBridgedApIfaceInternal();
+ } else {
+ return {nullptr, createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS)};
+ }
+}
+
std::pair<std::vector<std::string>, ndk::ScopedAStatus> WifiChip::getApIfaceNamesInternal() {
if (ap_ifaces_.empty()) {
return {std::vector<std::string>(), ndk::ScopedAStatus::ok()};
@@ -2032,6 +1919,23 @@
return createWifiStatusFromLegacyError(legacy_hal_.lock()->setMloMode(mode));
}
+ndk::ScopedAStatus WifiChip::setVoipModeInternal(const WifiChip::VoipMode in_mode) {
+ const auto ifname = getFirstActiveWlanIfaceName();
+ wifi_voip_mode mode;
+ switch (in_mode) {
+ case WifiChip::VoipMode::VOICE:
+ mode = wifi_voip_mode::WIFI_VOIP_MODE_VOICE;
+ break;
+ case WifiChip::VoipMode::OFF:
+ mode = wifi_voip_mode::WIFI_VOIP_MODE_OFF;
+ break;
+ default:
+ PLOG(ERROR) << "Error: invalid mode: " << toString(in_mode);
+ return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+ }
+ return createWifiStatusFromLegacyError(legacy_hal_.lock()->setVoipMode(ifname, mode));
+}
+
} // namespace wifi
} // namespace hardware
} // namespace android
diff --git a/wifi/aidl/default/wifi_chip.h b/wifi/aidl/default/wifi_chip.h
index 1a36032..ffd507f 100644
--- a/wifi/aidl/default/wifi_chip.h
+++ b/wifi/aidl/default/wifi_chip.h
@@ -19,6 +19,7 @@
#include <aidl/android/hardware/wifi/BnWifiChip.h>
#include <aidl/android/hardware/wifi/IWifiRttController.h>
+#include <aidl/android/hardware/wifi/common/OuiKeyedData.h>
#include <android-base/macros.h>
#include <list>
@@ -96,6 +97,10 @@
ndk::ScopedAStatus requestFirmwareDebugDump(std::vector<uint8_t>* _aidl_return) override;
ndk::ScopedAStatus createApIface(std::shared_ptr<IWifiApIface>* _aidl_return) override;
ndk::ScopedAStatus createBridgedApIface(std::shared_ptr<IWifiApIface>* _aidl_return) override;
+ ndk::ScopedAStatus createApOrBridgedApIface(
+ IfaceConcurrencyType in_ifaceType,
+ const std::vector<common::OuiKeyedData>& in_vendorData,
+ std::shared_ptr<IWifiApIface>* _aidl_return) override;
ndk::ScopedAStatus getApIfaceNames(std::vector<std::string>* _aidl_return) override;
ndk::ScopedAStatus getApIface(const std::string& in_ifname,
std::shared_ptr<IWifiApIface>* _aidl_return) override;
@@ -153,6 +158,7 @@
int32_t in_channelCategoryEnableFlag) override;
binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
ndk::ScopedAStatus setMloMode(const ChipMloMode in_mode) override;
+ ndk::ScopedAStatus setVoipMode(const VoipMode in_mode) override;
private:
void invalidateAndRemoveAllIfaces();
@@ -176,6 +182,8 @@
ndk::ScopedAStatus createVirtualApInterface(const std::string& apVirtIf);
std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus> createApIfaceInternal();
std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus> createBridgedApIfaceInternal();
+ std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus> createApOrBridgedApIfaceInternal(
+ IfaceConcurrencyType ifaceType, const std::vector<common::OuiKeyedData>& vendorData);
std::pair<std::vector<std::string>, ndk::ScopedAStatus> getApIfaceNamesInternal();
std::pair<std::shared_ptr<IWifiApIface>, ndk::ScopedAStatus> getApIfaceInternal(
const std::string& ifname);
@@ -262,6 +270,7 @@
getSupportedRadioCombinationsInternal();
std::pair<WifiChipCapabilities, ndk::ScopedAStatus> getWifiChipCapabilitiesInternal();
ndk::ScopedAStatus setMloModeInternal(const ChipMloMode in_mode);
+ ndk::ScopedAStatus setVoipModeInternal(const VoipMode in_mode);
void retrieveDynamicIfaceCombination();
void setWeakPtr(std::weak_ptr<WifiChip> ptr);
diff --git a/wifi/aidl/default/wifi_legacy_hal.cpp b/wifi/aidl/default/wifi_legacy_hal.cpp
index 209670b..55d6f59 100644
--- a/wifi/aidl/default/wifi_legacy_hal.cpp
+++ b/wifi/aidl/default/wifi_legacy_hal.cpp
@@ -183,10 +183,13 @@
on_rtt_results_internal_callback;
std::function<void(wifi_request_id, unsigned num_results, wifi_rtt_result_v2* rtt_results_v2[])>
on_rtt_results_internal_callback_v2;
+std::function<void(wifi_request_id, unsigned num_results, wifi_rtt_result_v3* rtt_results_v3[])>
+ on_rtt_results_internal_callback_v3;
void invalidateRttResultsCallbacks() {
on_rtt_results_internal_callback = nullptr;
on_rtt_results_internal_callback_v2 = nullptr;
+ on_rtt_results_internal_callback_v3 = nullptr;
};
void onAsyncRttResults(wifi_request_id id, unsigned num_results, wifi_rtt_result* rtt_results[]) {
@@ -206,6 +209,15 @@
}
}
+void onAsyncRttResultsV3(wifi_request_id id, unsigned num_results,
+ wifi_rtt_result_v3* rtt_results_v3[]) {
+ const auto lock = aidl_sync_util::acquireGlobalLock();
+ if (on_rtt_results_internal_callback_v3) {
+ on_rtt_results_internal_callback_v3(id, num_results, rtt_results_v3);
+ invalidateRttResultsCallbacks();
+ }
+}
+
// Callbacks for the various NAN operations.
// NOTE: These have very little conversions to perform before invoking the user
// callbacks.
@@ -439,11 +451,82 @@
// Callback to report cached scan results
std::function<void(wifi_cached_scan_report*)> on_cached_scan_results_internal_callback;
void onSyncCachedScanResults(wifi_cached_scan_report* cache_report) {
+ const auto lock = aidl_sync_util::acquireGlobalLock();
if (on_cached_scan_results_internal_callback) {
on_cached_scan_results_internal_callback(cache_report);
}
}
+// Callback to be invoked for TWT failure
+std::function<void((wifi_request_id, wifi_twt_error_code error_code))>
+ on_twt_failure_internal_callback;
+void onAsyncTwtError(wifi_request_id id, wifi_twt_error_code error_code) {
+ const auto lock = aidl_sync_util::acquireGlobalLock();
+ if (on_twt_failure_internal_callback) {
+ on_twt_failure_internal_callback(id, error_code);
+ }
+}
+
+// Callback to be invoked for TWT session creation
+std::function<void((wifi_request_id, wifi_twt_session twt_session))>
+ on_twt_session_create_internal_callback;
+void onAsyncTwtSessionCreate(wifi_request_id id, wifi_twt_session twt_session) {
+ const auto lock = aidl_sync_util::acquireGlobalLock();
+ if (on_twt_session_create_internal_callback) {
+ on_twt_session_create_internal_callback(id, twt_session);
+ }
+}
+
+// Callback to be invoked for TWT session update
+std::function<void((wifi_request_id, wifi_twt_session twt_session))>
+ on_twt_session_update_internal_callback;
+void onAsyncTwtSessionUpdate(wifi_request_id id, wifi_twt_session twt_session) {
+ const auto lock = aidl_sync_util::acquireGlobalLock();
+ if (on_twt_session_update_internal_callback) {
+ on_twt_session_update_internal_callback(id, twt_session);
+ }
+}
+
+// Callback to be invoked for TWT session teardown
+std::function<void(
+ (wifi_request_id, int twt_session_id, wifi_twt_teardown_reason_code reason_code))>
+ on_twt_session_teardown_internal_callback;
+void onAsyncTwtSessionTeardown(wifi_request_id id, int twt_session_id,
+ wifi_twt_teardown_reason_code reason_code) {
+ const auto lock = aidl_sync_util::acquireGlobalLock();
+ if (on_twt_session_teardown_internal_callback) {
+ on_twt_session_teardown_internal_callback(id, twt_session_id, reason_code);
+ }
+}
+
+// Callback to be invoked for TWT session get stats
+std::function<void((wifi_request_id, int twt_session_id, wifi_twt_session_stats stats))>
+ on_twt_session_stats_internal_callback;
+void onAsyncTwtSessionStats(wifi_request_id id, int twt_session_id, wifi_twt_session_stats stats) {
+ const auto lock = aidl_sync_util::acquireGlobalLock();
+ if (on_twt_session_stats_internal_callback) {
+ on_twt_session_stats_internal_callback(id, twt_session_id, stats);
+ }
+}
+
+// Callback to be invoked for TWT session suspend
+std::function<void((wifi_request_id, int twt_session_id))> on_twt_session_suspend_internal_callback;
+void onAsyncTwtSessionSuspend(wifi_request_id id, int twt_session_id) {
+ const auto lock = aidl_sync_util::acquireGlobalLock();
+ if (on_twt_session_suspend_internal_callback) {
+ on_twt_session_suspend_internal_callback(id, twt_session_id);
+ }
+}
+
+// Callback to be invoked for TWT session resume
+std::function<void((wifi_request_id, int twt_session_id))> on_twt_session_resume_internal_callback;
+void onAsyncTwtSessionResume(wifi_request_id id, int twt_session_id) {
+ const auto lock = aidl_sync_util::acquireGlobalLock();
+ if (on_twt_session_resume_internal_callback) {
+ on_twt_session_resume_internal_callback(id, twt_session_id);
+ }
+}
+
// End of the free-standing "C" style callbacks.
WifiLegacyHal::WifiLegacyHal(const std::weak_ptr<::android::wifi_system::InterfaceTool> iface_tool,
@@ -1251,6 +1334,38 @@
return status;
}
+wifi_error WifiLegacyHal::startRttRangeRequestV3(
+ const std::string& iface_name, wifi_request_id id,
+ const std::vector<wifi_rtt_config_v3>& rtt_configs,
+ const on_rtt_results_callback_v3& on_results_user_callback_v3) {
+ if (on_rtt_results_internal_callback_v3) {
+ return WIFI_ERROR_NOT_AVAILABLE;
+ }
+
+ on_rtt_results_internal_callback_v3 = [on_results_user_callback_v3](
+ wifi_request_id id, unsigned num_results,
+ wifi_rtt_result_v3* rtt_results_v3[]) {
+ if (num_results > 0 && !rtt_results_v3) {
+ LOG(ERROR) << "Unexpected nullptr in RTT v3 results";
+ return;
+ }
+ std::vector<const wifi_rtt_result_v3*> rtt_results_vec_v3;
+ std::copy_if(rtt_results_v3, rtt_results_v3 + num_results,
+ back_inserter(rtt_results_vec_v3),
+ [](wifi_rtt_result_v3* rtt_result_v3) { return rtt_result_v3 != nullptr; });
+ on_results_user_callback_v3(id, rtt_results_vec_v3);
+ };
+
+ std::vector<wifi_rtt_config_v3> rtt_configs_internal(rtt_configs);
+ wifi_error status = global_func_table_.wifi_rtt_range_request_v3(
+ id, getIfaceHandle(iface_name), rtt_configs.size(), rtt_configs_internal.data(),
+ {onAsyncRttResultsV3});
+ if (status != WIFI_SUCCESS) {
+ invalidateRttResultsCallbacks();
+ }
+ return status;
+}
+
wifi_error WifiLegacyHal::startRttRangeRequest(
const std::string& iface_name, wifi_request_id id,
const std::vector<wifi_rtt_config>& rtt_configs,
@@ -1327,6 +1442,14 @@
return {status, rtt_caps};
}
+std::pair<wifi_error, wifi_rtt_capabilities_v3> WifiLegacyHal::getRttCapabilitiesV3(
+ const std::string& iface_name) {
+ wifi_rtt_capabilities_v3 rtt_caps_v3;
+ wifi_error status = global_func_table_.wifi_get_rtt_capabilities_v3(getIfaceHandle(iface_name),
+ &rtt_caps_v3);
+ return {status, rtt_caps_v3};
+}
+
std::pair<wifi_error, wifi_rtt_responder> WifiLegacyHal::getRttResponderInfo(
const std::string& iface_name) {
wifi_rtt_responder rtt_responder;
@@ -1736,6 +1859,103 @@
return global_func_table_.wifi_set_voip_mode(getIfaceHandle(iface_name), mode);
}
+std::pair<wifi_twt_capabilities, wifi_error> WifiLegacyHal::twtGetCapabilities(
+ const std::string& ifaceName) {
+ wifi_twt_capabilities capabs = {};
+ wifi_error status =
+ global_func_table_.wifi_twt_get_capabilities(getIfaceHandle(ifaceName), &capabs);
+ return {capabs, status};
+}
+
+wifi_error WifiLegacyHal::twtSessionSetup(
+ const std::string& ifaceName, uint32_t cmdId, const wifi_twt_request& request,
+ const on_twt_failure& on_twt_failure_user_callback,
+ const on_twt_session_create& on_twt_session_create_user_callback,
+ const on_twt_session_update& on_twt_session_update_user_callback,
+ const on_twt_session_teardown& on_twt_session_teardown_user_callback,
+ const on_twt_session_stats& on_twt_session_stats_user_callback,
+ const on_twt_session_suspend& on_twt_session_suspend_user_callback,
+ const on_twt_session_resume& on_twt_session_resume_user_callback) {
+ if (on_twt_failure_internal_callback || on_twt_session_create_internal_callback ||
+ on_twt_session_update_internal_callback || on_twt_session_teardown_internal_callback ||
+ on_twt_session_stats_internal_callback) {
+ return WIFI_ERROR_NOT_AVAILABLE;
+ }
+
+ on_twt_failure_internal_callback = [on_twt_failure_user_callback](
+ wifi_request_id id, wifi_twt_error_code error_code) {
+ on_twt_failure_user_callback(id, error_code);
+ };
+
+ on_twt_session_create_internal_callback = [on_twt_session_create_user_callback](
+ wifi_request_id id,
+ wifi_twt_session twt_session) {
+ on_twt_session_create_user_callback(id, twt_session);
+ };
+
+ on_twt_session_update_internal_callback = [on_twt_session_update_user_callback](
+ wifi_request_id id,
+ wifi_twt_session twt_session) {
+ on_twt_session_update_user_callback(id, twt_session);
+ };
+
+ on_twt_session_teardown_internal_callback = [on_twt_session_teardown_user_callback](
+ wifi_request_id id, int session_id,
+ wifi_twt_teardown_reason_code reason_code) {
+ on_twt_session_teardown_user_callback(id, session_id, reason_code);
+ };
+
+ on_twt_session_stats_internal_callback = [on_twt_session_stats_user_callback](
+ wifi_request_id id, int session_id,
+ wifi_twt_session_stats stats) {
+ on_twt_session_stats_user_callback(id, session_id, stats);
+ };
+
+ on_twt_session_suspend_internal_callback = [on_twt_session_suspend_user_callback](
+ wifi_request_id id, int session_id) {
+ on_twt_session_suspend_user_callback(id, session_id);
+ };
+
+ on_twt_session_resume_internal_callback = [on_twt_session_resume_user_callback](
+ wifi_request_id id, int session_id) {
+ on_twt_session_resume_user_callback(id, session_id);
+ };
+
+ return global_func_table_.wifi_twt_session_setup(
+ cmdId, getIfaceHandle(ifaceName), request,
+ {onAsyncTwtError, onAsyncTwtSessionCreate, onAsyncTwtSessionUpdate,
+ onAsyncTwtSessionTeardown, onAsyncTwtSessionStats, onAsyncTwtSessionSuspend,
+ onAsyncTwtSessionResume});
+}
+
+wifi_error WifiLegacyHal::twtSessionUpdate(const std::string& ifaceName, uint32_t cmdId,
+ uint32_t sessionId, const wifi_twt_request& request) {
+ return global_func_table_.wifi_twt_session_update(cmdId, getIfaceHandle(ifaceName), sessionId,
+ request);
+}
+
+wifi_error WifiLegacyHal::twtSessionSuspend(const std::string& ifaceName, uint32_t cmdId,
+ uint32_t sessionId) {
+ return global_func_table_.wifi_twt_session_suspend(cmdId, getIfaceHandle(ifaceName), sessionId);
+}
+
+wifi_error WifiLegacyHal::twtSessionResume(const std::string& ifaceName, uint32_t cmdId,
+ uint32_t sessionId) {
+ return global_func_table_.wifi_twt_session_resume(cmdId, getIfaceHandle(ifaceName), sessionId);
+}
+
+wifi_error WifiLegacyHal::twtSessionTeardown(const std::string& ifaceName, uint32_t cmdId,
+ uint32_t sessionId) {
+ return global_func_table_.wifi_twt_session_teardown(cmdId, getIfaceHandle(ifaceName),
+ sessionId);
+}
+
+wifi_error WifiLegacyHal::twtSessionGetStats(const std::string& ifaceName, uint32_t cmdId,
+ uint32_t sessionId) {
+ return global_func_table_.wifi_twt_session_get_stats(cmdId, getIfaceHandle(ifaceName),
+ sessionId);
+}
+
wifi_error WifiLegacyHal::twtRegisterHandler(const std::string& iface_name,
const TwtCallbackHandlers& user_callbacks) {
on_twt_event_setup_response_callback = user_callbacks.on_setup_response;
@@ -1858,13 +2078,16 @@
return global_func_table_.wifi_enable_tx_power_limits(getIfaceHandle(iface_name), enable);
}
-wifi_error WifiLegacyHal::getWifiCachedScanResults(
- const std::string& iface_name, const CachedScanResultsCallbackHandlers& handler) {
- on_cached_scan_results_internal_callback = handler.on_cached_scan_results;
-
+wifi_error WifiLegacyHal::getWifiCachedScanResults(const std::string& iface_name,
+ WifiCachedScanReport& report) {
+ on_cached_scan_results_internal_callback = [&report](wifi_cached_scan_report* report_ptr) {
+ report.results.assign(report_ptr->results, report_ptr->results + report_ptr->result_cnt);
+ report.scanned_freqs.assign(report_ptr->scanned_freq_list,
+ report_ptr->scanned_freq_list + report_ptr->scanned_freq_num);
+ report.ts = report_ptr->ts;
+ };
wifi_error status = global_func_table_.wifi_get_cached_scan_results(getIfaceHandle(iface_name),
{onSyncCachedScanResults});
-
on_cached_scan_results_internal_callback = nullptr;
return status;
}
@@ -1934,6 +2157,7 @@
on_twt_event_info_frame_received_callback = nullptr;
on_twt_event_device_notify_callback = nullptr;
on_chre_nan_rtt_internal_callback = nullptr;
+ on_cached_scan_results_internal_callback = nullptr;
}
} // namespace legacy_hal
diff --git a/wifi/aidl/default/wifi_legacy_hal.h b/wifi/aidl/default/wifi_legacy_hal.h
index 5168a8b..121d1b5 100644
--- a/wifi/aidl/default/wifi_legacy_hal.h
+++ b/wifi/aidl/default/wifi_legacy_hal.h
@@ -186,6 +186,7 @@
using ::NanTxType;
using ::NpkSecurityAssociation;
using ::PASN;
+using ::ROAMING_AGGRESSIVE;
using ::ROAMING_DISABLE;
using ::ROAMING_ENABLE;
using ::RTT_PEER_AP;
@@ -214,6 +215,8 @@
using ::RTT_STATUS_SUCCESS;
using ::RTT_TYPE_1_SIDED;
using ::RTT_TYPE_2_SIDED;
+using ::RTT_TYPE_2_SIDED_11AZ_NTB;
+using ::RTT_TYPE_2_SIDED_11MC;
using ::RX_PKT_FATE_DRV_DROP_FILTER;
using ::RX_PKT_FATE_DRV_DROP_INVALID;
using ::RX_PKT_FATE_DRV_DROP_NOBUFS;
@@ -256,6 +259,7 @@
using ::WIFI_BAND_BG;
using ::WIFI_BAND_UNSPECIFIED;
using ::wifi_cached_scan_report;
+using ::wifi_cached_scan_result;
using ::wifi_cached_scan_results;
using ::WIFI_CHAN_WIDTH_10;
using ::WIFI_CHAN_WIDTH_160;
@@ -349,16 +353,20 @@
using ::WIFI_RTT_BW_80;
using ::WIFI_RTT_BW_UNSPECIFIED;
using ::wifi_rtt_capabilities;
+using ::wifi_rtt_capabilities_v3;
using ::wifi_rtt_config;
+using ::wifi_rtt_config_v3;
using ::wifi_rtt_preamble;
using ::WIFI_RTT_PREAMBLE_EHT;
using ::WIFI_RTT_PREAMBLE_HE;
using ::WIFI_RTT_PREAMBLE_HT;
+using ::WIFI_RTT_PREAMBLE_INVALID;
using ::WIFI_RTT_PREAMBLE_LEGACY;
using ::WIFI_RTT_PREAMBLE_VHT;
using ::wifi_rtt_responder;
using ::wifi_rtt_result;
using ::wifi_rtt_result_v2;
+using ::wifi_rtt_result_v3;
using ::wifi_rtt_status;
using ::wifi_rtt_type;
using ::wifi_rx_packet_fate;
@@ -368,6 +376,13 @@
using ::WIFI_SCAN_FLAG_INTERRUPTED;
using ::wifi_scan_result;
using ::WIFI_SUCCESS;
+using ::wifi_twt_capabilities;
+using ::wifi_twt_error_code;
+using ::wifi_twt_events;
+using ::wifi_twt_request;
+using ::wifi_twt_session;
+using ::wifi_twt_session_stats;
+using ::wifi_twt_teardown_reason_code;
using ::wifi_tx_packet_fate;
using ::wifi_tx_report;
using ::wifi_usable_channel;
@@ -422,6 +437,12 @@
bool valid;
};
+struct WifiCachedScanReport {
+ uint64_t ts;
+ std::vector<int> scanned_freqs;
+ std::vector<wifi_cached_scan_result> results;
+};
+
#pragma GCC diagnostic pop
// The |WLAN_DRIVER_WAKE_REASON_CNT.cmd_event_wake_cnt| and
@@ -485,6 +506,8 @@
std::function<void(wifi_request_id, const std::vector<const wifi_rtt_result*>&)>;
using on_rtt_results_callback_v2 =
std::function<void(wifi_request_id, const std::vector<const wifi_rtt_result_v2*>&)>;
+using on_rtt_results_callback_v3 =
+ std::function<void(wifi_request_id, const std::vector<const wifi_rtt_result_v3*>&)>;
// Callback for ring buffer data.
using on_ring_buffer_data_callback = std::function<void(
@@ -532,12 +555,23 @@
std::function<void(chre_nan_rtt_state)> on_wifi_chre_nan_rtt_state;
};
-// Cached Scan Results response and event callbacks struct.
-struct CachedScanResultsCallbackHandlers {
+using on_cached_scan_results_callback = std::function<void(wifi_cached_scan_report*)>;
+
+struct CachedScanResultsCallbfackHandlers {
// Callback for Cached Scan Results
std::function<void(wifi_cached_scan_report*)> on_cached_scan_results;
};
+using on_twt_failure = std::function<void(wifi_request_id id, wifi_twt_error_code error_code)>;
+using on_twt_session_create = std::function<void(wifi_request_id id, wifi_twt_session twt_session)>;
+using on_twt_session_update = std::function<void(wifi_request_id id, wifi_twt_session twt_session)>;
+using on_twt_session_teardown = std::function<void(wifi_request_id id, int session_id,
+ wifi_twt_teardown_reason_code reason_code)>;
+using on_twt_session_stats =
+ std::function<void(wifi_request_id id, int session_id, wifi_twt_session_stats stats)>;
+using on_twt_session_suspend = std::function<void(wifi_request_id id, int session_id)>;
+using on_twt_session_resume = std::function<void(wifi_request_id id, int session_id)>;
+
/**
* Class that encapsulates all legacy HAL interactions.
* This class manages the lifetime of the event loop thread used by legacy HAL.
@@ -659,9 +693,15 @@
const std::vector<wifi_rtt_config>& rtt_configs,
const on_rtt_results_callback& on_results_callback,
const on_rtt_results_callback_v2& on_results_callback_v2);
+ wifi_error startRttRangeRequestV3(const std::string& iface_name, wifi_request_id id,
+ const std::vector<wifi_rtt_config_v3>& rtt_configs,
+ const on_rtt_results_callback_v3& on_results_callback);
+
wifi_error cancelRttRangeRequest(const std::string& iface_name, wifi_request_id id,
const std::vector<std::array<uint8_t, ETH_ALEN>>& mac_addrs);
std::pair<wifi_error, wifi_rtt_capabilities> getRttCapabilities(const std::string& iface_name);
+ std::pair<wifi_error, wifi_rtt_capabilities_v3> getRttCapabilitiesV3(
+ const std::string& iface_name);
std::pair<wifi_error, wifi_rtt_responder> getRttResponderInfo(const std::string& iface_name);
wifi_error enableRttResponder(const std::string& iface_name, wifi_request_id id,
const wifi_channel_info& channel_hint, uint32_t max_duration_secs,
@@ -738,19 +778,39 @@
wifi_error setVoipMode(const std::string& iface_name, wifi_voip_mode mode);
+ // TWT functions
+ std::pair<wifi_twt_capabilities, wifi_error> twtGetCapabilities(const std::string& ifaceName);
+ wifi_error twtSessionSetup(const std::string& ifaceName, uint32_t cmdId,
+ const wifi_twt_request& request,
+ const on_twt_failure& on_twt_failure_user_callback,
+ const on_twt_session_create& on_twt_session_create_user_callback,
+ const on_twt_session_update& on_twt_session_update_user_callback,
+ const on_twt_session_teardown& on_twt_session_teardown_user_callback,
+ const on_twt_session_stats& on_twt_session_stats_user_callback,
+ const on_twt_session_suspend& on_twt_session_suspend_user_callback,
+ const on_twt_session_resume& on_twt_session_resume_user_callback);
+ wifi_error twtSessionUpdate(const std::string& ifaceName, uint32_t cmdId, uint32_t sessionId,
+ const wifi_twt_request& request);
+ wifi_error twtSessionSuspend(const std::string& ifaceName, uint32_t cmdId, uint32_t sessionId);
+ wifi_error twtSessionResume(const std::string& ifaceName, uint32_t cmdId, uint32_t sessionId);
+ wifi_error twtSessionTeardown(const std::string& ifaceName, uint32_t cmdId, uint32_t sessionId);
+ wifi_error twtSessionGetStats(const std::string& ifaceName, uint32_t cmdId, uint32_t sessionId);
+
+ // Note: Following TWT functions are deprecated
+ // Deprecated
wifi_error twtRegisterHandler(const std::string& iface_name,
const TwtCallbackHandlers& handler);
-
+ // Deprecated by twtGetCapabilities
std::pair<wifi_error, TwtCapabilitySet> twtGetCapability(const std::string& iface_name);
-
+ // Deprecated by twtSessionSetup
wifi_error twtSetupRequest(const std::string& iface_name, const TwtSetupRequest& msg);
-
+ // Deprecated by twtSessionTeardown
wifi_error twtTearDownRequest(const std::string& iface_name, const TwtTeardownRequest& msg);
-
+ // Deprecated by twtSessionSuspend and twtSessionResume
wifi_error twtInfoFrameRequest(const std::string& iface_name, const TwtInfoFrameRequest& msg);
-
+ // Deprecated by twtSessionGetStats
std::pair<wifi_error, TwtStats> twtGetStats(const std::string& iface_name, uint8_t configId);
-
+ // Deprecated
wifi_error twtClearStats(const std::string& iface_name, uint8_t configId);
wifi_error setScanMode(const std::string& iface_name, bool enable);
@@ -776,7 +836,7 @@
wifi_error enableWifiTxPowerLimits(const std::string& iface_name, bool enable);
wifi_error getWifiCachedScanResults(const std::string& iface_name,
- const CachedScanResultsCallbackHandlers& handler);
+ WifiCachedScanReport& report);
std::pair<wifi_error, wifi_chip_capabilities> getWifiChipCapabilities();
wifi_error enableStaChannelForPeerNetwork(uint32_t channelCategoryEnableFlag);
wifi_error setMloMode(wifi_mlo_mode mode);
diff --git a/wifi/aidl/default/wifi_legacy_hal_stubs.cpp b/wifi/aidl/default/wifi_legacy_hal_stubs.cpp
index b5196c9..3e4afd0 100644
--- a/wifi/aidl/default/wifi_legacy_hal_stubs.cpp
+++ b/wifi/aidl/default/wifi_legacy_hal_stubs.cpp
@@ -179,6 +179,15 @@
populateStubFor(&hal_fn->wifi_set_scan_mode);
populateStubFor(&hal_fn->wifi_set_mlo_mode);
populateStubFor(&hal_fn->wifi_get_supported_iface_concurrency_matrix);
+ populateStubFor(&hal_fn->wifi_get_rtt_capabilities_v3);
+ populateStubFor(&hal_fn->wifi_rtt_range_request_v3);
+ populateStubFor(&hal_fn->wifi_twt_get_capabilities);
+ populateStubFor(&hal_fn->wifi_twt_session_setup);
+ populateStubFor(&hal_fn->wifi_twt_session_update);
+ populateStubFor(&hal_fn->wifi_twt_session_suspend);
+ populateStubFor(&hal_fn->wifi_twt_session_resume);
+ populateStubFor(&hal_fn->wifi_twt_session_teardown);
+ populateStubFor(&hal_fn->wifi_twt_session_get_stats);
return true;
}
diff --git a/wifi/aidl/default/wifi_rtt_controller.cpp b/wifi/aidl/default/wifi_rtt_controller.cpp
index a5f6768..9dee45c 100644
--- a/wifi/aidl/default/wifi_rtt_controller.cpp
+++ b/wifi/aidl/default/wifi_rtt_controller.cpp
@@ -136,11 +136,45 @@
ndk::ScopedAStatus WifiRttController::rangeRequestInternal(
int32_t cmd_id, const std::vector<RttConfig>& rtt_configs) {
+ // Try 11mc & 11az ranging (v3)
+ std::vector<legacy_hal::wifi_rtt_config_v3> legacy_configs_v3;
+ if (!aidl_struct_util::convertAidlVectorOfRttConfigToLegacyV3(rtt_configs,
+ &legacy_configs_v3)) {
+ return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+ }
+ std::weak_ptr<WifiRttController> weak_ptr_this = weak_ptr_this_;
+ const auto& on_results_callback_v3 =
+ [weak_ptr_this](legacy_hal::wifi_request_id id,
+ const std::vector<const legacy_hal::wifi_rtt_result_v3*>& results) {
+ const auto shared_ptr_this = weak_ptr_this.lock();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "v3 Callback invoked on an invalid object";
+ return;
+ }
+ std::vector<RttResult> aidl_results;
+ if (!aidl_struct_util::convertLegacyVectorOfRttResultV3ToAidl(results,
+ &aidl_results)) {
+ LOG(ERROR) << "Failed to convert rtt results v3 to AIDL structs";
+ return;
+ }
+ for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
+ if (!callback->onResults(id, aidl_results).isOk()) {
+ LOG(ERROR) << "Failed to invoke the v3 callback";
+ }
+ }
+ };
+ legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startRttRangeRequestV3(
+ ifname_, cmd_id, legacy_configs_v3, on_results_callback_v3);
+
+ if (legacy_status != legacy_hal::WIFI_ERROR_NOT_SUPPORTED) {
+ return createWifiStatusFromLegacyError(legacy_status);
+ }
+
+ // Fallback to 11mc ranging.
std::vector<legacy_hal::wifi_rtt_config> legacy_configs;
if (!aidl_struct_util::convertAidlVectorOfRttConfigToLegacy(rtt_configs, &legacy_configs)) {
return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
}
- std::weak_ptr<WifiRttController> weak_ptr_this = weak_ptr_this_;
const auto& on_results_callback =
[weak_ptr_this](legacy_hal::wifi_request_id id,
const std::vector<const legacy_hal::wifi_rtt_result*>& results) {
@@ -181,7 +215,7 @@
}
}
};
- legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->startRttRangeRequest(
+ legacy_status = legacy_hal_.lock()->startRttRangeRequest(
ifname_, cmd_id, legacy_configs, on_results_callback, on_results_callback_v2);
return createWifiStatusFromLegacyError(legacy_status);
}
@@ -201,13 +235,29 @@
std::pair<RttCapabilities, ndk::ScopedAStatus> WifiRttController::getCapabilitiesInternal() {
legacy_hal::wifi_error legacy_status;
- legacy_hal::wifi_rtt_capabilities legacy_caps;
- std::tie(legacy_status, legacy_caps) = legacy_hal_.lock()->getRttCapabilities(ifname_);
+ legacy_hal::wifi_rtt_capabilities_v3 legacy_caps_v3;
+ std::tie(legacy_status, legacy_caps_v3) = legacy_hal_.lock()->getRttCapabilitiesV3(ifname_);
+ // Try v3 API first, if it is not supported fallback.
+ if (legacy_status == legacy_hal::WIFI_ERROR_NOT_SUPPORTED) {
+ legacy_hal::wifi_rtt_capabilities legacy_caps;
+ std::tie(legacy_status, legacy_caps) = legacy_hal_.lock()->getRttCapabilities(ifname_);
+ if (legacy_status != legacy_hal::WIFI_SUCCESS) {
+ return {RttCapabilities{}, createWifiStatusFromLegacyError(legacy_status)};
+ }
+
+ RttCapabilities aidl_caps;
+ if (!aidl_struct_util::convertLegacyRttCapabilitiesToAidl(legacy_caps, &aidl_caps)) {
+ return {RttCapabilities{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)};
+ }
+ return {aidl_caps, ndk::ScopedAStatus::ok()};
+ }
+
if (legacy_status != legacy_hal::WIFI_SUCCESS) {
return {RttCapabilities{}, createWifiStatusFromLegacyError(legacy_status)};
}
+
RttCapabilities aidl_caps;
- if (!aidl_struct_util::convertLegacyRttCapabilitiesToAidl(legacy_caps, &aidl_caps)) {
+ if (!aidl_struct_util::convertLegacyRttCapabilitiesV3ToAidl(legacy_caps_v3, &aidl_caps)) {
return {RttCapabilities{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)};
}
return {aidl_caps, ndk::ScopedAStatus::ok()};
diff --git a/wifi/aidl/default/wifi_sta_iface.cpp b/wifi/aidl/default/wifi_sta_iface.cpp
index 800813f..f0509dc 100644
--- a/wifi/aidl/default/wifi_sta_iface.cpp
+++ b/wifi/aidl/default/wifi_sta_iface.cpp
@@ -219,6 +219,49 @@
&WifiStaIface::setDtimMultiplierInternal, in_multiplier);
}
+ndk::ScopedAStatus WifiStaIface::getCachedScanData(CachedScanData* _aidl_return) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiStaIface::getCachedScanDataInternal, _aidl_return);
+}
+
+ndk::ScopedAStatus WifiStaIface::twtGetCapabilities(TwtCapabilities* _aidl_return) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiStaIface::twtGetCapabilitiesInternal, _aidl_return);
+}
+
+ndk::ScopedAStatus WifiStaIface::twtSessionSetup(int32_t in_cmdId,
+ const TwtRequest& in_twtRequest) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiStaIface::twtSessionSetupInternal, in_cmdId, in_twtRequest);
+}
+
+ndk::ScopedAStatus WifiStaIface::twtSessionUpdate(int32_t in_cmdId, int32_t in_sessionId,
+ const TwtRequest& in_twtRequest) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiStaIface::twtSessionUpdateInternal, in_cmdId, in_sessionId,
+ in_twtRequest);
+}
+
+ndk::ScopedAStatus WifiStaIface::twtSessionSuspend(int32_t in_cmdId, int32_t in_sessionId) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiStaIface::twtSessionSuspendInternal, in_cmdId, in_sessionId);
+}
+
+ndk::ScopedAStatus WifiStaIface::twtSessionResume(int32_t in_cmdId, int32_t in_sessionId) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiStaIface::twtSessionResumeInternal, in_cmdId, in_sessionId);
+}
+
+ndk::ScopedAStatus WifiStaIface::twtSessionTeardown(int32_t in_cmdId, int32_t in_sessionId) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiStaIface::twtSessionTeardownInternal, in_cmdId, in_sessionId);
+}
+
+ndk::ScopedAStatus WifiStaIface::twtSessionGetStats(int32_t in_cmdId, int32_t in_sessionId) {
+ return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
+ &WifiStaIface::twtSessionGetStatsInternal, in_cmdId, in_sessionId);
+}
+
std::pair<std::string, ndk::ScopedAStatus> WifiStaIface::getNameInternal() {
return {ifname_, ndk::ScopedAStatus::ok()};
}
@@ -540,6 +583,209 @@
return createWifiStatusFromLegacyError(legacy_status);
}
+std::pair<CachedScanData, ndk::ScopedAStatus> WifiStaIface::getCachedScanDataInternal() {
+ legacy_hal::WifiCachedScanReport cached_scan_report;
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->getWifiCachedScanResults(ifname_, cached_scan_report);
+ if (legacy_status != legacy_hal::WIFI_SUCCESS) {
+ return {CachedScanData{}, createWifiStatusFromLegacyError(legacy_status)};
+ }
+ CachedScanData aidl_scan_data;
+ if (!aidl_struct_util::convertCachedScanReportToAidl(cached_scan_report, &aidl_scan_data)) {
+ return {CachedScanData{}, createWifiStatus(WifiStatusCode::ERROR_UNKNOWN)};
+ }
+
+ return {aidl_scan_data, ndk::ScopedAStatus::ok()};
+}
+
+std::pair<TwtCapabilities, ndk::ScopedAStatus> WifiStaIface::twtGetCapabilitiesInternal() {
+ legacy_hal::wifi_twt_capabilities legacyHaltwtCapabilities;
+ legacy_hal::wifi_error legacy_status;
+ std::tie(legacyHaltwtCapabilities, legacy_status) =
+ legacy_hal_.lock()->twtGetCapabilities(ifname_);
+ if (legacy_status != legacy_hal::WIFI_SUCCESS) {
+ return {TwtCapabilities{}, createWifiStatusFromLegacyError(legacy_status)};
+ }
+ TwtCapabilities aidlTwtCapabilities;
+ if (!aidl_struct_util::convertTwtCapabilitiesToAidl(legacyHaltwtCapabilities,
+ &aidlTwtCapabilities)) {
+ return {TwtCapabilities{}, createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS)};
+ }
+ return {aidlTwtCapabilities, ndk::ScopedAStatus::ok()};
+}
+
+ndk::ScopedAStatus WifiStaIface::twtSessionSetupInternal(int32_t cmdId,
+ const TwtRequest& aidlTwtRequest) {
+ legacy_hal::wifi_twt_request legacyHalTwtRequest;
+ if (!aidl_struct_util::convertAidlTwtRequestToLegacy(aidlTwtRequest, &legacyHalTwtRequest)) {
+ return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+ }
+ std::weak_ptr<WifiStaIface> weak_ptr_this = weak_ptr_this_;
+
+ // onTwtFailure callback
+ const auto& on_twt_failure = [weak_ptr_this](legacy_hal::wifi_request_id id,
+ legacy_hal::wifi_twt_error_code error_code) {
+ const auto shared_ptr_this = weak_ptr_this.lock();
+ IWifiStaIfaceEventCallback::TwtErrorCode aidl_error_code =
+ aidl_struct_util::convertLegacyHalTwtErrorCodeToAidl(error_code);
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
+ if (!callback->onTwtFailure(id, aidl_error_code).isOk()) {
+ LOG(ERROR) << "Failed to invoke onTwtFailure callback";
+ }
+ }
+ };
+ // onTwtSessionCreate callback
+ const auto& on_twt_session_create = [weak_ptr_this](legacy_hal::wifi_request_id id,
+ legacy_hal::wifi_twt_session twt_session) {
+ const auto shared_ptr_this = weak_ptr_this.lock();
+ TwtSession aidl_twt_session;
+ if (!aidl_struct_util::convertLegacyHalTwtSessionToAidl(twt_session, &aidl_twt_session)) {
+ LOG(ERROR) << "convertLegacyHalTwtSessionToAidl failed";
+ return;
+ }
+
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
+ if (!callback->onTwtSessionCreate(id, aidl_twt_session).isOk()) {
+ LOG(ERROR) << "Failed to invoke onTwtSessionCreate callback";
+ }
+ }
+ };
+ // onTwtSessionUpdate callback
+ const auto& on_twt_session_update = [weak_ptr_this](legacy_hal::wifi_request_id id,
+ legacy_hal::wifi_twt_session twt_session) {
+ const auto shared_ptr_this = weak_ptr_this.lock();
+ TwtSession aidl_twt_session;
+ if (!aidl_struct_util::convertLegacyHalTwtSessionToAidl(twt_session, &aidl_twt_session)) {
+ LOG(ERROR) << "convertLegacyHalTwtSessionToAidl failed";
+ return;
+ }
+
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
+ if (!callback->onTwtSessionUpdate(id, aidl_twt_session).isOk()) {
+ LOG(ERROR) << "Failed to invoke onTwtSessionUpdate callback";
+ }
+ }
+ };
+ // onTwtSessionTeardown callback
+ const auto& on_twt_session_teardown =
+ [weak_ptr_this](legacy_hal::wifi_request_id id, int session_id,
+ legacy_hal::wifi_twt_teardown_reason_code reason_code) {
+ const auto shared_ptr_this = weak_ptr_this.lock();
+ IWifiStaIfaceEventCallback::TwtTeardownReasonCode aidl_reason_code =
+ aidl_struct_util::convertLegacyHalTwtReasonCodeToAidl(reason_code);
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
+ if (!callback->onTwtSessionTeardown(id, session_id, aidl_reason_code).isOk()) {
+ LOG(ERROR) << "Failed to invoke onTwtSessionTeardown callback";
+ }
+ }
+ };
+ // onTwtSessionStats callback
+ const auto& on_twt_session_stats = [weak_ptr_this](legacy_hal::wifi_request_id id,
+ int session_id,
+ legacy_hal::wifi_twt_session_stats stats) {
+ const auto shared_ptr_this = weak_ptr_this.lock();
+ TwtSessionStats aidl_session_stats;
+ if (!aidl_struct_util::convertLegacyHalTwtSessionStatsToAidl(stats, &aidl_session_stats)) {
+ LOG(ERROR) << "convertLegacyHalTwtSessionStatsToAidl failed";
+ return;
+ }
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
+ if (!callback->onTwtSessionStats(id, session_id, aidl_session_stats).isOk()) {
+ LOG(ERROR) << "Failed to invoke onTwtSessionStats callback";
+ }
+ }
+ };
+ // onTwtSessionSuspend callback
+ const auto& on_twt_session_suspend = [weak_ptr_this](legacy_hal::wifi_request_id id,
+ int session_id) {
+ const auto shared_ptr_this = weak_ptr_this.lock();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
+ if (!callback->onTwtSessionSuspend(id, session_id).isOk()) {
+ LOG(ERROR) << "Failed to invoke onTwtSessionSuspend callback";
+ }
+ }
+ };
+ // onTwtSessionResume callback
+ const auto& on_twt_session_resume = [weak_ptr_this](legacy_hal::wifi_request_id id,
+ int session_id) {
+ const auto shared_ptr_this = weak_ptr_this.lock();
+ if (!shared_ptr_this.get() || !shared_ptr_this->isValid()) {
+ LOG(ERROR) << "Callback invoked on an invalid object";
+ return;
+ }
+ for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
+ if (!callback->onTwtSessionResume(id, session_id).isOk()) {
+ LOG(ERROR) << "Failed to invoke onTwtSessionResume callback";
+ }
+ }
+ };
+
+ legacy_hal::wifi_error legacy_status = legacy_hal_.lock()->twtSessionSetup(
+ ifname_, cmdId, legacyHalTwtRequest, on_twt_failure, on_twt_session_create,
+ on_twt_session_update, on_twt_session_teardown, on_twt_session_stats,
+ on_twt_session_suspend, on_twt_session_resume);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
+ndk::ScopedAStatus WifiStaIface::twtSessionUpdateInternal(int32_t cmdId, int32_t sessionId,
+ const TwtRequest& aidlTwtRequest) {
+ legacy_hal::wifi_twt_request legacyHalTwtRequest;
+ if (!aidl_struct_util::convertAidlTwtRequestToLegacy(aidlTwtRequest, &legacyHalTwtRequest)) {
+ return createWifiStatus(WifiStatusCode::ERROR_INVALID_ARGS);
+ }
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->twtSessionUpdate(ifname_, cmdId, sessionId, legacyHalTwtRequest);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
+ndk::ScopedAStatus WifiStaIface::twtSessionSuspendInternal(int32_t cmdId, int32_t sessionId) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->twtSessionSuspend(ifname_, cmdId, sessionId);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
+ndk::ScopedAStatus WifiStaIface::twtSessionResumeInternal(int32_t cmdId, int32_t sessionId) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->twtSessionResume(ifname_, cmdId, sessionId);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
+ndk::ScopedAStatus WifiStaIface::twtSessionTeardownInternal(int32_t cmdId, int32_t sessionId) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->twtSessionTeardown(ifname_, cmdId, sessionId);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
+ndk::ScopedAStatus WifiStaIface::twtSessionGetStatsInternal(int32_t cmdId, int32_t sessionId) {
+ legacy_hal::wifi_error legacy_status =
+ legacy_hal_.lock()->twtSessionGetStats(ifname_, cmdId, sessionId);
+ return createWifiStatusFromLegacyError(legacy_status);
+}
+
} // namespace wifi
} // namespace hardware
} // namespace android
diff --git a/wifi/aidl/default/wifi_sta_iface.h b/wifi/aidl/default/wifi_sta_iface.h
index 3d7ec4d..eb8f745 100644
--- a/wifi/aidl/default/wifi_sta_iface.h
+++ b/wifi/aidl/default/wifi_sta_iface.h
@@ -90,6 +90,15 @@
ndk::ScopedAStatus getFactoryMacAddress(std::array<uint8_t, 6>* _aidl_return) override;
ndk::ScopedAStatus setScanMode(bool in_enable) override;
ndk::ScopedAStatus setDtimMultiplier(int32_t in_multiplier) override;
+ ndk::ScopedAStatus getCachedScanData(CachedScanData* _aidl_return) override;
+ ndk::ScopedAStatus twtGetCapabilities(TwtCapabilities* _aidl_return) override;
+ ndk::ScopedAStatus twtSessionSetup(int in_cmdId, const TwtRequest& in_twtRequest) override;
+ ndk::ScopedAStatus twtSessionUpdate(int in_cmdId, int32_t in_sessionId,
+ const TwtRequest& in_twtRequest) override;
+ ndk::ScopedAStatus twtSessionSuspend(int in_cmdId, int32_t in_sessionId) override;
+ ndk::ScopedAStatus twtSessionResume(int in_cmdId, int32_t in_sessionId) override;
+ ndk::ScopedAStatus twtSessionTeardown(int in_cmdId, int32_t in_sessionId) override;
+ ndk::ScopedAStatus twtSessionGetStats(int in_cmdId, int32_t in_sessionId) override;
private:
// Corresponding worker functions for the AIDL methods.
@@ -130,6 +139,15 @@
std::pair<std::array<uint8_t, 6>, ndk::ScopedAStatus> getFactoryMacAddressInternal();
ndk::ScopedAStatus setScanModeInternal(bool enable);
ndk::ScopedAStatus setDtimMultiplierInternal(const int multiplier);
+ std::pair<CachedScanData, ndk::ScopedAStatus> getCachedScanDataInternal();
+ std::pair<TwtCapabilities, ndk::ScopedAStatus> twtGetCapabilitiesInternal();
+ ndk::ScopedAStatus twtSessionSetupInternal(int cmdId, const TwtRequest& twtRequest);
+ ndk::ScopedAStatus twtSessionUpdateInternal(int cmdId, int32_t sessionId,
+ const TwtRequest& twtRequest);
+ ndk::ScopedAStatus twtSessionSuspendInternal(int cmdId, int32_t sessionId);
+ ndk::ScopedAStatus twtSessionResumeInternal(int cmdId, int32_t sessionId);
+ ndk::ScopedAStatus twtSessionTeardownInternal(int cmdId, int32_t sessionId);
+ ndk::ScopedAStatus twtSessionGetStatsInternal(int cmdId, int32_t sessionId);
void setWeakPtr(std::weak_ptr<WifiStaIface> ptr);
diff --git a/wifi/aidl/vts/functional/Android.bp b/wifi/aidl/vts/functional/Android.bp
index 1277182..9994d09 100644
--- a/wifi/aidl/vts/functional/Android.bp
+++ b/wifi/aidl/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -39,7 +40,8 @@
],
static_libs: [
"VtsHalWifiTargetTestUtil",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
"libwifi-system-iface",
],
test_suites: [
@@ -64,7 +66,8 @@
],
static_libs: [
"VtsHalWifiTargetTestUtil",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
"libwifi-system-iface",
],
test_suites: [
@@ -89,7 +92,8 @@
],
static_libs: [
"VtsHalWifiTargetTestUtil",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
"libwifi-system-iface",
],
test_suites: [
@@ -114,7 +118,8 @@
],
static_libs: [
"VtsHalWifiTargetTestUtil",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
"libwifi-system-iface",
],
test_suites: [
@@ -139,7 +144,8 @@
],
static_libs: [
"VtsHalWifiTargetTestUtil",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
"libwifi-system-iface",
],
test_suites: [
@@ -163,7 +169,8 @@
"libnativehelper",
],
static_libs: [
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
"libwifi-system-iface",
],
}
diff --git a/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp b/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp
index ca3c4b7..986e3a8 100644
--- a/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp
+++ b/wifi/aidl/vts/functional/wifi_aidl_test_utils.cpp
@@ -197,9 +197,26 @@
bool configureChipToSupportConcurrencyType(const std::shared_ptr<IWifiChip>& wifi_chip,
IfaceConcurrencyType type, int* configured_mode_id) {
+ if (!wifi_chip.get()) {
+ return false;
+ }
return configureChipToSupportConcurrencyTypeInternal(wifi_chip, type, configured_mode_id);
}
+bool doesChipSupportConcurrencyType(const std::shared_ptr<IWifiChip>& wifi_chip,
+ IfaceConcurrencyType type) {
+ if (!wifi_chip.get()) {
+ return false;
+ }
+ std::vector<IWifiChip::ChipMode> chip_modes;
+ auto status = wifi_chip->getAvailableModes(&chip_modes);
+ if (!status.isOk()) {
+ return false;
+ }
+ int mode_id;
+ return findAnyModeSupportingConcurrencyType(type, chip_modes, &mode_id);
+}
+
void stopWifiService(const char* instance_name) {
std::shared_ptr<IWifi> wifi = getWifi(instance_name);
if (wifi != nullptr) {
@@ -208,6 +225,9 @@
}
int32_t getChipFeatureSet(const std::shared_ptr<IWifiChip>& wifi_chip) {
+ if (!wifi_chip.get()) {
+ return 0;
+ }
int32_t features = 0;
if (wifi_chip->getFeatureSet(&features).isOk()) {
return features;
diff --git a/wifi/aidl/vts/functional/wifi_aidl_test_utils.h b/wifi/aidl/vts/functional/wifi_aidl_test_utils.h
index 0d70c3b..921d689 100644
--- a/wifi/aidl/vts/functional/wifi_aidl_test_utils.h
+++ b/wifi/aidl/vts/functional/wifi_aidl_test_utils.h
@@ -42,6 +42,9 @@
// Configure the chip in a mode to support the creation of the provided iface type.
bool configureChipToSupportConcurrencyType(const std::shared_ptr<IWifiChip>& wifi_chip,
IfaceConcurrencyType type, int* configured_mode_id);
+// Check whether the chip supports the creation of the provided iface type.
+bool doesChipSupportConcurrencyType(const std::shared_ptr<IWifiChip>& wifi_chip,
+ IfaceConcurrencyType type);
// Used to trigger IWifi.stop() at the end of every test.
void stopWifiService(const char* instance_name);
int32_t getChipFeatureSet(const std::shared_ptr<IWifiChip>& wifi_chip);
diff --git a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
index bbd27f9..a1b9ce1 100644
--- a/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_chip_aidl_test.cpp
@@ -63,6 +63,10 @@
return mode_id;
}
+ bool isConcurrencyTypeSupported(IfaceConcurrencyType type) {
+ return doesChipSupportConcurrencyType(wifi_chip_, type);
+ }
+
std::shared_ptr<IWifiStaIface> configureChipForStaAndGetIface() {
std::shared_ptr<IWifiStaIface> iface;
configureChipForConcurrencyType(IfaceConcurrencyType::STA);
@@ -532,6 +536,9 @@
* CreateApIface
*/
TEST_P(WifiChipAidlTest, CreateApIface) {
+ if (!isConcurrencyTypeSupported(IfaceConcurrencyType::AP)) {
+ GTEST_SKIP() << "AP is not supported";
+ }
configureChipForApAndGetIface();
}
@@ -549,6 +556,9 @@
* CreateP2pIface
*/
TEST_P(WifiChipAidlTest, CreateP2pIface) {
+ if (!isConcurrencyTypeSupported(IfaceConcurrencyType::P2P)) {
+ GTEST_SKIP() << "P2P is not supported";
+ }
configureChipForP2pAndGetIface();
}
@@ -583,6 +593,9 @@
* GetP2pIfaceNames
*/
TEST_P(WifiChipAidlTest, GetP2pIfaceNames) {
+ if (!isConcurrencyTypeSupported(IfaceConcurrencyType::P2P)) {
+ GTEST_SKIP() << "P2P is not supported";
+ }
configureChipForConcurrencyType(IfaceConcurrencyType::P2P);
std::vector<std::string> iface_names;
@@ -607,6 +620,9 @@
* GetApIfaceNames
*/
TEST_P(WifiChipAidlTest, GetApIfaceNames) {
+ if (!isConcurrencyTypeSupported(IfaceConcurrencyType::AP)) {
+ GTEST_SKIP() << "AP is not supported";
+ }
configureChipForConcurrencyType(IfaceConcurrencyType::AP);
std::vector<std::string> iface_names;
@@ -679,6 +695,9 @@
* GetP2pIface
*/
TEST_P(WifiChipAidlTest, GetP2pIface) {
+ if (!isConcurrencyTypeSupported(IfaceConcurrencyType::P2P)) {
+ GTEST_SKIP() << "P2P is not supported";
+ }
std::shared_ptr<IWifiP2pIface> iface = configureChipForP2pAndGetIface();
std::string iface_name = getP2pIfaceName(iface);
@@ -697,6 +716,9 @@
* GetApIface
*/
TEST_P(WifiChipAidlTest, GetApIface) {
+ if (!isConcurrencyTypeSupported(IfaceConcurrencyType::AP)) {
+ GTEST_SKIP() << "AP is not supported";
+ }
std::shared_ptr<IWifiApIface> iface = configureChipForApAndGetIface();
std::string iface_name = getApIfaceName(iface);
@@ -755,6 +777,9 @@
* RemoveP2pIface
*/
TEST_P(WifiChipAidlTest, RemoveP2pIface) {
+ if (!isConcurrencyTypeSupported(IfaceConcurrencyType::P2P)) {
+ GTEST_SKIP() << "P2P is not supported";
+ }
std::shared_ptr<IWifiP2pIface> iface = configureChipForP2pAndGetIface();
std::string iface_name = getP2pIfaceName(iface);
@@ -771,6 +796,9 @@
* RemoveApIface
*/
TEST_P(WifiChipAidlTest, RemoveApIface) {
+ if (!isConcurrencyTypeSupported(IfaceConcurrencyType::AP)) {
+ GTEST_SKIP() << "AP is not supported";
+ }
std::shared_ptr<IWifiApIface> iface = configureChipForApAndGetIface();
std::string iface_name = getApIfaceName(iface);
@@ -844,6 +872,36 @@
EXPECT_EQ(instances_after_remove.size(), 1);
}
+/*
+ * SetVoipMode_off
+ * Tests the setVoipMode() API with VoIP mode OFF.
+ */
+TEST_P(WifiChipAidlTest, SetVoipMode_off) {
+ configureChipForConcurrencyType(IfaceConcurrencyType::STA);
+ int32_t features = getChipFeatureSet(wifi_chip_);
+ if (features & static_cast<int32_t>(IWifiChip::FeatureSetMask::SET_VOIP_MODE)) {
+ auto status = wifi_chip_->setVoipMode(IWifiChip::VoipMode::OFF);
+ EXPECT_TRUE(status.isOk());
+ } else {
+ GTEST_SKIP() << "setVoipMode() is not supported by vendor.";
+ }
+}
+
+/*
+ * SetVoipMode_voice
+ * Tests the setVoipMode() API with VoIP mode VOICE.
+ */
+TEST_P(WifiChipAidlTest, SetVoipMode_voice) {
+ configureChipForConcurrencyType(IfaceConcurrencyType::STA);
+ int32_t features = getChipFeatureSet(wifi_chip_);
+ if (features & static_cast<int32_t>(IWifiChip::FeatureSetMask::SET_VOIP_MODE)) {
+ auto status = wifi_chip_->setVoipMode(IWifiChip::VoipMode::VOICE);
+ EXPECT_TRUE(status.isOk());
+ } else {
+ GTEST_SKIP() << "setVoipMode() is not supported by vendor.";
+ }
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(WifiChipAidlTest);
INSTANTIATE_TEST_SUITE_P(WifiTest, WifiChipAidlTest,
testing::ValuesIn(android::getAidlHalInstanceNames(IWifi::descriptor)),
diff --git a/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp b/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
index fa7149f..d368715 100644
--- a/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
+++ b/wifi/aidl/vts/functional/wifi_sta_iface_aidl_test.cpp
@@ -74,7 +74,17 @@
return testing::deviceSupportsFeature("com.google.android.tv.mdns_offload");
}
- // Detected panel TV device by using ro.oem.key1 property.
+ bool doesDeviceSupportFullNetworkingUnder2w() {
+ return testing::deviceSupportsFeature("com.google.android.tv.full_networking_under_2w");
+ }
+
+ // Detect TV devices.
+ bool isTvDevice() {
+ return testing::deviceSupportsFeature("android.software.leanback") ||
+ testing::deviceSupportsFeature("android.hardware.type.television");
+ }
+
+ // Detect Panel TV devices by using ro.oem.key1 property.
// https://docs.partner.android.com/tv/build/platform/props-vars/ro-oem-key1
bool isPanelTvDevice() {
const std::string oem_key1 = getPropertyString("ro.oem.key1");
@@ -135,10 +145,23 @@
*/
// @VsrTest = 5.3.12
TEST_P(WifiStaIfaceAidlTest, CheckApfIsSupported) {
- // Flat panel TV devices that support MDNS offload do not have to implement APF if the WiFi
- // chipset does not have sufficient RAM to do so.
- if (isPanelTvDevice() && isMdnsOffloadPresentInNIC()) {
- GTEST_SKIP() << "Panel TV supports mDNS offload. It is not required to support APF";
+ const std::string oem_key1 = getPropertyString("ro.oem.key1");
+ if (isTvDevice()) {
+ // Flat panel TV devices that support MDNS offload do not have to implement APF if the WiFi
+ // chipset does not have sufficient RAM to do so.
+ if (isPanelTvDevice() && isMdnsOffloadPresentInNIC()) {
+ GTEST_SKIP() << "Panel TV supports mDNS offload. It is not required to support APF";
+ }
+ // For TV devices declaring the
+ // com.google.android.tv.full_networking_under_2w feature, this indicates
+ // the device can meet the <= 2W standby power requirement while
+ // continuously processing network packets on the CPU, even in standby mode.
+ // In these cases, APF support is strongly recommended rather than being
+ // mandatory.
+ if (doesDeviceSupportFullNetworkingUnder2w()) {
+ GTEST_SKIP() << "TV Device meets the <= 2W standby power demand requirement. It is not "
+ "required to support APF.";
+ }
}
int vendor_api_level = property_get_int32("ro.vendor.api_level", 0);
// Before VSR 14, APF support is optional.
@@ -148,14 +171,18 @@
}
StaApfPacketFilterCapabilities apf_caps = {};
EXPECT_TRUE(wifi_sta_iface_->getApfPacketFilterCapabilities(&apf_caps).isOk());
- } else {
- EXPECT_TRUE(isFeatureSupported(IWifiStaIface::FeatureSetMask::APF));
- StaApfPacketFilterCapabilities apf_caps = {};
- EXPECT_TRUE(wifi_sta_iface_->getApfPacketFilterCapabilities(&apf_caps).isOk());
- // The APF version must be 4 and the usable memory must be at least
- // 1024 bytes.
- EXPECT_EQ(apf_caps.version, 4);
- EXPECT_GE(apf_caps.maxLength, 1024);
+ return;
+ }
+
+ EXPECT_TRUE(isFeatureSupported(IWifiStaIface::FeatureSetMask::APF));
+ StaApfPacketFilterCapabilities apf_caps = {};
+ EXPECT_TRUE(wifi_sta_iface_->getApfPacketFilterCapabilities(&apf_caps).isOk());
+ EXPECT_GE(apf_caps.version, 4);
+ // Based on VSR-14 the usable memory must be at least 1024 bytes.
+ EXPECT_GE(apf_caps.maxLength, 1024);
+ if (vendor_api_level >= __ANDROID_API_V__) {
+ // Based on VSR-15 the usable memory must be at least 2000 bytes.
+ EXPECT_GE(apf_caps.maxLength, 2000);
}
}
diff --git a/wifi/common/aidl/Android.bp b/wifi/common/aidl/Android.bp
new file mode 100644
index 0000000..11acb4f
--- /dev/null
+++ b/wifi/common/aidl/Android.bp
@@ -0,0 +1,50 @@
+// 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.
+
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+aidl_interface {
+ name: "android.hardware.wifi.common",
+ vendor_available: true,
+ srcs: [
+ "android/hardware/wifi/common/*.aidl",
+ ],
+ headers: [
+ "PersistableBundle_aidl",
+ ],
+ stability: "vintf",
+ backend: {
+ java: {
+ sdk_version: "module_current",
+ apex_available: [
+ "//apex_available:platform",
+ "com.android.wifi",
+ ],
+ min_sdk_version: "30",
+ },
+ cpp: {
+ enabled: false,
+ },
+ rust: {
+ enabled: false,
+ },
+ },
+}
diff --git a/wifi/common/aidl/aidl_api/android.hardware.wifi.common/current/android/hardware/wifi/common/OuiKeyedData.aidl b/wifi/common/aidl/aidl_api/android.hardware.wifi.common/current/android/hardware/wifi/common/OuiKeyedData.aidl
new file mode 100644
index 0000000..640a1f6
--- /dev/null
+++ b/wifi/common/aidl/aidl_api/android.hardware.wifi.common/current/android/hardware/wifi/common/OuiKeyedData.aidl
@@ -0,0 +1,39 @@
+/*
+ * 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.wifi.common;
+@VintfStability
+parcelable OuiKeyedData {
+ int oui;
+ android.os.PersistableBundle vendorData;
+}
diff --git a/wifi/common/aidl/android/hardware/wifi/common/OuiKeyedData.aidl b/wifi/common/aidl/android/hardware/wifi/common/OuiKeyedData.aidl
new file mode 100644
index 0000000..4e6a99f
--- /dev/null
+++ b/wifi/common/aidl/android/hardware/wifi/common/OuiKeyedData.aidl
@@ -0,0 +1,35 @@
+/*
+ * 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.
+ */
+
+package android.hardware.wifi.common;
+
+import android.os.PersistableBundle;
+
+/**
+ * Data for OUI-based configuration.
+ */
+@VintfStability
+parcelable OuiKeyedData {
+ /**
+ * OUI : 24-bit organizationally unique identifier to identify the vendor/OEM.
+ * See https://standards-oui.ieee.org/ for more information.
+ */
+ int oui;
+ /**
+ * Vendor data. Expected fields should be defined by the vendor.
+ */
+ PersistableBundle vendorData;
+}
diff --git a/wifi/hostapd/1.0/Android.bp b/wifi/hostapd/1.0/Android.bp
index b9a84d6..38083e7 100644
--- a/wifi/hostapd/1.0/Android.bp
+++ b/wifi/hostapd/1.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/hostapd/1.0/vts/functional/Android.bp b/wifi/hostapd/1.0/vts/functional/Android.bp
index daf5b60..a44ae6d 100644
--- a/wifi/hostapd/1.0/vts/functional/Android.bp
+++ b/wifi/hostapd/1.0/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -28,7 +29,7 @@
defaults: ["VtsHalTargetTestDefaults"],
srcs: ["hostapd_hidl_test_utils.cpp"],
export_include_dirs: [
- "."
+ ".",
],
static_libs: [
"VtsHalWifiV1_0TargetTestUtil",
@@ -57,5 +58,8 @@
"libwifi-system",
"libwifi-system-iface",
],
- test_suites: ["general-tests", "vts"],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
}
diff --git a/wifi/hostapd/1.1/Android.bp b/wifi/hostapd/1.1/Android.bp
index c90b68d..27b8079 100644
--- a/wifi/hostapd/1.1/Android.bp
+++ b/wifi/hostapd/1.1/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/hostapd/1.1/vts/functional/Android.bp b/wifi/hostapd/1.1/vts/functional/Android.bp
index 999a6a7..196730e 100644
--- a/wifi/hostapd/1.1/vts/functional/Android.bp
+++ b/wifi/hostapd/1.1/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/hostapd/1.2/Android.bp b/wifi/hostapd/1.2/Android.bp
index c8bf2f8..15446af 100644
--- a/wifi/hostapd/1.2/Android.bp
+++ b/wifi/hostapd/1.2/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/hostapd/1.2/vts/functional/Android.bp b/wifi/hostapd/1.2/vts/functional/Android.bp
index 26edab5..411110b 100644
--- a/wifi/hostapd/1.2/vts/functional/Android.bp
+++ b/wifi/hostapd/1.2/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/hostapd/1.3/Android.bp b/wifi/hostapd/1.3/Android.bp
index f75b5e2..5598327 100644
--- a/wifi/hostapd/1.3/Android.bp
+++ b/wifi/hostapd/1.3/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/hostapd/1.3/vts/functional/Android.bp b/wifi/hostapd/1.3/vts/functional/Android.bp
index 78cd4af..50ecc28 100644
--- a/wifi/hostapd/1.3/vts/functional/Android.bp
+++ b/wifi/hostapd/1.3/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/hostapd/aidl/Android.bp b/wifi/hostapd/aidl/Android.bp
index 54895c1..1daa9bb 100644
--- a/wifi/hostapd/aidl/Android.bp
+++ b/wifi/hostapd/aidl/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -27,6 +28,9 @@
srcs: [
"android/hardware/wifi/hostapd/*.aidl",
],
+ imports: [
+ "android.hardware.wifi.common-V1",
+ ],
stability: "vintf",
backend: {
java: {
@@ -40,6 +44,12 @@
ndk: {
gen_trace: true,
},
+ cpp: {
+ enabled: false,
+ },
+ rust: {
+ enabled: false,
+ },
},
versions_with_info: [
{
@@ -47,5 +57,4 @@
imports: [],
},
],
-
}
diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ApInfo.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ApInfo.aidl
index ca20f37..1a66105 100644
--- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ApInfo.aidl
+++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/ApInfo.aidl
@@ -40,4 +40,5 @@
android.hardware.wifi.hostapd.ChannelBandwidth channelBandwidth;
android.hardware.wifi.hostapd.Generation generation;
byte[] apIfaceInstanceMacAddress;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}
diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IfaceParams.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IfaceParams.aidl
index 0c88a39..64367bb 100644
--- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IfaceParams.aidl
+++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IfaceParams.aidl
@@ -37,4 +37,5 @@
String name;
android.hardware.wifi.hostapd.HwModeParams hwModeParams;
android.hardware.wifi.hostapd.ChannelParams[] channelParams;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}
diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ApInfo.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ApInfo.aidl
index a6fe63b..f2b2ee6 100644
--- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ApInfo.aidl
+++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/ApInfo.aidl
@@ -16,6 +16,7 @@
package android.hardware.wifi.hostapd;
+import android.hardware.wifi.common.OuiKeyedData;
import android.hardware.wifi.hostapd.ChannelBandwidth;
import android.hardware.wifi.hostapd.Generation;
@@ -57,4 +58,9 @@
* MAC Address of the apIfaceInstance.
*/
byte[] apIfaceInstanceMacAddress;
+
+ /**
+ * Optional vendor-specific information.
+ */
+ @nullable OuiKeyedData[] vendorData;
}
diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IfaceParams.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IfaceParams.aidl
index a8abec3..3f8ee39 100644
--- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IfaceParams.aidl
+++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IfaceParams.aidl
@@ -16,6 +16,7 @@
package android.hardware.wifi.hostapd;
+import android.hardware.wifi.common.OuiKeyedData;
import android.hardware.wifi.hostapd.ChannelParams;
import android.hardware.wifi.hostapd.HwModeParams;
@@ -36,4 +37,8 @@
* The list of the channel params for the dual interfaces.
*/
ChannelParams[] channelParams;
+ /**
+ * Optional vendor-specific configuration parameters.
+ */
+ @nullable OuiKeyedData[] vendorData;
}
diff --git a/wifi/hostapd/aidl/vts/functional/Android.bp b/wifi/hostapd/aidl/vts/functional/Android.bp
index ff35056..9fbbf4b 100644
--- a/wifi/hostapd/aidl/vts/functional/Android.bp
+++ b/wifi/hostapd/aidl/vts/functional/Android.bp
@@ -1,4 +1,5 @@
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -36,7 +37,8 @@
"android.hardware.wifi@1.4",
"android.hardware.wifi@1.5",
"android.hardware.wifi@1.6",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
"libwifi-system",
"libwifi-system-iface",
"VtsHalWifiTargetTestUtil",
diff --git a/wifi/legacy_headers/Android.bp b/wifi/legacy_headers/Android.bp
new file mode 100644
index 0000000..725d42c
--- /dev/null
+++ b/wifi/legacy_headers/Android.bp
@@ -0,0 +1,40 @@
+// Copyright (C) 2024 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.
+
+cc_library_headers {
+ name: "wifi_legacy_headers",
+ vendor_available: true,
+ export_include_dirs: ["include"],
+
+ header_libs: ["libcutils_headers"],
+ export_header_lib_headers: ["libcutils_headers"],
+}
+
+cc_library_shared {
+ name: "wifi_legacy",
+ vendor_available: true,
+
+ header_libs: [
+ "wifi_legacy_headers",
+ ],
+ export_header_lib_headers: ["wifi_legacy_headers"],
+
+ export_include_dirs: ["include"],
+
+ cflags: [
+ "-DQEMU_HARDWARE",
+ "-Wall",
+ "-Werror",
+ ],
+}
diff --git a/wifi/legacy_headers/include/hardware_legacy/gscan.h b/wifi/legacy_headers/include/hardware_legacy/gscan.h
new file mode 100644
index 0000000..d5d8b9c
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/gscan.h
@@ -0,0 +1,430 @@
+#include "wifi_hal.h"
+
+#ifndef __WIFI_HAL_GSCAN_H__
+#define __WIFI_HAL_GSCAN_H__
+
+// Define static_assert() unless already defined by compiler.
+#ifndef __has_feature
+ #define __has_feature(__x) 0
+#endif
+#if !(__has_feature(cxx_static_assert)) && !defined(static_assert)
+ #define static_assert(__b, __m) \
+ extern int compile_time_assert_failed[ ( __b ) ? 1 : -1 ] \
+ __attribute__( ( unused ) );
+#endif
+
+/* AP Scans */
+
+typedef enum {
+ WIFI_BAND_UNSPECIFIED,
+ WIFI_BAND_BG = 1, // 2.4 GHz
+ WIFI_BAND_A = 2, // 5 GHz without DFS
+ WIFI_BAND_A_DFS = 4, // 5 GHz DFS only
+ WIFI_BAND_A_WITH_DFS = 6, // 5 GHz with DFS
+ WIFI_BAND_ABG = 3, // 2.4 GHz + 5 GHz; no DFS
+ WIFI_BAND_ABG_WITH_DFS = 7, // 2.4 GHz + 5 GHz with DFS
+} wifi_band;
+
+#define MAX_CHANNELS 16
+#define MAX_BUCKETS 16
+#define MAX_HOTLIST_APS 128
+#define MAX_SIGNIFICANT_CHANGE_APS 64
+#define MAX_EPNO_NETWORKS 64
+#define MAX_HOTLIST_SSID 8
+#define MAX_AP_CACHE_PER_SCAN 32
+
+wifi_error wifi_get_valid_channels(wifi_interface_handle handle,
+ int band, int max_channels, wifi_channel *channels, int *num_channels);
+
+typedef struct {
+ int max_scan_cache_size; // total space allocated for scan (in bytes)
+ int max_scan_buckets; // maximum number of channel buckets
+ int max_ap_cache_per_scan; // maximum number of APs that can be stored per scan
+ int max_rssi_sample_size; // number of RSSI samples used for averaging RSSI
+ int max_scan_reporting_threshold; // max possible report_threshold as described
+ // in wifi_scan_cmd_params
+ int max_hotlist_bssids; // maximum number of entries for hotlist BSSIDs
+ int max_hotlist_ssids; // maximum number of entries for hotlist SSIDs
+ int max_significant_wifi_change_aps; // maximum number of entries for
+ // significant wifi change APs
+ int max_bssid_history_entries; // number of BSSID/RSSI entries that device can hold
+ int max_number_epno_networks; // max number of epno entries
+ int max_number_epno_networks_by_ssid; // max number of epno entries if ssid is specified,
+ // that is, epno entries for which an exact match is
+ // required, or entries corresponding to hidden ssids
+ int max_number_of_white_listed_ssid; // max number of white listed SSIDs, M target is 2 to 4
+} wifi_gscan_capabilities;
+
+wifi_error wifi_get_gscan_capabilities(wifi_interface_handle handle,
+ wifi_gscan_capabilities *capabilities);
+
+typedef enum {
+ WIFI_SCAN_RESULTS_AVAILABLE, // reported when REPORT_EVENTS_EACH_SCAN is set and a scan
+ // completes. WIFI_SCAN_THRESHOLD_NUM_SCANS or
+ // WIFI_SCAN_THRESHOLD_PERCENT can be reported instead if the
+ // reason for the event is available; however, at most one of
+ // these events should be reported per scan. If there are
+ // multiple buckets that were scanned this period and one has the
+ // EACH_SCAN flag set then this event should be prefered.
+ WIFI_SCAN_THRESHOLD_NUM_SCANS, // can be reported when REPORT_EVENTS_EACH_SCAN is not set and
+ // report_threshold_num_scans is reached.
+ WIFI_SCAN_THRESHOLD_PERCENT, // can be reported when REPORT_EVENTS_EACH_SCAN is not set and
+ // report_threshold_percent is reached.
+ WIFI_SCAN_FAILED, // reported when currently executing gscans have failed.
+ // start_gscan will need to be called again in order to continue
+ // scanning. This is intended to indicate abnormal scan
+ // terminations (not those as a result of stop_gscan).
+} wifi_scan_event;
+
+
+/* Format of information elements found in the beacon */
+typedef struct {
+ byte id; // element identifier
+ byte len; // number of bytes to follow
+ byte data[];
+} wifi_information_element;
+
+typedef struct {
+ wifi_timestamp ts; // time since boot (in microsecond) when the result was
+ // retrieved
+ char ssid[32+1]; // null terminated
+ mac_addr bssid;
+ wifi_channel channel; // channel frequency in MHz
+ wifi_rssi rssi; // in db
+ wifi_timespan rtt; // in nanoseconds
+ wifi_timespan rtt_sd; // standard deviation in rtt
+ unsigned short beacon_period; // period advertised in the beacon
+ unsigned short capability; // capabilities advertised in the beacon
+ unsigned int ie_length; // size of the ie_data blob
+ char ie_data[1]; // blob of all the information elements found in the
+ // beacon; this data should be a packed list of
+ // wifi_information_element objects, one after the other.
+ // other fields
+} wifi_scan_result;
+
+static_assert(MAX_BUCKETS <= 8 * sizeof(unsigned),
+ "The buckets_scanned bitset is represented by an unsigned int and cannot support this many "
+ "buckets on this platform.");
+typedef struct {
+ /* reported when each probe response is received, if report_events
+ * enabled in wifi_scan_cmd_params. buckets_scanned is a bitset of the
+ * buckets that are currently being scanned. See the buckets_scanned field
+ * in the wifi_cached_scan_results struct for more details.
+ */
+ void (*on_full_scan_result) (wifi_request_id id, wifi_scan_result *result,
+ unsigned buckets_scanned);
+
+ /* indicates progress of scanning statemachine */
+ void (*on_scan_event) (wifi_request_id id, wifi_scan_event event);
+
+} wifi_scan_result_handler;
+
+typedef struct {
+ wifi_channel channel; // frequency
+ int dwellTimeMs; // dwell time hint
+ int passive; // 0 => active, 1 => passive scan; ignored for DFS
+ /* Add channel class */
+} wifi_scan_channel_spec;
+
+#define REPORT_EVENTS_EACH_SCAN (1 << 0)
+#define REPORT_EVENTS_FULL_RESULTS (1 << 1)
+#define REPORT_EVENTS_NO_BATCH (1 << 2)
+
+typedef struct {
+ int bucket; // bucket index, 0 based
+ wifi_band band; // when UNSPECIFIED, use channel list
+ int period; // desired period, in millisecond; if this is too
+ // low, the firmware should choose to generate results as
+ // fast as it can instead of failing the command.
+ // for exponential backoff bucket this is the min_period
+ /* report_events semantics -
+ * This is a bit field; which defines following bits -
+ * REPORT_EVENTS_EACH_SCAN => report a scan completion event after scan. If this is not set
+ * then scan completion events should be reported if
+ * report_threshold_percent or report_threshold_num_scans is
+ * reached.
+ * REPORT_EVENTS_FULL_RESULTS => forward scan results (beacons/probe responses + IEs)
+ * in real time to HAL, in addition to completion events
+ * Note: To keep backward compatibility, fire completion
+ * events regardless of REPORT_EVENTS_EACH_SCAN.
+ * REPORT_EVENTS_NO_BATCH => controls if scans for this bucket should be placed in the
+ * history buffer
+ */
+ byte report_events;
+ int max_period; // if max_period is non zero or different than period, then this bucket is
+ // an exponential backoff bucket and the scan period will grow exponentially
+ // as per formula: actual_period(N) = period * (base ^ (N/step_count))
+ // to a maximum period of max_period
+ int base; // for exponential back off bucket: multiplier: new_period=old_period*base
+ int step_count; // for exponential back off bucket, number of scans to perform for a given
+ // period
+
+ int num_channels;
+ // channels to scan; these may include DFS channels
+ // Note that a given channel may appear in multiple buckets
+ wifi_scan_channel_spec channels[MAX_CHANNELS];
+} wifi_scan_bucket_spec;
+
+typedef struct {
+ int base_period; // base timer period in ms
+ int max_ap_per_scan; // number of access points to store in each scan entry in
+ // the BSSID/RSSI history buffer (keep the highest RSSI
+ // access points)
+ int report_threshold_percent; // in %, when scan buffer is this much full, wake up apps
+ // processor
+ int report_threshold_num_scans; // in number of scans, wake up AP after these many scans
+ int num_buckets;
+ wifi_scan_bucket_spec buckets[MAX_BUCKETS];
+} wifi_scan_cmd_params;
+
+/*
+ * Start periodic GSCAN
+ * When this is called all requested buckets should be scanned, starting the beginning of the cycle
+ *
+ * For example:
+ * If there are two buckets specified
+ * - Bucket 1: period=10s
+ * - Bucket 2: period=20s
+ * - Bucket 3: period=30s
+ * Then the following scans should occur
+ * - t=0 buckets 1, 2, and 3 are scanned
+ * - t=10 bucket 1 is scanned
+ * - t=20 bucket 1 and 2 are scanned
+ * - t=30 bucket 1 and 3 are scanned
+ * - t=40 bucket 1 and 2 are scanned
+ * - t=50 bucket 1 is scanned
+ * - t=60 buckets 1, 2, and 3 are scanned
+ * - and the patter repeats
+ *
+ * If any scan does not occur or is incomplete (error, interrupted, etc) then a cached scan result
+ * should still be recorded with the WIFI_SCAN_FLAG_INTERRUPTED flag set.
+ */
+wifi_error wifi_start_gscan(wifi_request_id id, wifi_interface_handle iface,
+ wifi_scan_cmd_params params, wifi_scan_result_handler handler);
+
+/* Stop periodic GSCAN */
+wifi_error wifi_stop_gscan(wifi_request_id id, wifi_interface_handle iface);
+
+typedef enum {
+ WIFI_SCAN_FLAG_INTERRUPTED = 1 // Indicates that scan results are not complete because
+ // probes were not sent on some channels
+} wifi_scan_flags;
+
+/* Get the GSCAN cached scan results */
+typedef struct {
+ int scan_id; // a unique identifier for the scan unit
+ int flags; // a bitmask with additional
+ // information about scan.
+ unsigned buckets_scanned; // a bitset of the buckets that were scanned.
+ // for example a value of 13 (0b1101) would
+ // indicate that buckets 0, 2 and 3 were
+ // scanned to produce this list of results.
+ // should be set to 0 if this information is
+ // not available.
+ int num_results; // number of bssids retrieved by the scan
+ wifi_scan_result results[MAX_AP_CACHE_PER_SCAN]; // scan results - one for each bssid
+} wifi_cached_scan_results;
+
+wifi_error wifi_get_cached_gscan_results(wifi_interface_handle iface, byte flush,
+ int max, wifi_cached_scan_results *results, int *num);
+
+/* BSSID Hotlist */
+typedef struct {
+ void (*on_hotlist_ap_found)(wifi_request_id id,
+ unsigned num_results, wifi_scan_result *results);
+ void (*on_hotlist_ap_lost)(wifi_request_id id,
+ unsigned num_results, wifi_scan_result *results);
+} wifi_hotlist_ap_found_handler;
+
+typedef struct {
+ mac_addr bssid; // AP BSSID
+ wifi_rssi low; // low threshold
+ wifi_rssi high; // high threshold
+} ap_threshold_param;
+
+typedef struct {
+ int lost_ap_sample_size;
+ int num_bssid; // number of hotlist APs
+ ap_threshold_param ap[MAX_HOTLIST_APS]; // hotlist APs
+} wifi_bssid_hotlist_params;
+
+/* Set the BSSID Hotlist */
+wifi_error wifi_set_bssid_hotlist(wifi_request_id id, wifi_interface_handle iface,
+ wifi_bssid_hotlist_params params, wifi_hotlist_ap_found_handler handler);
+
+/* Clear the BSSID Hotlist */
+wifi_error wifi_reset_bssid_hotlist(wifi_request_id id, wifi_interface_handle iface);
+
+/* SSID Hotlist */
+typedef struct {
+ void (*on_hotlist_ssid_found)(wifi_request_id id,
+ unsigned num_results, wifi_scan_result *results);
+ void (*on_hotlist_ssid_lost)(wifi_request_id id,
+ unsigned num_results, wifi_scan_result *results);
+} wifi_hotlist_ssid_handler;
+
+typedef struct {
+ char ssid[32+1]; // SSID
+ wifi_band band; // band for this set of threshold params
+ wifi_rssi low; // low threshold
+ wifi_rssi high; // high threshold
+} ssid_threshold_param;
+
+typedef struct {
+ int lost_ssid_sample_size;
+ int num_ssid; // number of hotlist SSIDs
+ ssid_threshold_param ssid[MAX_HOTLIST_SSID]; // hotlist SSIDs
+} wifi_ssid_hotlist_params;
+
+/* Significant wifi change */
+typedef struct {
+ mac_addr bssid; // BSSID
+ wifi_channel channel; // channel frequency in MHz
+ int num_rssi; // number of rssi samples
+ wifi_rssi rssi[]; // RSSI history in db
+} wifi_significant_change_result;
+
+typedef struct {
+ void (*on_significant_change)(wifi_request_id id,
+ unsigned num_results, wifi_significant_change_result **results);
+} wifi_significant_change_handler;
+
+// The sample size parameters in the wifi_significant_change_params structure
+// represent the number of occurence of a g-scan where the BSSID was seen and RSSI was
+// collected for that BSSID, or, the BSSID was expected to be seen and didn't.
+// for instance: lost_ap_sample_size : number of time a g-scan was performed on the
+// channel the BSSID was seen last, and the BSSID was not seen during those g-scans
+typedef struct {
+ int rssi_sample_size; // number of samples for averaging RSSI
+ int lost_ap_sample_size; // number of samples to confirm AP loss
+ int min_breaching; // number of APs breaching threshold
+ int num_bssid; // max 64
+ ap_threshold_param ap[MAX_SIGNIFICANT_CHANGE_APS];
+} wifi_significant_change_params;
+
+/* Set the Signifcant AP change list */
+wifi_error wifi_set_significant_change_handler(wifi_request_id id, wifi_interface_handle iface,
+ wifi_significant_change_params params, wifi_significant_change_handler handler);
+
+/* Clear the Signifcant AP change list */
+wifi_error wifi_reset_significant_change_handler(wifi_request_id id, wifi_interface_handle iface);
+
+/* Random MAC OUI for PNO */
+wifi_error wifi_set_scanning_mac_oui(wifi_interface_handle handle, oui scan_oui);
+
+
+// Enhanced PNO:
+// Enhanced PNO feature is expected to be enabled all of the time (e.g. screen lit) and may thus
+// require firmware to store a large number of networks, covering the whole list of known networks.
+// Therefore, it is acceptable for firmware to store a crc24, crc32 or other short hash of the SSID,
+// such that a low but non-zero probability of collision exist. With that scheme it should be
+// possible for firmware to keep an entry as small as 4 bytes for each pno network.
+// For instance, a firmware pn0 entry can be implemented in the form of:
+// PNO ENTRY = crc24(3 bytes) | flags>>3 (5 bits) | auth flags(3 bits)
+//
+// No scans should be automatically performed by the chip. Instead all scan results from gscan
+// should be scored and the wifi_epno_handler on_network_found callback should be called with
+// the scan results.
+//
+// A PNO network shall be reported once, that is, once a network is reported by firmware
+// its entry shall be marked as "done" until framework calls wifi_set_epno_list again.
+// Calling wifi_set_epno_list shall reset the "done" status of pno networks in firmware.
+//
+// A network should only be considered found if its RSSI is above the minimum RSSI for its
+// frequency range (min5GHz_rssi and min24GHz_rssi for 5GHz and 2.4GHz networks respectively).
+// When disconnected the list of scan results should be returned if any network is found.
+// When connected the scan results shall be reported only if the score of any network in the scan
+// is greater than that of the currently connected BSSID.
+//
+// The FW should calculate the score of all the candidates (including currently connected one)
+// with following equation:
+// RSSI score = (RSSI + 85) * 4;
+// If RSSI score > initial_score_max , RSSI score = initial_score_max;
+// final score = RSSI score
+// + current_connection_bonus (if currently connected BSSID)
+// + same_network_bonus (if network has SAME_NETWORK flag)
+// + secure_bonus (if the network is not open)
+// + band5GHz_bonus (if BSSID is on 5G)
+// If there is a BSSID’s score > current BSSID’s score, then report the cached scan results
+// at the end of the scan (excluding the ones on blacklist) to the upper layer.
+// Additionally, all BSSIDs that are in the BSSID blacklist should be ignored by Enhanced PNO
+
+// Whether directed scan needs to be performed (for hidden SSIDs)
+#define WIFI_PNO_FLAG_DIRECTED_SCAN (1 << 0)
+// Whether PNO event shall be triggered if the network is found on A band
+#define WIFI_PNO_FLAG_A_BAND (1 << 1)
+// Whether PNO event shall be triggered if the network is found on G band
+#define WIFI_PNO_FLAG_G_BAND (1 << 2)
+// Whether strict matching is required
+// If required then the firmware must store the network's SSID and not just a hash
+#define WIFI_PNO_FLAG_STRICT_MATCH (1 << 3)
+// If this SSID should be considered the same network as the currently connected one for scoring
+#define WIFI_PNO_FLAG_SAME_NETWORK (1 << 4)
+
+// Code for matching the beacon AUTH IE - additional codes TBD
+#define WIFI_PNO_AUTH_CODE_OPEN (1 << 0) // open
+#define WIFI_PNO_AUTH_CODE_PSK (1 << 1) // WPA_PSK or WPA2PSK
+#define WIFI_PNO_AUTH_CODE_EAPOL (1 << 2) // any EAPOL
+
+typedef struct {
+ char ssid[32+1]; // null terminated
+ byte flags; // WIFI_PNO_FLAG_XXX
+ byte auth_bit_field; // auth bit field for matching WPA IE
+} wifi_epno_network;
+
+/* ePNO Parameters */
+typedef struct {
+ int min5GHz_rssi; // minimum 5GHz RSSI for a BSSID to be considered
+ int min24GHz_rssi; // minimum 2.4GHz RSSI for a BSSID to be considered
+ int initial_score_max; // the maximum score that a network can have before bonuses
+ int current_connection_bonus; // only report when there is a network's score this much higher
+ // than the current connection.
+ int same_network_bonus; // score bonus for all networks with the same network flag
+ int secure_bonus; // score bonus for networks that are not open
+ int band5GHz_bonus; // 5GHz RSSI score bonus (applied to all 5GHz networks)
+ int num_networks; // number of wifi_epno_network objects
+ wifi_epno_network networks[MAX_EPNO_NETWORKS]; // PNO networks
+} wifi_epno_params;
+
+typedef struct {
+ // on results
+ void (*on_network_found)(wifi_request_id id,
+ unsigned num_results, wifi_scan_result *results);
+} wifi_epno_handler;
+
+
+/* Set the ePNO list - enable ePNO with the given parameters */
+wifi_error wifi_set_epno_list(wifi_request_id id, wifi_interface_handle iface,
+ const wifi_epno_params *epno_params, wifi_epno_handler handler);
+
+/* Reset the ePNO list - no ePNO networks should be matched after this */
+wifi_error wifi_reset_epno_list(wifi_request_id id, wifi_interface_handle iface);
+
+
+typedef struct {
+ int id; // identifier of this network block, report this in event
+ char realm[256]; // null terminated UTF8 encoded realm, 0 if unspecified
+ int64_t roamingConsortiumIds[16]; // roaming consortium ids to match, 0s if unspecified
+ byte plmn[3]; // mcc/mnc combination as per rules, 0s if unspecified
+} wifi_passpoint_network;
+
+typedef struct {
+ void (*on_passpoint_network_found)(
+ wifi_request_id id,
+ int net_id, // network block identifier for the matched network
+ wifi_scan_result *result, // scan result, with channel and beacon information
+ int anqp_len, // length of ANQP blob
+ byte *anqp // ANQP data, in the information_element format
+ );
+} wifi_passpoint_event_handler;
+
+/* Sets a list for passpoint networks for PNO purposes; it should be matched
+ * against any passpoint networks (designated by Interworking element) found
+ * during regular PNO scan. */
+wifi_error wifi_set_passpoint_list(wifi_request_id id, wifi_interface_handle iface, int num,
+ wifi_passpoint_network *networks, wifi_passpoint_event_handler handler);
+
+/* Reset passpoint network list - no Passpoint networks should be matched after this */
+wifi_error wifi_reset_passpoint_list(wifi_request_id id, wifi_interface_handle iface);
+
+#endif
diff --git a/wifi/legacy_headers/include/hardware_legacy/link_layer_stats.h b/wifi/legacy_headers/include/hardware_legacy/link_layer_stats.h
new file mode 100644
index 0000000..f4e16c6
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/link_layer_stats.h
@@ -0,0 +1,342 @@
+#include "wifi_hal.h"
+
+#ifndef __WIFI_HAL_STATS_H
+#define __WIFI_HAL_STATS_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#define STATS_MAJOR_VERSION 1
+#define STATS_MINOR_VERSION 0
+#define STATS_MICRO_VERSION 0
+
+typedef enum {
+ WIFI_DISCONNECTED = 0,
+ WIFI_AUTHENTICATING = 1,
+ WIFI_ASSOCIATING = 2,
+ WIFI_ASSOCIATED = 3,
+ WIFI_EAPOL_STARTED = 4, // if done by firmware/driver
+ WIFI_EAPOL_COMPLETED = 5, // if done by firmware/driver
+} wifi_connection_state;
+
+typedef enum {
+ WIFI_ROAMING_IDLE = 0,
+ WIFI_ROAMING_ACTIVE = 1,
+} wifi_roam_state;
+
+typedef enum {
+ WIFI_INTERFACE_STA = 0,
+ WIFI_INTERFACE_SOFTAP = 1,
+ WIFI_INTERFACE_IBSS = 2,
+ WIFI_INTERFACE_P2P_CLIENT = 3,
+ WIFI_INTERFACE_P2P_GO = 4,
+ WIFI_INTERFACE_NAN = 5,
+ WIFI_INTERFACE_MESH = 6,
+ WIFI_INTERFACE_TDLS = 7,
+ WIFI_INTERFACE_UNKNOWN = -1
+ } wifi_interface_mode;
+
+#define WIFI_CAPABILITY_QOS 0x00000001 // set for QOS association
+#define WIFI_CAPABILITY_PROTECTED 0x00000002 // set for protected association (802.11 beacon frame control protected bit set)
+#define WIFI_CAPABILITY_INTERWORKING 0x00000004 // set if 802.11 Extended Capabilities element interworking bit is set
+#define WIFI_CAPABILITY_HS20 0x00000008 // set for HS20 association
+#define WIFI_CAPABILITY_SSID_UTF8 0x00000010 // set is 802.11 Extended Capabilities element UTF-8 SSID bit is set
+#define WIFI_CAPABILITY_COUNTRY 0x00000020 // set is 802.11 Country Element is present
+
+typedef struct {
+ wifi_interface_mode mode; // interface mode
+ u8 mac_addr[6]; // interface mac address (self)
+ wifi_connection_state state; // connection state (valid for STA, CLI only)
+ wifi_roam_state roaming; // roaming state
+ u32 capabilities; // WIFI_CAPABILITY_XXX (self)
+ u8 ssid[33]; // null terminated SSID
+ u8 bssid[6]; // bssid
+ u8 ap_country_str[3]; // country string advertised by AP
+ u8 country_str[3]; // country string for this association
+ u8 time_slicing_duty_cycle_percent;// if this iface is being served using time slicing on a radio with one or more ifaces (i.e MCC), then the duty cycle assigned to this iface in %.
+ // If not using time slicing (i.e SCC or DBS), set to 100.
+} wifi_interface_link_layer_info;
+
+/* channel information */
+typedef struct {
+ wifi_channel_width width; // channel width (20, 40, 80, 80+80, 160, 320)
+ wifi_channel center_freq; // primary 20 MHz channel
+ wifi_channel center_freq0; // center frequency (MHz) first segment
+ wifi_channel center_freq1; // center frequency (MHz) second segment
+} wifi_channel_info;
+
+/* wifi rate */
+typedef struct {
+ u32 preamble :3; // 0: OFDM, 1:CCK, 2:HT 3:VHT 4:HE 5:EHT 6..7 reserved
+ u32 nss :2; // 0:1x1, 1:2x2, 3:3x3, 4:4x4
+ u32 bw :3; // 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz 4:320Mhz
+ u32 rateMcsIdx :8; // OFDM/CCK rate code would be as per ieee std in the units of 0.5mbps
+ // HT/VHT/HE/EHT it would be mcs index
+ u32 reserved :16; // reserved
+ u32 bitrate; // units of 100 Kbps
+} wifi_rate;
+
+/* channel statistics */
+typedef struct {
+ wifi_channel_info channel; // channel
+ u32 on_time; // msecs the radio is awake (32 bits number accruing over time)
+ u32 cca_busy_time; // msecs the CCA register is busy (32 bits number accruing over time)
+} wifi_channel_stat;
+
+// Max number of tx power levels. The actual number vary per device and is specified by |num_tx_levels|
+#define RADIO_STAT_MAX_TX_LEVELS 256
+
+/* radio statistics */
+typedef struct {
+ wifi_radio radio; // wifi radio (if multiple radio supported)
+ u32 on_time; // msecs the radio is awake (32 bits number accruing over time)
+ u32 tx_time; // msecs the radio is transmitting (32 bits number accruing over time)
+ u32 num_tx_levels; // number of radio transmit power levels
+ u32 *tx_time_per_levels; // pointer to an array of radio transmit per power levels in
+ // msecs accured over time
+ u32 rx_time; // msecs the radio is in active receive (32 bits number accruing over time)
+ u32 on_time_scan; // msecs the radio is awake due to all scan (32 bits number accruing over time)
+ u32 on_time_nbd; // msecs the radio is awake due to NAN (32 bits number accruing over time)
+ u32 on_time_gscan; // msecs the radio is awake due to G?scan (32 bits number accruing over time)
+ u32 on_time_roam_scan; // msecs the radio is awake due to roam?scan (32 bits number accruing over time)
+ u32 on_time_pno_scan; // msecs the radio is awake due to PNO scan (32 bits number accruing over time)
+ u32 on_time_hs20; // msecs the radio is awake due to HS2.0 scans and GAS exchange (32 bits number accruing over time)
+ u32 num_channels; // number of channels
+ wifi_channel_stat channels[]; // channel statistics
+} wifi_radio_stat;
+
+/**
+ * Packet statistics reporting by firmware is performed on MPDU basi (i.e. counters increase by 1 for each MPDU)
+ * As well, "data packet" in associated comments, shall be interpreted as 802.11 data packet,
+ * that is, 802.11 frame control subtype == 2 and excluding management and control frames.
+ *
+ * As an example, in the case of transmission of an MSDU fragmented in 16 MPDUs which are transmitted
+ * OTA in a 16 units long a-mpdu, for which a block ack is received with 5 bits set:
+ * tx_mpdu : shall increase by 5
+ * retries : shall increase by 16
+ * tx_ampdu : shall increase by 1
+ * data packet counters shall not increase regardless of the number of BAR potentially sent by device for this a-mpdu
+ * data packet counters shall not increase regardless of the number of BA received by device for this a-mpdu
+ *
+ * For each subsequent retransmission of the 11 remaining non ACK'ed mpdus
+ * (regardless of the fact that they are transmitted in a-mpdu or not)
+ * retries : shall increase by 1
+ *
+ * If no subsequent BA or ACK are received from AP, until packet lifetime expires for those 11 packet that were not ACK'ed
+ * mpdu_lost : shall increase by 11
+ */
+
+/* per rate statistics */
+typedef struct {
+ wifi_rate rate; // rate information
+ u32 tx_mpdu; // number of successfully transmitted data pkts (ACK rcvd)
+ u32 rx_mpdu; // number of received data pkts
+ u32 mpdu_lost; // number of data packet losses (no ACK)
+ u32 retries; // total number of data pkt retries
+ u32 retries_short; // number of short data pkt retries
+ u32 retries_long; // number of long data pkt retries
+} wifi_rate_stat;
+
+/* access categories */
+typedef enum {
+ WIFI_AC_VO = 0,
+ WIFI_AC_VI = 1,
+ WIFI_AC_BE = 2,
+ WIFI_AC_BK = 3,
+ WIFI_AC_MAX = 4,
+} wifi_traffic_ac;
+
+/* wifi peer type */
+typedef enum
+{
+ WIFI_PEER_STA,
+ WIFI_PEER_AP,
+ WIFI_PEER_P2P_GO,
+ WIFI_PEER_P2P_CLIENT,
+ WIFI_PEER_NAN,
+ WIFI_PEER_TDLS,
+ WIFI_PEER_INVALID,
+} wifi_peer_type;
+
+/* per peer statistics */
+typedef struct bssload_info {
+ u16 sta_count; // station count
+ u16 chan_util; // channel utilization
+ u8 PAD[4];
+} bssload_info_t;
+
+typedef struct {
+ wifi_peer_type type; // peer type (AP, TDLS, GO etc.)
+ u8 peer_mac_address[6]; // mac address
+ u32 capabilities; // peer WIFI_CAPABILITY_XXX
+ bssload_info_t bssload; // STA count and CU
+ u32 num_rate; // number of rates
+ wifi_rate_stat rate_stats[]; // per rate statistics, number of entries = num_rate
+} wifi_peer_info;
+
+/* Per access category statistics */
+typedef struct {
+ wifi_traffic_ac ac; // access category (VI, VO, BE, BK)
+ u32 tx_mpdu; // number of successfully transmitted unicast data pkts (ACK rcvd)
+ u32 rx_mpdu; // number of received unicast data packets
+ u32 tx_mcast; // number of succesfully transmitted multicast data packets
+ // STA case: implies ACK received from AP for the unicast packet in which mcast pkt was sent
+ u32 rx_mcast; // number of received multicast data packets
+ u32 rx_ampdu; // number of received unicast a-mpdus; support of this counter is optional
+ u32 tx_ampdu; // number of transmitted unicast a-mpdus; support of this counter is optional
+ u32 mpdu_lost; // number of data pkt losses (no ACK)
+ u32 retries; // total number of data pkt retries
+ u32 retries_short; // number of short data pkt retries
+ u32 retries_long; // number of long data pkt retries
+ u32 contention_time_min; // data pkt min contention time (usecs)
+ u32 contention_time_max; // data pkt max contention time (usecs)
+ u32 contention_time_avg; // data pkt avg contention time (usecs)
+ u32 contention_num_samples; // num of data pkts used for contention statistics
+} wifi_wmm_ac_stat;
+
+/* interface statistics */
+typedef struct {
+ wifi_interface_handle iface; // wifi interface
+ wifi_interface_link_layer_info info; // current state of the interface
+ u32 beacon_rx; // access point beacon received count from connected AP
+ u64 average_tsf_offset; // average beacon offset encountered (beacon_TSF - TBTT)
+ // The average_tsf_offset field is used so as to calculate the
+ // typical beacon contention time on the channel as well may be
+ // used to debug beacon synchronization and related power consumption issue
+ u32 leaky_ap_detected; // indicate that this AP typically leaks packets beyond the driver guard time.
+ u32 leaky_ap_avg_num_frames_leaked; // average number of frame leaked by AP after frame with PM bit set was ACK'ed by AP
+ u32 leaky_ap_guard_time; // guard time currently in force (when implementing IEEE power management based on
+ // frame control PM bit), How long driver waits before shutting down the radio and
+ // after receiving an ACK for a data frame with PM bit set)
+ u32 mgmt_rx; // access point mgmt frames received count from connected AP (including Beacon)
+ u32 mgmt_action_rx; // action frames received count
+ u32 mgmt_action_tx; // action frames transmit count
+ wifi_rssi rssi_mgmt; // access Point Beacon and Management frames RSSI (averaged)
+ wifi_rssi rssi_data; // access Point Data Frames RSSI (averaged) from connected AP
+ wifi_rssi rssi_ack; // access Point ACK RSSI (averaged) from connected AP
+ wifi_wmm_ac_stat ac[WIFI_AC_MAX]; // per ac data packet statistics
+ u32 num_peers; // number of peers
+ wifi_peer_info peer_info[]; // per peer statistics
+} wifi_iface_stat;
+
+/* Various states for the link */
+typedef enum {
+ // Chip does not support reporting the state of the link.
+ WIFI_LINK_STATE_UNKNOWN = 0,
+ // Link has not been in use since last report. It is placed in power save. All
+ // management, control and data frames for the MLO connection are carried over
+ // other links. In this state the link will not listen to beacons even in DTIM
+ // period and does not perform any GTK/IGTK/BIGTK updates but remains
+ // associated.
+ WIFI_LINK_STATE_NOT_IN_USE = 1,
+ // Link is in use. In presence of traffic, it is set to be power active. When
+ // the traffic stops, the link will go into power save mode and will listen
+ // for beacons every DTIM period.
+ WIFI_LINK_STATE_IN_USE = 2,
+} wifi_link_state;
+
+/* Per link statistics */
+typedef struct {
+ u8 link_id; // Identifier for the link.
+ wifi_link_state state; // State for the link.
+ wifi_radio radio; // Radio on which link stats are sampled.
+ u32 frequency; // Frequency on which link is operating.
+ u32 beacon_rx; // Beacon received count from connected AP on the link.
+ u64 average_tsf_offset; // Average beacon offset encountered (beacon_TSF -
+ // TBTT). The average_tsf_offset field is used so as
+ // to calculate the typical beacon contention time on
+ // the channel as well may be used to debug beacon
+ // synchronization and related power consumption
+ // issue.
+ u32 leaky_ap_detected; // Indicate that this AP on the link typically leaks
+ // packets beyond the driver guard time.
+ u32 leaky_ap_avg_num_frames_leaked; // Average number of frame leaked by AP
+ // in the link after frame with PM bit
+ // set was ACK'ed by AP.
+ u32 leaky_ap_guard_time; // Guard time currently in force (when implementing
+ // IEEE power management based on frame control PM
+ // bit), How long driver waits before shutting down
+ // the radio and after receiving an ACK for a data
+ // frame with PM bit set).
+ u32 mgmt_rx; // Management frames received count from connected AP on the
+ // link (including Beacon).
+ u32 mgmt_action_rx; // Action frames received count on the link.
+ u32 mgmt_action_tx; // Action frames transmit count on the link.
+ wifi_rssi rssi_mgmt; // Access Point Beacon and Management frames RSSI
+ // (averaged) on the link.
+ wifi_rssi rssi_data; // Access Point Data Frames RSSI (averaged) from
+ // connected AP on the link.
+ wifi_rssi rssi_ack; // Access Point ACK RSSI (averaged) from connected AP on
+ // the links.
+ wifi_wmm_ac_stat ac[WIFI_AC_MAX]; // Per AC data packet statistics for the
+ // link.
+ u8 time_slicing_duty_cycle_percent; // If this link is being served using
+ // time slicing on a radio with one or
+ // more links, then the duty cycle
+ // assigned to this link in %.
+ u32 num_peers; // Number of peers.
+ wifi_peer_info peer_info[]; // Peer statistics for the link.
+} wifi_link_stat;
+
+/* Multi link stats for interface */
+typedef struct {
+ wifi_interface_handle iface; // Wifi interface.
+ wifi_interface_link_layer_info info; // Current state of the interface.
+ int num_links; // Number of links.
+ wifi_link_stat links[]; // Stats per link.
+} wifi_iface_ml_stat;
+/* configuration params */
+typedef struct {
+ u32 mpdu_size_threshold; // threshold to classify the pkts as short or long
+ // packet size < mpdu_size_threshold => short
+ u32 aggressive_statistics_gathering; // set for field debug mode. Driver should collect all statistics regardless of performance impact.
+} wifi_link_layer_params;
+
+/* API to trigger the link layer statistics collection.
+ Unless his API is invoked - link layer statistics will not be collected.
+ Radio statistics (once started) do not stop or get reset unless wifi_clear_link_stats is invoked
+ Interface statistics (once started) reset and start afresh after each connection */
+wifi_error wifi_set_link_stats(wifi_interface_handle iface, wifi_link_layer_params params);
+
+/* Callbacks for reporting link layer stats. Only one of the callbacks needs to
+ * be called. */
+typedef struct {
+ /* Legacy: Single iface/link stats. */
+ void (*on_link_stats_results)(wifi_request_id id,
+ wifi_iface_stat *iface_stat, int num_radios,
+ wifi_radio_stat *radio_stat);
+ /* Multi link stats. */
+ void (*on_multi_link_stats_results)(wifi_request_id id,
+ wifi_iface_ml_stat *iface_ml_stat,
+ int num_radios,
+ wifi_radio_stat *radio_stat);
+} wifi_stats_result_handler;
+
+/* api to collect the link layer statistics for a given iface and all the radio stats */
+wifi_error wifi_get_link_stats(wifi_request_id id,
+ wifi_interface_handle iface, wifi_stats_result_handler handler);
+
+/* wifi statistics bitmap */
+#define WIFI_STATS_RADIO 0x00000001 // all radio statistics
+#define WIFI_STATS_RADIO_CCA 0x00000002 // cca_busy_time (within radio statistics)
+#define WIFI_STATS_RADIO_CHANNELS 0x00000004 // all channel statistics (within radio statistics)
+#define WIFI_STATS_RADIO_SCAN 0x00000008 // all scan statistics (within radio statistics)
+#define WIFI_STATS_IFACE 0x00000010 // all interface statistics
+#define WIFI_STATS_IFACE_TXRATE 0x00000020 // all tx rate statistics (within interface statistics)
+#define WIFI_STATS_IFACE_AC 0x00000040 // all ac statistics (within interface statistics)
+#define WIFI_STATS_IFACE_CONTENTION 0x00000080 // all contention (min, max, avg) statistics (within ac statisctics)
+
+/* clear api to reset statistics, stats_clear_rsp_mask identifies what stats have been cleared
+ stop_req = 1 will imply whether to stop the statistics collection.
+ stop_rsp = 1 will imply that stop_req was honored and statistics collection was stopped.
+ */
+wifi_error wifi_clear_link_stats(wifi_interface_handle iface,
+ u32 stats_clear_req_mask, u32 *stats_clear_rsp_mask, u8 stop_req, u8 *stop_rsp);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /*__WIFI_HAL_STATS_ */
diff --git a/wifi/legacy_headers/include/hardware_legacy/roam.h b/wifi/legacy_headers/include/hardware_legacy/roam.h
new file mode 100644
index 0000000..dbfd54b
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/roam.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2016 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 __WIFI_HAL_ROAM_H__
+#define __WIFI_HAL_ROAM_H__
+
+#include "wifi_hal.h"
+
+#define MAX_BLACKLIST_BSSID 16
+#define MAX_WHITELIST_SSID 8
+#define MAX_SSID_LENGTH 32
+
+typedef struct {
+ u32 max_blacklist_size;
+ u32 max_whitelist_size;
+} wifi_roaming_capabilities;
+
+typedef enum {
+ ROAMING_DISABLE,
+ ROAMING_ENABLE,
+ ROAMING_AGGRESSIVE
+} fw_roaming_state_t;
+
+typedef struct {
+ u32 length;
+ char ssid_str[MAX_SSID_LENGTH];
+} ssid_t;
+
+typedef struct {
+ u32 num_blacklist_bssid; // Number of bssids valid in blacklist_bssid[].
+ mac_addr blacklist_bssid[MAX_BLACKLIST_BSSID]; // List of bssids which should not be considered
+ // for romaing by firmware/driver.
+ u32 num_whitelist_ssid; // Number of ssids valid in whitelist_ssid[].
+ ssid_t whitelist_ssid[MAX_WHITELIST_SSID]; // List of ssids to which firmware/driver can
+ // consider to roam to.
+} wifi_roaming_config;
+
+/* Get the chipset roaming capabilities. */
+wifi_error wifi_get_roaming_capabilities(wifi_interface_handle handle,
+ wifi_roaming_capabilities *caps);
+/* Enable/disable firmware roaming */
+wifi_error wifi_enable_firmware_roaming(wifi_interface_handle handle,
+ fw_roaming_state_t state);
+
+/* Pass down the blacklist BSSID and whitelist SSID to firmware. */
+wifi_error wifi_configure_roaming(wifi_interface_handle handle,
+ wifi_roaming_config *roaming_config);
+
+#endif /* __WIFI_HAL_ROAM_H__ */
diff --git a/wifi/legacy_headers/include/hardware_legacy/rtt.h b/wifi/legacy_headers/include/hardware_legacy/rtt.h
new file mode 100644
index 0000000..63c3325
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/rtt.h
@@ -0,0 +1,411 @@
+
+#include "wifi_hal.h"
+#include "gscan.h"
+
+#ifndef __WIFI_HAL_RTT_H__
+#define __WIFI_HAL_RTT_H__
+
+/* Ranging status */
+typedef enum {
+ RTT_STATUS_SUCCESS = 0,
+ RTT_STATUS_FAILURE = 1, // general failure status
+ RTT_STATUS_FAIL_NO_RSP = 2, // target STA does not respond to request
+ RTT_STATUS_FAIL_REJECTED = 3, // request rejected. Applies to 2-sided RTT only
+ RTT_STATUS_FAIL_NOT_SCHEDULED_YET = 4,
+ RTT_STATUS_FAIL_TM_TIMEOUT = 5, // timing measurement times out
+ RTT_STATUS_FAIL_AP_ON_DIFF_CHANNEL = 6, // Target on different channel, cannot range
+ RTT_STATUS_FAIL_NO_CAPABILITY = 7, // ranging not supported
+ RTT_STATUS_ABORTED = 8, // request aborted for unknown reason
+ RTT_STATUS_FAIL_INVALID_TS = 9, // Invalid T1-T4 timestamp
+ RTT_STATUS_FAIL_PROTOCOL = 10, // 11mc protocol failed
+ RTT_STATUS_FAIL_SCHEDULE = 11, // request could not be scheduled
+ RTT_STATUS_FAIL_BUSY_TRY_LATER = 12, // responder cannot collaborate at time of request
+ RTT_STATUS_INVALID_REQ = 13, // bad request args
+ RTT_STATUS_NO_WIFI = 14, // WiFi not enabled
+ RTT_STATUS_FAIL_FTM_PARAM_OVERRIDE = 15, // Responder overrides param info, cannot range with new params
+ RTT_STATUS_NAN_RANGING_PROTOCOL_FAILURE =16, //Negotiation failure
+ RTT_STATUS_NAN_RANGING_CONCURRENCY_NOT_SUPPORTED=17, //concurrency not supported (NDP+RTT)
+} wifi_rtt_status;
+
+/* RTT peer type */
+typedef enum {
+ RTT_PEER_AP = 0x1,
+ RTT_PEER_STA = 0x2,
+ RTT_PEER_P2P_GO = 0x3,
+ RTT_PEER_P2P_CLIENT = 0x4,
+ RTT_PEER_NAN = 0x5
+} rtt_peer_type;
+
+/* RTT Measurement Bandwidth */
+typedef enum {
+ WIFI_RTT_BW_UNSPECIFIED = 0x00,
+ WIFI_RTT_BW_5 = 0x01,
+ WIFI_RTT_BW_10 = 0x02,
+ WIFI_RTT_BW_20 = 0x04,
+ WIFI_RTT_BW_40 = 0x08,
+ WIFI_RTT_BW_80 = 0x10,
+ WIFI_RTT_BW_160 = 0x20,
+ WIFI_RTT_BW_320 = 0x40
+} wifi_rtt_bw;
+
+/* RTT Measurement Preamble */
+typedef enum {
+ WIFI_RTT_PREAMBLE_INVALID = 0x0,
+ WIFI_RTT_PREAMBLE_LEGACY = 0x1,
+ WIFI_RTT_PREAMBLE_HT = 0x2,
+ WIFI_RTT_PREAMBLE_VHT = 0x4,
+ WIFI_RTT_PREAMBLE_HE = 0x8,
+ WIFI_RTT_PREAMBLE_EHT = 0x10,
+} wifi_rtt_preamble ;
+
+/* RTT Type */
+typedef enum {
+ RTT_TYPE_1_SIDED = 0x1,
+ /* Deprecated. Use RTT_TYPE_2_SIDED_11MC instead. */
+ RTT_TYPE_2_SIDED = 0x2,
+ RTT_TYPE_2_SIDED_11MC = RTT_TYPE_2_SIDED,
+ RTT_TYPE_2_SIDED_11AZ_NTB = 0x3,
+
+} wifi_rtt_type;
+
+/* RTT configuration */
+typedef struct {
+ mac_addr addr; // peer device mac address
+ wifi_rtt_type type; // 1-sided or 2-sided RTT (11mc and 11az)
+ rtt_peer_type peer; // optional - peer device hint (STA, P2P, AP)
+ wifi_channel_info channel; // Required for STA-AP mode, optional for P2P, NBD etc.
+ unsigned burst_period; // Time interval between bursts (units: 100 ms).
+ // Applies to 1-sided and 2-sided RTT multi-burst requests.
+ // Range: 0-31, 0: no preference by initiator (2-sided RTT)
+ // Note: Applicable for 11mc only.
+ unsigned num_burst; // Total number of RTT bursts to be executed. It will be
+ // specified in the same way as the parameter "Number of
+ // Burst Exponent" found in the FTM frame format. It
+ // applies to both: 1-sided RTT and 2-sided RTT. Valid
+ // values are 0 to 15 as defined in 802.11mc std.
+ // 0 means single shot
+ // The implication of this parameter on the maximum
+ // number of RTT results is the following:
+ // for 1-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst)
+ // for 2-sided RTT: max num of RTT results = (2^num_burst)*(num_frames_per_burst - 1)
+ // Note: Applicable for 11mc only.
+ unsigned num_frames_per_burst; // num of frames per burst.
+ // Minimum value = 1, Maximum value = 31
+ // For 2-sided this equals the number of FTM frames
+ // to be attempted in a single burst. This also
+ // equals the number of FTM frames that the
+ // initiator will request that the responder send
+ // in a single frame.
+ // Note: Applicable for 11mc only.
+ unsigned num_retries_per_rtt_frame; // number of retries for a failed RTT frame. Applies
+ // to 1-sided RTT only. Minimum value = 0, Maximum value = 3
+
+ //following fields are only valid for 2-side RTT
+ unsigned num_retries_per_ftmr; // Maximum number of retries that the initiator can
+ // retry an FTMR frame.
+ // Minimum value = 0, Maximum value = 3
+ byte LCI_request; // 1: request LCI, 0: do not request LCI
+ byte LCR_request; // 1: request LCR, 0: do not request LCR
+ unsigned burst_duration; // Applies to 1-sided and 2-sided 11mc RTT. Valid values will
+ // be 2-11 and 15 as specified by the 802.11mc std for
+ // the FTM parameter burst duration. In a multi-burst
+ // request, if responder overrides with larger value,
+ // the initiator will return failure. In a single-burst
+ // request if responder overrides with larger value,
+ // the initiator will sent TMR_STOP to terminate RTT
+ // at the end of the burst_duration it requested.
+ wifi_rtt_preamble preamble; // RTT preamble to be used in the RTT frames
+ wifi_rtt_bw bw; // RTT BW to be used in the RTT frames
+} wifi_rtt_config;
+
+/* RTT configuration v3 (11az support)*/
+typedef struct {
+ wifi_rtt_config rtt_config;
+ byte ntb_min_measurement_time_millis; // 11az Non-Trigger-based (non-TB) minimum measurement
+ // time in milliseconds
+ byte ntb_max_measurement_time_millis; // 11az Non-Trigger-based (non-TB) maximum measurement
+ // time in milliseconds
+ byte tx_ltf_repetition_count; // Multiple transmissions of HE-LTF symbols in an HE
+ // Ranging NDP. A value of 1 indicates no repetition.
+} wifi_rtt_config_v3;
+
+/* RTT results */
+typedef struct {
+ mac_addr addr; // device mac address
+ unsigned burst_num; // burst number in a multi-burst request. Note: Applicable to
+ // 1-sided RTT and 2-sided IEEE 802.11mc only.
+ unsigned measurement_number; // Total RTT measurement frames attempted
+ unsigned success_number; // Total successful RTT measurement frames
+ byte number_per_burst_peer; // Maximum number of "FTM frames per burst" supported by
+ // the responder STA. Applies to 2-sided RTT only.
+ // If reponder overrides with larger value:
+ // - for single-burst request initiator will truncate the
+ // larger value and send a TMR_STOP after receiving as
+ // many frames as originally requested.
+ // - for multi-burst request, initiator will return
+ // failure right away.
+ wifi_rtt_status status; // ranging status
+ byte retry_after_duration; // When status == RTT_STATUS_FAIL_BUSY_TRY_LATER,
+ // this will be the time provided by the responder as to
+ // when the request can be tried again. Applies to 2-sided
+ // RTT only. In sec, 1-31sec.
+ wifi_rtt_type type; // RTT type
+ wifi_rssi rssi; // average rssi in 0.5 dB steps e.g. 143 implies -71.5 dB
+ wifi_rssi rssi_spread; // rssi spread in 0.5 dB steps e.g. 5 implies 2.5 dB spread (optional)
+ wifi_rate tx_rate; // 1-sided RTT: TX rate of RTT frame.
+ // 2-sided RTT: TX rate of initiator's Ack in response to FTM frame.
+ wifi_rate rx_rate; // 1-sided RTT: TX rate of Ack from other side.
+ // 2-sided RTT: TX rate of FTM frame coming from responder.
+ wifi_timespan rtt; // round trip time in picoseconds
+ wifi_timespan rtt_sd; // rtt standard deviation in picoseconds
+ wifi_timespan rtt_spread; // difference between max and min rtt times recorded in picoseconds
+ // Note: Only applicable for IEEE 802.11mc
+ int distance_mm; // distance in mm (optional)
+ int distance_sd_mm; // standard deviation in mm (optional)
+ int distance_spread_mm; // difference between max and min distance recorded in mm (optional)
+ wifi_timestamp ts; // time of the measurement (in microseconds since boot)
+ int burst_duration; // in ms, actual time taken by the FW to finish one burst
+ // measurement. Applies to 1-sided and 2-sided RTT.
+ int negotiated_burst_num; // Number of bursts allowed by the responder. Applies
+ // to 2-sided 11mc RTT only.
+ wifi_information_element *LCI; // for 11mc and 11az only
+ wifi_information_element *LCR; // for 11mc and 11az only
+} wifi_rtt_result;
+
+/* RTT results version 2 */
+typedef struct {
+ wifi_rtt_result rtt_result; // Legacy wifi rtt result structure
+ wifi_channel frequency; // primary channel frequency (MHz) used for ranging measurements
+ // If frequency is unknown, this will be set to |UNSPECIFIED(-1)|
+ wifi_rtt_bw packet_bw; // RTT packet bandwidth is an average BW of the BWs of RTT frames.
+ // Cap the average close to a specific valid RttBw.
+} wifi_rtt_result_v2;
+
+/* RTT results v3 (11az support)*/
+typedef struct {
+ wifi_rtt_result_v2 rtt_result;
+ int tx_ltf_repetition_count; // 11az Transmit LTF repetitions used to get this result.
+ int ntb_min_measurement_time_millis; // Minimum non-trigger based (non-TB) dynamic measurement
+ // time in milliseconds assigned by the 11az responder.
+ int ntb_max_measurement_time_millis; // Maximum non-trigger based (non-TB) dynamic measurement
+ // time in milliseconds assigned by the 11az responder.
+} wifi_rtt_result_v3;
+
+
+/* RTT result callbacks */
+typedef struct {
+ /*
+ * This callback is deprecated on Android 14 and onwards. Newer implementations should support
+ * on_rtt_results_v2 callback.
+ */
+ void (*on_rtt_results) (wifi_request_id id,
+ unsigned num_results,
+ wifi_rtt_result *rtt_result[]);
+
+ /*
+ * Called when vendor implementation supports sending RTT results version 2.
+ *
+ * Note: This callback is deprecated on Android 15 onwards. Newer implementation should support
+ * on_rtt_results_v3.
+ */
+ void (*on_rtt_results_v2) (wifi_request_id id,
+ unsigned num_results,
+ wifi_rtt_result_v2 *rtt_result_v2[]);
+} wifi_rtt_event_handler;
+
+/* API to request RTT measurement */
+wifi_error wifi_rtt_range_request(wifi_request_id id, wifi_interface_handle iface,
+ unsigned num_rtt_config, wifi_rtt_config rtt_config[], wifi_rtt_event_handler handler);
+
+/* RTT result v3 callback (11az support) */
+typedef struct {
+ /*
+ * Called when vendor implementation supports sending RTT results version 3 (Added support for
+ * 11az ranging)
+ */
+ void (*on_rtt_results_v3) (wifi_request_id id,
+ unsigned num_results,
+ wifi_rtt_result_v3 *rtt_result_v3[]);
+} wifi_rtt_event_handler_v3;
+
+
+/* v3 API to request RTT measurement(11az support). */
+wifi_error wifi_rtt_range_request_v3(wifi_request_id id,
+ wifi_interface_handle iface,
+ unsigned num_rtt_config,
+ wifi_rtt_config_v3 rtt_config_v3[],
+ wifi_rtt_event_handler_v3 handler);
+
+/* API to cancel RTT measurements */
+wifi_error wifi_rtt_range_cancel(wifi_request_id id, wifi_interface_handle iface,
+ unsigned num_devices, mac_addr addr[]);
+
+/* NBD ranging channel map */
+typedef struct {
+ wifi_channel availablity[32]; // specifies the channel map for each of the 16 TU windows
+ // frequency of 0 => unspecified; which means firmware is
+ // free to do whatever it wants in this window.
+} wifi_channel_map;
+
+/* API to start publishing the channel map on responder device in a NBD cluster.
+ Responder device will take this request and schedule broadcasting the channel map
+ in a NBD ranging attribute in a SDF. DE will automatically remove the ranging
+ attribute from the OTA queue after number of DW specified by num_dw
+ where Each DW is 512 TUs apart */
+wifi_error wifi_rtt_channel_map_set(wifi_request_id id,
+ wifi_interface_handle iface, wifi_channel_map *params, unsigned num_dw);
+
+/* API to clear the channel map on the responder device in a NBD cluster.
+ Responder device will cancel future ranging channel request, starting from “next”
+ DW interval and will also stop broadcasting NBD ranging attribute in SDF */
+wifi_error wifi_rtt_channel_map_clear(wifi_request_id id, wifi_interface_handle iface);
+
+// Preamble definition for bit mask used in wifi_rtt_capabilities
+#define PREAMBLE_LEGACY 0x1
+#define PREAMBLE_HT 0x2
+#define PREAMBLE_VHT 0x4
+#define PREAMBLE_HE 0x8
+#define PREAMBLE_EHT 0x10
+
+// BW definition for bit mask used in wifi_rtt_capabilities
+#define BW_5_SUPPORT 0x1
+#define BW_10_SUPPORT 0x2
+#define BW_20_SUPPORT 0x4
+#define BW_40_SUPPORT 0x8
+#define BW_80_SUPPORT 0x10
+#define BW_160_SUPPORT 0x20
+#define BW_320_SUPPORT 0x40
+
+/* RTT Capabilities */
+typedef struct {
+ byte rtt_one_sided_supported; // if 1-sided rtt data collection is supported
+ byte rtt_ftm_supported; // if ftm rtt data collection is supported
+ byte lci_support; // if initiator supports LCI request. Applies to 2-sided RTT
+ // (applies to both 11mc and 11az).
+ byte lcr_support; // if initiator supports LCR request. Applies to 2-sided RTT
+ // (applies to both 11mc and 11az).
+ byte preamble_support; // bit mask indicates what preamble is supported by 11mc
+ // initiator
+ byte bw_support; // bit mask indicates what BW is supported by 11mc initiator
+ byte responder_supported; // if 11mc responder mode is supported
+ byte mc_version; // draft 11mc spec version supported by chip. For instance,
+ // version 4.0 should be 40 and version 4.3 should be 43 etc.
+} wifi_rtt_capabilities;
+
+
+/* RTT capabilities of the device */
+wifi_error wifi_get_rtt_capabilities(wifi_interface_handle iface,
+ wifi_rtt_capabilities *capabilities);
+
+/* RTT Capabilities v3 (11az support) */
+typedef struct {
+ wifi_rtt_capabilities rtt_capab;
+ byte az_preamble_support; // bit mask indicates what preamble is supported by the 11az
+ // initiator
+ byte az_bw_support; // bit mask indicates what BW is supported by 11az initiator
+ byte ntb_initiator_supported; // if 11az non-TB initiator is supported
+ byte ntb_responder_supported; // if 11az non-TB responder is supported
+ byte max_tx_ltf_repetition_count;// maximum HE LTF repetitions the 11az initiator is capable of
+ // transmitting in the preamble of I2R NDP
+} wifi_rtt_capabilities_v3;
+
+/* RTT capabilities v3 of the device (11az support) */
+wifi_error wifi_get_rtt_capabilities_v3(wifi_interface_handle iface,
+ wifi_rtt_capabilities_v3 *capabilities);
+
+/* debugging definitions */
+enum {
+ RTT_DEBUG_DISABLE,
+ RTT_DEBUG_LOG,
+ RTT_DEBUG_PROTO,
+ RTT_DEBUG_BURST,
+ RTT_DEBUG_ACCURACY,
+ RTT_DEBUG_LOGDETAIL
+}; //rtt debug type
+
+enum {
+ RTT_DEBUG_FORMAT_TXT,
+ RTT_DEBUG_FORMAT_BINARY
+}; //rtt debug format
+
+typedef struct rtt_debug {
+ unsigned version;
+ unsigned len; // total length of after len field
+ unsigned type; // rtt debug type
+ unsigned format; //rtt debug format
+ char dbuf[0]; // debug content
+} rtt_debug_t;
+
+/* set configuration for debug */
+wifi_error wifi_rtt_debug_cfg(wifi_interface_handle h, unsigned rtt_dbg_type, char *cfgbuf, unsigned cfg_buf_size);
+/* get the debug information */
+wifi_error wifi_rtt_debug_get(wifi_interface_handle h, rtt_debug_t **debugbuf);
+/* free the debug buffer */
+wifi_error wifi_rtt_debug_free(wifi_interface_handle h, rtt_debug_t *debugbuf);
+
+/* API for setting LCI/LCR information to be provided to a requestor */
+typedef enum {
+ WIFI_MOTION_NOT_EXPECTED = 0, // Not expected to change location
+ WIFI_MOTION_EXPECTED = 1, // Expected to change location
+ WIFI_MOTION_UNKNOWN = 2, // Movement pattern unknown
+} wifi_motion_pattern;
+
+typedef struct {
+ long latitude; // latitude in degrees * 2^25 , 2's complement
+ long longitude; // latitude in degrees * 2^25 , 2's complement
+ int altitude; // Altitude in units of 1/256 m
+ byte latitude_unc; // As defined in Section 2.3.2 of IETF RFC 6225
+ byte longitude_unc; // As defined in Section 2.3.2 of IETF RFC 6225
+ byte altitude_unc; // As defined in Section 2.4.5 from IETF RFC 6225:
+
+ //Following element for configuring the Z subelement
+ wifi_motion_pattern motion_pattern;
+ int floor; // floor in units of 1/16th of floor. 0x80000000 if unknown.
+ int height_above_floor; // in units of 1/64 m
+ int height_unc; // in units of 1/64 m. 0 if unknown
+} wifi_lci_information;
+
+typedef struct {
+ char country_code[2]; // country code
+ int length; // length of the info field
+ char civic_info[256]; // Civic info to be copied in FTM frame
+} wifi_lcr_information;
+
+// API to configure the LCI. Used in RTT Responder mode only
+wifi_error wifi_set_lci(wifi_request_id id, wifi_interface_handle iface,
+ wifi_lci_information *lci);
+
+// API to configure the LCR. Used in RTT Responder mode only.
+wifi_error wifi_set_lcr(wifi_request_id id, wifi_interface_handle iface,
+ wifi_lcr_information *lcr);
+
+/**
+ * RTT Responder information
+ */
+typedef struct {
+ wifi_channel_info channel;
+ wifi_rtt_preamble preamble;
+} wifi_rtt_responder;
+
+/**
+ * Get RTT responder information e.g. WiFi channel to enable responder on.
+ */
+wifi_error wifi_rtt_get_responder_info(wifi_interface_handle iface,
+ wifi_rtt_responder *responder_info);
+
+/**
+ * Enable RTT responder mode.
+ * channel_hint - hint of the channel information where RTT responder should be enabled on.
+ * max_duration_seconds - timeout of responder mode.
+ * channel_used - channel used for RTT responder, NULL if responder is not enabled.
+ */
+wifi_error wifi_enable_responder(wifi_request_id id, wifi_interface_handle iface,
+ wifi_channel_info channel_hint, unsigned max_duration_seconds,
+ wifi_rtt_responder *responder_info);
+
+/**
+ * Disable RTT responder mode.
+ */
+wifi_error wifi_disable_responder(wifi_request_id id, wifi_interface_handle iface);
+
+#endif
diff --git a/wifi/legacy_headers/include/hardware_legacy/tdls.h b/wifi/legacy_headers/include/hardware_legacy/tdls.h
new file mode 100644
index 0000000..9ac225a
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/tdls.h
@@ -0,0 +1,85 @@
+
+#include "wifi_hal.h"
+
+#ifndef _TDLS_H_
+#define _TDLS_H_
+
+typedef enum {
+ WIFI_TDLS_DISABLED = 1, /* TDLS is not enabled, default status for all STAs */
+ WIFI_TDLS_ENABLED, /* TDLS is enabled, but not yet tried */
+ WIFI_TDLS_ESTABLISHED, /* Direct link is established */
+ WIFI_TDLS_ESTABLISHED_OFF_CHANNEL, /* Direct link is established using MCC */
+ WIFI_TDLS_DROPPED, /* Direct link was established,
+ * but is temporarily dropped now */
+ WIFI_TDLS_FAILED /* TDLS permanent failed. Inform error to upper layer
+ * and go back to WIFI_TDLS_DISABLED */
+} wifi_tdls_state;
+
+typedef enum {
+ WIFI_TDLS_SUCCESS, /* Success */
+ WIFI_TDLS_UNSPECIFIED = -1, /* Unspecified reason */
+ WIFI_TDLS_NOT_SUPPORTED = -2, /* Remote side doesn't support TDLS */
+ WIFI_TDLS_UNSUPPORTED_BAND = -3, /* Remote side doesn't support this band */
+ WIFI_TDLS_NOT_BENEFICIAL = -4, /* Going to AP is better than going direct */
+ WIFI_TDLS_DROPPED_BY_REMOTE = -5 /* Remote side doesn't want it anymore */
+} wifi_tdls_reason;
+
+typedef struct {
+ int channel; /* channel hint, in channel number (NOT frequency ) */
+ int global_operating_class; /* operating class to use */
+ int max_latency_ms; /* max latency that can be tolerated by apps */
+ int min_bandwidth_kbps; /* bandwidth required by apps, in kilo bits per second */
+} wifi_tdls_params;
+
+typedef struct {
+ int channel;
+ int global_operating_class;
+ wifi_tdls_state state;
+ wifi_tdls_reason reason;
+} wifi_tdls_status;
+
+typedef struct {
+ int max_concurrent_tdls_session_num; /* Maximum TDLS session number can be supported by the
+ * Firmware and hardware*/
+ int is_global_tdls_supported; /* 1 -- support, 0 -- not support */
+ int is_per_mac_tdls_supported; /* 1 -- support, 0 -- not support */
+ int is_off_channel_tdls_supported; /* 1 -- support, 0 -- not support */
+} wifi_tdls_capabilities;
+
+typedef struct {
+ /* on_tdls_state_changed - reports state of TDLS link to framework
+ * Report this event when the state of TDLS link changes */
+ void (*on_tdls_state_changed)(mac_addr addr, wifi_tdls_status status);
+} wifi_tdls_handler;
+
+
+/* wifi_enable_tdls - enables TDLS-auto mode for a specific route
+ *
+ * params specifies hints, which provide more information about
+ * why TDLS is being sought. The firmware should do its best to
+ * honor the hints before downgrading regular AP link
+ * If upper layer has no specific values, this should be NULL
+ *
+ * handler is used to inform the upper layer about the status change and the corresponding reason
+ */
+wifi_error wifi_enable_tdls(wifi_interface_handle iface, mac_addr addr,
+ wifi_tdls_params *params, wifi_tdls_handler handler);
+
+/* wifi_disable_tdls - disables TDLS-auto mode for a specific route
+ *
+ * This terminates any existing TDLS with addr device, and frees the
+ * device resources to make TDLS connections on new routes.
+ *
+ * DON'T fire any more events on 'handler' specified in earlier call to
+ * wifi_enable_tdls after this action.
+ */
+wifi_error wifi_disable_tdls(wifi_interface_handle iface, mac_addr addr);
+
+/* wifi_get_tdls_status - allows getting the status of TDLS for a specific route */
+wifi_error wifi_get_tdls_status(wifi_interface_handle iface, mac_addr addr,
+ wifi_tdls_status *status);
+
+/* return the current HW + Firmware combination's TDLS capabilities */
+wifi_error wifi_get_tdls_capabilities(wifi_interface_handle iface,
+ wifi_tdls_capabilities *capabilities);
+#endif
diff --git a/wifi/legacy_headers/include/hardware_legacy/wifi_cached_scan_results.h b/wifi/legacy_headers/include/hardware_legacy/wifi_cached_scan_results.h
new file mode 100644
index 0000000..a2a23fe
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/wifi_cached_scan_results.h
@@ -0,0 +1,92 @@
+/*
+ * 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.
+ */
+
+#ifndef __WIFI_CACHED_SCAN_RESULTS_H__
+#define __WIFI_CACHED_SCAN_RESULTS_H__
+
+#include "wifi_hal.h"
+
+#define WIFI_CACHED_SCAN_RESULT_FLAGS_NONE (0)
+/* Element ID 61 (HT Operation) is present (see HT 7.3.2) */
+#define WIFI_CACHED_SCAN_RESULT_FLAGS_HT_OPS_PRESENT (1 << 0)
+/* Element ID 192 (VHT Operation) is present (see VHT 8.4.2) */
+#define WIFI_CACHED_SCAN_RESULT_FLAGS_VHT_OPS_PRESENT (1 << 1)
+/* Element ID 255 + Extension 36 (HE Operation) is present
+ * (see 802.11ax 9.4.2.1)
+ */
+#define WIFI_CACHED_SCAN_RESULT_FLAGS_HE_OPS_PRESENT (1 << 2)
+/* Element ID 255 + Extension 106 (HE Operation) is present
+ * (see 802.11be D1.5 9.4.2.1)
+ */
+#define WIFI_CACHED_SCAN_RESULT_FLAGS_EHT_OPS_PRESENT (1 << 3)
+/* Element ID 127 (Extended Capabilities) is present, and bit 70
+ * (Fine Timing Measurement Responder) is set to 1
+ * (see IEEE Std 802.11-2016 9.4.2.27)
+ */
+#define WIFI_CACHED_SCAN_RESULT_FLAGS_IS_FTM_RESPONDER (1 << 4)
+
+/**
+ * Provides information about a single access point (AP) detected in a scan.
+ */
+typedef struct {
+ /* Number of milliseconds prior to ts in the enclosing
+ * wifi_cached_scan_result_report struct when
+ * the probe response or beacon frame that
+ * was used to populate this structure was received.
+ */
+ u32 age_ms;
+ /* The Capability Information field */
+ u16 capability;
+ /* null terminated */
+ u8 ssid[33];
+ u8 ssid_len;
+ u8 bssid[6];
+ /* A set of flags from WIFI_CACHED_SCAN_RESULT_FLAGS_* */
+ u8 flags;
+ s8 rssi;
+ wifi_channel_spec chanspec;
+}wifi_cached_scan_result;
+
+/*
+ * Data structure sent with events of type WifiCachedScanResult.
+ */
+typedef struct {
+ /* time since boot (in microsecond) when the result was retrieved */
+ wifi_timestamp ts;
+ /* If 0, indicates that all frequencies in current regulation were
+ * scanned. Otherwise, indicates the number of frequencies scanned, as
+ * specified in scanned_freq_list.
+ */
+ u16 scanned_freq_num;
+ /* Pointer to an array containing scanned_freq_num values comprising the
+ * set of frequencies that were scanned. Frequencies are specified as
+ * channel center frequencies in MHz. May be NULL if scannedFreqListLen is
+ * 0.
+ */
+ const u32 *scanned_freq_list;
+ /* The total number of cached results returned. */
+ u8 result_cnt;
+ /* Pointer to an array containing result_cnt entries. May be NULL if
+ * result_cnt is 0.
+ */
+ const wifi_cached_scan_result *results;
+} wifi_cached_scan_report;
+
+/* callback for reporting cached scan report */
+typedef struct {
+ void (*on_cached_scan_results) (wifi_cached_scan_report *cache_report);
+} wifi_cached_scan_result_handler;
+#endif
diff --git a/wifi/legacy_headers/include/hardware_legacy/wifi_config.h b/wifi/legacy_headers/include/hardware_legacy/wifi_config.h
new file mode 100644
index 0000000..9ddf8b8
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/wifi_config.h
@@ -0,0 +1,45 @@
+#include "wifi_hal.h"
+
+#ifndef __WIFI_HAL_CONFIG_H
+#define __WIFI_HAL_CONFIG_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#define CONFIG_MAJOR_VERSION 1
+#define CONFIG_MINOR_VERSION 0
+#define CONFIG_MICRO_VERSION 0
+
+// whether the wifi chipset wakes at every dtim beacon or a multiple of the dtim period
+// if extended_dtim is set to 3, the STA shall wake up every 3 DTIM beacons
+wifi_error wifi_extended_dtim_config_set(wifi_request_id id,
+ wifi_interface_handle iface, int extended_dtim);
+
+//set the country code to driver
+wifi_error wifi_set_country_code(wifi_interface_handle iface, const char* country_code);
+
+//set the wifi_iface stats averaging factor used to calculate
+// statistics like average the TSF offset or average number of frame leaked
+// For instance, upon beacon reception:
+// current_avg = ((beacon_TSF - TBTT) * factor + previous_avg * (0x10000 - factor) ) / 0x10000
+// For instance, when evaluating leaky APs:
+// current_avg = ((num frame received within guard time) * factor + previous_avg * (0x10000 - factor)) / 0x10000
+
+wifi_error wifi_set_beacon_wifi_iface_stats_averaging_factor(wifi_request_id id, wifi_interface_handle iface,
+ u16 factor);
+
+// configure guard time, i.e. when implementing IEEE power management based on
+// frame control PM bit, how long driver waits before shutting down the radio and
+// after receiving an ACK for a data frame with PM bit set
+wifi_error wifi_set_guard_time(wifi_request_id id, wifi_interface_handle iface,
+ u32 guard_time);
+
+#ifdef __cplusplus
+}
+
+#endif /* __cplusplus */
+
+#endif /*__WIFI_HAL_STATS_ */
+
diff --git a/wifi/legacy_headers/include/hardware_legacy/wifi_hal.h b/wifi/legacy_headers/include/hardware_legacy/wifi_hal.h
new file mode 100644
index 0000000..9c82e80
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/wifi_hal.h
@@ -0,0 +1,1389 @@
+/*
+ * Copyright (C) 2016 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 __WIFI_HAL_H__
+#define __WIFI_HAL_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+#include <stdint.h>
+
+#define IFNAMSIZ 16
+#define UNSPECIFIED -1 // wifi HAL common definition for unspecified value
+
+/* typedefs */
+typedef unsigned char byte;
+typedef unsigned char u8;
+typedef signed char s8;
+typedef uint16_t u16;
+typedef uint32_t u32;
+typedef int32_t s32;
+typedef uint64_t u64;
+typedef int64_t s64;
+typedef int wifi_request_id;
+typedef int wifi_channel; // indicates channel frequency in MHz
+typedef int wifi_rssi;
+typedef int wifi_radio;
+typedef byte mac_addr[6];
+typedef byte oui[3];
+typedef int64_t wifi_timestamp; // In microseconds (us)
+typedef int64_t wifi_timespan; // In picoseconds (ps)
+typedef uint64_t feature_set;
+
+/* forward declarations */
+struct wifi_info;
+struct wifi_interface_info;
+typedef struct wifi_info *wifi_handle;
+typedef struct wifi_interface_info *wifi_interface_handle;
+
+/* WiFi Common definitions */
+/* channel operating width */
+typedef enum {
+ WIFI_CHAN_WIDTH_20 = 0,
+ WIFI_CHAN_WIDTH_40 = 1,
+ WIFI_CHAN_WIDTH_80 = 2,
+ WIFI_CHAN_WIDTH_160 = 3,
+ WIFI_CHAN_WIDTH_80P80 = 4,
+ WIFI_CHAN_WIDTH_5 = 5,
+ WIFI_CHAN_WIDTH_10 = 6,
+ WIFI_CHAN_WIDTH_320 = 7,
+ WIFI_CHAN_WIDTH_INVALID = -1
+} wifi_channel_width;
+
+/* Multi-Link Operation modes */
+typedef enum {
+ WIFI_MLO_MODE_DEFAULT = 0,
+ WIFI_MLO_MODE_LOW_LATENCY = 1,
+ WIFI_MLO_MODE_HIGH_THROUGHPUT = 2,
+ WIFI_MLO_MODE_LOW_POWER = 3,
+} wifi_mlo_mode;
+
+/* Pre selected Power scenarios to be applied from BDF file */
+typedef enum {
+ WIFI_POWER_SCENARIO_INVALID = -2,
+ WIFI_POWER_SCENARIO_DEFAULT = -1,
+ WIFI_POWER_SCENARIO_VOICE_CALL = 0,
+ WIFI_POWER_SCENARIO_ON_HEAD_CELL_OFF = 1,
+ WIFI_POWER_SCENARIO_ON_HEAD_CELL_ON = 2,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_OFF = 3,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_ON = 4,
+ WIFI_POWER_SCENARIO_ON_BODY_BT = 5,
+ WIFI_POWER_SCENARIO_ON_HEAD_HOTSPOT = 6,
+ WIFI_POWER_SCENARIO_ON_HEAD_HOTSPOT_MMW = 7,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_ON_BT = 8,
+ WIFI_POWER_SCENARIO_ON_BODY_HOTSPOT = 9,
+ WIFI_POWER_SCENARIO_ON_BODY_HOTSPOT_BT = 10,
+ WIFI_POWER_SCENARIO_ON_BODY_HOTSPOT_MMW = 11,
+ WIFI_POWER_SCENARIO_ON_BODY_HOTSPOT_BT_MMW = 12,
+ WIFI_POWER_SCENARIO_ON_HEAD_CELL_OFF_UNFOLDED = 13,
+ WIFI_POWER_SCENARIO_ON_HEAD_CELL_ON_UNFOLDED = 14,
+ WIFI_POWER_SCENARIO_ON_HEAD_HOTSPOT_UNFOLDED = 15,
+ WIFI_POWER_SCENARIO_ON_HEAD_HOTSPOT_MMW_UNFOLDED = 16,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_OFF_UNFOLDED = 17,
+ WIFI_POWER_SCENARIO_ON_BODY_BT_UNFOLDED = 18,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_ON_UNFOLDED = 19,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_ON_BT_UNFOLDED = 20,
+ WIFI_POWER_SCENARIO_ON_BODY_HOTSPOT_UNFOLDED = 21,
+ WIFI_POWER_SCENARIO_ON_BODY_HOTSPOT_BT_UNFOLDED = 22,
+ WIFI_POWER_SCENARIO_ON_BODY_HOTSPOT_MMW_UNFOLDED = 23,
+ WIFI_POWER_SCENARIO_ON_BODY_HOTSPOT_BT_MMW_UNFOLDED = 24,
+ WIFI_POWER_SCENARIO_ON_BODY_REAR_CAMERA = 25,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_OFF_UNFOLDED_CAP = 26,
+ WIFI_POWER_SCENARIO_ON_BODY_BT_UNFOLDED_CAP = 27,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_ON_UNFOLDED_CAP = 28,
+ WIFI_POWER_SCENARIO_ON_BODY_CELL_ON_BT_UNFOLDED_CAP = 29,
+} wifi_power_scenario;
+
+typedef enum {
+ WIFI_LATENCY_MODE_NORMAL = 0,
+ WIFI_LATENCY_MODE_LOW = 1,
+} wifi_latency_mode;
+
+/* Wifi Thermal mitigation modes */
+typedef enum {
+ WIFI_MITIGATION_NONE = 0,
+ WIFI_MITIGATION_LIGHT = 1,
+ WIFI_MITIGATION_MODERATE = 2,
+ WIFI_MITIGATION_SEVERE = 3,
+ WIFI_MITIGATION_CRITICAL = 4,
+ WIFI_MITIGATION_EMERGENCY = 5,
+} wifi_thermal_mode;
+
+/*
+ * Wifi voice over IP mode
+ * may add new modes later, for example, voice + video over IP mode.
+ */
+typedef enum {
+ WIFI_VOIP_MODE_OFF = 0,
+ WIFI_VOIP_MODE_VOICE = 1,
+} wifi_voip_mode;
+
+/* List of interface types supported */
+typedef enum {
+ WIFI_INTERFACE_TYPE_STA = 0,
+ WIFI_INTERFACE_TYPE_AP = 1,
+ WIFI_INTERFACE_TYPE_P2P = 2,
+ WIFI_INTERFACE_TYPE_NAN = 3,
+ WIFI_INTERFACE_TYPE_AP_BRIDGED = 4,
+} wifi_interface_type;
+
+/*
+ * enum wlan_mac_band - Band information corresponding to the WLAN MAC.
+ */
+typedef enum {
+/* WLAN MAC Operates in 2.4 GHz Band */
+ WLAN_MAC_2_4_BAND = 1 << 0,
+/* WLAN MAC Operates in 5 GHz Band */
+ WLAN_MAC_5_0_BAND = 1 << 1,
+/* WLAN MAC Operates in 6 GHz Band */
+ WLAN_MAC_6_0_BAND = 1 << 2,
+/* WLAN MAC Operates in 60 GHz Band */
+ WLAN_MAC_60_0_BAND = 1 << 3,
+} wlan_mac_band;
+
+/* List of chre nan rtt state */
+typedef enum {
+ CHRE_PREEMPTED = 0,
+ CHRE_UNAVAILABLE = 1,
+ CHRE_AVAILABLE = 2,
+} chre_nan_rtt_state;
+
+typedef struct {
+ wifi_channel_width width;
+ int center_frequency0;
+ int center_frequency1;
+ int primary_frequency;
+} wifi_channel_spec;
+
+/*
+ * wifi_usable_channel specifies a channel frequency, bandwidth, and bitmask
+ * of modes allowed on the channel.
+ */
+typedef struct {
+ /* Channel frequency in MHz */
+ wifi_channel freq;
+ /* Channel operating width (20, 40, 80, 160, 320 etc.) */
+ wifi_channel_width width;
+ /* BIT MASK of BIT(WIFI_INTERFACE_*) represented by |wifi_interface_mode|
+ * Bitmask does not represent concurrency.
+ * Examples:
+ * - If a channel is usable only for STA, then only the WIFI_INTERFACE_STA
+ * bit would be set for that channel.
+ * - If 5GHz SAP is not allowed, then none of the 5GHz channels will have
+ * WIFI_INTERFACE_SOFTAP bit set.
+ * Note: TDLS bit is set only if there is a STA connection. TDLS bit is set
+ * on non-STA channels only if TDLS off channel is supported.
+ */
+ u32 iface_mode_mask;
+} wifi_usable_channel;
+
+/*
+ * wifi_usable_channel_filter
+ */
+typedef enum {
+ /* Filter Wifi channels that should be avoided due to cellular coex
+ * restrictions. Some Wifi channels can have extreme interference
+ * from/to cellular due to short frequency separation with neighboring
+ * cellular channels or when there is harmonic and intermodulation
+ * interference. Channels which only have some performance degradation
+ * (e.g. power back off is sufficient to deal with coexistence issue)
+ * can be included and should not be filtered out.
+ */
+ WIFI_USABLE_CHANNEL_FILTER_CELLULAR_COEXISTENCE = 1 << 0,
+ /* Filter channels due to concurrency state.
+ * Examples:
+ * - 5GHz SAP operation may be supported in standalone mode, but if
+ * there is STA connection on 5GHz DFS channel, none of the 5GHz
+ * channels are usable for SAP if device does not support DFS SAP mode.
+ * - P2P GO may not be supported on indoor channels in EU during
+ * standalone mode but if there is a STA connection on indoor channel,
+ * P2P GO may be supported by some vendors on the same STA channel.
+ */
+ WIFI_USABLE_CHANNEL_FILTER_CONCURRENCY = 1 << 1,
+ /* This Filter queries Wifi channels and bands that are supported for
+ * NAN3.1 Instant communication mode. This filter should only be applied to NAN interface.
+ * If 5G is supported default discovery channel 149/44 is considered,
+ * If 5G is not supported then channel 6 has to be considered.
+ * Based on regulatory domain if channel 149 and 44 are restricted, channel 6 should
+ * be considered for instant communication channel
+ */
+ WIFI_USABLE_CHANNEL_FILTER_NAN_INSTANT_MODE = 1 << 2,
+} wifi_usable_channel_filter;
+
+typedef enum {
+ WIFI_SUCCESS = 0,
+ WIFI_ERROR_NONE = 0,
+ WIFI_ERROR_UNKNOWN = -1,
+ WIFI_ERROR_UNINITIALIZED = -2,
+ WIFI_ERROR_NOT_SUPPORTED = -3,
+ WIFI_ERROR_NOT_AVAILABLE = -4, // Not available right now, but try later
+ WIFI_ERROR_INVALID_ARGS = -5,
+ WIFI_ERROR_INVALID_REQUEST_ID = -6,
+ WIFI_ERROR_TIMED_OUT = -7,
+ WIFI_ERROR_TOO_MANY_REQUESTS = -8, // Too many instances of this request
+ WIFI_ERROR_OUT_OF_MEMORY = -9,
+ WIFI_ERROR_BUSY = -10,
+} wifi_error;
+
+typedef enum {
+ WIFI_ACCESS_CATEGORY_BEST_EFFORT = 0,
+ WIFI_ACCESS_CATEGORY_BACKGROUND = 1,
+ WIFI_ACCESS_CATEGORY_VIDEO = 2,
+ WIFI_ACCESS_CATEGORY_VOICE = 3
+} wifi_access_category;
+
+/* Channel category mask */
+typedef enum {
+ WIFI_INDOOR_CHANNEL = 1 << 0,
+ WIFI_DFS_CHANNEL = 1 << 1,
+} wifi_channel_category;
+
+/* Antenna configuration */
+typedef enum {
+ WIFI_ANTENNA_UNSPECIFIED = 0,
+ WIFI_ANTENNA_1X1 = 1,
+ WIFI_ANTENNA_2X2 = 2,
+ WIFI_ANTENNA_3X3 = 3,
+ WIFI_ANTENNA_4X4 = 4,
+} wifi_antenna_configuration;
+
+/* Wifi Radio configuration */
+typedef struct {
+ /* Operating band */
+ wlan_mac_band band;
+ /* Antenna configuration */
+ wifi_antenna_configuration antenna_cfg;
+} wifi_radio_configuration;
+
+/* WiFi Radio Combination */
+typedef struct {
+ u32 num_radio_configurations;
+ wifi_radio_configuration radio_configurations[];
+} wifi_radio_combination;
+
+/* WiFi Radio combinations matrix */
+/* For Example in case of a chip which has two radios, where one radio is
+ * capable of 2.4GHz 2X2 only and another radio which is capable of either
+ * 5GHz or 6GHz 2X2, number of possible radio combinations in this case
+ * are 5 and possible combinations are
+ * {{{2G 2X2}}, //Standalone 2G
+ * {{5G 2X2}}, //Standalone 5G
+ * {{6G 2X2}}, //Standalone 6G
+ * {{2G 2X2}, {5G 2X2}}, //2G+5G DBS
+ * {{2G 2X2}, {6G 2X2}}} //2G+6G DBS
+ * Note: Since this chip doesn’t support 5G+6G simultaneous operation
+ * as there is only one radio which can support both, So it can only
+ * do MCC 5G+6G. This table should not get populated with possible MCC
+ * configurations. This is only for simultaneous radio configurations
+ * (such as Standalone, multi band simultaneous or single band simultaneous).
+ */
+typedef struct {
+ u32 num_radio_combinations;
+ /* Each row represents possible radio combinations */
+ wifi_radio_combination radio_combinations[];
+} wifi_radio_combination_matrix;
+
+typedef struct {
+ /**
+ * Maximum number of links supported by the chip for MLO association.
+ */
+ u32 max_mlo_association_link_count;
+ /**
+ * Maximum number of Simultaneous Transmit and Receive (STR) links used
+ * in Multi-Link Operation. The maximum number of STR links used can be
+ * different from the maximum number of radios supported by the chip.
+ *
+ * This is a static configuration of the chip.
+ */
+ u32 max_mlo_str_link_count;
+ /**
+ * Maximum number of concurrent TDLS sessions supported by the chip.
+ *
+ */
+ u32 max_concurrent_tdls_session_count;
+} wifi_chip_capabilities;
+
+#define MAX_IFACE_COMBINATIONS 16
+#define MAX_IFACE_LIMITS 8
+
+/* Wifi interface limit
+ * Example:
+ * 1. To allow STA+STA:
+ * wifi_iface_limit limit1 = {
+ * .max_limit = 2,
+ * .iface_mask = BIT(WIFI_INTERFACE_TYPE_STA)
+ * };
+ * 2. To allow Single P2P/NAN:
+ * wifi_iface_limit limit2 = {
+ * .max_limit = 1,
+ * .iface_mask = BIT(WIFI_INTERFACE_TYPE_P2P)
+ * | BIT(WIFI_INTERFACE_TYPE_NAN)
+ * };
+ */
+typedef struct {
+ /* Max number of interfaces of same type */
+ u32 max_limit;
+ /* BIT mask of interfaces from wifi_interface_type */
+ u32 iface_mask;
+} wifi_iface_limit;
+
+/* Wifi Interface combination
+ * Example:
+ * 1. To allow STA+SAP:
+ * wifi_iface_limit limits1[] = {
+ * {1, BIT(WIFI_INTERFACE_TYPE_STA)},
+ * };
+ * wifi_iface_limit limits2[] = {
+ * {1, BIT(WIFI_INTERFACE_TYPE_AP)},
+ * };
+ * wifi_iface_combination comb1 = {
+ * .max_ifaces = 2,
+ * .num_iface_limits = 2,
+ * .iface_limits = {limits1, limits2,},
+ * };
+ *
+ * 2. To allow STA+P2P/NAN:
+ * wifi_iface_limit limits3[] = {
+ * {1, BIT(WIFI_INTERFACE_TYPE_STA)},
+ * {1, BIT(WIFI_INTERFACE_TYPE_P2P)
+ | BIT(WIFI_INTERFACE_TYPE_NAN)},
+ * };
+ * wifi_iface_combination comb2 = {
+ * .max_ifaces = 2,
+ * .num_iface_limits = 1,
+ * .iface_limits = {limits3,},
+ * };
+ *
+ * 3. To allow STA+STA/AP:
+ * wifi_iface_limit limits4[] = {
+ * {2, BIT(WIFI_INTERFACE_TYPE_STA)},
+ * };
+ * wifi_iface_limit limits5[] = {
+ * {1, BIT(WIFI_INTERFACE_TYPE_STA)},
+ * {1, BIT(WIFI_INTERFACE_TYPE_AP)},
+ * };
+ * wifi_iface_combination comb3 = {
+ * .max_ifaces = 2,
+ * .num_iface_limits = 2,
+ * .iface_limits = {limits4, limits5,},
+ * };
+ *
+ * 4. To allow AP_BRIDGED (AP+AP in bridge mode):
+ * wifi_iface_limit limits6[] = {
+ * {1, BIT(WIFI_INTERFACE_TYPE_AP_BRIDGED)},
+ * };
+ * wifi_iface_combination comb4 = {
+ * .max_ifaces = 1,
+ * .num_iface_limits = 1,
+ * .iface_limits = {limits6,},
+ * };
+ */
+typedef struct {
+ /* Maximum number of concurrent interfaces allowed in this combination */
+ u32 max_ifaces;
+ /* Total number of interface limits in a combination */
+ u32 num_iface_limits;
+ /* Interface limits */
+ wifi_iface_limit iface_limits[MAX_IFACE_LIMITS];
+} wifi_iface_combination;
+
+/* Wifi Interface concurrency combination matrix
+ * Example:
+ * 1. To allow 2 port concurrency with limts defined in above comments:
+ * wifi_iface_concurrency_matrix iface_concurrency_matrix = {
+ * .num_iface_combinations = 4,
+ * .iface_combinations = {comb1, comb2, comb3, comb4, }
+ * };
+ */
+typedef struct {
+ /* Total count of possible iface combinations */
+ u32 num_iface_combinations;
+ /* Interface combinations */
+ wifi_iface_combination iface_combinations[MAX_IFACE_COMBINATIONS];
+} wifi_iface_concurrency_matrix;
+
+/* Initialize/Cleanup */
+
+wifi_error wifi_initialize(wifi_handle *handle);
+
+/**
+ * wifi_wait_for_driver
+ * Function should block until the driver is ready to proceed.
+ * Any errors from this function is considered fatal & will fail the HAL startup sequence.
+ *
+ * on success returns WIFI_SUCCESS
+ * on failure returns WIFI_ERROR_TIMED_OUT
+ */
+wifi_error wifi_wait_for_driver_ready(void);
+
+typedef void (*wifi_cleaned_up_handler) (wifi_handle handle);
+void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler);
+void wifi_event_loop(wifi_handle handle);
+
+/* Error handling */
+void wifi_get_error_info(wifi_error err, const char **msg); // return a pointer to a static string
+
+/* Feature enums */
+#define WIFI_FEATURE_INFRA (uint64_t)0x1 // Basic infrastructure mode
+#define WIFI_FEATURE_INFRA_5G (uint64_t)0x2 // Support for 5 GHz Band
+#define WIFI_FEATURE_HOTSPOT (uint64_t)0x4 // Support for GAS/ANQP
+#define WIFI_FEATURE_P2P (uint64_t)0x8 // Wifi-Direct
+#define WIFI_FEATURE_SOFT_AP (uint64_t)0x10 // Soft AP
+#define WIFI_FEATURE_GSCAN (uint64_t)0x20 // Google-Scan APIs
+#define WIFI_FEATURE_NAN (uint64_t)0x40 // Neighbor Awareness Networking
+#define WIFI_FEATURE_D2D_RTT (uint64_t)0x80 // Device-to-device RTT
+#define WIFI_FEATURE_D2AP_RTT (uint64_t)0x100 // Device-to-AP RTT
+#define WIFI_FEATURE_BATCH_SCAN (uint64_t)0x200 // Batched Scan (legacy)
+#define WIFI_FEATURE_PNO (uint64_t)0x400 // Preferred network offload
+#define WIFI_FEATURE_ADDITIONAL_STA (uint64_t)0x800 // Support for two STAs
+#define WIFI_FEATURE_TDLS (uint64_t)0x1000 // Tunnel directed link setup
+#define WIFI_FEATURE_TDLS_OFFCHANNEL (uint64_t)0x2000 // Support for TDLS off channel
+#define WIFI_FEATURE_EPR (uint64_t)0x4000 // Enhanced power reporting
+#define WIFI_FEATURE_AP_STA (uint64_t)0x8000 // Support for AP STA Concurrency
+#define WIFI_FEATURE_LINK_LAYER_STATS (uint64_t)0x10000 // Link layer stats collection
+#define WIFI_FEATURE_LOGGER (uint64_t)0x20000 // WiFi Logger
+#define WIFI_FEATURE_HAL_EPNO (uint64_t)0x40000 // WiFi PNO enhanced
+#define WIFI_FEATURE_RSSI_MONITOR (uint64_t)0x80000 // RSSI Monitor
+#define WIFI_FEATURE_MKEEP_ALIVE (uint64_t)0x100000 // WiFi mkeep_alive
+#define WIFI_FEATURE_CONFIG_NDO (uint64_t)0x200000 // ND offload configure
+#define WIFI_FEATURE_TX_TRANSMIT_POWER (uint64_t)0x400000 // Capture Tx transmit power levels
+#define WIFI_FEATURE_CONTROL_ROAMING (uint64_t)0x800000 // Enable/Disable firmware roaming
+#define WIFI_FEATURE_IE_WHITELIST (uint64_t)0x1000000 // Support Probe IE white listing
+#define WIFI_FEATURE_SCAN_RAND (uint64_t)0x2000000 // Support MAC & Probe Sequence Number randomization
+#define WIFI_FEATURE_SET_TX_POWER_LIMIT (uint64_t)0x4000000 // Support Tx Power Limit setting
+#define WIFI_FEATURE_USE_BODY_HEAD_SAR (uint64_t)0x8000000 // Support Using Body/Head Proximity for SAR
+#define WIFI_FEATURE_DYNAMIC_SET_MAC (uint64_t)0x10000000 // Support changing MAC address without iface reset(down and up)
+#define WIFI_FEATURE_SET_LATENCY_MODE (uint64_t)0x40000000 // Support Latency mode setting
+#define WIFI_FEATURE_P2P_RAND_MAC (uint64_t)0x80000000 // Support P2P MAC randomization
+#define WIFI_FEATURE_INFRA_60G (uint64_t)0x100000000 // Support for 60GHz Band
+#define WIFI_FEATURE_AFC_CHANNEL (uint64_t)0x200000000 // Support for setting 6GHz AFC channel allowance
+#define WIFI_FEATURE_T2LM_NEGO (uint64_t)0x400000000 // Support for TID-To-Link mapping negotiation
+#define WIFI_FEATURE_ROAMING_MODE_CONTROL (uint64_t)0x800000000 // Support for configuring roaming mode
+#define WIFI_FEATURE_SET_VOIP_MODE (uint64_t)0x1000000000 // Support Voip mode setting
+#define WIFI_FEATURE_CACHED_SCAN_RESULTS (uint64_t)0x2000000000 // Support cached scan result report
+// Add more features here
+
+#define IS_MASK_SET(mask, flags) (((flags) & (mask)) == (mask))
+
+#define IS_SUPPORTED_FEATURE(feature, featureSet) IS_MASK_SET(feature, featureSet)
+
+/* Feature set */
+wifi_error wifi_get_supported_feature_set(wifi_interface_handle handle, feature_set *set);
+
+/*
+ * Each row represents a valid feature combination;
+ * all other combinations are invalid!
+ */
+wifi_error wifi_get_concurrency_matrix(wifi_interface_handle handle, int set_size_max,
+ feature_set set[], int *set_size);
+
+/* multiple interface support */
+
+wifi_error wifi_get_ifaces(wifi_handle handle, int *num_ifaces, wifi_interface_handle **ifaces);
+wifi_error wifi_get_iface_name(wifi_interface_handle iface, char *name, size_t size);
+wifi_interface_handle wifi_get_iface_handle(wifi_handle handle, char *name);
+
+/* STA + STA support - Supported if WIFI_FEATURE_ADDITIONAL_STA is set */
+
+/**
+ * Invoked to indicate that the provided iface is the primary STA iface when there are more
+ * than 1 STA iface concurrently active.
+ *
+ * Note: If the wifi firmware/chip cannot support multiple instances of any offload
+ * (like roaming, APF, rssi threshold, etc), the firmware should ensure that these
+ * offloads are at least enabled for the primary interface. If the new primary interface is
+ * already connected to a network, the firmware must switch all the offloads on
+ * this new interface without disconnecting.
+ */
+wifi_error wifi_multi_sta_set_primary_connection(wifi_handle handle, wifi_interface_handle iface);
+
+/**
+ * When there are 2 or more simultaneous STA connections, this use case hint indicates what
+ * use-case is being enabled by the framework. This use case hint can be used by the firmware
+ * to modify various firmware configurations like:
+ * - Allowed BSSIDs the firmware can choose for the initial connection/roaming attempts.
+ * - Duty cycle to choose for the 2 STA connections if the radio is in MCC mode.
+ * - Whether roaming, APF and other offloads needs to be enabled or not.
+ *
+ * Note:
+ * - This will be invoked before an active wifi connection is established on the second interface.
+ * - This use-case hint is implicitly void when the second STA interface is brought down.
+ */
+typedef enum {
+ /**
+ * Usage:
+ * - This will be sent down for make before break use-case.
+ * - Platform is trying to speculatively connect to a second network and evaluate it without
+ * disrupting the primary connection.
+ *
+ * Requirements for Firmware:
+ * - Do not reduce the number of tx/rx chains of primary connection.
+ * - If using MCC, should set the MCC duty cycle of the primary connection to be higher than
+ * the secondary connection (maybe 70/30 split).
+ * - Should pick the best BSSID for the secondary STA (disregard the chip mode) independent of
+ * the primary STA:
+ * - Don’t optimize for DBS vs MCC/SCC
+ * - Should not impact the primary connection’s bssid selection:
+ * - Don’t downgrade chains of the existing primary connection.
+ * - Don’t optimize for DBS vs MCC/SCC.
+ */
+ WIFI_DUAL_STA_TRANSIENT_PREFER_PRIMARY = 0,
+ /**
+ * Usage:
+ * - This will be sent down for any app requested peer to peer connections.
+ * - In this case, both the connections needs to be allocated equal resources.
+ * - For the peer to peer use case, BSSID for the secondary connection will be chosen by the
+ * framework.
+ *
+ * Requirements for Firmware:
+ * - Can choose MCC or DBS mode depending on the MCC efficiency and HW capability.
+ * - If using MCC, set the MCC duty cycle of the primary connection to be equal to the secondary
+ * connection.
+ * - Prefer BSSID candidates which will help provide the best "overall" performance for both the
+ * connections.
+ */
+ WIFI_DUAL_STA_NON_TRANSIENT_UNBIASED = 1
+} wifi_multi_sta_use_case;
+
+wifi_error wifi_multi_sta_set_use_case(wifi_handle handle, wifi_multi_sta_use_case use_case);
+
+/* Configuration events */
+
+typedef struct {
+ void (*on_country_code_changed)(char code[2]); // We can get this from supplicant too
+
+ // More event handlers
+} wifi_event_handler;
+
+typedef struct {
+ char iface_name[IFNAMSIZ + 1];
+ wifi_channel channel;
+} wifi_iface_info;
+
+typedef struct {
+ u32 wlan_mac_id;
+/* BIT MASK of BIT(WLAN_MAC*) as represented by wlan_mac_band */
+ u32 mac_band;
+/* Represents the connected Wi-Fi interfaces associated with each MAC */
+ int num_iface;
+ wifi_iface_info *iface_info;
+} wifi_mac_info;
+
+typedef struct {
+ void (*on_radio_mode_change)(wifi_request_id id, unsigned num_mac,
+ wifi_mac_info *mac_info);
+} wifi_radio_mode_change_handler;
+
+typedef struct {
+ void (*on_rssi_threshold_breached)(wifi_request_id id, u8 *cur_bssid, s8 cur_rssi);
+} wifi_rssi_event_handler;
+
+typedef struct {
+ void (*on_subsystem_restart)(const char* error);
+} wifi_subsystem_restart_handler;
+
+typedef struct {
+ void (*on_chre_nan_rtt_change)(chre_nan_rtt_state state);
+} wifi_chre_handler;
+
+wifi_error wifi_set_iface_event_handler(wifi_request_id id, wifi_interface_handle iface, wifi_event_handler eh);
+wifi_error wifi_reset_iface_event_handler(wifi_request_id id, wifi_interface_handle iface);
+
+wifi_error wifi_set_nodfs_flag(wifi_interface_handle handle, u32 nodfs);
+wifi_error wifi_select_tx_power_scenario(wifi_interface_handle handle, wifi_power_scenario scenario);
+wifi_error wifi_reset_tx_power_scenario(wifi_interface_handle handle);
+wifi_error wifi_set_latency_mode(wifi_interface_handle handle, wifi_latency_mode mode);
+wifi_error wifi_map_dscp_access_category(wifi_handle handle,
+ uint32_t start, uint32_t end,
+ uint32_t access_category);
+wifi_error wifi_reset_dscp_mapping(wifi_handle handle);
+
+wifi_error wifi_set_subsystem_restart_handler(wifi_handle handle,
+ wifi_subsystem_restart_handler handler);
+
+/**
+ * Wifi HAL Thermal Mitigation API
+ *
+ * wifi_handle : wifi global handle (note: this is not a interface specific
+ * command). Mitigation is expected to be applied across all active interfaces
+ * The implementation and the mitigation action mapping to each mode is chip
+ * specific. Mitigation will be active until Wifi is turned off or
+ * WIFI_MITIGATION_NONE mode is sent
+ *
+ * mode: Thermal mitigation mode
+ * WIFI_MITIGATION_NONE : Clear all Wifi thermal mitigation actions
+ * WIFI_MITIGATION_LIGHT : Light Throttling where UX is not impacted
+ * WIFI_MITIGATION_MODERATE : Moderate throttling where UX not largely impacted
+ * WIFI_MITIGATION_SEVERE : Severe throttling where UX is largely impacted
+ * WIFI_MITIGATION_CRITICAL : Platform has done everything to reduce power
+ * WIFI_MITIGATION_EMERGENCY: Key components in platform are shutting down
+ *
+ * completion_window
+ * Deadline (in milliseconds) to complete this request, value 0 implies apply
+ * immediately. Deadline is basically a relaxed limit and allows vendors to
+ * apply the mitigation within the window (if it cannot apply immediately)
+ *
+ * Return
+ * WIFI_ERROR_NOT_SUPPORTED : Chip does not support thermal mitigation
+ * WIFI_ERROR_BUSY : Mitigation is supported, but retry later
+ * WIFI_ERROR_NONE : Mitigation request has been accepted
+ */
+wifi_error wifi_set_thermal_mitigation_mode(wifi_handle handle,
+ wifi_thermal_mode mode,
+ u32 completion_window);
+
+
+typedef struct rx_data_cnt_details_t {
+ int rx_unicast_cnt; /*Total rx unicast packet which woke up host */
+ int rx_multicast_cnt; /*Total rx multicast packet which woke up host */
+ int rx_broadcast_cnt; /*Total rx broadcast packet which woke up host */
+} RX_DATA_WAKE_CNT_DETAILS;
+
+typedef struct rx_wake_pkt_type_classification_t {
+ int icmp_pkt; /*wake icmp packet count */
+ int icmp6_pkt; /*wake icmp6 packet count */
+ int icmp6_ra; /*wake icmp6 RA packet count */
+ int icmp6_na; /*wake icmp6 NA packet count */
+ int icmp6_ns; /*wake icmp6 NS packet count */
+ //ToDo: Any more interesting classification to add?
+} RX_WAKE_PKT_TYPE_CLASSFICATION;
+
+typedef struct rx_multicast_cnt_t{
+ int ipv4_rx_multicast_addr_cnt; /*Rx wake packet was ipv4 multicast */
+ int ipv6_rx_multicast_addr_cnt; /*Rx wake packet was ipv6 multicast */
+ int other_rx_multicast_addr_cnt;/*Rx wake packet was non-ipv4 and non-ipv6*/
+} RX_MULTICAST_WAKE_DATA_CNT;
+
+/*
+ * Structure holding all the driver/firmware wake count reasons.
+ *
+ * Buffers for the array fields (cmd_event_wake_cnt/driver_fw_local_wake_cnt)
+ * are allocated and freed by the framework. The size of each allocated
+ * array is indicated by the corresponding |_cnt| field. HAL needs to fill in
+ * the corresponding |_used| field to indicate the number of elements used in
+ * the array.
+ */
+typedef struct wlan_driver_wake_reason_cnt_t {
+ int total_cmd_event_wake; /* Total count of cmd event wakes */
+ int *cmd_event_wake_cnt; /* Individual wake count array, each index a reason */
+ int cmd_event_wake_cnt_sz; /* Max number of cmd event wake reasons */
+ int cmd_event_wake_cnt_used; /* Number of cmd event wake reasons specific to the driver */
+
+ int total_driver_fw_local_wake; /* Total count of drive/fw wakes, for local reasons */
+ int *driver_fw_local_wake_cnt; /* Individual wake count array, each index a reason */
+ int driver_fw_local_wake_cnt_sz; /* Max number of local driver/fw wake reasons */
+ int driver_fw_local_wake_cnt_used; /* Number of local driver/fw wake reasons specific to the driver */
+
+ int total_rx_data_wake; /* total data rx packets, that woke up host */
+ RX_DATA_WAKE_CNT_DETAILS rx_wake_details;
+ RX_WAKE_PKT_TYPE_CLASSFICATION rx_wake_pkt_classification_info;
+ RX_MULTICAST_WAKE_DATA_CNT rx_multicast_wake_pkt_info;
+} WLAN_DRIVER_WAKE_REASON_CNT;
+
+/* Wi-Fi coex channel avoidance support */
+
+#define WIFI_COEX_NO_POWER_CAP (int32_t)0x7FFFFFF
+
+typedef enum {
+ WIFI_AWARE = 1 << 0,
+ SOFTAP = 1 << 1,
+ WIFI_DIRECT = 1 << 2
+} wifi_coex_restriction;
+
+/**
+ * Representation of a Wi-Fi channel to be avoided for Wi-Fi coex channel avoidance.
+ *
+ * band is represented as an WLAN_MAC* enum value defined in wlan_mac_band.
+ * If power_cap_dbm is WIFI_COEX_NO_POWER_CAP, then no power cap should be applied if the specified
+ * channel is used.
+ */
+typedef struct {
+ wlan_mac_band band;
+ u32 channel;
+ s32 power_cap_dbm;
+} wifi_coex_unsafe_channel;
+
+
+/* include various feature headers */
+
+#include "gscan.h"
+#include "link_layer_stats.h"
+#include "wifi_cached_scan_results.h"
+#include "rtt.h"
+#include "tdls.h"
+#include "wifi_logger.h"
+#include "wifi_config.h"
+#include "wifi_nan.h"
+#include "wifi_offload.h"
+#include "roam.h"
+#include "wifi_twt.h"
+
+//wifi HAL function pointer table
+typedef struct {
+ wifi_error (* wifi_initialize) (wifi_handle *);
+ wifi_error (* wifi_wait_for_driver_ready) (void);
+ void (* wifi_cleanup) (wifi_handle, wifi_cleaned_up_handler);
+ void (*wifi_event_loop)(wifi_handle);
+ void (* wifi_get_error_info) (wifi_error , const char **);
+ wifi_error (* wifi_get_supported_feature_set) (wifi_interface_handle, feature_set *);
+ wifi_error (* wifi_get_concurrency_matrix) (wifi_interface_handle, int, feature_set *, int *);
+ wifi_error (* wifi_set_scanning_mac_oui) (wifi_interface_handle, unsigned char *);
+ wifi_error (* wifi_get_supported_channels)(wifi_handle, int *, wifi_channel *);
+ wifi_error (* wifi_is_epr_supported)(wifi_handle);
+ wifi_error (* wifi_get_ifaces) (wifi_handle , int *, wifi_interface_handle **);
+ wifi_error (* wifi_get_iface_name) (wifi_interface_handle, char *name, size_t);
+ wifi_error (* wifi_set_iface_event_handler) (wifi_request_id,wifi_interface_handle ,
+ wifi_event_handler);
+ wifi_error (* wifi_reset_iface_event_handler) (wifi_request_id, wifi_interface_handle);
+ wifi_error (* wifi_start_gscan) (wifi_request_id, wifi_interface_handle, wifi_scan_cmd_params,
+ wifi_scan_result_handler);
+ wifi_error (* wifi_stop_gscan)(wifi_request_id, wifi_interface_handle);
+ wifi_error (* wifi_get_cached_gscan_results)(wifi_interface_handle, byte, int,
+ wifi_cached_scan_results *, int *);
+ wifi_error (* wifi_set_bssid_hotlist)(wifi_request_id, wifi_interface_handle,
+ wifi_bssid_hotlist_params, wifi_hotlist_ap_found_handler);
+ wifi_error (* wifi_reset_bssid_hotlist)(wifi_request_id, wifi_interface_handle);
+ wifi_error (* wifi_set_significant_change_handler)(wifi_request_id, wifi_interface_handle,
+ wifi_significant_change_params, wifi_significant_change_handler);
+ wifi_error (* wifi_reset_significant_change_handler)(wifi_request_id, wifi_interface_handle);
+ wifi_error (* wifi_get_gscan_capabilities)(wifi_interface_handle, wifi_gscan_capabilities *);
+ wifi_error (* wifi_set_link_stats) (wifi_interface_handle, wifi_link_layer_params);
+ wifi_error (* wifi_get_link_stats) (wifi_request_id,wifi_interface_handle,
+ wifi_stats_result_handler);
+ wifi_error (* wifi_clear_link_stats)(wifi_interface_handle,u32, u32 *, u8, u8 *);
+ wifi_error (* wifi_get_valid_channels)(wifi_interface_handle,int, int, wifi_channel *, int *);
+ wifi_error (* wifi_rtt_range_request)(wifi_request_id, wifi_interface_handle, unsigned,
+ wifi_rtt_config[], wifi_rtt_event_handler);
+ wifi_error (* wifi_rtt_range_request_v3)(wifi_request_id, wifi_interface_handle, unsigned,
+ wifi_rtt_config_v3[], wifi_rtt_event_handler_v3);
+ wifi_error (* wifi_rtt_range_cancel)(wifi_request_id, wifi_interface_handle, unsigned,
+ mac_addr[]);
+ wifi_error (* wifi_get_rtt_capabilities)(wifi_interface_handle, wifi_rtt_capabilities *);
+ wifi_error (* wifi_get_rtt_capabilities_v3)(wifi_interface_handle, wifi_rtt_capabilities_v3 *);
+ wifi_error (* wifi_rtt_get_responder_info)(wifi_interface_handle iface,
+ wifi_rtt_responder *responder_info);
+ wifi_error (* wifi_enable_responder)(wifi_request_id id, wifi_interface_handle iface,
+ wifi_channel_info channel_hint, unsigned max_duration_seconds,
+ wifi_rtt_responder *responder_info);
+ wifi_error (* wifi_disable_responder)(wifi_request_id id, wifi_interface_handle iface);
+ wifi_error (* wifi_set_nodfs_flag)(wifi_interface_handle, u32);
+ wifi_error (* wifi_start_logging)(wifi_interface_handle, u32, u32, u32, u32, char *);
+ wifi_error (* wifi_set_epno_list)(wifi_request_id, wifi_interface_handle,
+ const wifi_epno_params *, wifi_epno_handler);
+ wifi_error (* wifi_reset_epno_list)(wifi_request_id, wifi_interface_handle);
+ wifi_error (* wifi_set_country_code)(wifi_interface_handle, const char *);
+ wifi_error (* wifi_get_firmware_memory_dump)( wifi_interface_handle iface,
+ wifi_firmware_memory_dump_handler handler);
+ wifi_error (* wifi_set_log_handler)(wifi_request_id id, wifi_interface_handle iface,
+ wifi_ring_buffer_data_handler handler);
+ wifi_error (* wifi_reset_log_handler)(wifi_request_id id, wifi_interface_handle iface);
+ wifi_error (* wifi_set_alert_handler)(wifi_request_id id, wifi_interface_handle iface,
+ wifi_alert_handler handler);
+ wifi_error (* wifi_reset_alert_handler)(wifi_request_id id, wifi_interface_handle iface);
+ wifi_error (* wifi_get_firmware_version)(wifi_interface_handle iface, char *buffer,
+ int buffer_size);
+ wifi_error (* wifi_get_ring_buffers_status)(wifi_interface_handle iface,
+ u32 *num_rings, wifi_ring_buffer_status *status);
+ wifi_error (* wifi_get_logger_supported_feature_set)(wifi_interface_handle iface,
+ unsigned int *support);
+ wifi_error (* wifi_get_ring_data)(wifi_interface_handle iface, char *ring_name);
+ wifi_error (* wifi_enable_tdls)(wifi_interface_handle, mac_addr, wifi_tdls_params *,
+ wifi_tdls_handler);
+ wifi_error (* wifi_disable_tdls)(wifi_interface_handle, mac_addr);
+ wifi_error (*wifi_get_tdls_status) (wifi_interface_handle, mac_addr, wifi_tdls_status *);
+ wifi_error (*wifi_get_tdls_capabilities)(wifi_interface_handle iface,
+ wifi_tdls_capabilities *capabilities);
+ wifi_error (* wifi_get_driver_version)(wifi_interface_handle iface, char *buffer,
+ int buffer_size);
+ wifi_error (* wifi_set_passpoint_list)(wifi_request_id id, wifi_interface_handle iface,
+ int num, wifi_passpoint_network *networks, wifi_passpoint_event_handler handler);
+ wifi_error (* wifi_reset_passpoint_list)(wifi_request_id id, wifi_interface_handle iface);
+ wifi_error (*wifi_set_lci) (wifi_request_id id, wifi_interface_handle iface,
+ wifi_lci_information *lci);
+ wifi_error (*wifi_set_lcr) (wifi_request_id id, wifi_interface_handle iface,
+ wifi_lcr_information *lcr);
+ wifi_error (*wifi_start_sending_offloaded_packet)(wifi_request_id id,
+ wifi_interface_handle iface, u16 ether_type, u8 *ip_packet,
+ u16 ip_packet_len, u8 *src_mac_addr, u8 *dst_mac_addr,
+ u32 period_msec);
+ wifi_error (*wifi_stop_sending_offloaded_packet)(wifi_request_id id,
+ wifi_interface_handle iface);
+ wifi_error (*wifi_start_rssi_monitoring)(wifi_request_id id, wifi_interface_handle
+ iface, s8 max_rssi, s8 min_rssi, wifi_rssi_event_handler eh);
+ wifi_error (*wifi_stop_rssi_monitoring)(wifi_request_id id, wifi_interface_handle iface);
+ wifi_error (*wifi_get_wake_reason_stats)(wifi_interface_handle iface,
+ WLAN_DRIVER_WAKE_REASON_CNT *wifi_wake_reason_cnt);
+ wifi_error (*wifi_configure_nd_offload)(wifi_interface_handle iface, u8 enable);
+ wifi_error (*wifi_get_driver_memory_dump)(wifi_interface_handle iface,
+ wifi_driver_memory_dump_callbacks callbacks);
+ wifi_error (*wifi_start_pkt_fate_monitoring)(wifi_interface_handle iface);
+ wifi_error (*wifi_get_tx_pkt_fates)(wifi_interface_handle handle,
+ wifi_tx_report *tx_report_bufs,
+ size_t n_requested_fates,
+ size_t *n_provided_fates);
+ wifi_error (*wifi_get_rx_pkt_fates)(wifi_interface_handle handle,
+ wifi_rx_report *rx_report_bufs,
+ size_t n_requested_fates,
+ size_t *n_provided_fates);
+
+ /* NAN functions */
+ wifi_error (*wifi_nan_enable_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanEnableRequest* msg);
+ wifi_error (*wifi_nan_disable_request)(transaction_id id,
+ wifi_interface_handle iface);
+ wifi_error (*wifi_nan_publish_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanPublishRequest* msg);
+ wifi_error (*wifi_nan_publish_cancel_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanPublishCancelRequest* msg);
+ wifi_error (*wifi_nan_subscribe_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanSubscribeRequest* msg);
+ wifi_error (*wifi_nan_subscribe_cancel_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanSubscribeCancelRequest* msg);
+ wifi_error (*wifi_nan_transmit_followup_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanTransmitFollowupRequest* msg);
+ wifi_error (*wifi_nan_stats_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanStatsRequest* msg);
+ wifi_error (*wifi_nan_config_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanConfigRequest* msg);
+ wifi_error (*wifi_nan_tca_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanTCARequest* msg);
+ wifi_error (*wifi_nan_beacon_sdf_payload_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanBeaconSdfPayloadRequest* msg);
+ wifi_error (*wifi_nan_register_handler)(wifi_interface_handle iface,
+ NanCallbackHandler handlers);
+ wifi_error (*wifi_nan_get_version)(wifi_handle handle,
+ NanVersion* version);
+ wifi_error (*wifi_nan_get_capabilities)(transaction_id id,
+ wifi_interface_handle iface);
+ wifi_error (*wifi_nan_data_interface_create)(transaction_id id,
+ wifi_interface_handle iface,
+ char *iface_name);
+ wifi_error (*wifi_nan_data_interface_delete)(transaction_id id,
+ wifi_interface_handle iface,
+ char *iface_name);
+ wifi_error (*wifi_nan_data_request_initiator)(
+ transaction_id id, wifi_interface_handle iface,
+ NanDataPathInitiatorRequest *msg);
+ wifi_error (*wifi_nan_data_indication_response)(
+ transaction_id id, wifi_interface_handle iface,
+ NanDataPathIndicationResponse *msg);
+ wifi_error (*wifi_nan_data_end)(transaction_id id,
+ wifi_interface_handle iface,
+ NanDataPathEndRequest *msg);
+ wifi_error (*wifi_select_tx_power_scenario)(wifi_interface_handle iface,
+ wifi_power_scenario scenario);
+ wifi_error (*wifi_reset_tx_power_scenario)(wifi_interface_handle iface);
+
+ /**
+ * Returns the chipset's hardware filtering capabilities:
+ * @param version pointer to version of the packet filter interpreter
+ * supported, filled in upon return. 0 indicates no support.
+ * @param max_len pointer to maximum size of the filter bytecode, filled in
+ * upon return.
+ */
+ wifi_error (*wifi_get_packet_filter_capabilities)(wifi_interface_handle handle,
+ u32 *version, u32 *max_len);
+ /**
+ * Programs the packet filter.
+ * @param program pointer to the program byte-code.
+ * @param len length of the program byte-code.
+ */
+ wifi_error (*wifi_set_packet_filter)(wifi_interface_handle handle,
+ const u8 *program, u32 len);
+ wifi_error (*wifi_read_packet_filter)(wifi_interface_handle handle,
+ u32 src_offset, u8 *host_dst,
+ u32 length);
+ wifi_error (*wifi_get_roaming_capabilities)(wifi_interface_handle handle,
+ wifi_roaming_capabilities *caps);
+ wifi_error (*wifi_enable_firmware_roaming)(wifi_interface_handle handle,
+ fw_roaming_state_t state);
+ wifi_error (*wifi_configure_roaming)(wifi_interface_handle handle,
+ wifi_roaming_config *roaming_config);
+ wifi_error (*wifi_set_radio_mode_change_handler)(wifi_request_id id, wifi_interface_handle
+ iface, wifi_radio_mode_change_handler eh);
+ wifi_error (*wifi_set_latency_mode)(wifi_interface_handle iface,
+ wifi_latency_mode mode);
+ wifi_error (*wifi_set_thermal_mitigation_mode)(wifi_handle handle,
+ wifi_thermal_mode mode,
+ u32 completion_window);
+ wifi_error (*wifi_map_dscp_access_category)(wifi_handle handle,
+ u32 start, u32 end,
+ u32 access_category);
+ wifi_error (*wifi_reset_dscp_mapping)(wifi_handle handle);
+
+ wifi_error (*wifi_virtual_interface_create)(wifi_handle handle, const char* ifname,
+ wifi_interface_type iface_type);
+ wifi_error (*wifi_virtual_interface_delete)(wifi_handle handle, const char* ifname);
+
+ wifi_error (*wifi_set_subsystem_restart_handler)(wifi_handle handle,
+ wifi_subsystem_restart_handler handler);
+
+ /**
+ * Allow vendor HAL to choose interface name when creating
+ * an interface. This can be implemented by chips with their
+ * own interface naming policy.
+ * If not implemented, the default naming will be used.
+ */
+ wifi_error (*wifi_get_supported_iface_name)(wifi_handle handle, u32 iface_type,
+ char *name, size_t len);
+
+ /**
+ * Perform early initialization steps that are needed when WIFI
+ * is disabled.
+ * If the function returns failure, it means the vendor HAL is unusable
+ * (for example, if chip hardware is not installed) and no further
+ * functions should be called.
+ */
+ wifi_error (*wifi_early_initialize)(void);
+
+ /**
+ * Get supported feature set which are chip-global, that is
+ * not dependent on any created interface.
+ */
+ wifi_error (*wifi_get_chip_feature_set)(wifi_handle handle, feature_set *set);
+
+ /**
+ * Invoked to indicate that the provided iface is the primary STA iface when there are more
+ * than 1 STA iface concurrently active.
+ */
+ wifi_error (*wifi_multi_sta_set_primary_connection)(wifi_handle handle,
+ wifi_interface_handle iface);
+
+
+ /**
+ * When there are 2 simultaneous STA connections, this use case hint
+ * indicates what STA + STA use-case is being enabled by the framework.
+ */
+ wifi_error (*wifi_multi_sta_set_use_case)(wifi_handle handle,
+ wifi_multi_sta_use_case use_case);
+
+ /**
+ * Invoked to indicate that the following list of wifi_coex_unsafe_channel should be avoided
+ * with the specified restrictions.
+ * @param unsafeChannels list of current |wifi_coex_unsafe_channel| to avoid.
+ * @param restrictions bitmask of |wifi_coex_restriction| indicating wifi interfaces to
+ * restrict from the current unsafe channels.
+ */
+ wifi_error (*wifi_set_coex_unsafe_channels)(wifi_handle handle, u32 num_channels,
+ wifi_coex_unsafe_channel *unsafeChannels,
+ u32 restrictions);
+
+ /**
+ * Invoked to set voip optimization mode for the provided STA iface
+ */
+ wifi_error (*wifi_set_voip_mode)(wifi_interface_handle iface, wifi_voip_mode mode);
+
+ /**
+ * Get Target Wake Time (TWT) local device capabilities for the station interface.
+ *
+ * @param iface Wifi interface handle
+ * @param capabilities TWT capabilities
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_twt_get_capabilities)(wifi_interface_handle iface,
+ wifi_twt_capabilities* capabilities);
+ /**
+ * Setup a TWT session.
+ *
+ * Supported only if wifi_twt_capabilities.is_twt_requester_supported is set. Results in
+ * asynchronous callback wifi_twt_events.on_twt_session_create on success or
+ * wifi_twt_events.on_twt_failure with error code.
+ *
+ * @param id Identifier for the command. The value 0 is reserved.
+ * @param iface Wifi interface handle
+ * @param request TWT request parameters
+ * @param events TWT events
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_twt_session_setup)(wifi_request_id id, wifi_interface_handle iface,
+ wifi_twt_request request, wifi_twt_events events);
+ /**
+ * Update a TWT session.
+ *
+ * Supported only if wifi_twt_session.is_updatable is set. Reesults in asynchronous callback
+ * wifi_twt_events.on_twt_session_update on success or wifi_twt_events.on_twt_failure with
+ * error code.
+ *
+ * @param id Identifier for the command. The value 0 is reserved.
+ * @param iface Wifi interface handle
+ * @param session_id TWT session identifier
+ * @param request TWT request parameters
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_twt_session_update)(wifi_request_id id, wifi_interface_handle iface,
+ int session_id, wifi_twt_request request);
+ /**
+ * Suspend a TWT session.
+ * Supported only if wifi_twt_session.is_suspendable is set. Results in asynchronous callback
+ * wifi_twt_events.on_twt_session_suspend on success or wifi_twt_events.on_twt_failure with
+ * error code.
+ *
+ * @param id Identifier for the command. The value 0 is reserved.
+ * @param iface Wifi interface handle
+ * @param session_id TWT session identifier
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_twt_session_suspend)(wifi_request_id id, wifi_interface_handle iface,
+ int session_id);
+ /**
+ * Resume a suspended TWT session.
+ *
+ * Supported only if wifi_twt_session.is_suspendable is set. Results in asynchronous callback
+ * wifi_twt_events.on_twt_session_resume on success or wifi_twt_events.on_twt_failure with
+ * error code.
+ *
+ * @param id Identifier for the command. The value 0 is reserved.
+ * @param iface Wifi interface handle
+ * @param session_id TWT session identifier
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_twt_session_resume)(wifi_request_id id, wifi_interface_handle iface,
+ int session_id);
+ /**
+ * Teardown a TWT session.
+ *
+ * Results in asynchronous callback wifi_twt_events.on_twt_session_teardown on success or
+ * wifi_twt_events.on_twt_failure with error code.
+ *
+ * @param id Identifier for the command. The value 0 is reserved.
+ * @param iface Wifi interface handle
+ * @param session_id TWT session identifier
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_twt_session_teardown)(wifi_request_id id, wifi_interface_handle iface,
+ int session_id);
+
+ /**
+ * Get stats for a TWT session.
+ *
+ * Results in asynchronous callback wifi_twt_events.on_twt_session_stats on success or
+ * wifi_twt_events.on_twt_failure with error code.
+ *
+ * @param id Identifier for the command. The value 0 is reserved.
+ * @param iface Wifi interface handle
+ * @param session_id TWT session identifier
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_twt_session_get_stats)(wifi_request_id id, wifi_interface_handle iface,
+ int session_id);
+
+ /**@brief twt_register_handler
+ * Request to register TWT callback before sending any TWT request
+ * @param wifi_interface_handle:
+ * @param TwtCallbackHandler: callback function pointers
+ * @return Synchronous wifi_error
+ *
+ * Note: This function is deprecated
+ */
+ wifi_error (*wifi_twt_register_handler)(wifi_interface_handle iface,
+ TwtCallbackHandler handler);
+
+ /**@brief twt_get_capability
+ * Request TWT capability
+ * @param wifi_interface_handle:
+ * @return Synchronous wifi_error and TwtCapabilitySet
+ *
+ * Note: This function is deprecated by wifi_twt_get_capabilities
+ */
+ wifi_error (*wifi_twt_get_capability)(wifi_interface_handle iface,
+ TwtCapabilitySet* twt_cap_set);
+
+ /**@brief twt_setup_request
+ * Request to send TWT setup frame
+ * @param wifi_interface_handle:
+ * @param TwtSetupRequest: detailed parameters of setup request
+ * @return Synchronous wifi_error
+ * @return Asynchronous EventTwtSetupResponse CB return TwtSetupResponse
+ *
+ * Note: This function is deprecated by wifi_twt_session_setup
+ */
+ wifi_error (*wifi_twt_setup_request)(wifi_interface_handle iface,
+ TwtSetupRequest* msg);
+
+ /**@brief twt_teardown_request
+ * Request to send TWT teardown frame
+ * @param wifi_interface_handle:
+ * @param TwtTeardownRequest: detailed parameters of teardown request
+ * @return Synchronous wifi_error
+ * @return Asynchronous EventTwtTeardownCompletion CB return TwtTeardownCompletion
+ * TwtTeardownCompletion may also be received due to other events
+ * like CSA, BTCX, TWT scheduler, MultiConnection, peer-initiated teardown, etc.
+ *
+ * Note: This function is deprecated by wifi_twt_session_teardown
+ */
+ wifi_error (*wifi_twt_teardown_request)(wifi_interface_handle iface,
+ TwtTeardownRequest* msg);
+
+ /**@brief twt_info_frame_request
+ * Request to send TWT info frame
+ * @param wifi_interface_handle:
+ * @param TwtInfoFrameRequest: detailed parameters in info frame
+ * @return Synchronous wifi_error
+ * @return Asynchronous EventTwtInfoFrameReceived CB return TwtInfoFrameReceived
+ * Driver may also receive Peer-initiated TwtInfoFrame
+ *
+ * Note: This function is deprecated by wifi_twt_session_suspend and
+ * wifi_twt_session_resume
+ */
+ wifi_error (*wifi_twt_info_frame_request)(wifi_interface_handle iface,
+ TwtInfoFrameRequest* msg);
+
+ /**@brief twt_get_stats
+ * Request to get TWT stats
+ * @param wifi_interface_handle:
+ * @param config_id: configuration ID of TWT request
+ * @return Synchronous wifi_error and TwtStats
+ *
+ * Note: This function is deprecated by wifi_twt_get_session_stats
+ */
+ wifi_error (*wifi_twt_get_stats)(wifi_interface_handle iface, u8 config_id,
+ TwtStats* stats);
+
+ /**@brief twt_clear_stats
+ * Request to clear TWT stats
+ * @param wifi_interface_handle:
+ * @param config_id: configuration ID of TWT request
+ * @return Synchronous wifi_error
+ *
+ * Note: This function is deprecated by wifi_twt_session_clear_stats
+ */
+ wifi_error (*wifi_twt_clear_stats)(wifi_interface_handle iface, u8 config_id);
+
+ /**
+ * Invoked to set DTIM configuration when the host is in the suspend mode
+ * @param wifi_interface_handle:
+ * @param multiplier: when STA in the power saving mode, the wake up interval will be set to
+ * 1) multiplier * DTIM period if multiplier > 0.
+ * 2) the device default value if multiplier <=0
+ * Some implementations may apply an additional cap to wake up interval in the case of 1).
+ */
+ wifi_error (*wifi_set_dtim_config)(wifi_interface_handle handle, u32 multiplier);
+
+ /**@brief wifi_get_usable_channels
+ * Request list of usable channels for the requested bands and modes. Usable
+ * implies channel is allowed as per regulatory for the current country code
+ * and not restricted due to other hard limitations (e.g. DFS, Coex) In
+ * certain modes (e.g. STA+SAP) there could be other hard restrictions
+ * since MCC operation many not be supported by SAP. This API also allows
+ * driver to return list of usable channels for each mode uniquely to
+ * distinguish cases where only a limited set of modes are allowed on
+ * a given channel e.g. srd channels may be supported for P2P but not
+ * for SAP or P2P-Client may be allowed on an indoor channel but P2P-GO
+ * may not be allowed. This API is not interface specific and will be
+ * used to query capabilities of driver in terms of what modes (STA, SAP,
+ * P2P_CLI, P2P_GO, NAN, TDLS) can be supported on each of the channels.
+ * @param handle global wifi_handle
+ * @param band_mask BIT MASK of WLAN_MAC* as represented by |wlan_mac_band|
+ * @param iface_mode_mask BIT MASK of BIT(WIFI_INTERFACE_*) represented by
+ * |wifi_interface_mode|. Bitmask respresents all the modes that the
+ * caller is interested in (e.g. STA, SAP, WFD-CLI, WFD-GO, TDLS, NAN).
+ * Note: Bitmask does not represent concurrency matrix. If the caller
+ * is interested in CLI, GO modes, the iface_mode_mask would be set
+ * to WIFI_INTERFACE_P2P_CLIENT|WIFI_INTERFACE_P2P_GO.
+ * @param filter_mask BIT MASK of WIFI_USABLE_CHANNEL_FILTER_* represented by
+ * |wifi_usable_channel_filter|. Indicates if the channel list should
+ * be filtered based on additional criteria. If filter_mask is not
+ * specified, driver should return list of usable channels purely
+ * based on regulatory constraints.
+ * @param max_size maximum number of |wifi_usable_channel|
+ * @param size actual number of |wifi_usable_channel| entries returned by driver
+ * @param channels list of usable channels represented by |wifi_usable_channel|
+ */
+ wifi_error (*wifi_get_usable_channels)(wifi_handle handle, u32 band_mask, u32 iface_mode_mask,
+ u32 filter_mask, u32 max_size, u32* size,
+ wifi_usable_channel* channels);
+
+ /**
+ * Trigger wifi subsystem restart to reload firmware
+ */
+ wifi_error (*wifi_trigger_subsystem_restart)(wifi_handle handle);
+
+ /**
+ * Invoked to set that the device is operating in an indoor environment.
+ * @param handle global wifi_handle
+ * @param isIndoor: true if the device is operating in an indoor
+ * environment, false otherwise.
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_set_indoor_state)(wifi_handle handle, bool isIndoor);
+
+ /**@brief wifi_get_supported_radio_combinations_matrix
+ * Request all the possible radio combinations this device can offer.
+ * @param handle global wifi_handle
+ * @param max_size maximum size allocated for filling the wifi_radio_combination_matrix
+ * @param wifi_radio_combination_matrix to return all the possible radio
+ * combinations.
+ * @param size actual size of wifi_radio_combination_matrix returned from
+ * lower layer
+ *
+ */
+ wifi_error (*wifi_get_supported_radio_combinations_matrix)(
+ wifi_handle handle, u32 max_size, u32 *size,
+ wifi_radio_combination_matrix *radio_combination_matrix);
+
+ /**@brief wifi_nan_rtt_chre_enable_request
+ * Request to enable CHRE NAN RTT
+ * @param transaction_id: NAN transaction id
+ * @param wifi_interface_handle
+ * @param NanEnableRequest request message
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_nan_rtt_chre_enable_request)(transaction_id id,
+ wifi_interface_handle iface,
+ NanEnableRequest* msg);
+
+ /**@brief wifi_nan_rtt_chre_disable_request
+ * Request to disable CHRE NAN RTT
+ * @param transaction_id: NAN transaction id
+ * @param wifi_interface_handle
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_nan_rtt_chre_disable_request)(transaction_id id, wifi_interface_handle iface);
+
+ /**@brief wifi_chre_register_handler
+ * register a handler to get the state of CHR
+ * @param wifi_interface_handle
+ * @param wifi_chre_handler: callback function pointer
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_chre_register_handler)(wifi_interface_handle iface,
+ wifi_chre_handler handler);
+
+ /**@brief wifi_enable_tx_power_limits
+ * Enable WiFi Tx power limis
+ * @param wifi_interface_handle
+ * @param isEnable : If enable TX limit or not
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_enable_tx_power_limits) (wifi_interface_handle iface,
+ bool isEnable);
+
+ /**@brief wifi_get_cached_scan_results
+ * Retrieve scan results cached in wifi firmware
+ * @param wifi_interface_handle
+ * @param wifi_cached_scan_result_handler : callback function pointer
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_get_cached_scan_results)(wifi_interface_handle iface,
+ wifi_cached_scan_result_handler handler);
+ /**@brief wifi_get_chip_capabilities
+ * Retrieve capabilities supported by this chip
+ * @param wifi_handle
+ * @return Synchronous wifi_error and chip capabilites
+ */
+ wifi_error (*wifi_get_chip_capabilities)(wifi_handle handle,
+ wifi_chip_capabilities *chip_capabilities);
+
+ /**@brief wifi_get_supported_iface_concurrency_matrix
+ * Request all the possible interface concurrency combinations this
+ * Wifi Chip can offer.
+ * @param handle global wifi_handle
+ * @param wifi_iface_concurrency_matrix to return all the possible
+ * interface concurrency combinations.
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_get_supported_iface_concurrency_matrix)(
+ wifi_handle handle, wifi_iface_concurrency_matrix *matrix);
+
+ /**@brief wifi_enable_sta_channel_for_peer_network
+ * enable or disable the feature of allowing current STA-connected
+ * channel for WFA GO, SAP and Wi-Fi Aware when the regulatory allows.
+ * @param handle global wifi_handle
+ * @param channelCategoryEnableFlag bitmask of |wifi_channel_category|.
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_enable_sta_channel_for_peer_network)(
+ wifi_handle handle, u32 channelCategoryEnableFlag);
+
+ /**@brief wifi_nan_suspend_request
+ * Request that the specified NAN session be suspended.
+ * @param transaction_id: NAN transaction id
+ * @param wifi_interface_handle
+ * @param NanSuspendRequest request message
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_nan_suspend_request)(transaction_id id, wifi_interface_handle iface,
+ NanSuspendRequest *msg);
+
+ /**@brief wifi_nan_resume_request
+ * Request that the specified NAN session be resumed.
+ * @param transaction_id: NAN transaction id
+ * @param wifi_interface_handle
+ * @param NanResumeRequest request message
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_nan_resume_request)(transaction_id id, wifi_interface_handle iface,
+ NanResumeRequest *msg);
+
+ wifi_error (*wifi_nan_pairing_request)(
+ transaction_id id, wifi_interface_handle iface,
+ NanPairingRequest *msg);
+ wifi_error (*wifi_nan_pairing_indication_response)(
+ transaction_id id, wifi_interface_handle iface,
+ NanPairingIndicationResponse *msg);
+ wifi_error (*wifi_nan_bootstrapping_request)(
+ transaction_id id, wifi_interface_handle iface,
+ NanBootstrappingRequest *msg);
+ wifi_error (*wifi_nan_bootstrapping_indication_response)(
+ transaction_id id, wifi_interface_handle iface,
+ NanBootstrappingIndicationResponse *msg);
+
+ /**@brief wifi_set_scan_mode
+ * Notify driver/firmware current is scan only mode to allow lower
+ * level to optimize power consumption.
+ * @param enable true if current is scan only mode
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_set_scan_mode)(const char * ifname, bool enable);
+
+ wifi_error (*wifi_nan_pairing_end)(transaction_id id,
+ wifi_interface_handle iface,
+ NanPairingEndRequest *msg);
+
+ /**@brief wifi_set_mlo_mode
+ * Set Multi-Link Operation mode.
+ * @param handle global wifi_handle
+ * @param mode: MLO mode
+ * @return Synchronous wifi_error
+ */
+ wifi_error (*wifi_set_mlo_mode)(wifi_handle handle, wifi_mlo_mode mode);
+
+ /*
+ * when adding new functions make sure to add stubs in
+ * wifi_legacy_hal_stubs.cpp::initHalFuncTableWithStubs
+ */
+} wifi_hal_fn;
+
+wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn);
+typedef wifi_error (*init_wifi_vendor_hal_func_table_t)(wifi_hal_fn *fn);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/wifi/legacy_headers/include/hardware_legacy/wifi_logger.h b/wifi/legacy_headers/include/hardware_legacy/wifi_logger.h
new file mode 100644
index 0000000..0692859
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/wifi_logger.h
@@ -0,0 +1,646 @@
+#include "wifi_hal.h"
+
+#ifndef __WIFI_HAL_LOGGER_H
+#define __WIFI_HAL_LOGGER_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#define LOGGER_MAJOR_VERSION 1
+#define LOGGER_MINOR_VERSION 0
+#define LOGGER_MICRO_VERSION 0
+
+
+
+/**
+ * WiFi logger life cycle is as follow:
+ *
+ * - At initialization time, framework will call wifi_get_ring_buffers_status
+ * so as to obtain the names and list of supported buffers.
+ * - When WiFi operation start framework will call wifi_start_logging
+ * so as to trigger log collection.
+ * - Developper UI will provide an option to the user, so as it can set the verbose level
+ * of individual buffer as reported by wifi_get_ring_buffers_status.
+ * - During wifi operations, driver will periodically report per ring data to framework
+ * by invoking the on_ring_buffer_data call back.
+ * - when capturing a bug report, framework will indicate to driver that all the data
+ * has to be uploaded, urgently, by calling wifi_get_ring_data.
+ *
+ * The data uploaded by driver will be stored by framework in separate files, with one stream
+ * of file per ring.
+ * Framework will store the files in pcapng format, allowing for easy merging and parsing
+ * with network analyzer tools.
+ */
+
+
+typedef int wifi_ring_buffer_id;
+
+#define PER_PACKET_ENTRY_FLAGS_DIRECTION_TX 1 // 0: TX, 1: RX
+#define PER_PACKET_ENTRY_FLAGS_TX_SUCCESS 2 // whether packet was transmitted or
+ // received/decrypted successfully
+#define PER_PACKET_ENTRY_FLAGS_80211_HEADER 4 // has full 802.11 header, else has 802.3 header
+#define PER_PACKET_ENTRY_FLAGS_PROTECTED 8 // whether packet was encrypted
+
+typedef struct {
+ u8 flags;
+ u8 tid; // transmit or received tid
+ u16 MCS; // modulation and bandwidth
+ u8 rssi; // TX: RSSI of ACK for that packet
+ // RX: RSSI of packet
+ u8 num_retries; // number of attempted retries
+ u16 last_transmit_rate; // last transmit rate in .5 mbps
+ u16 link_layer_transmit_sequence; // transmit/reeive sequence for that MPDU packet
+ u64 firmware_entry_timestamp; // TX: firmware timestamp (us) when packet is queued within
+ // firmware buffer for SDIO/HSIC or into PCIe buffer
+ // RX: firmware receive timestamp
+ u64 start_contention_timestamp; // firmware timestamp (us) when packet start contending for the
+ // medium for the first time, at head of its AC queue,
+ // or as part of an MPDU or A-MPDU. This timestamp is
+ // not updated for each retry, only the first transmit attempt.
+ u64 transmit_success_timestamp; // fimrware timestamp (us) when packet is successfully
+ // transmitted or aborted because it has exhausted
+ // its maximum number of retries.
+ u8 data[0]; // packet data. The length of packet data is determined by the entry_size field of
+ // the wifi_ring_buffer_entry structure. It is expected that first bytes of the
+ // packet, or packet headers only (up to TCP or RTP/UDP headers)
+ // will be copied into the ring
+} __attribute__((packed)) wifi_ring_per_packet_status_entry;
+
+
+/* Below events refer to the wifi_connectivity_event ring and shall be supported */
+#define WIFI_EVENT_ASSOCIATION_REQUESTED 0 // driver receives association command from kernel
+#define WIFI_EVENT_AUTH_COMPLETE 1
+#define WIFI_EVENT_ASSOC_COMPLETE 2
+#define WIFI_EVENT_FW_AUTH_STARTED 3 // fw event indicating auth frames are sent
+#define WIFI_EVENT_FW_ASSOC_STARTED 4 // fw event indicating assoc frames are sent
+#define WIFI_EVENT_FW_RE_ASSOC_STARTED 5 // fw event indicating reassoc frames are sent
+#define WIFI_EVENT_DRIVER_SCAN_REQUESTED 6
+#define WIFI_EVENT_DRIVER_SCAN_RESULT_FOUND 7
+#define WIFI_EVENT_DRIVER_SCAN_COMPLETE 8
+#define WIFI_EVENT_G_SCAN_STARTED 9
+#define WIFI_EVENT_G_SCAN_COMPLETE 10
+#define WIFI_EVENT_DISASSOCIATION_REQUESTED 11
+#define WIFI_EVENT_RE_ASSOCIATION_REQUESTED 12
+#define WIFI_EVENT_ROAM_REQUESTED 13
+#define WIFI_EVENT_BEACON_RECEIVED 14 // received beacon from AP (event enabled
+ // only in verbose mode)
+#define WIFI_EVENT_ROAM_SCAN_STARTED 15 // firmware has triggered a roam scan (not g-scan)
+#define WIFI_EVENT_ROAM_SCAN_COMPLETE 16 // firmware has completed a roam scan (not g-scan)
+#define WIFI_EVENT_ROAM_SEARCH_STARTED 17 // firmware has started searching for roam
+ // candidates (with reason =xx)
+#define WIFI_EVENT_ROAM_SEARCH_STOPPED 18 // firmware has stopped searching for roam
+ // candidates (with reason =xx)
+#define WIFI_EVENT_CHANNEL_SWITCH_ANOUNCEMENT 20 // received channel switch anouncement from AP
+#define WIFI_EVENT_FW_EAPOL_FRAME_TRANSMIT_START 21 // fw start transmit eapol frame, with
+ // EAPOL index 1-4
+#define WIFI_EVENT_FW_EAPOL_FRAME_TRANSMIT_STOP 22 // fw gives up eapol frame, with rate,
+ // success/failure and number retries
+#define WIFI_EVENT_DRIVER_EAPOL_FRAME_TRANSMIT_REQUESTED 23 // kernel queue EAPOL for transmission
+ // in driver with EAPOL index 1-4
+#define WIFI_EVENT_FW_EAPOL_FRAME_RECEIVED 24 // with rate, regardless of the fact that
+ // EAPOL frame is accepted or rejected by fw
+#define WIFI_EVENT_DRIVER_EAPOL_FRAME_RECEIVED 26 // with rate, and eapol index, driver has
+ // received EAPOL frame and will queue it up
+ // to wpa_supplicant
+#define WIFI_EVENT_BLOCK_ACK_NEGOTIATION_COMPLETE 27 // with success/failure, parameters
+#define WIFI_EVENT_BT_COEX_BT_SCO_START 28
+#define WIFI_EVENT_BT_COEX_BT_SCO_STOP 29
+#define WIFI_EVENT_BT_COEX_BT_SCAN_START 30 // for paging/scan etc., when BT starts transmiting
+ // twice per BT slot
+#define WIFI_EVENT_BT_COEX_BT_SCAN_STOP 31
+#define WIFI_EVENT_BT_COEX_BT_HID_START 32
+#define WIFI_EVENT_BT_COEX_BT_HID_STOP 33
+#define WIFI_EVENT_ROAM_AUTH_STARTED 34 // fw sends auth frame in roaming to next candidate
+#define WIFI_EVENT_ROAM_AUTH_COMPLETE 35 // fw receive auth confirm from ap
+#define WIFI_EVENT_ROAM_ASSOC_STARTED 36 // firmware sends assoc/reassoc frame in
+ // roaming to next candidate
+#define WIFI_EVENT_ROAM_ASSOC_COMPLETE 37 // firmware receive assoc/reassoc confirm from ap
+#define WIFI_EVENT_G_SCAN_STOP 38 // firmware sends stop G_SCAN
+#define WIFI_EVENT_G_SCAN_CYCLE_STARTED 39 // firmware indicates G_SCAN scan cycle started
+#define WIFI_EVENT_G_SCAN_CYCLE_COMPLETED 40 // firmware indicates G_SCAN scan cycle completed
+#define WIFI_EVENT_G_SCAN_BUCKET_STARTED 41 // firmware indicates G_SCAN scan start
+ // for a particular bucket
+#define WIFI_EVENT_G_SCAN_BUCKET_COMPLETED 42 // firmware indicates G_SCAN scan completed for
+ // for a particular bucket
+#define WIFI_EVENT_G_SCAN_RESULTS_AVAILABLE 43 // Event received from firmware about G_SCAN scan
+ // results being available
+#define WIFI_EVENT_G_SCAN_CAPABILITIES 44 // Event received from firmware with G_SCAN
+ // capabilities
+#define WIFI_EVENT_ROAM_CANDIDATE_FOUND 45 // Event received from firmware when eligible
+ // candidate is found
+#define WIFI_EVENT_ROAM_SCAN_CONFIG 46 // Event received from firmware when roam scan
+ // configuration gets enabled or disabled
+#define WIFI_EVENT_AUTH_TIMEOUT 47 // firmware/driver timed out authentication
+#define WIFI_EVENT_ASSOC_TIMEOUT 48 // firmware/driver timed out association
+#define WIFI_EVENT_MEM_ALLOC_FAILURE 49 // firmware/driver encountered allocation failure
+#define WIFI_EVENT_DRIVER_PNO_ADD 50 // driver added a PNO network in firmware
+#define WIFI_EVENT_DRIVER_PNO_REMOVE 51 // driver removed a PNO network in firmware
+#define WIFI_EVENT_DRIVER_PNO_NETWORK_FOUND 52 // driver received PNO networks
+ // found indication from firmware
+#define WIFI_EVENT_DRIVER_PNO_SCAN_REQUESTED 53 // driver triggered a scan for PNO networks
+#define WIFI_EVENT_DRIVER_PNO_SCAN_RESULT_FOUND 54 // driver received scan results
+ // of PNO networks
+#define WIFI_EVENT_DRIVER_PNO_SCAN_COMPLETE 55 // driver updated scan results from
+ // PNO networks to cfg80211
+
+/**
+ * Parameters of wifi logger events are TLVs
+ * Event parameters tags are defined as:
+ */
+#define WIFI_TAG_VENDOR_SPECIFIC 0 // take a byte stream as parameter
+#define WIFI_TAG_BSSID 1 // takes a 6 bytes MAC address as parameter
+#define WIFI_TAG_ADDR 2 // takes a 6 bytes MAC address as parameter
+#define WIFI_TAG_SSID 3 // takes a 32 bytes SSID address as parameter
+#define WIFI_TAG_STATUS 4 // takes an integer as parameter
+#define WIFI_TAG_CHANNEL_SPEC 5 // takes one or more wifi_channel_spec as parameter
+#define WIFI_TAG_WAKE_LOCK_EVENT 6 // takes a wake_lock_event struct as parameter
+#define WIFI_TAG_ADDR1 7 // takes a 6 bytes MAC address as parameter
+#define WIFI_TAG_ADDR2 8 // takes a 6 bytes MAC address as parameter
+#define WIFI_TAG_ADDR3 9 // takes a 6 bytes MAC address as parameter
+#define WIFI_TAG_ADDR4 10 // takes a 6 bytes MAC address as parameter
+#define WIFI_TAG_TSF 11 // take a 64 bits TSF value as parameter
+#define WIFI_TAG_IE 12 // take one or more specific 802.11 IEs parameter,
+ // IEs are in turn indicated in TLV format as per
+ // 802.11 spec
+#define WIFI_TAG_INTERFACE 13 // take interface name as parameter
+#define WIFI_TAG_REASON_CODE 14 // take a reason code as per 802.11 as parameter
+#define WIFI_TAG_RATE_MBPS 15 // take a wifi rate in 0.5 mbps
+#define WIFI_TAG_REQUEST_ID 16 // take an integer as parameter
+#define WIFI_TAG_BUCKET_ID 17 // take an integer as parameter
+#define WIFI_TAG_GSCAN_PARAMS 18 // takes a wifi_scan_cmd_params struct as parameter
+#define WIFI_TAG_GSCAN_CAPABILITIES 19 // takes a wifi_gscan_capabilities struct as parameter
+#define WIFI_TAG_SCAN_ID 20 // take an integer as parameter
+#define WIFI_TAG_RSSI 21 // take an integer as parameter
+#define WIFI_TAG_CHANNEL 22 // take an integer as parameter
+#define WIFI_TAG_LINK_ID 23 // take an integer as parameter
+#define WIFI_TAG_LINK_ROLE 24 // take an integer as parameter
+#define WIFI_TAG_LINK_STATE 25 // take an integer as parameter
+#define WIFI_TAG_LINK_TYPE 26 // take an integer as parameter
+#define WIFI_TAG_TSCO 27 // take an integer as parameter
+#define WIFI_TAG_RSCO 28 // take an integer as parameter
+#define WIFI_TAG_EAPOL_MESSAGE_TYPE 29 // take an integer as parameter
+ // M1-1, M2-2, M3-3, M4-4
+
+typedef struct {
+ u16 tag;
+ u16 length; // length of value
+ u8 value[0];
+} __attribute__((packed)) tlv_log;
+
+typedef struct {
+ u16 event;
+ tlv_log tlvs[0]; // separate parameter structure per event to be provided and optional data
+ // the event_data is expected to include an official android part, with some
+ // parameter as transmit rate, num retries, num scan result found etc...
+ // as well, event_data can include a vendor proprietary part which is
+ // understood by the developer only.
+} __attribute__((packed)) wifi_ring_buffer_driver_connectivity_event;
+
+
+/**
+ * Ring buffer name for power events ring. note that power event are extremely frequents
+ * and thus should be stored in their own ring/file so as not to clobber connectivity events.
+ */
+typedef struct {
+ int status; // 0 taken, 1 released
+ int reason; // reason why this wake lock is taken
+ char name[0]; // null terminated
+} __attribute__((packed)) wake_lock_event;
+
+typedef struct {
+ u16 event;
+ tlv_log tlvs[0];
+} __attribute__((packed)) wifi_power_event;
+
+
+/**
+ * This structure represent a logger entry within a ring buffer.
+ * Wifi driver are responsible to manage the ring buffer and write the debug
+ * information into those rings.
+ *
+ * In general, the debug entries can be used to store meaningful 802.11 information (SME, MLME,
+ * connection and packet statistics) as well as vendor proprietary data that is specific to a
+ * specific driver or chipset.
+ * Binary entries can be used so as to store packet data or vendor specific information and
+ * will be treated as blobs of data by android.
+ *
+ * A user land process will be started by framework so as to periodically retrieve the
+ * data logged by drivers into their ring buffer, store the data into log files and include
+ * the logs into android bugreports.
+ */
+enum {
+ RING_BUFFER_ENTRY_FLAGS_HAS_BINARY = (1 << (0)), // set for binary entries
+ RING_BUFFER_ENTRY_FLAGS_HAS_TIMESTAMP = (1 << (1)) // set if 64 bits timestamp is present
+};
+
+enum {
+ ENTRY_TYPE_CONNECT_EVENT = 1,
+ ENTRY_TYPE_PKT,
+ ENTRY_TYPE_WAKE_LOCK,
+ ENTRY_TYPE_POWER_EVENT,
+ ENTRY_TYPE_DATA
+};
+
+typedef struct {
+ u16 entry_size; // the size of payload excluding the header.
+ u8 flags;
+ u8 type; // entry type
+ u64 timestamp; // present if has_timestamp bit is set.
+} __attribute__((packed)) wifi_ring_buffer_entry;
+
+#define WIFI_RING_BUFFER_FLAG_HAS_BINARY_ENTRIES 0x00000001 // set if binary entries are present
+#define WIFI_RING_BUFFER_FLAG_HAS_ASCII_ENTRIES 0x00000002 // set if ascii entries are present
+
+
+/* ring buffer params */
+/**
+ * written_bytes and read_bytes implement a producer consumer API
+ * hence written_bytes >= read_bytes
+ * a modulo arithmetic of the buffer size has to be applied to those counters:
+ * actual offset into ring buffer = written_bytes % ring_buffer_byte_size
+ *
+ */
+typedef struct {
+ u8 name[32];
+ u32 flags;
+ wifi_ring_buffer_id ring_id; // unique integer representing the ring
+ u32 ring_buffer_byte_size; // total memory size allocated for the buffer
+ u32 verbose_level; // verbose level for ring buffer
+ u32 written_bytes; // number of bytes that was written to the buffer by driver,
+ // monotonously increasing integer
+ u32 read_bytes; // number of bytes that was read from the buffer by user land,
+ // monotonously increasing integer
+ u32 written_records; // number of records that was written to the buffer by driver,
+ // monotonously increasing integer
+} wifi_ring_buffer_status;
+
+
+/**
+ * Callback for reporting ring data
+ *
+ * The ring buffer data collection is event based:
+ * - Driver calls on_ring_buffer_data when new records are available, the wifi_ring_buffer_status
+ * passed up to framework in the call back indicates to framework if more data is available in
+ * the ring buffer. It is not expected that driver will necessarily always empty the ring
+ * immediately as data is available, instead driver will report data every X seconds or if
+ * N bytes are available.
+ * - In the case where a bug report has to be captured, framework will require driver to upload
+ * all data immediately. This is indicated to driver when framework calls wifi_get_ringdata.
+ * When framework calls wifi_get_ring_data, driver will start sending all available data in the
+ * indicated ring by repeatedly invoking the on_ring_buffer_data callback.
+ *
+ * The callback is called by log handler whenever ring data comes in driver.
+ */
+typedef struct {
+ void (*on_ring_buffer_data) (char *ring_name, char *buffer, int buffer_size,
+ wifi_ring_buffer_status *status);
+} wifi_ring_buffer_data_handler;
+
+/**
+ * API to set the log handler for getting ring data
+ * - Only a single instance of log handler can be instantiated for each ring buffer.
+ */
+wifi_error wifi_set_log_handler(wifi_request_id id, wifi_interface_handle iface,
+ wifi_ring_buffer_data_handler handler);
+
+/* API to reset the log handler */
+wifi_error wifi_reset_log_handler(wifi_request_id id, wifi_interface_handle iface);
+
+
+/**
+ * Callback for reporting FW dump
+ *
+ * The buffer data collection is event based such as FW health check or FW dump.
+ * The callback is called by alert handler.
+ */
+typedef struct {
+ void (*on_alert) (wifi_request_id id, char *buffer, int buffer_size, int err_code);
+} wifi_alert_handler;
+
+/*
+ * API to set the alert handler for the alert case in Wi-Fi Chip
+ * - Only a single instance of alert handler can be instantiated.
+ */
+wifi_error wifi_set_alert_handler(wifi_request_id id, wifi_interface_handle iface,
+ wifi_alert_handler handler);
+
+/* API to reset the alert handler */
+wifi_error wifi_reset_alert_handler(wifi_request_id id, wifi_interface_handle iface);
+
+/* API for framework to indicate driver has to upload and drain all data of a given ring */
+wifi_error wifi_get_ring_data(wifi_interface_handle iface, char *ring_name);
+
+
+/**
+ * API to trigger the debug collection.
+ * Unless his API is invoked - logging is not triggered.
+ * - Verbose_level 0 corresponds to no collection,
+ * and it makes log handler stop by no more events from driver.
+ * - Verbose_level 1 correspond to normal log level, with minimal user impact.
+ * This is the default value.
+ * - Verbose_level 2 are enabled when user is lazily trying to reproduce a problem,
+ * wifi performances and power can be impacted but device should not otherwise be
+ * significantly impacted.
+ * - Verbose_level 3+ are used when trying to actively debug a problem.
+ *
+ * ring_name represent the name of the ring for which data collection shall start.
+ *
+ * flags: TBD parameter used to enable/disable specific events on a ring
+ * max_interval: maximum interval in seconds for driver to invoke on_ring_buffer_data,
+ * ignore if zero
+ * min_data_size: minimum data size in buffer for driver to invoke on_ring_buffer_data,
+ * ignore if zero
+ */
+wifi_error wifi_start_logging(wifi_interface_handle iface, u32 verbose_level, u32 flags,
+ u32 max_interval_sec, u32 min_data_size, char *ring_name);
+
+/**
+ * API to get the status of all ring buffers supported by driver.
+ * - Caller is responsible to allocate / free ring buffer status.
+ * - Maximum no of ring buffer would be 10.
+ */
+wifi_error wifi_get_ring_buffers_status(wifi_interface_handle iface, u32 *num_rings,
+ wifi_ring_buffer_status *status);
+
+/**
+ * Synchronous memory dump by user request.
+ * - Caller is responsible to store memory dump data into a local,
+ * e.g., /data/misc/wifi/memdump.bin
+ */
+typedef struct {
+ void (*on_firmware_memory_dump) (char *buffer, int buffer_size);
+} wifi_firmware_memory_dump_handler;
+
+/**
+ * API to collect a firmware memory dump for a given iface by async memdump event.
+ * - Triggered by Alerthandler, esp. when FW problem or FW health check happens
+ * - Caller is responsible to store fw dump data into a local,
+ * e.g., /data/misc/wifi/alertdump-1.bin
+ */
+wifi_error wifi_get_firmware_memory_dump(wifi_interface_handle iface,
+ wifi_firmware_memory_dump_handler handler);
+
+/**
+ * API to collect a firmware version string.
+ * - Caller is responsible to allocate / free a buffer to retrieve firmware verion info.
+ * - Max string will be at most 256 bytes.
+ */
+wifi_error wifi_get_firmware_version(wifi_interface_handle iface, char *buffer, int buffer_size);
+
+/**
+ * API to collect a driver version string.
+ * - Caller is responsible to allocate / free a buffer to retrieve driver verion info.
+ * - Max string will be at most 256 bytes.
+ */
+wifi_error wifi_get_driver_version(wifi_interface_handle iface, char *buffer, int buffer_size);
+
+
+/* Feature set */
+enum {
+ WIFI_LOGGER_MEMORY_DUMP_SUPPORTED = (1 << (0)), // Memory dump of FW
+ WIFI_LOGGER_PER_PACKET_TX_RX_STATUS_SUPPORTED = (1 << (1)), // PKT status
+ WIFI_LOGGER_CONNECT_EVENT_SUPPORTED = (1 << (2)), // Connectivity event
+ WIFI_LOGGER_POWER_EVENT_SUPPORTED = (1 << (3)), // POWER of Driver
+ WIFI_LOGGER_WAKE_LOCK_SUPPORTED = (1 << (4)), // WAKE LOCK of Driver
+ WIFI_LOGGER_VERBOSE_SUPPORTED = (1 << (5)), // verbose log of FW
+ WIFI_LOGGER_WATCHDOG_TIMER_SUPPORTED = (1 << (6)), // monitor the health of FW
+ WIFI_LOGGER_DRIVER_DUMP_SUPPORTED = (1 << (7)), // dumps driver state
+ WIFI_LOGGER_PACKET_FATE_SUPPORTED = (1 << (8)), // tracks connection packets' fate
+};
+
+/**
+ * API to retrieve the current supportive features.
+ * - An integer variable is enough to have bit mapping info by caller.
+ */
+wifi_error wifi_get_logger_supported_feature_set(wifi_interface_handle iface,
+ unsigned int *support);
+
+typedef struct {
+ /* Buffer is to be allocated and freed by HAL implementation. */
+ void (*on_driver_memory_dump) (char *buffer, int buffer_size);
+} wifi_driver_memory_dump_callbacks;
+
+/**
+ API to collect driver state.
+
+ Framework will call this API soon before or after (but not
+ concurrently with) wifi_get_firmware_memory_dump(). Capturing
+ firmware and driver dumps is intended to help identify
+ inconsistent state between these components.
+
+ - In response to this call, HAL implementation should make one or
+ more calls to callbacks.on_driver_memory_dump(). Framework will
+ copy data out of the received |buffer|s, and concatenate the
+ contents thereof.
+ - HAL implemention will indicate completion of the driver memory
+ dump by returning from this call.
+*/
+wifi_error wifi_get_driver_memory_dump(
+ wifi_interface_handle iface,
+ wifi_driver_memory_dump_callbacks callbacks);
+
+
+/* packet fate logs */
+
+#define MD5_PREFIX_LEN 4
+#define MAX_FATE_LOG_LEN 32
+#define MAX_FRAME_LEN_ETHERNET 1518
+#define MAX_FRAME_LEN_80211_MGMT 2352 // 802.11-2012 Fig. 8-34
+
+typedef enum {
+ // Sent over air and ACKed.
+ TX_PKT_FATE_ACKED,
+
+ // Sent over air but not ACKed. (Normal for broadcast/multicast.)
+ TX_PKT_FATE_SENT,
+
+ // Queued within firmware, but not yet sent over air.
+ TX_PKT_FATE_FW_QUEUED,
+
+ // Dropped by firmware as invalid. E.g. bad source address, bad checksum,
+ // or invalid for current state.
+ TX_PKT_FATE_FW_DROP_INVALID,
+
+ // Dropped by firmware due to lack of buffer space.
+ TX_PKT_FATE_FW_DROP_NOBUFS,
+
+ // Dropped by firmware for any other reason. Includes frames that
+ // were sent by driver to firmware, but unaccounted for by
+ // firmware.
+ TX_PKT_FATE_FW_DROP_OTHER,
+
+ // Queued within driver, not yet sent to firmware.
+ TX_PKT_FATE_DRV_QUEUED,
+
+ // Dropped by driver as invalid. E.g. bad source address, or
+ // invalid for current state.
+ TX_PKT_FATE_DRV_DROP_INVALID,
+
+ // Dropped by driver due to lack of buffer space.
+ TX_PKT_FATE_DRV_DROP_NOBUFS,
+
+ // Dropped by driver for any other reason.
+ TX_PKT_FATE_DRV_DROP_OTHER,
+} wifi_tx_packet_fate;
+
+typedef enum {
+ // Valid and delivered to network stack (e.g., netif_rx()).
+ RX_PKT_FATE_SUCCESS,
+
+ // Queued within firmware, but not yet sent to driver.
+ RX_PKT_FATE_FW_QUEUED,
+
+ // Dropped by firmware due to host-programmable filters.
+ RX_PKT_FATE_FW_DROP_FILTER,
+
+ // Dropped by firmware as invalid. E.g. bad checksum, decrypt failed,
+ // or invalid for current state.
+ RX_PKT_FATE_FW_DROP_INVALID,
+
+ // Dropped by firmware due to lack of buffer space.
+ RX_PKT_FATE_FW_DROP_NOBUFS,
+
+ // Dropped by firmware for any other reason.
+ RX_PKT_FATE_FW_DROP_OTHER,
+
+ // Queued within driver, not yet delivered to network stack.
+ RX_PKT_FATE_DRV_QUEUED,
+
+ // Dropped by driver due to filter rules.
+ RX_PKT_FATE_DRV_DROP_FILTER,
+
+ // Dropped by driver as invalid. E.g. not permitted in current state.
+ RX_PKT_FATE_DRV_DROP_INVALID,
+
+ // Dropped by driver due to lack of buffer space.
+ RX_PKT_FATE_DRV_DROP_NOBUFS,
+
+ // Dropped by driver for any other reason.
+ RX_PKT_FATE_DRV_DROP_OTHER,
+} wifi_rx_packet_fate;
+
+typedef enum {
+ FRAME_TYPE_UNKNOWN,
+ FRAME_TYPE_ETHERNET_II,
+ FRAME_TYPE_80211_MGMT,
+} frame_type;
+
+typedef struct {
+ // The type of MAC-layer frame that this frame_info holds.
+ // - For data frames, use FRAME_TYPE_ETHERNET_II.
+ // - For management frames, use FRAME_TYPE_80211_MGMT.
+ // - If the type of the frame is unknown, use FRAME_TYPE_UNKNOWN.
+ frame_type payload_type;
+
+ // The number of bytes included in |frame_content|. If the frame
+ // contents are missing (e.g. RX frame dropped in firmware),
+ // |frame_len| should be set to 0.
+ size_t frame_len;
+
+ // Host clock when this frame was received by the driver (either
+ // outbound from the host network stack, or inbound from the
+ // firmware).
+ // - The timestamp should be taken from a clock which includes time
+ // the host spent suspended (e.g. ktime_get_boottime()).
+ // - If no host timestamp is available (e.g. RX frame was dropped in
+ // firmware), this field should be set to 0.
+ u32 driver_timestamp_usec;
+
+ // Firmware clock when this frame was received by the firmware
+ // (either outbound from the host, or inbound from a remote
+ // station).
+ // - The timestamp should be taken from a clock which includes time
+ // firmware spent suspended (if applicable).
+ // - If no firmware timestamp is available (e.g. TX frame was
+ // dropped by driver), this field should be set to 0.
+ // - Consumers of |frame_info| should _not_ assume any
+ // synchronization between driver and firmware clocks.
+ u32 firmware_timestamp_usec;
+
+ // Actual frame content.
+ // - Should be provided for TX frames originated by the host.
+ // - Should be provided for RX frames received by the driver.
+ // - Optionally provided for TX frames originated by firmware. (At
+ // discretion of HAL implementation.)
+ // - Optionally provided for RX frames dropped in firmware. (At
+ // discretion of HAL implementation.)
+ // - If frame content is not provided, |frame_len| should be set
+ // to 0.
+ union {
+ char ethernet_ii_bytes[MAX_FRAME_LEN_ETHERNET];
+ char ieee_80211_mgmt_bytes[MAX_FRAME_LEN_80211_MGMT];
+ } frame_content;
+} frame_info;
+
+typedef struct {
+ // Prefix of MD5 hash of |frame_inf.frame_content|. If frame
+ // content is not provided, prefix of MD5 hash over the same data
+ // that would be in frame_content, if frame content were provided.
+ char md5_prefix[MD5_PREFIX_LEN];
+ wifi_tx_packet_fate fate;
+ frame_info frame_inf;
+} wifi_tx_report;
+
+typedef struct {
+ // Prefix of MD5 hash of |frame_inf.frame_content|. If frame
+ // content is not provided, prefix of MD5 hash over the same data
+ // that would be in frame_content, if frame content were provided.
+ char md5_prefix[MD5_PREFIX_LEN];
+ wifi_rx_packet_fate fate;
+ frame_info frame_inf;
+} wifi_rx_report;
+
+/**
+ API to start packet fate monitoring.
+ - Once stared, monitoring should remain active until HAL is unloaded.
+ - When HAL is unloaded, all packet fate buffers should be cleared.
+*/
+wifi_error wifi_start_pkt_fate_monitoring(wifi_interface_handle handle);
+
+/**
+ API to retrieve fates of outbound packets.
+ - HAL implementation should fill |tx_report_bufs| with fates of
+ _first_ min(n_requested_fates, actual packets) frames
+ transmitted for the most recent association. The fate reports
+ should follow the same order as their respective packets.
+ - HAL implementation may choose (but is not required) to include
+ reports for management frames.
+ - Packets reported by firmware, but not recognized by driver,
+ should be included. However, the ordering of the corresponding
+ reports is at the discretion of HAL implementation.
+ - Framework may call this API multiple times for the same association.
+ - Framework will ensure |n_requested_fates <= MAX_FATE_LOG_LEN|.
+ - Framework will allocate and free the referenced storage.
+*/
+wifi_error wifi_get_tx_pkt_fates(wifi_interface_handle handle,
+ wifi_tx_report *tx_report_bufs,
+ size_t n_requested_fates,
+ size_t *n_provided_fates);
+
+/**
+ API to retrieve fates of inbound packets.
+ - HAL implementation should fill |rx_report_bufs| with fates of
+ _first_ min(n_requested_fates, actual packets) frames
+ received for the most recent association. The fate reports
+ should follow the same order as their respective packets.
+ - HAL implementation may choose (but is not required) to include
+ reports for management frames.
+ - Packets reported by firmware, but not recognized by driver,
+ should be included. However, the ordering of the corresponding
+ reports is at the discretion of HAL implementation.
+ - Framework may call this API multiple times for the same association.
+ - Framework will ensure |n_requested_fates <= MAX_FATE_LOG_LEN|.
+ - Framework will allocate and free the referenced storage.
+*/
+wifi_error wifi_get_rx_pkt_fates(wifi_interface_handle handle,
+ wifi_rx_report *rx_report_bufs,
+ size_t n_requested_fates,
+ size_t *n_provided_fates);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /*__WIFI_HAL_STATS_ */
diff --git a/wifi/legacy_headers/include/hardware_legacy/wifi_nan.h b/wifi/legacy_headers/include/hardware_legacy/wifi_nan.h
new file mode 100644
index 0000000..55034d1
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/wifi_nan.h
@@ -0,0 +1,3500 @@
+/*
+ * Copyright (C) 2016 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 __NAN_H__
+#define __NAN_H__
+
+#include <net/if.h>
+#include <stdbool.h>
+#include "wifi_hal.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*****************************************************************************
+ * Neighbour Aware Network Service Structures and Functions
+ *****************************************************************************/
+
+/*
+ Definitions
+ All multi-byte fields within all NAN protocol stack messages are assumed to be in Little Endian order.
+*/
+
+typedef int NanVersion;
+typedef u16 transaction_id;
+typedef u32 NanDataPathId;
+
+#define NAN_MAC_ADDR_LEN 6
+#define NAN_MAJOR_VERSION 4
+#define NAN_MINOR_VERSION 0
+#define NAN_MICRO_VERSION 0
+#define NAN_MAX_SOCIAL_CHANNELS 3
+
+/* NAN Maximum Lengths */
+#define NAN_MAX_SERVICE_NAME_LEN 255
+#define NAN_MAX_MATCH_FILTER_LEN 255
+#define NAN_MAX_SERVICE_SPECIFIC_INFO_LEN 1024
+#define NAN_MAX_VSA_DATA_LEN 1024
+#define NAN_MAX_MESH_DATA_LEN 32
+#define NAN_MAX_INFRA_DATA_LEN 32
+#define NAN_MAX_CLUSTER_ATTRIBUTE_LEN 255
+#define NAN_MAX_SUBSCRIBE_MAX_ADDRESS 42
+#define NAN_MAX_FAM_CHANNELS 32
+#define NAN_MAX_POSTDISCOVERY_LEN 5
+#define NAN_MAX_FRAME_DATA_LEN 504
+#define NAN_DP_MAX_APP_INFO_LEN 512
+#define NAN_ERROR_STR_LEN 255
+#define NAN_PMK_INFO_LEN 32
+#define NAN_MAX_SCID_BUF_LEN 1024
+#define NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN 2048
+#define NAN_SECURITY_MIN_PASSPHRASE_LEN 8
+#define NAN_SECURITY_MAX_PASSPHRASE_LEN 63
+#define NAN_MAX_CHANNEL_INFO_SUPPORTED 4
+#define NAN_IDENTITY_KEY_LEN 16
+#define NAN_IDENTITY_TAG_LEN 8
+#define NAN_IDENTITY_NONCE_LEN 8
+#define NAN_MAX_MATCH_IDENTITY_LEN 1024
+/*
+ Definition of various NanResponseType
+*/
+typedef enum {
+ NAN_RESPONSE_ENABLED = 0,
+ NAN_RESPONSE_DISABLED = 1,
+ NAN_RESPONSE_PUBLISH = 2,
+ NAN_RESPONSE_PUBLISH_CANCEL = 3,
+ NAN_RESPONSE_TRANSMIT_FOLLOWUP = 4,
+ NAN_RESPONSE_SUBSCRIBE = 5,
+ NAN_RESPONSE_SUBSCRIBE_CANCEL = 6,
+ NAN_RESPONSE_STATS = 7,
+ NAN_RESPONSE_CONFIG = 8,
+ NAN_RESPONSE_TCA = 9,
+ NAN_RESPONSE_ERROR = 10,
+ NAN_RESPONSE_BEACON_SDF_PAYLOAD = 11,
+ NAN_GET_CAPABILITIES = 12,
+ NAN_DP_INTERFACE_CREATE = 13,
+ NAN_DP_INTERFACE_DELETE = 14,
+ NAN_DP_INITIATOR_RESPONSE = 15,
+ NAN_DP_RESPONDER_RESPONSE = 16,
+ NAN_DP_END = 17,
+ NAN_PAIRING_INITIATOR_RESPONSE = 18,
+ NAN_PAIRING_RESPONDER_RESPONSE = 19,
+ NAN_BOOTSTRAPPING_INITIATOR_RESPONSE = 20,
+ NAN_BOOTSTRAPPING_RESPONDER_RESPONSE = 21,
+ NAN_PAIRING_END = 22,
+ NAN_SUSPEND_REQUEST_RESPONSE = 23,
+ NAN_RESUME_REQUEST_RESPONSE = 24
+} NanResponseType;
+
+/* NAN Publish Types */
+typedef enum {
+ NAN_PUBLISH_TYPE_UNSOLICITED = 0,
+ NAN_PUBLISH_TYPE_SOLICITED,
+ NAN_PUBLISH_TYPE_UNSOLICITED_SOLICITED
+} NanPublishType;
+
+/* NAN Transmit Priorities */
+typedef enum {
+ NAN_TX_PRIORITY_NORMAL = 0,
+ NAN_TX_PRIORITY_HIGH
+} NanTxPriority;
+
+/* NAN Statistics Request ID Codes */
+typedef enum {
+ NAN_STATS_ID_DE_PUBLISH = 0,
+ NAN_STATS_ID_DE_SUBSCRIBE,
+ NAN_STATS_ID_DE_MAC,
+ NAN_STATS_ID_DE_TIMING_SYNC,
+ NAN_STATS_ID_DE_DW,
+ NAN_STATS_ID_DE
+} NanStatsType;
+
+/* NAN Protocol Event ID Codes */
+typedef enum {
+ NAN_EVENT_ID_DISC_MAC_ADDR = 0,
+ NAN_EVENT_ID_STARTED_CLUSTER,
+ NAN_EVENT_ID_JOINED_CLUSTER
+} NanDiscEngEventType;
+
+/* NAN Data Path type */
+typedef enum {
+ NAN_DATA_PATH_UNICAST_MSG = 0,
+ NAN_DATA_PATH_MULTICAST_MSG
+} NdpType;
+
+/* NAN Ranging Configuration */
+typedef enum {
+ NAN_RANGING_DISABLE = 0,
+ NAN_RANGING_ENABLE
+} NanRangingState;
+
+/* TCA Type */
+typedef enum {
+ NAN_TCA_ID_CLUSTER_SIZE = 0
+} NanTcaType;
+
+/* pairing request type*/
+typedef enum {
+ NAN_PAIRING_SETUP = 0,
+ NAN_PAIRING_VERIFICATION = 1
+} NanPairingRequestType;
+
+/* Nan AKM type */
+typedef enum {
+ SAE = 0,
+ PASN = 1
+} NanAkm;
+
+/* NAN Channel Info */
+typedef struct {
+ u32 channel;
+ u32 bandwidth;
+ u32 nss;
+} NanChannelInfo;
+
+/*
+ Various NAN Protocol Response code
+*/
+typedef enum {
+ /* NAN Protocol Response Codes */
+ NAN_STATUS_SUCCESS = 0,
+ /* NAN Discovery Engine/Host driver failures */
+ NAN_STATUS_INTERNAL_FAILURE = 1,
+ /* NAN OTA failures */
+ NAN_STATUS_PROTOCOL_FAILURE = 2,
+ /* if the publish/subscribe id is invalid */
+ NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID = 3,
+ /* If we run out of resources allocated */
+ NAN_STATUS_NO_RESOURCE_AVAILABLE = 4,
+ /* if invalid params are passed */
+ NAN_STATUS_INVALID_PARAM = 5,
+ /* if the requestor instance id is invalid */
+ NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID = 6,
+ /* if the ndp id is invalid */
+ NAN_STATUS_INVALID_NDP_ID = 7,
+ /* if NAN is enabled when wifi is turned off */
+ NAN_STATUS_NAN_NOT_ALLOWED = 8,
+ /* if over the air ack is not received */
+ NAN_STATUS_NO_OTA_ACK = 9,
+ /* If NAN is already enabled and we are try to re-enable the same */
+ NAN_STATUS_ALREADY_ENABLED = 10,
+ /* If followup message internal queue is full */
+ NAN_STATUS_FOLLOWUP_QUEUE_FULL = 11,
+ /* Unsupported concurrency session enabled, NAN disabled notified */
+ NAN_STATUS_UNSUPPORTED_CONCURRENCY_NAN_DISABLED = 12,
+ /* if the pairing id is invalid */
+ NAN_STATUS_INVALID_PAIRING_ID = 13,
+ /* if the bootstrapping id is invalid */
+ NAN_STATUS_INVALID_BOOTSTRAPPING_ID = 14,
+ /* If same request is received again */
+ NAN_STATUS_REDUNDANT_REQUEST = 15,
+ /* If current request is not supported */
+ NAN_STATUS_NOT_SUPPORTED = 16,
+ /* If no Wifi Aware connection is active */
+ NAN_STATUS_NO_CONNECTION = 17,
+} NanStatusType;
+
+/* NAN Transmit Types */
+typedef enum {
+ NAN_TX_TYPE_BROADCAST = 0,
+ NAN_TX_TYPE_UNICAST
+} NanTxType;
+
+/* NAN Subscribe Type */
+typedef enum {
+ NAN_SUBSCRIBE_TYPE_PASSIVE = 0,
+ NAN_SUBSCRIBE_TYPE_ACTIVE
+} NanSubscribeType;
+
+/* NAN Service Response Filter Attribute Bit */
+typedef enum {
+ NAN_SRF_ATTR_BLOOM_FILTER = 0,
+ NAN_SRF_ATTR_PARTIAL_MAC_ADDR
+} NanSRFType;
+
+/* NAN Service Response Filter Include Bit */
+typedef enum {
+ NAN_SRF_INCLUDE_DO_NOT_RESPOND = 0,
+ NAN_SRF_INCLUDE_RESPOND
+} NanSRFIncludeType;
+
+/* NAN Match indication type */
+typedef enum {
+ NAN_MATCH_ALG_MATCH_ONCE = 0,
+ NAN_MATCH_ALG_MATCH_CONTINUOUS,
+ NAN_MATCH_ALG_MATCH_NEVER
+} NanMatchAlg;
+
+/* NAN Transmit Window Type */
+typedef enum {
+ NAN_TRANSMIT_IN_DW = 0,
+ NAN_TRANSMIT_IN_FAW
+} NanTransmitWindowType;
+
+/* NAN SRF State in Subscribe */
+typedef enum {
+ NAN_DO_NOT_USE_SRF = 0,
+ NAN_USE_SRF
+} NanSRFState;
+
+/* NAN Include SSI in MatchInd */
+typedef enum {
+ NAN_SSI_NOT_REQUIRED_IN_MATCH_IND = 0,
+ NAN_SSI_REQUIRED_IN_MATCH_IND
+} NanSsiInMatchInd;
+
+/* NAN DP security Configuration */
+typedef enum {
+ NAN_DP_CONFIG_NO_SECURITY = 0,
+ NAN_DP_CONFIG_SECURITY
+} NanDataPathSecurityCfgStatus;
+
+typedef enum {
+ NAN_QOS_NOT_REQUIRED = 0,
+ NAN_QOS_REQUIRED
+} NanQosCfgStatus;
+
+
+/* Data request Responder's response */
+typedef enum {
+ NAN_DP_REQUEST_ACCEPT = 0,
+ NAN_DP_REQUEST_REJECT
+} NanDataPathResponseCode;
+
+/* Pairing request Responder's response */
+typedef enum {
+ NAN_PAIRING_REQUEST_ACCEPT = 0,
+ NAN_PAIRING_REQUEST_REJECT
+} NanPairingResponseCode;
+
+/* Pairing bootstrapping Responder's response */
+typedef enum {
+ NAN_BOOTSTRAPPING_REQUEST_ACCEPT = 0,
+ NAN_BOOTSTRAPPING_REQUEST_REJECT = 1,
+ NAN_BOOTSTRAPPING_REQUEST_COMEBACK = 2
+} NanBootstrappingResponseCode;
+
+/* NAN DP channel config options */
+typedef enum {
+ NAN_DP_CHANNEL_NOT_REQUESTED = 0,
+ NAN_DP_REQUEST_CHANNEL_SETUP,
+ NAN_DP_FORCE_CHANNEL_SETUP
+} NanDataPathChannelCfg;
+
+/* Enable/Disable NAN Ranging Auto response */
+typedef enum {
+ NAN_RANGING_AUTO_RESPONSE_ENABLE = 1,
+ NAN_RANGING_AUTO_RESPONSE_DISABLE
+} NanRangingAutoResponse;
+
+/* Enable/Disable NAN service range report */
+typedef enum {
+ NAN_DISABLE_RANGE_REPORT = 1,
+ NAN_ENABLE_RANGE_REPORT
+} NanRangeReport;
+
+/* NAN Range Response */
+typedef enum {
+ NAN_RANGE_REQUEST_ACCEPT = 1,
+ NAN_RANGE_REQUEST_REJECT,
+ NAN_RANGE_REQUEST_CANCEL
+} NanRangeResponse;
+
+/* NAN Security Key Input Type*/
+typedef enum {
+ NAN_SECURITY_KEY_INPUT_PMK = 1,
+ NAN_SECURITY_KEY_INPUT_PASSPHRASE
+} NanSecurityKeyInputType;
+
+typedef struct {
+ /* pmk length */
+ u32 pmk_len;
+ /*
+ PMK: Info is optional in Discovery phase.
+ PMK info can be passed during
+ the NDP session.
+ */
+ u8 pmk[NAN_PMK_INFO_LEN];
+} NanSecurityPmk;
+
+typedef struct {
+ /* passphrase length */
+ u32 passphrase_len;
+ /*
+ passphrase info is optional in Discovery phase.
+ passphrase info can be passed during
+ the NDP session.
+ */
+ u8 passphrase[NAN_SECURITY_MAX_PASSPHRASE_LEN];
+} NanSecurityPassPhrase;
+
+typedef struct {
+ NanSecurityKeyInputType key_type;
+ union {
+ NanSecurityPmk pmk_info;
+ NanSecurityPassPhrase passphrase_info;
+ } body;
+} NanSecurityKeyInfo;
+
+/* NAN Security Cipher Suites Mask */
+#define NAN_CIPHER_SUITE_SHARED_KEY_NONE 0x00
+#define NAN_CIPHER_SUITE_SHARED_KEY_128_MASK 0x01
+#define NAN_CIPHER_SUITE_SHARED_KEY_256_MASK 0x02
+#define NAN_CIPHER_SUITE_PUBLIC_KEY_2WDH_128_MASK 0x04
+#define NAN_CIPHER_SUITE_PUBLIC_KEY_2WDH_256_MASK 0x08
+#define NAN_CIPHER_SUITE_PUBLIC_KEY_PASN_128_MASK 0x40
+#define NAN_CIPHER_SUITE_PUBLIC_KEY_PASN_256_MASK 0x80
+
+/* NAN ranging indication condition MASKS */
+#define NAN_RANGING_INDICATE_CONTINUOUS_MASK 0x01
+#define NAN_RANGING_INDICATE_INGRESS_MET_MASK 0x02
+#define NAN_RANGING_INDICATE_EGRESS_MET_MASK 0x04
+
+/* NAN schedule update reason MASKS */
+#define NAN_SCHEDULE_UPDATE_NSS_MASK 0x01
+#define NAN_SCHEDULE_UPDATE_CHANNEL_MASK 0x02
+
+/* NAN pairing bootstrapping method */
+#define NAN_PAIRING_BOOTSTRAPPING_OPPORTUNISTIC_MASK 0x01
+#define NAN_PAIRING_BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK 0x02
+#define NAN_PAIRING_BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK 0x04
+#define NAN_PAIRING_BOOTSTRAPPING_QR_DISPLAY_MASK 0x08
+#define NAN_PAIRING_BOOTSTRAPPING_NFC_TAG_MASK 0x10
+#define NAN_PAIRING_BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK 0x20
+#define NAN_PAIRING_BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK 0x40
+#define NAN_PAIRING_BOOTSTRAPPING_QR_SCAN_MASK 0x80
+#define NAN_PAIRING_BOOTSTRAPPING_NFC_READER_MASK 0x100
+#define NAN_PAIRING_BOOTSTRAPPING_SERVICE_MANAGED_MASK 0x4000
+#define NAN_PAIRING_BOOTSTRAPPING_HANDSHAKE_SHIP_MASK 0x8000
+
+/*
+ Structure to set the Service Descriptor Extension
+ Attribute (SDEA) passed as part of NanPublishRequest/
+ NanSubscribeRequest/NanMatchInd.
+*/
+typedef struct {
+ /*
+ Optional configuration of Data Path Enable request.
+ configure flag determines whether configuration needs
+ to be passed or not.
+ */
+ u8 config_nan_data_path;
+ NdpType ndp_type;
+ /*
+ NAN secuirty required flag to indicate
+ if the security is enabled or disabled
+ */
+ NanDataPathSecurityCfgStatus security_cfg;
+ /*
+ NAN ranging required flag to indicate
+ if ranging is enabled on disabled
+ */
+ NanRangingState ranging_state;
+ /*
+ Enable/Disable Ranging report,
+ when configured NanRangeReportInd received
+ */
+ NanRangeReport range_report;
+ /*
+ NAN QOS required flag to indicate
+ if QOS is required or not.
+ */
+ NanQosCfgStatus qos_cfg;
+ /*
+ Config to set FSD with Gas bit
+ in the SDEA Control Field.
+ */
+ u8 config_fsd_gas;
+ u8 enable_fsd_gas;
+
+ /*
+ Config to set FSD Required bit
+ in the SDEA Control Field.
+ */
+ u8 config_fsd_req;
+ u8 enable_fsd_req;
+
+ /*
+ Config to set gtk protection bit
+ in the SDEA Control Field.
+ */
+ u8 gtk_protection;
+} NanSdeaCtrlParams;
+
+/*
+ Nan Ranging Peer Info in MatchInd
+*/
+typedef struct {
+ /*
+ Distance to the NAN device with the MAC address indicated
+ with ranged mac address.
+ */
+ u32 range_measurement_mm;
+ /* Ranging event matching the configuration of continuous/ingress/egress. */
+ u32 ranging_event_type;
+} NanRangeInfo;
+
+/* Nan/NDP Capabilites info */
+typedef struct {
+ u32 max_concurrent_nan_clusters;
+ u32 max_publishes;
+ u32 max_subscribes;
+ u32 max_service_name_len;
+ u32 max_match_filter_len;
+ u32 max_total_match_filter_len;
+ u32 max_service_specific_info_len;
+ u32 max_vsa_data_len;
+ u32 max_mesh_data_len;
+ u32 max_ndi_interfaces;
+ u32 max_ndp_sessions;
+ u32 max_app_info_len;
+ u32 max_queued_transmit_followup_msgs;
+ u32 ndp_supported_bands;
+ u32 cipher_suites_supported;
+ u32 max_scid_len;
+ bool is_ndp_security_supported;
+ u32 max_sdea_service_specific_info_len;
+ u32 max_subscribe_address;
+ u32 ndpe_attr_supported;
+ bool is_instant_mode_supported;
+ bool is_6g_supported;
+ bool is_he_supported;
+ bool is_pairing_supported;
+ bool is_set_cluster_id_supported;
+ bool is_suspension_supported;
+} NanCapabilities;
+
+/*
+ Nan accept policy: Per service basis policy
+ Based on this policy(ALL/NONE), responder side
+ will send ACCEPT/REJECT
+*/
+typedef enum {
+ NAN_SERVICE_ACCEPT_POLICY_NONE = 0,
+ /* Default value */
+ NAN_SERVICE_ACCEPT_POLICY_ALL
+} NanServiceAcceptPolicy;
+
+/*
+ Host can send Vendor specific attributes which the Discovery Engine can
+ enclose in Beacons and/or Service Discovery frames transmitted.
+ Below structure is used to populate that.
+*/
+typedef struct {
+ /*
+ 0 = transmit only in the next discovery window
+ 1 = transmit in next 16 discovery window
+ */
+ u8 payload_transmit_flag;
+ /*
+ Below flags will determine in which all frames
+ the vendor specific attributes should be included
+ */
+ u8 tx_in_discovery_beacon;
+ u8 tx_in_sync_beacon;
+ u8 tx_in_service_discovery;
+ /* Organizationally Unique Identifier */
+ u32 vendor_oui;
+ /*
+ vendor specific attribute to be transmitted
+ vsa_len : Length of the vsa data.
+ */
+ u32 vsa_len;
+ u8 vsa[NAN_MAX_VSA_DATA_LEN];
+} NanTransmitVendorSpecificAttribute;
+
+
+/*
+ Discovery Engine will forward any Vendor Specific Attributes
+ which it received as part of this structure.
+*/
+/* Mask to determine on which frames attribute was received */
+#define RX_DISCOVERY_BEACON_MASK 0x01
+#define RX_SYNC_BEACON_MASK 0x02
+#define RX_SERVICE_DISCOVERY_MASK 0x04
+typedef struct {
+ /*
+ Frames on which this vendor specific attribute
+ was received. Mask defined above
+ */
+ u8 vsa_received_on;
+ /* Organizationally Unique Identifier */
+ u32 vendor_oui;
+ /* vendor specific attribute */
+ u32 attr_len;
+ u8 vsa[NAN_MAX_VSA_DATA_LEN];
+} NanReceiveVendorSpecificAttribute;
+
+/*
+ NAN Beacon SDF Payload Received structure
+ Discovery engine sends the details of received Beacon or
+ Service Discovery Frames as part of this structure.
+*/
+typedef struct {
+ /* Frame data */
+ u32 frame_len;
+ u8 frame_data[NAN_MAX_FRAME_DATA_LEN];
+} NanBeaconSdfPayloadReceive;
+
+/*
+ Host can set the Periodic scan parameters for each of the
+ 3(6, 44, 149) Social channels. Only these channels are allowed
+ any other channels are rejected
+*/
+typedef enum {
+ NAN_CHANNEL_24G_BAND = 0,
+ NAN_CHANNEL_5G_BAND_LOW,
+ NAN_CHANNEL_5G_BAND_HIGH
+} NanChannelIndex;
+
+/*
+ Structure to set the Social Channel Scan parameters
+ passed as part of NanEnableRequest/NanConfigRequest
+*/
+typedef struct {
+ /*
+ Dwell time of each social channel in milliseconds
+ NanChannelIndex corresponds to the respective channel
+ If time set to 0 then the FW default time will be used.
+ */
+ u8 dwell_time[NAN_MAX_SOCIAL_CHANNELS]; // default value 200 msec
+
+ /*
+ Scan period of each social channel in seconds
+ NanChannelIndex corresponds to the respective channel
+ If time set to 0 then the FW default time will be used.
+ */
+ u16 scan_period[NAN_MAX_SOCIAL_CHANNELS]; // default value 20 sec
+} NanSocialChannelScanParams;
+
+/*
+ Host can send Post Connectivity Capability attributes
+ to be included in Service Discovery frames transmitted
+ as part of this structure.
+*/
+typedef struct {
+ /*
+ 0 = transmit only in the next discovery window
+ 1 = transmit in next 16 discovery window
+ */
+ u8 payload_transmit_flag;
+ /* 1 - Wifi Direct supported 0 - Not supported */
+ u8 is_wfd_supported;
+ /* 1 - Wifi Direct Services supported 0 - Not supported */
+ u8 is_wfds_supported;
+ /* 1 - TDLS supported 0 - Not supported */
+ u8 is_tdls_supported;
+ /* 1 - IBSS supported 0 - Not supported */
+ u8 is_ibss_supported;
+ /* 1 - Mesh supported 0 - Not supported */
+ u8 is_mesh_supported;
+ /*
+ 1 - NAN Device currently connect to WLAN Infra AP
+ 0 - otherwise
+ */
+ u8 wlan_infra_field;
+} NanTransmitPostConnectivityCapability;
+
+/*
+ Discovery engine providing the post connectivity capability
+ received.
+*/
+typedef struct {
+ /* 1 - Wifi Direct supported 0 - Not supported */
+ u8 is_wfd_supported;
+ /* 1 - Wifi Direct Services supported 0 - Not supported */
+ u8 is_wfds_supported;
+ /* 1 - TDLS supported 0 - Not supported */
+ u8 is_tdls_supported;
+ /* 1 - IBSS supported 0 - Not supported */
+ u8 is_ibss_supported;
+ /* 1 - Mesh supported 0 - Not supported */
+ u8 is_mesh_supported;
+ /*
+ 1 - NAN Device currently connect to WLAN Infra AP
+ 0 - otherwise
+ */
+ u8 wlan_infra_field;
+} NanReceivePostConnectivityCapability;
+
+/*
+ Indicates the availability interval duration associated with the
+ Availability Intervals Bitmap field
+*/
+typedef enum {
+ NAN_DURATION_16MS = 0,
+ NAN_DURATION_32MS = 1,
+ NAN_DURATION_64MS = 2
+} NanAvailDuration;
+
+/* Further availability per channel information */
+typedef struct {
+ /* Defined above */
+ NanAvailDuration entry_control;
+ /*
+ 1 byte field indicating the frequency band the NAN Device
+ will be available as defined in IEEE Std. 802.11-2012
+ Annex E Table E-4 Global Operating Classes
+ */
+ u8 class_val;
+ /*
+ 1 byte field indicating the channel the NAN Device
+ will be available.
+ */
+ u8 channel;
+ /*
+ Map Id - 4 bit field which identifies the Further
+ availability map attribute.
+ */
+ u8 mapid;
+ /*
+ divides the time between the beginnings of consecutive Discovery
+ Windows of a given NAN cluster into consecutive time intervals
+ of equal durations. The time interval duration is specified by
+ the Availability Interval Duration subfield of the Entry Control
+ field.
+
+ A Nan device that sets the i-th bit of the Availability
+ Intervals Bitmap to 1 shall be present during the corresponding
+ i-th time interval in the operation channel indicated by the
+ Operating Class and Channel Number fields in the same Availability Entry.
+
+ A Nan device that sets the i-th bit of the Availability Intervals Bitmap to
+ 0 may be present during the corresponding i-th time interval in the operation
+ channel indicated by the Operating Class and Channel Number fields in the same
+ Availability Entry.
+
+ The size of the Bitmap is dependent upon the Availability Interval Duration
+ chosen in the Entry Control Field. The size can be either 1, 2 or 4 bytes long
+
+ - Duration field is equal to 0, only AIB[0] is valid
+ - Duration field is equal to 1, only AIB [0] and AIB [1] is valid
+ - Duration field is equal to 2, AIB [0], AIB [1], AIB [2] and AIB [3] are valid
+ */
+ u32 avail_interval_bitmap;
+} NanFurtherAvailabilityChannel;
+
+/*
+ Further availability map which can be sent and received from
+ Discovery engine
+*/
+typedef struct {
+ /*
+ Number of channels indicates the number of channel
+ entries which is part of fam
+ */
+ u8 numchans;
+ NanFurtherAvailabilityChannel famchan[NAN_MAX_FAM_CHANNELS];
+} NanFurtherAvailabilityMap;
+
+/*
+ Host can send Post-Nan Discovery attributes which the Discovery Engine can
+ enclose in Service Discovery frames
+*/
+/* Possible connection types in Post NAN Discovery attributes */
+typedef enum {
+ NAN_CONN_WLAN_INFRA = 0,
+ NAN_CONN_P2P_OPER = 1,
+ NAN_CONN_WLAN_IBSS = 2,
+ NAN_CONN_WLAN_MESH = 3,
+ NAN_CONN_FURTHER_SERVICE_AVAILABILITY = 4,
+ NAN_CONN_WLAN_RANGING = 5
+} NanConnectionType;
+
+/* Possible device roles in Post NAN Discovery attributes */
+typedef enum {
+ NAN_WLAN_INFRA_AP = 0,
+ NAN_WLAN_INFRA_STA = 1,
+ NAN_P2P_OPER_GO = 2,
+ NAN_P2P_OPER_DEV = 3,
+ NAN_P2P_OPER_CLI = 4
+} NanDeviceRole;
+
+/* Configuration params of NAN Ranging */
+typedef struct {
+ /*
+ Interval in milli sec between two ranging measurements.
+ If the Awake DW intervals in NanEnable/Config are larger
+ than the ranging intervals priority is given to Awake DW
+ Intervals. Only on a match the ranging is initiated for the
+ peer
+ */
+ u32 ranging_interval_msec;
+ /*
+ Flags indicating the type of ranging event to be notified
+ NAN_RANGING_INDICATE_ MASKS are used to set these.
+ BIT0 - Continuous Ranging event notification.
+ BIT1 - Ingress distance is <=.
+ BIT2 - Egress distance is >=.
+ */
+ u32 config_ranging_indications;
+ /* Ingress distance in millimeters (optional) */
+ u32 distance_ingress_mm;
+ /* Egress distance in millmilliimeters (optional) */
+ u32 distance_egress_mm;
+} NanRangingCfg;
+
+/* NAN Ranging request's response */
+typedef struct {
+ /* Publish Id of an earlier Publisher */
+ u16 publish_id;
+ /*
+ A 32 bit Requestor instance Id which is sent to the Application.
+ This Id will be used in subsequent RangeResponse on Subscribe side.
+ */
+ u32 requestor_instance_id;
+ /* Peer MAC addr of Range Requestor */
+ u8 peer_addr[NAN_MAC_ADDR_LEN];
+ /* Response indicating ACCEPT/REJECT/CANCEL of Range Request */
+ NanRangeResponse ranging_response;
+} NanRangeResponseCfg;
+
+/* Structure of Post NAN Discovery attribute */
+typedef struct {
+ /* Connection type of the host */
+ NanConnectionType type;
+ /*
+ Device role of the host based on
+ the connection type
+ */
+ NanDeviceRole role;
+ /*
+ Flag to send the information as a single shot or repeated
+ for next 16 discovery windows
+ 0 - Single_shot
+ 1 - next 16 discovery windows
+ */
+ u8 transmit_freq;
+ /* Duration of the availability bitmask */
+ NanAvailDuration duration;
+ /* Availability interval bitmap based on duration */
+ u32 avail_interval_bitmap;
+ /*
+ Mac address depending on the conn type and device role
+ --------------------------------------------------
+ | Conn Type | Device Role | Mac address Usage |
+ --------------------------------------------------
+ | WLAN_INFRA | AP/STA | BSSID of the AP |
+ --------------------------------------------------
+ | P2P_OPER | GO | GO's address |
+ --------------------------------------------------
+ | P2P_OPER | P2P_DEVICE | Address of who |
+ | | | would become GO |
+ --------------------------------------------------
+ | WLAN_IBSS | NA | BSSID |
+ --------------------------------------------------
+ | WLAN_MESH | NA | BSSID |
+ --------------------------------------------------
+ */
+ u8 addr[NAN_MAC_ADDR_LEN];
+ /*
+ Mandatory mesh id value if connection type is WLAN_MESH
+ Mesh id contains 0-32 octet identifier and should be
+ as per IEEE Std.802.11-2012 spec.
+ */
+ u16 mesh_id_len;
+ u8 mesh_id[NAN_MAX_MESH_DATA_LEN];
+ /*
+ Optional infrastructure SSID if conn_type is set to
+ NAN_CONN_WLAN_INFRA
+ */
+ u16 infrastructure_ssid_len;
+ u8 infrastructure_ssid_val[NAN_MAX_INFRA_DATA_LEN];
+} NanTransmitPostDiscovery;
+
+/*
+ Discovery engine providing the structure of Post NAN
+ Discovery
+*/
+typedef struct {
+ /* Connection type of the host */
+ NanConnectionType type;
+ /*
+ Device role of the host based on
+ the connection type
+ */
+ NanDeviceRole role;
+ /* Duration of the availability bitmask */
+ NanAvailDuration duration;
+ /* Availability interval bitmap based on duration */
+ u32 avail_interval_bitmap;
+ /*
+ Map Id - 4 bit field which identifies the Further
+ availability map attribute.
+ */
+ u8 mapid;
+ /*
+ Mac address depending on the conn type and device role
+ --------------------------------------------------
+ | Conn Type | Device Role | Mac address Usage |
+ --------------------------------------------------
+ | WLAN_INFRA | AP/STA | BSSID of the AP |
+ --------------------------------------------------
+ | P2P_OPER | GO | GO's address |
+ --------------------------------------------------
+ | P2P_OPER | P2P_DEVICE | Address of who |
+ | | | would become GO |
+ --------------------------------------------------
+ | WLAN_IBSS | NA | BSSID |
+ --------------------------------------------------
+ | WLAN_MESH | NA | BSSID |
+ --------------------------------------------------
+ */
+ u8 addr[NAN_MAC_ADDR_LEN];
+ /*
+ Mandatory mesh id value if connection type is WLAN_MESH
+ Mesh id contains 0-32 octet identifier and should be
+ as per IEEE Std.802.11-2012 spec.
+ */
+ u16 mesh_id_len;
+ u8 mesh_id[NAN_MAX_MESH_DATA_LEN];
+ /*
+ Optional infrastructure SSID if conn_type is set to
+ NAN_CONN_WLAN_INFRA
+ */
+ u16 infrastructure_ssid_len;
+ u8 infrastructure_ssid_val[NAN_MAX_INFRA_DATA_LEN];
+} NanReceivePostDiscovery;
+
+/*
+ NAN device level configuration of SDF and Sync beacons in both
+ 2.4/5GHz bands
+*/
+typedef struct {
+ /* Configure 2.4GHz DW Band */
+ u8 config_2dot4g_dw_band;
+ /*
+ Indicates the interval for Sync beacons and SDF's in 2.4GHz band.
+ Valid values of DW Interval are: 1, 2, 3, 4 and 5, 0 is reserved.
+ The SDF includes in OTA when enabled. The publish/subscribe period
+ values don't override the device level configurations.
+ */
+ u32 dw_2dot4g_interval_val; // default value 1
+ /* Configure 5GHz DW Band */
+ u8 config_5g_dw_band;
+ /*
+ Indicates the interval for Sync beacons and SDF's in 5GHz band
+ Valid values of DW Interval are: 1, 2, 3, 4 and 5, 0 no wake up for
+ any interval. The SDF includes in OTA when enabled. The publish/subscribe
+ period values don't override the device level configurations.
+ */
+ u32 dw_5g_interval_val; // default value 1 when 5G is enabled
+} NanConfigDW;
+
+/*
+ Enable Request Message Structure
+ The NanEnableReq message instructs the Discovery Engine to enter an operational state
+*/
+typedef struct {
+ /* Mandatory parameters below */
+ u8 master_pref; // default value 0x02
+ /*
+ A cluster_low value matching cluster_high indicates a request to join
+ a cluster with that value. If the requested cluster is not found the
+ device will start its own cluster.
+ */
+ u16 cluster_low; // default value 0
+ u16 cluster_high; // default value 0xFFFF
+
+ /*
+ Optional configuration of Enable request.
+ Each of the optional parameters have configure flag which
+ determine whether configuration is to be passed or not.
+ */
+ u8 config_support_5g;
+ u8 support_5g_val; // default value 0; turned off by default
+ /*
+ BIT 0 is used to specify to include Service IDs in Sync/Discovery beacons
+ 0 - Do not include SIDs in any beacons
+ 1 - Include SIDs in all beacons.
+ Rest 7 bits are count field which allows control over the number of SIDs
+ included in the Beacon. 0 means to include as many SIDs that fit into
+ the maximum allow Beacon frame size
+ */
+ u8 config_sid_beacon;
+ u8 sid_beacon_val; // default value 0x01
+ /*
+ The rssi values below should be specified without sign.
+ For eg: -70dBm should be specified as 70.
+ */
+ u8 config_2dot4g_rssi_close;
+ u8 rssi_close_2dot4g_val; // default value -60 dBm
+
+ u8 config_2dot4g_rssi_middle;
+ u8 rssi_middle_2dot4g_val; // default value -70 dBm
+
+ u8 config_2dot4g_rssi_proximity;
+ u8 rssi_proximity_2dot4g_val;// default value -60dBm
+
+ u8 config_hop_count_limit;
+ u8 hop_count_limit_val; // default value 0x02
+
+ /*
+ Defines 2.4G channel access support
+ 0 - No Support
+ 1 - Supported
+ */
+ u8 config_2dot4g_support;
+ u8 support_2dot4g_val; // default value 0x01
+ /*
+ Defines 2.4G channels will be used for sync/discovery beacons
+ 0 - 2.4G channels not used for beacons
+ 1 - 2.4G channels used for beacons
+ */
+ u8 config_2dot4g_beacons;
+ u8 beacon_2dot4g_val; // default value 1
+ /*
+ Defines 2.4G channels will be used for Service Discovery frames
+ 0 - 2.4G channels not used for Service Discovery frames
+ 1 - 2.4G channels used for Service Discovery frames
+ */
+ u8 config_2dot4g_sdf;
+ u8 sdf_2dot4g_val; // default value 1
+ /*
+ Defines 5G channels will be used for sync/discovery beacons
+ 0 - 5G channels not used for beacons
+ 1 - 5G channels used for beacons
+ */
+ u8 config_5g_beacons;
+ u8 beacon_5g_val; // default value 1 when 5G is enabled
+ /*
+ Defines 5G channels will be used for Service Discovery frames
+ 0 - 5G channels not used for Service Discovery frames
+ 1 - 5G channels used for Service Discovery frames
+ */
+ u8 config_5g_sdf;
+ u8 sdf_5g_val; // default value is 0 when 5G is enabled
+ /*
+ 1 byte value which defines the RSSI in
+ dBm for a close by Peer in 5 Ghz channels.
+ The rssi values should be specified without sign.
+ For eg: -70dBm should be specified as 70.
+ */
+ u8 config_5g_rssi_close;
+ u8 rssi_close_5g_val; // default value -60dBm when 5G is enabled
+ /*
+ 1 byte value which defines the RSSI value in
+ dBm for a close by Peer in 5 Ghz channels.
+ The rssi values should be specified without sign.
+ For eg: -70dBm should be specified as 70.
+ */
+ u8 config_5g_rssi_middle;
+ u8 rssi_middle_5g_val; // default value -75dBm when 5G is enabled
+ /*
+ 1 byte value which defines the RSSI filter
+ threshold. Any Service Descriptors received above this
+ value that are configured for RSSI filtering will be dropped.
+ The rssi values should be specified without sign.
+ For eg: -70dBm should be specified as 70.
+ */
+ u8 config_5g_rssi_close_proximity;
+ u8 rssi_close_proximity_5g_val; // default value -60dBm when 5G is enabled
+ /*
+ 1 byte quantity which defines the window size over
+ which the “average RSSI” will be calculated over.
+ */
+ u8 config_rssi_window_size;
+ u8 rssi_window_size_val; // default value 0x08
+ /*
+ The 24 bit Organizationally Unique ID + the 8 bit Network Id.
+ */
+ u8 config_oui;
+ u32 oui_val; // default value {0x51, 0x6F, 0x9A, 0x01, 0x00, 0x00}
+ /*
+ NAN Interface Address, If not configured the Discovery Engine
+ will generate a 6 byte Random MAC.
+ */
+ u8 config_intf_addr;
+ u8 intf_addr_val[NAN_MAC_ADDR_LEN];
+ /*
+ If set to 1, the Discovery Engine will enclose the Cluster
+ Attribute only sent in Beacons in a Vendor Specific Attribute
+ and transmit in a Service Descriptor Frame.
+ */
+ u8 config_cluster_attribute_val;
+ /*
+ The periodicity in seconds between full scan’s to find any new
+ clusters available in the area. A Full scan should not be done
+ more than every 10 seconds and should not be done less than every
+ 30 seconds.
+ */
+ u8 config_scan_params;
+ NanSocialChannelScanParams scan_params_val;
+ /*
+ 1 byte quantity which forces the Random Factor to a particular
+ value for all transmitted Sync/Discovery beacons
+ */
+ u8 config_random_factor_force;
+ u8 random_factor_force_val; // default value off and set to 0x00
+ /*
+ 1 byte quantity which forces the HC for all transmitted Sync and
+ Discovery Beacon NO matter the real HC being received over the
+ air.
+ */
+ u8 config_hop_count_force;
+ u8 hop_count_force_val; // default value 0x00
+
+ /* channel frequency in MHz to enable Nan on */
+ u8 config_24g_channel;
+ wifi_channel channel_24g_val; // default value channel 0x6
+
+ u8 config_5g_channel;
+ wifi_channel channel_5g_val; // default value channel 44 or 149 regulatory
+ // domain
+ /* Configure 2.4/5GHz DW */
+ NanConfigDW config_dw;
+
+ /*
+ By default discovery MAC address randomization is enabled
+ and default interval value is 30 minutes i.e. 1800 seconds.
+ The value 0 is used to disable MAC addr randomization.
+ */
+ u8 config_disc_mac_addr_randomization;
+ u32 disc_mac_addr_rand_interval_sec; // default value 1800 sec
+
+ /*
+ Set/Enable corresponding bits to disable Discovery indications:
+ BIT0 - Disable Discovery MAC Address Event.
+ BIT1 - Disable Started Cluster Event.
+ BIT2 - Disable Joined Cluster Event.
+ */
+ u8 discovery_indication_cfg; // default value 0x0
+ /*
+ BIT 0 is used to specify to include Service IDs in Sync/Discovery beacons
+ 0 - Do not include SIDs in any beacons
+ 1 - Include SIDs in all beacons.
+ Rest 7 bits are count field which allows control over the number of SIDs
+ included in the Beacon. 0 means to include as many SIDs that fit into
+ the maximum allow Beacon frame size
+ */
+ u8 config_subscribe_sid_beacon;
+ u32 subscribe_sid_beacon_val; // default value 0x0
+ /*
+ Discovery Beacon Interval config.
+ Default value is 128 msec in 2G DW and 176 msec in 2G/5G DW.
+ When 0 value is passed it is reset to default value of 128 or 176 msec.
+ */
+ u8 config_discovery_beacon_int;
+ u32 discovery_beacon_interval;
+ /*
+ Enable Number of Spatial Streams.
+ This is NAN Power Optimization feature for NAN discovery.
+ */
+ u8 config_nss;
+ // default value is implementation specific and passing 0 sets it to default
+ u32 nss;
+ /*
+ Enable device level NAN Ranging feature.
+ 0 - Disable
+ 1 - Enable
+ */
+ u8 config_enable_ranging;
+ u32 enable_ranging;
+ /*
+ Enable/Disable DW Early termination.
+ 0 - Disable
+ 1 - Enable
+ */
+ u8 config_dw_early_termination;
+ u32 enable_dw_termination;
+ /*
+ Indicate whether to use NDPE attribute to bring-up TCP/IP connection.
+ If config_ndpe_attr is not configured, the default behavior is
+ not using NDPE attr, and the capability is not advertised.
+ 0 - Not use
+ 1 - Use
+ */
+ u8 config_ndpe_attr;
+ u32 use_ndpe_attr;
+ /*
+ Enable NAN v3.1 instant communication mode.
+ 0 - Disable
+ 1 - Enable
+ */
+ u8 config_enable_instant_mode;
+ u32 enable_instant_mode;
+ /*
+ Config NAN v3.1 instant communication channel frequency selected over NFC/OOB method.
+ If dual band is supported default channel is 149 or 44 as per regulatory domain,
+ else channel 6 (send frequency in MHz).
+ Sometimes depending on country code retrictions, even 149/44 may be restricted
+ in those cases instant channel will be operational only in 2.4GHz.
+ Use wifi_get_usable_channels() API to get supported bands/channels before
+ Instant mode NFC handshake is triggered
+ */
+ u8 config_instant_mode_channel;
+ wifi_channel instant_mode_channel;
+
+ /*
+ Enable/Disable unsync service discovery.
+ 0 - Disable
+ 1 - Enable
+ */
+ u8 config_unsync_srvdsc;
+ u8 enable_unsync_srvdsc;
+
+ /*
+ Configure regulatory information.
+ */
+ u8 config_reg_info;
+ u8 reg_info_val;
+} NanEnableRequest;
+
+/*
+ NAN pairing config.
+*/
+typedef struct {
+
+ /*
+ Enable Nan pairing setup
+ */
+ u32 enable_pairing_setup;
+
+ /*
+ Enable cache NIK/NPK after Nan pairing setup
+ */
+ u32 enable_pairing_cache;
+
+ /*
+ Enable Nan pairing verification with cached NIK/NPK
+ */
+ u32 enable_pairing_verification;
+
+ /*
+ The set of supported bootstrapping methods.
+ */
+ u16 supported_bootstrapping_methods;
+} NanPairingConfig;
+
+/*
+ Publish Msg Structure
+ Message is used to request the DE to publish the Service Name
+ using the parameters passed into the Discovery Window
+*/
+typedef struct {
+ u16 publish_id;/* id 0 means new publish, any other id is existing publish */
+ u16 ttl; /* how many seconds to run for. 0 means forever until canceled */
+ /*
+ period: Awake DW Interval for publish(service)
+ Indicates the interval between two Discovery Windows in which
+ the device supporting the service is awake to transmit or
+ receive the Service Discovery frames.
+ Valid values of Awake DW Interval are: 1, 2, 4, 8 and 16, value 0 will
+ default to 1.
+ */
+ u16 period;
+ NanPublishType publish_type;/* 0= unsolicited, solicited = 1, 2= both */
+ NanTxType tx_type; /* 0 = broadcast, 1= unicast if solicited publish */
+ u8 publish_count; /* number of OTA Publish, 0 means forever until canceled */
+ u16 service_name_len; /* length of service name */
+ u8 service_name[NAN_MAX_SERVICE_NAME_LEN];/* UTF-8 encoded string identifying the service */
+ /*
+ Field which specifies how the matching indication to host is controlled.
+ 0 - Match and Indicate Once
+ 1 - Match and Indicate continuous
+ 2 - Match and Indicate never. This means don't indicate the match to the host.
+ 3 - Reserved
+ */
+ NanMatchAlg publish_match_indicator;
+
+ /*
+ Sequence of values
+ NAN Device that has invoked a Subscribe method corresponding to this Publish method
+ */
+ u16 service_specific_info_len;
+ u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ Ordered sequence of <length, value> pairs which specify further response conditions
+ beyond the service name used to filter subscribe messages to respond to.
+ This is only needed when the PT is set to NAN_SOLICITED or NAN_SOLICITED_UNSOLICITED.
+ */
+ u16 rx_match_filter_len;
+ u8 rx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
+
+ /*
+ Ordered sequence of <length, value> pairs to be included in the Discovery Frame.
+ If present it is always sent in a Discovery Frame
+ */
+ u16 tx_match_filter_len;
+ u8 tx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
+
+ /*
+ flag which specifies that the Publish should use the configured RSSI
+ threshold and the received RSSI in order to filter requests
+ 0 – ignore the configured RSSI threshold when running a Service
+ Descriptor attribute or Service ID List Attribute through the DE matching logic.
+ 1 – use the configured RSSI threshold when running a Service
+ Descriptor attribute or Service ID List Attribute through the DE matching logic.
+
+ */
+ u8 rssi_threshold_flag;
+
+ /*
+ 8-bit bitmap which allows the Host to associate this publish
+ with a particular Post-NAN Connectivity attribute
+ which has been sent down in a NanConfigureRequest/NanEnableRequest
+ message. If the DE fails to find a configured Post-NAN
+ connectivity attributes referenced by the bitmap,
+ the DE will return an error code to the Host.
+ If the Publish is configured to use a Post-NAN Connectivity
+ attribute and the Host does not refresh the Post-NAN Connectivity
+ attribute the Publish will be canceled and the Host will be sent
+ a PublishTerminatedIndication message.
+ */
+ u8 connmap;
+ /*
+ Set/Enable corresponding bits to disable any indications that follow a publish.
+ BIT0 - Disable publish termination indication.
+ BIT1 - Disable match expired indication.
+ BIT2 - Disable followUp indication received (OTA).
+ BIT3 - Disable publishReplied indication.
+ */
+ u8 recv_indication_cfg;
+ /*
+ Nan accept policy for the specific service(publish)
+ */
+ NanServiceAcceptPolicy service_responder_policy;
+ /* NAN Cipher Suite Type */
+ u32 cipher_type;
+ /*
+ Nan Security Key Info is optional in Discovery phase.
+ PMK or passphrase info can be passed during
+ the NDP session.
+ */
+ NanSecurityKeyInfo key_info;
+
+ /* Security Context Identifiers length */
+ u32 scid_len;
+ /*
+ Security Context Identifier attribute contains PMKID
+ shall be included in NDP setup and response messages.
+ Security Context Identifier, Identifies the Security
+ Context. For NAN Shared Key Cipher Suite, this field
+ contains the 16 octet PMKID identifying the PMK used
+ for setting up the Secure Data Path.
+ */
+ u8 scid[NAN_MAX_SCID_BUF_LEN];
+
+ /* NAN configure service discovery extended attributes */
+ NanSdeaCtrlParams sdea_params;
+
+ /* NAN Ranging configuration */
+ NanRangingCfg ranging_cfg;
+
+ /* Enable/disable NAN serivce Ranging auto response mode */
+ NanRangingAutoResponse ranging_auto_response;
+
+ /*
+ When the ranging_auto_response_cfg is not set, NanRangeRequestInd is
+ received. Nan Range Response to Peer MAC Addr is notified to indicate
+ ACCEPT/REJECT/CANCEL to the requestor.
+ */
+ NanRangeResponseCfg range_response_cfg;
+
+ /*
+ Sequence of values indicating the service specific info in SDEA
+ */
+ u16 sdea_service_specific_info_len;
+ u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ The Identity key for pairing, used to generate NIRA
+ */
+ u8 nan_identity_key[NAN_IDENTITY_KEY_LEN];
+
+ /*
+ The config for Nan pairing
+ */
+ NanPairingConfig nan_pairing_config;
+
+ /*
+ Specifies whether suspension can be possible in this publish session.
+ The request would fail if enable_suspendability is true but
+ is_suspension_supported is false in NanCapabilities.
+ */
+ bool enable_suspendability;
+
+ /* s3 capabilities */
+ u16 s3_capabilities;
+
+ /* cipher capabilities */
+ u8 cipher_capabilities;
+} NanPublishRequest;
+
+/*
+ Publish Cancel Msg Structure
+ The PublishServiceCancelReq Message is used to request the DE to stop publishing
+ the Service Name identified by the Publish Id in the message.
+*/
+typedef struct {
+ u16 publish_id;
+} NanPublishCancelRequest;
+
+/*
+ NAN Subscribe Structure
+ The SubscribeServiceReq message is sent to the Discovery Engine
+ whenever the Upper layers would like to listen for a Service Name
+*/
+typedef struct {
+ u16 subscribe_id; /* id 0 means new subscribe, non zero is existing subscribe */
+ u16 ttl; /* how many seconds to run for. 0 means forever until canceled */
+ /*
+ period: Awake DW Interval for subscribe(service)
+ Indicates the interval between two Discovery Windows in which
+ the device supporting the service is awake to transmit or
+ receive the Service Discovery frames.
+ Valid values of Awake DW Interval are: 1, 2, 4, 8 and 16, value 0 will
+ default to 1.
+ */
+ u16 period;
+
+ /* Flag which specifies how the Subscribe request shall be processed. */
+ NanSubscribeType subscribe_type; /* 0 - PASSIVE , 1- ACTIVE */
+
+ /* Flag which specifies on Active Subscribes how the Service Response Filter attribute is populated.*/
+ NanSRFType serviceResponseFilter; /* 0 - Bloom Filter, 1 - MAC Addr */
+
+ /* Flag which specifies how the Service Response Filter Include bit is populated.*/
+ NanSRFIncludeType serviceResponseInclude; /* 0=Do not respond if in the Address Set, 1= Respond */
+
+ /* Flag which specifies if the Service Response Filter should be used when creating Subscribes.*/
+ NanSRFState useServiceResponseFilter; /* 0=Do not send the Service Response Filter,1= send */
+
+ /*
+ Flag which specifies if the Service Specific Info is needed in
+ the Publish message before creating the MatchIndication
+ */
+ NanSsiInMatchInd ssiRequiredForMatchIndication; /* 0=Not needed, 1= Required */
+
+ /*
+ Field which specifies how the matching indication to host is controlled.
+ 0 - Match and Indicate Once
+ 1 - Match and Indicate continuous
+ 2 - Match and Indicate never. This means don't indicate the match to the host.
+ 3 - Reserved
+ */
+ NanMatchAlg subscribe_match_indicator;
+
+ /*
+ The number of Subscribe Matches which should occur
+ before the Subscribe request is automatically terminated.
+ */
+ u8 subscribe_count; /* If this value is 0 this field is not used by the DE.*/
+
+ u16 service_name_len;/* length of service name */
+ u8 service_name[NAN_MAX_SERVICE_NAME_LEN]; /* UTF-8 encoded string identifying the service */
+
+ /* Sequence of values which further specify the published service beyond the service name*/
+ u16 service_specific_info_len;
+ u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ Ordered sequence of <length, value> pairs used to filter out received publish discovery messages.
+ This can be sent both for a Passive or an Active Subscribe
+ */
+ u16 rx_match_filter_len;
+ u8 rx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
+
+ /*
+ Ordered sequence of <length, value> pairs included in the
+ Discovery Frame when an Active Subscribe is used.
+ */
+ u16 tx_match_filter_len;
+ u8 tx_match_filter[NAN_MAX_MATCH_FILTER_LEN];
+
+ /*
+ Flag which specifies that the Subscribe should use the configured RSSI
+ threshold and the received RSSI in order to filter requests
+ 0 – ignore the configured RSSI threshold when running a Service
+ Descriptor attribute or Service ID List Attribute through the DE matching logic.
+ 1 – use the configured RSSI threshold when running a Service
+ Descriptor attribute or Service ID List Attribute through the DE matching logic.
+
+ */
+ u8 rssi_threshold_flag;
+
+ /*
+ 8-bit bitmap which allows the Host to associate this Active
+ Subscribe with a particular Post-NAN Connectivity attribute
+ which has been sent down in a NanConfigureRequest/NanEnableRequest
+ message. If the DE fails to find a configured Post-NAN
+ connectivity attributes referenced by the bitmap,
+ the DE will return an error code to the Host.
+ If the Subscribe is configured to use a Post-NAN Connectivity
+ attribute and the Host does not refresh the Post-NAN Connectivity
+ attribute the Subscribe will be canceled and the Host will be sent
+ a SubscribeTerminatedIndication message.
+ */
+ u8 connmap;
+ /*
+ NAN Interface Address, conforming to the format as described in
+ 8.2.4.3.2 of IEEE Std. 802.11-2012.
+ */
+ u8 num_intf_addr_present;
+ u8 intf_addr[NAN_MAX_SUBSCRIBE_MAX_ADDRESS][NAN_MAC_ADDR_LEN];
+ /*
+ Set/Enable corresponding bits to disable indications that follow a subscribe.
+ BIT0 - Disable subscribe termination indication.
+ BIT1 - Disable match expired indication.
+ BIT2 - Disable followUp indication received (OTA).
+ */
+ u8 recv_indication_cfg;
+
+ /* NAN Cipher Suite Type */
+ u32 cipher_type;
+ /*
+ Nan Security Key Info is optional in Discovery phase.
+ PMK or passphrase info can be passed during
+ the NDP session.
+ */
+ NanSecurityKeyInfo key_info;
+
+ /* Security Context Identifiers length */
+ u32 scid_len;
+ /*
+ Security Context Identifier attribute contains PMKID
+ shall be included in NDP setup and response messages.
+ Security Context Identifier, Identifies the Security
+ Context. For NAN Shared Key Cipher Suite, this field
+ contains the 16 octet PMKID identifying the PMK used
+ for setting up the Secure Data Path.
+ */
+ u8 scid[NAN_MAX_SCID_BUF_LEN];
+
+ /* NAN configure service discovery extended attributes */
+ NanSdeaCtrlParams sdea_params;
+
+ /* NAN Ranging configuration */
+ NanRangingCfg ranging_cfg;
+
+ /* Enable/disable NAN serivce Ranging auto response mode */
+ NanRangingAutoResponse ranging_auto_response;
+
+ /*
+ When the ranging_auto_response_cfg is not set, NanRangeRequestInd is
+ received. Nan Range Response to Peer MAC Addr is notified to indicate
+ ACCEPT/REJECT/CANCEL to the requestor.
+ */
+ NanRangeResponseCfg range_response_cfg;
+
+ /*
+ Sequence of values indicating the service specific info in SDEA
+ */
+ u16 sdea_service_specific_info_len;
+ u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
+ /*
+ The Identity key for pairing, used to generate NIRA
+ */
+ u8 nan_identity_key[NAN_IDENTITY_KEY_LEN];
+
+ /*
+ The config for Nan pairing
+ */
+ NanPairingConfig nan_pairing_config;
+
+ /*
+ Specifies whether suspension can be possible in this subscribe session.
+ The request would fail if enable_suspendability is true but
+ is_suspension_supported is false in NanCapabilities.
+ */
+ bool enable_suspendability;
+
+ /* cipher capabilities */
+ u8 cipher_capabilities;
+} NanSubscribeRequest;
+
+/*
+ NAN Subscribe Cancel Structure
+ The SubscribeCancelReq Message is used to request the DE to stop looking for the Service Name.
+*/
+typedef struct {
+ u16 subscribe_id;
+} NanSubscribeCancelRequest;
+
+/*
+ Transmit follow up Structure
+ The TransmitFollowupReq message is sent to the DE to allow the sending of the Service_Specific_Info
+ to a particular MAC address.
+*/
+typedef struct {
+ /* Publish or Subscribe Id of an earlier Publish/Subscribe */
+ u16 publish_subscribe_id;
+
+ /*
+ This Id is the Requestor Instance that is passed as
+ part of earlier MatchInd/FollowupInd message.
+ */
+ u32 requestor_instance_id;
+ u8 addr[NAN_MAC_ADDR_LEN]; /* Unicast address */
+ NanTxPriority priority; /* priority of the request 2=high */
+ NanTransmitWindowType dw_or_faw; /* 0= send in a DW, 1=send in FAW */
+
+ /*
+ Sequence of values which further specify the published service beyond
+ the service name.
+ */
+ u16 service_specific_info_len;
+ u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
+ /*
+ Set/Enable corresponding bits to disable responses after followUp.
+ BIT0 - Disable followUp response from FW.
+ */
+ u8 recv_indication_cfg;
+
+ /*
+ Sequence of values indicating the service specific info in SDEA
+ */
+ u16 sdea_service_specific_info_len;
+ u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ Add shared key descriptor attribute to the Followup request when the
+ flag is set
+ */
+ u8 shared_key_desc_flag;
+} NanTransmitFollowupRequest;
+
+/*
+ Stats Request structure
+ The Discovery Engine can be queried at runtime by the Host processor for statistics
+ concerning various parts of the Discovery Engine.
+*/
+typedef struct {
+ NanStatsType stats_type; /* NAN Statistics Request Type */
+ u8 clear; /* 0= Do not clear the stats and return the current contents , 1= Clear the associated stats */
+} NanStatsRequest;
+
+/*
+ Suspend Request Structure
+ The SuspendRequest message is used to request that the specified session is suspended.
+ The session can be resumed using the NanResumeRequest message.
+*/
+typedef struct {
+ u16 publish_subscribe_id;
+} NanSuspendRequest;
+
+/*
+ Resume Request Structure
+ The ResumeRequest message is used to request that the specified session is resumed.
+*/
+typedef struct {
+ u16 publish_subscribe_id;
+} NanResumeRequest;
+
+/*
+ Config Structure
+ The NanConfigurationReq message is sent by the Host to the
+ Discovery Engine in order to configure the Discovery Engine during runtime.
+*/
+typedef struct {
+ u8 config_sid_beacon;
+ u8 sid_beacon;
+ u8 config_rssi_proximity;
+ u8 rssi_proximity; // default value -60dBm
+ u8 config_master_pref;
+ u8 master_pref; // default value 0x02
+ /*
+ 1 byte value which defines the RSSI filter threshold.
+ Any Service Descriptors received above this value
+ that are configured for RSSI filtering will be dropped.
+ The rssi values should be specified without sign.
+ For eg: -70dBm should be specified as 70.
+ */
+ u8 config_5g_rssi_close_proximity;
+ u8 rssi_close_proximity_5g_val; // default value -60dBm
+ /*
+ Optional configuration of Configure request.
+ Each of the optional parameters have configure flag which
+ determine whether configuration is to be passed or not.
+ */
+ /*
+ 1 byte quantity which defines the window size over
+ which the “average RSSI” will be calculated over.
+ */
+ u8 config_rssi_window_size;
+ u8 rssi_window_size_val; // default value 0x08
+ /*
+ If set to 1, the Discovery Engine will enclose the Cluster
+ Attribute only sent in Beacons in a Vendor Specific Attribute
+ and transmit in a Service Descriptor Frame.
+ */
+ u8 config_cluster_attribute_val;
+ /*
+ The periodicity in seconds between full scan’s to find any new
+ clusters available in the area. A Full scan should not be done
+ more than every 10 seconds and should not be done less than every
+ 30 seconds.
+ */
+ u8 config_scan_params;
+ NanSocialChannelScanParams scan_params_val;
+ /*
+ 1 byte quantity which forces the Random Factor to a particular
+ value for all transmitted Sync/Discovery beacons
+ */
+ u8 config_random_factor_force;
+ u8 random_factor_force_val; // default value 0x00
+ /*
+ 1 byte quantity which forces the HC for all transmitted Sync and
+ Discovery Beacon NO matter the real HC being received over the
+ air.
+ */
+ u8 config_hop_count_force;
+ u8 hop_count_force_val; // default value of 0
+ /* NAN Post Connectivity Capability */
+ u8 config_conn_capability;
+ NanTransmitPostConnectivityCapability conn_capability_val;
+ /* NAN Post Discover Capability */
+ u8 num_config_discovery_attr;
+ NanTransmitPostDiscovery discovery_attr_val[NAN_MAX_POSTDISCOVERY_LEN];
+ /* NAN Further availability Map */
+ u8 config_fam;
+ NanFurtherAvailabilityMap fam_val;
+ /* Configure 2.4/5GHz DW */
+ NanConfigDW config_dw;
+ /*
+ By default discovery MAC address randomization is enabled
+ and default interval value is 30 minutes i.e. 1800 seconds.
+ The value 0 is used to disable MAC addr randomization.
+ */
+ u8 config_disc_mac_addr_randomization;
+ u32 disc_mac_addr_rand_interval_sec; // default value of 30 minutes
+
+ /*
+ Set/Enable corresponding bits to disable Discovery indications:
+ BIT0 - Disable Discovery MAC Address Event.
+ BIT1 - Disable Started Cluster Event.
+ BIT2 - Disable Joined Cluster Event.
+ */
+ u8 discovery_indication_cfg; // default value of 0
+ /*
+ BIT 0 is used to specify to include Service IDs in Sync/Discovery beacons
+ 0 - Do not include SIDs in any beacons
+ 1 - Include SIDs in all beacons.
+ Rest 7 bits are count field which allows control over the number of SIDs
+ included in the Beacon. 0 means to include as many SIDs that fit into
+ the maximum allow Beacon frame size
+ */
+ u8 config_subscribe_sid_beacon;
+ u32 subscribe_sid_beacon_val; // default value 0x0
+ /*
+ Discovery Beacon Interval config.
+ Default value is 128 msec in 2G DW and 176 msec in 2G/5G DW.
+ When 0 value is passed it is reset to default value of 128 or 176 msec.
+ */
+ u8 config_discovery_beacon_int;
+ u32 discovery_beacon_interval;
+ /*
+ Enable Number of Spatial Streams.
+ This is NAN Power Optimization feature for NAN discovery.
+ */
+ u8 config_nss;
+ // default value is implementation specific and passing 0 sets it to default
+ u32 nss;
+ /*
+ Enable device level NAN Ranging feature.
+ 0 - Disable
+ 1 - Enable
+ */
+ u8 config_enable_ranging;
+ u32 enable_ranging;
+ /*
+ Enable/Disable DW Early termination.
+ 0 - Disable
+ 1 - Enable
+ */
+ u8 config_dw_early_termination;
+ u32 enable_dw_termination;
+ /*
+ Indicate whether to use NDPE attribute to bring-up TCP/IP connection
+ If config_ndpe_attr is not configured, the default behavior is
+ not using NDPE attr, and the capability is not advertised.
+ 0 - Not use
+ 1 - Use
+ */
+ u8 config_ndpe_attr;
+ u32 use_ndpe_attr;
+ /*
+ Enable NAN v3.1 instant communication mode.
+ 0 - Disable
+ 1 - Enable
+ */
+ u8 config_enable_instant_mode;
+ u32 enable_instant_mode;
+ /*
+ Config NAN v3.1 instant communication channel selected over NFC/OOB method.
+ If dual band is supported default channel is 149 or 44 as per regulatory domain,
+ else channel 6 (send frequency in MHz).
+ Sometimes depending on country code retrictions, even 149/44 may be restricted
+ in those cases instant channel will be operational only in 2.4GHz.
+ Use wifi_get_usable_channels() API to get supported bands/channels before
+ Instant mode NFC handshake is triggered
+ */
+ u8 config_instant_mode_channel;
+ wifi_channel instant_mode_channel;
+ /*
+ Config cluster ID with the cluster ID selected over NFC/OOB method.
+ */
+ u8 config_cluster_id;
+ u16 cluster_id_val; // default value 0x0
+} NanConfigRequest;
+
+/*
+ TCA Structure
+ The Discovery Engine can be configured to send up Events whenever a configured
+ Threshold Crossing Alert (TCA) Type crosses an integral threshold in a particular direction.
+*/
+typedef struct {
+ NanTcaType tca_type; /* Nan Protocol Threshold Crossing Alert (TCA) Codes */
+
+ /* flag which control whether or not an event is generated for the Rising direction */
+ u8 rising_direction_evt_flag; /* 0 - no event, 1 - event */
+
+ /* flag which control whether or not an event is generated for the Falling direction */
+ u8 falling_direction_evt_flag;/* 0 - no event, 1 - event */
+
+ /* flag which requests a previous TCA request to be cleared from the DE */
+ u8 clear;/*0= Do not clear the TCA, 1=Clear the TCA */
+
+ /* 32 bit value which represents the threshold to be used.*/
+ u32 threshold;
+} NanTCARequest;
+
+/*
+ Beacon Sdf Payload Structure
+ The Discovery Engine can be configured to publish vendor specific attributes as part of
+ beacon or service discovery frame transmitted as part of this request..
+*/
+typedef struct {
+ /*
+ NanVendorAttribute will have the Vendor Specific Attribute which the
+ vendor wants to publish as part of Discovery or Sync or Service discovery frame
+ */
+ NanTransmitVendorSpecificAttribute vsa;
+} NanBeaconSdfPayloadRequest;
+
+/* Publish statistics. */
+typedef struct
+{
+ u32 validPublishServiceReqMsgs;
+ u32 validPublishServiceRspMsgs;
+ u32 validPublishServiceCancelReqMsgs;
+ u32 validPublishServiceCancelRspMsgs;
+ u32 validPublishRepliedIndMsgs;
+ u32 validPublishTerminatedIndMsgs;
+ u32 validActiveSubscribes;
+ u32 validMatches;
+ u32 validFollowups;
+ u32 invalidPublishServiceReqMsgs;
+ u32 invalidPublishServiceCancelReqMsgs;
+ u32 invalidActiveSubscribes;
+ u32 invalidMatches;
+ u32 invalidFollowups;
+ u32 publishCount;
+ u32 publishNewMatchCount;
+ u32 pubsubGlobalNewMatchCount;
+} NanPublishStats;
+
+/* Subscribe statistics. */
+typedef struct
+{
+ u32 validSubscribeServiceReqMsgs;
+ u32 validSubscribeServiceRspMsgs;
+ u32 validSubscribeServiceCancelReqMsgs;
+ u32 validSubscribeServiceCancelRspMsgs;
+ u32 validSubscribeTerminatedIndMsgs;
+ u32 validSubscribeMatchIndMsgs;
+ u32 validSubscribeUnmatchIndMsgs;
+ u32 validSolicitedPublishes;
+ u32 validMatches;
+ u32 validFollowups;
+ u32 invalidSubscribeServiceReqMsgs;
+ u32 invalidSubscribeServiceCancelReqMsgs;
+ u32 invalidSubscribeFollowupReqMsgs;
+ u32 invalidSolicitedPublishes;
+ u32 invalidMatches;
+ u32 invalidFollowups;
+ u32 subscribeCount;
+ u32 bloomFilterIndex;
+ u32 subscribeNewMatchCount;
+ u32 pubsubGlobalNewMatchCount;
+} NanSubscribeStats;
+
+/* NAN DW Statistics*/
+typedef struct
+{
+ /* RX stats */
+ u32 validFrames;
+ u32 validActionFrames;
+ u32 validBeaconFrames;
+ u32 ignoredActionFrames;
+ u32 ignoredBeaconFrames;
+ u32 invalidFrames;
+ u32 invalidActionFrames;
+ u32 invalidBeaconFrames;
+ u32 invalidMacHeaders;
+ u32 invalidPafHeaders;
+ u32 nonNanBeaconFrames;
+
+ u32 earlyActionFrames;
+ u32 inDwActionFrames;
+ u32 lateActionFrames;
+
+ /* TX stats */
+ u32 framesQueued;
+ u32 totalTRSpUpdates;
+ u32 completeByTRSp;
+ u32 completeByTp75DW;
+ u32 completeByTendDW;
+ u32 lateActionFramesTx;
+} NanDWStats;
+
+/* NAN MAC Statistics. */
+typedef struct
+{
+ /* RX stats */
+ u32 validFrames;
+ u32 validActionFrames;
+ u32 validBeaconFrames;
+ u32 ignoredActionFrames;
+ u32 ignoredBeaconFrames;
+ u32 invalidFrames;
+ u32 invalidActionFrames;
+ u32 invalidBeaconFrames;
+ u32 invalidMacHeaders;
+ u32 invalidPafHeaders;
+ u32 nonNanBeaconFrames;
+
+ u32 earlyActionFrames;
+ u32 inDwActionFrames;
+ u32 lateActionFrames;
+
+ /* TX stats */
+ u32 framesQueued;
+ u32 totalTRSpUpdates;
+ u32 completeByTRSp;
+ u32 completeByTp75DW;
+ u32 completeByTendDW;
+ u32 lateActionFramesTx;
+
+ u32 twIncreases;
+ u32 twDecreases;
+ u32 twChanges;
+ u32 twHighwater;
+ u32 bloomFilterIndex;
+} NanMacStats;
+
+/* NAN Sync Statistics*/
+typedef struct
+{
+ u64 currTsf;
+ u64 myRank;
+ u64 currAmRank;
+ u64 lastAmRank;
+ u32 currAmBTT;
+ u32 lastAmBTT;
+ u8 currAmHopCount;
+ u8 currRole;
+ u16 currClusterId;
+
+ u64 timeSpentInCurrRole;
+ u64 totalTimeSpentAsMaster;
+ u64 totalTimeSpentAsNonMasterSync;
+ u64 totalTimeSpentAsNonMasterNonSync;
+ u32 transitionsToAnchorMaster;
+ u32 transitionsToMaster;
+ u32 transitionsToNonMasterSync;
+ u32 transitionsToNonMasterNonSync;
+ u32 amrUpdateCount;
+ u32 amrUpdateRankChangedCount;
+ u32 amrUpdateBTTChangedCount;
+ u32 amrUpdateHcChangedCount;
+ u32 amrUpdateNewDeviceCount;
+ u32 amrExpireCount;
+ u32 mergeCount;
+ u32 beaconsAboveHcLimit;
+ u32 beaconsBelowRssiThresh;
+ u32 beaconsIgnoredNoSpace;
+ u32 beaconsForOurCluster;
+ u32 beaconsForOtherCluster;
+ u32 beaconCancelRequests;
+ u32 beaconCancelFailures;
+ u32 beaconUpdateRequests;
+ u32 beaconUpdateFailures;
+ u32 syncBeaconTxAttempts;
+ u32 syncBeaconTxFailures;
+ u32 discBeaconTxAttempts;
+ u32 discBeaconTxFailures;
+ u32 amHopCountExpireCount;
+ u32 ndpChannelFreq;
+ u32 ndpChannelFreq2;
+ u32 schedUpdateChannelFreq;
+} NanSyncStats;
+
+/* NAN Misc DE Statistics */
+typedef struct
+{
+ u32 validErrorRspMsgs;
+ u32 validTransmitFollowupReqMsgs;
+ u32 validTransmitFollowupRspMsgs;
+ u32 validFollowupIndMsgs;
+ u32 validConfigurationReqMsgs;
+ u32 validConfigurationRspMsgs;
+ u32 validStatsReqMsgs;
+ u32 validStatsRspMsgs;
+ u32 validEnableReqMsgs;
+ u32 validEnableRspMsgs;
+ u32 validDisableReqMsgs;
+ u32 validDisableRspMsgs;
+ u32 validDisableIndMsgs;
+ u32 validEventIndMsgs;
+ u32 validTcaReqMsgs;
+ u32 validTcaRspMsgs;
+ u32 validTcaIndMsgs;
+ u32 invalidTransmitFollowupReqMsgs;
+ u32 invalidConfigurationReqMsgs;
+ u32 invalidStatsReqMsgs;
+ u32 invalidEnableReqMsgs;
+ u32 invalidDisableReqMsgs;
+ u32 invalidTcaReqMsgs;
+} NanDeStats;
+
+/* Publish Response Message structure */
+typedef struct {
+ u16 publish_id;
+} NanPublishResponse;
+
+/* Subscribe Response Message structure */
+typedef struct {
+ u16 subscribe_id;
+} NanSubscribeResponse;
+
+/*
+ Stats Response Message structure
+ The Discovery Engine response to a request by the Host for statistics.
+*/
+typedef struct {
+ NanStatsType stats_type;
+ union {
+ NanPublishStats publish_stats;
+ NanSubscribeStats subscribe_stats;
+ NanMacStats mac_stats;
+ NanSyncStats sync_stats;
+ NanDeStats de_stats;
+ NanDWStats dw_stats;
+ } data;
+} NanStatsResponse;
+
+/* Response returned for Initiators Data request */
+typedef struct {
+ /*
+ Unique token Id generated on the initiator
+ side used for a NDP session between two NAN devices
+ */
+ NanDataPathId ndp_instance_id;
+} NanDataPathRequestResponse;
+
+/* Response returned for Initiators pairing request */
+typedef struct {
+ /*
+ Unique token Id generated on the initiator
+ side used for a pairing session between two NAN devices
+ */
+ u32 paring_instance_id;
+} NanPairingRequestResponse;
+
+/* Response returned for Initiators bootstrapping request */
+typedef struct {
+ /*
+ Unique token Id generated on the initiator
+ side used for a bootstrapping session between two NAN devices
+ */
+ u32 bootstrapping_instance_id;
+} NanBootstrappingRequestResponse;
+
+/*
+ NAN Response messages
+*/
+typedef struct {
+ NanStatusType status; /* contains the result code */
+ char nan_error[NAN_ERROR_STR_LEN]; /* Describe the NAN error type */
+ NanResponseType response_type; /* NanResponseType Definitions */
+ union {
+ NanPublishResponse publish_response;
+ NanSubscribeResponse subscribe_response;
+ NanStatsResponse stats_response;
+ NanDataPathRequestResponse data_request_response;
+ NanCapabilities nan_capabilities;
+ NanPairingRequestResponse pairing_request_response;
+ NanBootstrappingRequestResponse bootstrapping_request_response;
+ } body;
+} NanResponseMsg;
+
+/*
+ Publish Replied Indication
+ The PublishRepliedInd Message is sent by the DE when an Active Subscribe is
+ received over the air and it matches a Solicited PublishServiceReq which had
+ been created with the replied_event_flag set.
+*/
+typedef struct {
+ /*
+ A 32 bit Requestor Instance Id which is sent to the Application.
+ This Id will be sent in any subsequent UnmatchInd/FollowupInd
+ messages
+ */
+ u32 requestor_instance_id;
+ u8 addr[NAN_MAC_ADDR_LEN];
+ /*
+ If RSSI filtering was configured in NanPublishRequest then this
+ field will contain the received RSSI value. 0 if not
+ */
+ u8 rssi_value;
+} NanPublishRepliedInd;
+
+/*
+ Publish Terminated
+ The PublishTerminatedInd message is sent by the DE whenever a Publish
+ terminates from a user-specified timeout or a unrecoverable error in the DE.
+*/
+typedef struct {
+ /* Id returned during the initial Publish */
+ u16 publish_id;
+ /*
+ For all user configured termination NAN_STATUS_SUCCESS
+ and no other reasons expected from firmware.
+ */
+ NanStatusType reason;
+ char nan_reason[NAN_ERROR_STR_LEN]; /* Describe the NAN reason type */
+} NanPublishTerminatedInd;
+
+/* The NIRA used to identify the pairing devices*/
+typedef struct {
+ u8 nonce[NAN_IDENTITY_NONCE_LEN];
+ u8 tag[NAN_IDENTITY_TAG_LEN];
+} NanIdentityResolutionAttribute;
+
+/*
+ Match Indication
+ The MatchInd message is sent once per responding MAC address whenever
+ the Discovery Engine detects a match for a previous SubscribeServiceReq
+ or PublishServiceReq.
+*/
+typedef struct {
+ /* Publish or Subscribe Id of an earlier Publish/Subscribe */
+ u16 publish_subscribe_id;
+ /*
+ A 32 bit Requestor Instance Id which is sent to the Application.
+ This Id will be sent in any subsequent UnmatchInd/FollowupInd
+ messages
+ */
+ u32 requestor_instance_id;
+ u8 addr[NAN_MAC_ADDR_LEN];
+
+ /*
+ Sequence of octets which were received in a Discovery Frame matching the
+ Subscribe Request.
+ */
+ u16 service_specific_info_len;
+ u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ Ordered sequence of <length, value> pairs received in the Discovery Frame
+ matching the Subscribe Request.
+ */
+ u16 sdf_match_filter_len;
+ u8 sdf_match_filter[NAN_MAX_MATCH_FILTER_LEN];
+
+ /*
+ flag to indicate if the Match occurred in a Beacon Frame or in a
+ Service Discovery Frame.
+ 0 - Match occured in a Service Discovery Frame
+ 1 - Match occured in a Beacon Frame
+ */
+ u8 match_occured_flag;
+
+ /*
+ flag to indicate FW is out of resource and that it can no longer
+ track this Service Name. The Host still need to send the received
+ Match_Handle but duplicate MatchInd messages may be received on
+ this Handle until the resource frees up.
+ 0 - FW is caching this match
+ 1 - FW is unable to cache this match
+ */
+ u8 out_of_resource_flag;
+
+ /*
+ If RSSI filtering was configured in NanSubscribeRequest then this
+ field will contain the received RSSI value. 0 if not.
+ All rssi values should be specified without sign.
+ For eg: -70dBm should be specified as 70.
+ */
+ u8 rssi_value;
+
+ /*
+ optional attributes. Each optional attribute is associated with a flag
+ which specifies whether the attribute is valid or not
+ */
+ /* NAN Post Connectivity Capability received */
+ u8 is_conn_capability_valid;
+ NanReceivePostConnectivityCapability conn_capability;
+
+ /* NAN Post Discover Capability */
+ u8 num_rx_discovery_attr;
+ NanReceivePostDiscovery discovery_attr[NAN_MAX_POSTDISCOVERY_LEN];
+
+ /* NAN Further availability Map */
+ u8 num_chans;
+ NanFurtherAvailabilityChannel famchan[NAN_MAX_FAM_CHANNELS];
+
+ /* NAN Cluster Attribute */
+ u8 cluster_attribute_len;
+ u8 cluster_attribute[NAN_MAX_CLUSTER_ATTRIBUTE_LEN];
+
+ /* NAN Cipher Suite */
+ u32 peer_cipher_type;
+
+ /* Security Context Identifiers length */
+ u32 scid_len;
+ /*
+ Security Context Identifier attribute contains PMKID
+ shall be included in NDP setup and response messages.
+ Security Context Identifier, Identifies the Security
+ Context. For NAN Shared Key Cipher Suite, this field
+ contains the 16 octet PMKID identifying the PMK used
+ for setting up the Secure Data Path.
+ */
+ u8 scid[NAN_MAX_SCID_BUF_LEN];
+
+ /* Peer service discovery extended attributes */
+ NanSdeaCtrlParams peer_sdea_params;
+
+ /*
+ Ranging indication and NanMatchAlg are not tied.
+ Ex: NanMatchAlg can indicate Match_ONCE, but ranging
+ indications can be continuous. All ranging indications
+ depend on SDEA control parameters of ranging required for
+ continuous, and ingress/egress values in the ranging config.
+ Ranging indication data is notified if:
+ 1) Ranging required is enabled in SDEA.
+ range info notified continuous.
+ 2) if range_limit ingress/egress MASKS are enabled
+ notify once for ingress >= ingress_distance
+ and egress <= egress_distance, same for ingress_egress_both
+ 3) if the Awake DW intervals are higher than the ranging intervals,
+ priority is given to the device DW intervalsi.
+ */
+ /*
+ Range Info includes:
+ 1) distance to the NAN device with the MAC address indicated
+ with ranged mac address.
+ 2) Ranging event matching the configuration of continuous/ingress/egress.
+ */
+ NanRangeInfo range_info;
+
+ /*
+ Sequence of values indicating the service specific info in SDEA
+ */
+ u16 sdea_service_specific_info_len;
+ u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ The config for Nan pairing set by the peer
+ */
+ NanPairingConfig peer_pairing_config;
+
+ /*
+ The NIRA from peer for Nan pairing verification
+ */
+ NanIdentityResolutionAttribute nira;
+} NanMatchInd;
+
+/*
+ MatchExpired Indication
+ The MatchExpiredInd message is sent whenever the Discovery Engine detects that
+ a previously Matched Service has been gone for too long. If the previous
+ MatchInd message for this Publish/Subscribe Id had the out_of_resource_flag
+ set then this message will not be received
+*/
+typedef struct {
+ /* Publish or Subscribe Id of an earlier Publish/Subscribe */
+ u16 publish_subscribe_id;
+ /*
+ 32 bit value sent by the DE in a previous
+ MatchInd/FollowupInd to the application.
+ */
+ u32 requestor_instance_id;
+} NanMatchExpiredInd;
+
+/*
+ Subscribe Terminated
+ The SubscribeTerminatedInd message is sent by the DE whenever a
+ Subscribe terminates from a user-specified timeout or a unrecoverable error in the DE.
+*/
+typedef struct {
+ /* Id returned during initial Subscribe */
+ u16 subscribe_id;
+ /*
+ For all user configured termination NAN_STATUS_SUCCESS
+ and no other reasons expected from firmware.
+ */
+ NanStatusType reason;
+ char nan_reason[NAN_ERROR_STR_LEN]; /* Describe the NAN reason type */
+} NanSubscribeTerminatedInd;
+
+/*
+ Followup Indication Message
+ The FollowupInd message is sent by the DE to the Host whenever it receives a
+ Followup message from another peer.
+*/
+typedef struct {
+ /* Publish or Subscribe Id of an earlier Publish/Subscribe */
+ u16 publish_subscribe_id;
+ /*
+ A 32 bit Requestor instance Id which is sent to the Application.
+ This Id will be used in subsequent UnmatchInd/FollowupInd messages.
+ */
+ u32 requestor_instance_id;
+ u8 addr[NAN_MAC_ADDR_LEN];
+
+ /* Flag which the DE uses to decide if received in a DW or a FAW*/
+ u8 dw_or_faw; /* 0=Received in a DW, 1 = Received in a FAW*/
+
+ /*
+ Sequence of values which further specify the published service beyond
+ the service name
+ */
+ u16 service_specific_info_len;
+ u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ Sequence of values indicating the service specific info in SDEA
+ */
+ u16 sdea_service_specific_info_len;
+ u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
+} NanFollowupInd;
+
+/*
+ Event data notifying the Mac address of the Discovery engine.
+ which is reported as one of the Discovery engine event
+*/
+typedef struct {
+ u8 addr[NAN_MAC_ADDR_LEN];
+} NanMacAddressEvent;
+
+/*
+ Event data notifying the Cluster address of the cluster
+ which is reported as one of the Discovery engine event
+*/
+typedef struct {
+ u8 addr[NAN_MAC_ADDR_LEN];
+} NanClusterEvent;
+
+/*
+ Discovery Engine Event Indication
+ The Discovery Engine can inform the Host when significant events occur
+ The data following the EventId is dependent upon the EventId type.
+ In other words, each new event defined will carry a different
+ structure of information back to the host.
+*/
+typedef struct {
+ NanDiscEngEventType event_type; /* NAN Protocol Event Codes */
+ union {
+ /*
+ MacAddressEvent which will have 6 byte mac address
+ of the Discovery engine.
+ */
+ NanMacAddressEvent mac_addr;
+ /*
+ Cluster Event Data which will be obtained when the
+ device starts a new cluster or joins a cluster.
+ The event data will have 6 byte octet string of the
+ cluster started or joined.
+ */
+ NanClusterEvent cluster;
+ } data;
+} NanDiscEngEventInd;
+
+/* Cluster size TCA event*/
+typedef struct {
+ /* size of the cluster*/
+ u32 cluster_size;
+} NanTcaClusterEvent;
+
+/*
+ NAN TCA Indication
+ The Discovery Engine can inform the Host when significant events occur.
+ The data following the TcaId is dependent upon the TcaId type.
+ In other words, each new event defined will carry a different structure
+ of information back to the host.
+*/
+typedef struct {
+ NanTcaType tca_type;
+ /* flag which defines if the configured Threshold has risen above the threshold */
+ u8 rising_direction_evt_flag; /* 0 - no event, 1 - event */
+
+ /* flag which defines if the configured Threshold has fallen below the threshold */
+ u8 falling_direction_evt_flag;/* 0 - no event, 1 - event */
+ union {
+ /*
+ This event in obtained when the cluser size threshold
+ is crossed. Event will have the cluster size
+ */
+ NanTcaClusterEvent cluster;
+ } data;
+} NanTCAInd;
+
+/*
+ NAN Disabled Indication
+ The NanDisableInd message indicates to the upper layers that the Discovery
+ Engine has flushed all state and has been shutdown. When this message is received
+ the DE is guaranteed to have left the NAN cluster it was part of and will have terminated
+ any in progress Publishes or Subscribes.
+*/
+typedef struct {
+ /*
+ Following reasons expected:
+ NAN_STATUS_SUCCESS
+ NAN_STATUS_UNSUPPORTED_CONCURRENCY_NAN_DISABLED
+ */
+ NanStatusType reason;
+ char nan_reason[NAN_ERROR_STR_LEN]; /* Describe the NAN reason type */
+} NanDisabledInd;
+
+/*
+ NAN Beacon or SDF Payload Indication
+ The NanBeaconSdfPayloadInd message indicates to the upper layers that information
+ elements were received either in a Beacon or SDF which needs to be delivered
+ outside of a Publish/Subscribe Handle.
+*/
+typedef struct {
+ /* The MAC address of the peer which sent the attributes.*/
+ u8 addr[NAN_MAC_ADDR_LEN];
+ /*
+ Optional attributes. Each optional attribute is associated with a flag
+ which specifies whether the attribute is valid or not
+ */
+ /* NAN Receive Vendor Specific Attribute*/
+ u8 is_vsa_received;
+ NanReceiveVendorSpecificAttribute vsa;
+
+ /* NAN Beacon or SDF Payload Received*/
+ u8 is_beacon_sdf_payload_received;
+ NanBeaconSdfPayloadReceive data;
+} NanBeaconSdfPayloadInd;
+
+/*
+ Event Indication notifying the
+ transmit followup in progress
+*/
+typedef struct {
+ transaction_id id;
+ /*
+ Following reason codes returned:
+ NAN_STATUS_SUCCESS
+ NAN_STATUS_NO_OTA_ACK
+ NAN_STATUS_PROTOCOL_FAILURE
+ */
+ NanStatusType reason;
+ char nan_reason[NAN_ERROR_STR_LEN]; /* Describe the NAN reason type */
+} NanTransmitFollowupInd;
+
+/*
+ Data request Initiator/Responder
+ app/service related info
+*/
+typedef struct {
+ u16 ndp_app_info_len;
+ u8 ndp_app_info[NAN_DP_MAX_APP_INFO_LEN];
+} NanDataPathAppInfo;
+
+/* QoS configuration */
+typedef enum {
+ NAN_DP_CONFIG_NO_QOS = 0,
+ NAN_DP_CONFIG_QOS
+} NanDataPathQosCfg;
+
+/* Configuration params of Data request Initiator/Responder */
+typedef struct {
+ /* Status Indicating Security/No Security */
+ NanDataPathSecurityCfgStatus security_cfg;
+ NanDataPathQosCfg qos_cfg;
+} NanDataPathCfg;
+
+/* Nan Data Path Initiator requesting a data session */
+typedef struct {
+ /*
+ Unique Instance Id identifying the Responder's service.
+ This is same as publish_id notified on the subscribe side
+ in a publish/subscribe scenario
+ */
+ u32 requestor_instance_id; /* Value 0 for no publish/subscribe */
+
+ /* Config flag for channel request */
+ NanDataPathChannelCfg channel_request_type;
+ /* Channel frequency in MHz to start data-path */
+ wifi_channel channel;
+ /*
+ Discovery MAC addr of the publisher/peer
+ */
+ u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
+ /*
+ Interface name on which this NDP session is to be started.
+ This will be the same interface name provided during interface
+ create.
+ */
+ char ndp_iface[IFNAMSIZ+1];
+ /* Initiator/Responder Security/QoS configuration */
+ NanDataPathCfg ndp_cfg;
+ /* App/Service information of the Initiator */
+ NanDataPathAppInfo app_info;
+ /* NAN Cipher Suite Type */
+ u32 cipher_type;
+ /*
+ Nan Security Key Info is optional in Discovery phase.
+ PMK or passphrase info can be passed during
+ the NDP session.
+ */
+ NanSecurityKeyInfo key_info;
+ /* length of service name */
+ u32 service_name_len;
+ /*
+ UTF-8 encoded string identifying the service name.
+ The service name field is only used if a Nan discovery
+ is not associated with the NDP (out-of-band discovery).
+ */
+ u8 service_name[NAN_MAX_SERVICE_NAME_LEN];
+
+ /* Security Context Identifiers length */
+ u32 scid_len;
+ /*
+ Security Context Identifier attribute contains PMKID
+ shall be included in NDP setup and response messages.
+ Security Context Identifier, Identifies the Security
+ Context. For NAN Shared Key Cipher Suite, this field
+ contains the 16 octet PMKID identifying the PMK used
+ for setting up the Secure Data Path.
+ */
+ u8 scid[NAN_MAX_SCID_BUF_LEN];
+
+ /* Publish or Subscribe Id of an earlier Publish/Subscribe */
+ u16 publish_subscribe_id;
+
+ /* configure CSIA (Cipher Suite Information attribute) capability to specify GTK, IGTK, BIGTK
+ are supported or not
+ */
+ u8 csia_capabilities;
+
+ /* configure GTK(Group Transient Key) protection required or not */
+ u8 gtk_protection;
+
+} NanDataPathInitiatorRequest;
+
+/*
+ Data struct to initiate a data response on the responder side
+ for an indication received with a data request
+*/
+typedef struct {
+ /*
+ Unique token Id generated on the initiator/responder
+ side used for a NDP session between two NAN devices
+ */
+ NanDataPathId ndp_instance_id;
+ /*
+ Interface name on which this NDP session is to be started.
+ This will be the same interface name provided during interface
+ create.
+ */
+ char ndp_iface[IFNAMSIZ+1];
+ /* Initiator/Responder Security/QoS configuration */
+ NanDataPathCfg ndp_cfg;
+ /* App/Service information of the responder */
+ NanDataPathAppInfo app_info;
+ /* Response Code indicating ACCEPT/REJECT/DEFER */
+ NanDataPathResponseCode rsp_code;
+ /* NAN Cipher Suite Type */
+ u32 cipher_type;
+ /*
+ Nan Security Key Info is optional in Discovery phase.
+ PMK or passphrase info can be passed during
+ the NDP session.
+ */
+ NanSecurityKeyInfo key_info;
+ /* length of service name */
+ u32 service_name_len;
+ /*
+ UTF-8 encoded string identifying the service name.
+ The service name field is only used if a Nan discovery
+ is not associated with the NDP (out-of-band discovery).
+ */
+ u8 service_name[NAN_MAX_SERVICE_NAME_LEN];
+
+ /* Security Context Identifiers length */
+ u32 scid_len;
+ /*
+ Security Context Identifier attribute contains PMKID
+ shall be included in NDP setup and response messages.
+ Security Context Identifier, Identifies the Security
+ Context. For NAN Shared Key Cipher Suite, this field
+ contains the 16 octet PMKID identifying the PMK used
+ for setting up the Secure Data Path.
+ */
+ u8 scid[NAN_MAX_SCID_BUF_LEN];
+
+ /* Publish or Subscribe Id of an earlier Publish/Subscribe */
+ u16 publish_subscribe_id;
+
+ /*
+ Discovery MAC addr of the publisher/peer
+ */
+ u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
+
+ /* configure CSIA (Cipher Suite Information attribute) capability to specify GTK, IGTK, BIGTK
+ are supported or not
+ */
+ u8 csia_capabilities;
+
+ /* configure GTK(Group Transient Key) protection required or not */
+ u8 gtk_protection;
+} NanDataPathIndicationResponse;
+
+/* Sub slot parameters */
+typedef struct {
+ u8 entry_control;
+ u16 time_bitmap_control;
+ u32 time_bitmap;
+} NanS3Params;
+
+/* NDP termination info */
+typedef struct {
+ u8 num_ndp_instances;
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a NDP session between two NAN devices
+ */
+ NanDataPathId ndp_instance_id[];
+} NanDataPathEndRequest;
+
+/*
+ Event indication received on the
+ responder side when a Nan Data request or
+ NDP session is initiated on the Initiator side
+*/
+typedef struct {
+ /*
+ Unique Instance Id corresponding to a service/session.
+ This is similar to the publish_id generated on the
+ publisher side
+ */
+ u16 service_instance_id;
+ /* Discovery MAC addr of the peer/initiator */
+ u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a NDP session between two NAN devices
+ */
+ NanDataPathId ndp_instance_id;
+ /* Initiator/Responder Security/QoS configuration */
+ NanDataPathCfg ndp_cfg;
+ /* App/Service information of the initiator */
+ NanDataPathAppInfo app_info;
+
+ /* Security Context Identifiers length */
+ u32 scid_len;
+ /*
+ Security Context Identifier attribute contains PMKID
+ shall be included in NDP setup and response messages.
+ Security Context Identifier, Identifies the Security
+ Context. For NAN Shared Key Cipher Suite, this field
+ contains the 16 octet PMKID identifying the PMK used
+ for setting up the Secure Data Path.
+ */
+ u8 scid[NAN_MAX_SCID_BUF_LEN];
+
+ /* configure CSIA (Cipher Suite Information attribute) capability to specify GTK, IGTK, BIGTK
+ are supported or not
+ */
+ u8 csia_capabilities;
+
+ /* configure GTK(Group Transient Key) protection required or not */
+ u8 gtk_protection;
+} NanDataPathRequestInd;
+
+/*
+ Event indication of data confirm is received on both
+ initiator and responder side confirming a NDP session
+*/
+typedef struct {
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a NDP session between two NAN devices
+ */
+ NanDataPathId ndp_instance_id;
+ /*
+ NDI mac address of the peer
+ (required to derive target ipv6 address)
+ */
+ u8 peer_ndi_mac_addr[NAN_MAC_ADDR_LEN];
+ /* App/Service information of Initiator/Responder */
+ NanDataPathAppInfo app_info;
+ /* Response code indicating ACCEPT/REJECT/DEFER */
+ NanDataPathResponseCode rsp_code;
+ /*
+ Reason code indicating the cause for REJECT.
+ NAN_STATUS_SUCCESS and NAN_STATUS_PROTOCOL_FAILURE are
+ expected reason codes.
+ */
+ NanStatusType reason_code;
+ /* Number of channels for which info is indicated */
+ u32 num_channels;
+ /*
+ Data indicating the Channel list and BW of the channel.
+ */
+ NanChannelInfo channel_info[NAN_MAX_CHANNEL_INFO_SUPPORTED];
+} NanDataPathConfirmInd;
+
+/*
+ Event indication of schedule update is received on both
+ initiator and responder when a schedule change occurs
+*/
+typedef struct {
+ /*
+ NMI mac address
+ */
+ u8 peer_mac_addr[NAN_MAC_ADDR_LEN];
+ /*
+ Reason code indicating the cause of schedule update.
+ BIT_0 NSS Update
+ BIT_1 Channel list update
+ */
+ u32 schedule_update_reason_code;
+ /* Number of channels for which info is indicated */
+ u32 num_channels;
+ /*
+ Data indicating the Channel list and BW of the channel.
+ */
+ NanChannelInfo channel_info[NAN_MAX_CHANNEL_INFO_SUPPORTED];
+ /* Number of NDP instance Ids */
+ u8 num_ndp_instances;
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a NDP session between two NAN devices
+ */
+ NanDataPathId ndp_instance_id[];
+} NanDataPathScheduleUpdateInd;
+
+/*
+ Event indication received on the
+ initiator/responder side terminating
+ a NDP session
+*/
+typedef struct {
+ u8 num_ndp_instances;
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a NDP session between two NAN devices
+ */
+ NanDataPathId ndp_instance_id[];
+} NanDataPathEndInd;
+
+/*
+ Event indicating Range Request received on the
+ Published side.
+*/
+typedef struct {
+ u16 publish_id;/* id is existing publish */
+ /* Range Requestor's MAC address */
+ u8 range_req_intf_addr[NAN_MAC_ADDR_LEN];
+} NanRangeRequestInd;
+
+/*
+ Event indicating Range report on the
+ Published side.
+*/
+typedef struct {
+ u16 publish_id;/* id is existing publish */
+ /* Range Requestor's MAC address */
+ u8 range_req_intf_addr[NAN_MAC_ADDR_LEN];
+ /*
+ Distance to the NAN device with the MAC address indicated
+ with ranged mac address.
+ */
+ u32 range_measurement_mm;
+} NanRangeReportInd;
+
+/*
+ NAN pairing initator request
+*/
+typedef struct {
+ /*
+ This Id is the Requestor Instance that is passed as
+ part of earlier MatchInd/FollowupInd message.
+ */
+ u32 requestor_instance_id;
+
+ /*
+ Discovery MAC addr of the publisher/peer
+ */
+ u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
+
+ /*
+ Indicate the pairing session is of setup or verification
+ */
+ NanPairingRequestType nan_pairing_request_type;
+
+ /*
+ whether the pairing is opportunistic or password
+ */
+ u8 is_opportunistic;
+
+ /*
+ Security key info used for the pairing setup or verification
+ */
+ NanSecurityKeyInfo key_info;
+ /*
+ AKM used for the pairing verification
+ */
+ NanAkm akm;
+
+ /*
+ Whether should cache the negotiated NIK/NPK for future verification
+ */
+ u8 enable_pairing_cache;
+
+ /*
+ The Identity key for pairing, can be used for pairing verification
+ */
+ u8 nan_identity_key[NAN_IDENTITY_KEY_LEN];
+
+ /*
+ NAN Cipher Suite Type
+ */
+ u32 cipher_type;
+
+} NanPairingRequest;
+
+/*
+ Data struct to initiate a pairing response on the responder side for an indication received with a
+ pairing request
+*/
+typedef struct {
+
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a pairing session between two NAN devices
+ */
+ u32 pairing_instance_id;
+
+ /*
+ Indicate the pairing session is setup or verification
+ */
+ NanPairingRequestType nan_pairing_request_type;
+
+ /* Response Code indicating ACCEPT/REJECT */
+ NanPairingResponseCode rsp_code;
+
+ /*
+ whether the pairing is opportunistic or password
+ */
+ u8 is_opportunistic;
+
+ /*
+ Security key info used for the pairing setup or verification
+ */
+ NanSecurityKeyInfo key_info;
+
+ /*
+ AKM used for the pairing verification
+ */
+ NanAkm akm;
+
+ /*
+ Whether should cache the negotiated NIK/NPK for future verification
+ */
+ u8 enable_pairing_cache;
+
+ /*
+ The Identity key for pairing, can be used for pairing verification
+ */
+ u8 nan_identity_key[NAN_IDENTITY_KEY_LEN];
+
+ /*
+ NAN Cipher Suite Type
+ */
+ u32 cipher_type;
+} NanPairingIndicationResponse;
+
+typedef struct {
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a pairing session between two NAN devices
+ */
+ u32 pairing_instance_id;
+} NanPairingEndRequest;
+
+/*
+ Event indication received on the responder side when a Nan pairing session is initiated on the
+ Initiator side
+*/
+typedef struct {
+ /* Publish instance id generated on Publisher side corresponding to a session */
+ u16 publish_subscribe_id;
+ /*
+ This Id is the Requestor Instance that is passed as
+ part of earlier MatchInd/FollowupInd message.
+ */
+ u32 requestor_instance_id;
+ /*
+ Unique Instance Id corresponding to a service/session.
+ This is similar to the publish_id generated on the
+ publisher side
+ */
+ u32 pairing_instance_id;
+ /* Discovery MAC addr of the peer/initiator */
+ u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
+ /* Indicate the pairing session is setup or verification */
+ NanPairingRequestType nan_pairing_request_type;
+ /* Whether should cache the negotiated NIK/NPK for future verification */
+ u8 enable_pairing_cache;
+ /* The NIRA from peer for Nan pairing verification */
+ NanIdentityResolutionAttribute nira;
+} NanPairingRequestInd;
+
+/*
+ The security info negotiate after the pairing setup for caching
+*/
+typedef struct {
+ /* The inentity key of peer device*/
+ u8 peer_nan_identity_key[NAN_IDENTITY_KEY_LEN];
+ /* The inentity key of local device*/
+ u8 local_nan_identity_key[NAN_IDENTITY_KEY_LEN];
+ /* The PMK excahnge between two devices*/
+ NanSecurityPmk npk;
+ /* The AKM used during the key exchange*/
+ NanAkm akm;
+ /* NAN Cipher Suite Type */
+ u32 cipher_type;
+} NpkSecurityAssociation;
+
+/*
+ Event indication of pairing confirm is received on both
+ initiator and responder side confirming a pairing session
+*/
+typedef struct {
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a pairing session between two NAN devices
+ */
+ u32 pairing_instance_id;
+ /* Response code indicating ACCEPT/REJECT */
+ NanPairingResponseCode rsp_code;
+ /*
+ Reason code indicating the cause for REJECT.
+ NAN_STATUS_SUCCESS and NAN_STATUS_PROTOCOL_FAILURE are
+ expected reason codes.
+ */
+ NanStatusType reason_code;
+ /*
+ Indicate the pairing session is setup or verification
+ */
+ NanPairingRequestType nan_pairing_request_type;
+ /* Whether should cache the negotiated NIK/NPK for future verification */
+ u8 enable_pairing_cache;
+ /*
+ The security association info negotiated in the pairing setup, used for future verification
+ */
+ NpkSecurityAssociation npk_security_association;
+} NanPairingConfirmInd;
+
+/*
+ NAN pairing bootstrapping initiator request
+*/
+typedef struct {
+ /* Publish or Subscribe Id of local Publish/Subscribe */
+ u16 publish_subscribe_id;
+
+ /*
+ This Id is the Requestor Instance that is passed as
+ part of earlier MatchInd/FollowupInd message.
+ */
+ u32 requestor_instance_id;
+
+ /*
+ Discovery MAC addr of the publisher/peer
+ */
+ u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
+
+ /* Proposed bootstrapping method */
+ u16 request_bootstrapping_method;
+
+ /*
+ Sequence of values which further specify the published service beyond
+ the service name.
+ */
+ u16 service_specific_info_len;
+ u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ Sequence of values indicating the service specific info in SDEA
+ Used for service managed bootstrapping method
+ */
+ u16 sdea_service_specific_info_len;
+ u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
+
+ /* Indicates that this is comeback Bootstrapping request */
+ u8 comeback;
+
+ /* The length of cookie. */
+ u32 cookie_length;
+
+ /* Cookie for the follow up request */
+ u8 cookie[];
+
+} NanBootstrappingRequest;
+/*
+ NAN pairing bootstrapping response from responder to a initate request
+*/
+typedef struct {
+ /* Publish or Subscribe Id of local Publish/Subscribe */
+ u16 publish_subscribe_id;
+
+ /*
+ This Id is the Peer Instance that is passed as
+ part of earlier MatchInd/FollowupInd message.
+ */
+ u32 service_instance_id;
+
+ /* Discovery MAC addr of the peer/initiator */
+ u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
+
+ /*
+ Sequence of values which further specify the published service beyond
+ the service name.
+ */
+ u16 service_specific_info_len;
+ u8 service_specific_info[NAN_MAX_SERVICE_SPECIFIC_INFO_LEN];
+
+ /*
+ Sequence of values indicating the service specific info in SDEA
+ Used for service managed bootstrapping method
+ */
+ u16 sdea_service_specific_info_len;
+ u8 sdea_service_specific_info[NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN];
+
+ /* Response Code indicating ACCEPT/REJECT */
+ NanBootstrappingResponseCode rsp_code;
+
+ /* The delay of bootstrapping in seconds */
+ u32 come_back_delay;
+
+ /* The length of cookie. */
+ u32 cookie_length;
+
+ /* Cookie for the follow up response */
+ u8 cookie[];
+
+} NanBootstrappingIndicationResponse;
+
+/*
+ Event indication received on the responder side when a Nan bootsrapping session is initiated on
+ the Initiator side
+*/
+typedef struct {
+ /* Publish or Subscribe Id of an earlier Publish/Subscribe */
+ u16 publish_subscribe_id;
+ /*
+ Unique Instance Id corresponding to a service/session.
+ This is similar to the publish_id generated on the
+ publisher side
+ */
+ u32 bootstrapping_instance_id;
+ /*
+ This Id is the Requestor Instance that is passed as
+ part of earlier MatchInd/FollowupInd message.
+ */
+ u32 requestor_instance_id;
+ /* Discovery MAC addr of the peer/initiator */
+ u8 peer_disc_mac_addr[NAN_MAC_ADDR_LEN];
+ /* Proposed bootstrapping method from peer*/
+ u16 request_bootstrapping_method;
+
+} NanBootstrappingRequestInd;
+
+/*
+ Event indication of bootstapping confirm is received on both
+ initiator side confirming a bootstrapping method
+*/
+typedef struct {
+ /*
+ Unique token Id generated on the initiator/responder side
+ used for a bootstrapping session between two NAN devices
+ */
+ u32 bootstrapping_instance_id;
+ /* Response Code indicating ACCEPT/REJECT */
+ NanBootstrappingResponseCode rsp_code;
+ /*
+ Reason code indicating the cause for REJECT.
+ NAN_STATUS_SUCCESS and NAN_STATUS_PROTOCOL_FAILURE are
+ expected reason codes.
+ */
+ NanStatusType reason_code;
+ /* The delay of bootstrapping in seconds */
+ u32 come_back_delay;
+
+ /* The length of cookie. */
+ u32 cookie_length;
+
+ /* Cookie received from the comeback response */
+ u8 cookie[];
+
+} NanBootstrappingConfirmInd;
+
+/*
+ Event indication the device enter or exist the suspension mode
+*/
+typedef struct {
+ /* Indication the device is suspended or not */
+ bool is_suspended;
+} NanSuspensionModeChangeInd;
+
+/* Response and Event Callbacks */
+typedef struct {
+ /* NotifyResponse invoked to notify the status of the Request */
+ void (*NotifyResponse)(transaction_id id, NanResponseMsg* rsp_data);
+ /* Callbacks for various Events */
+ void (*EventPublishReplied)(NanPublishRepliedInd *event);
+ void (*EventPublishTerminated)(NanPublishTerminatedInd* event);
+ void (*EventMatch) (NanMatchInd* event);
+ void (*EventMatchExpired) (NanMatchExpiredInd* event);
+ void (*EventSubscribeTerminated) (NanSubscribeTerminatedInd* event);
+ void (*EventFollowup) (NanFollowupInd* event);
+ void (*EventDiscEngEvent) (NanDiscEngEventInd* event);
+ void (*EventDisabled) (NanDisabledInd* event);
+ void (*EventTca) (NanTCAInd* event);
+ void (*EventBeaconSdfPayload) (NanBeaconSdfPayloadInd* event);
+ void (*EventDataRequest)(NanDataPathRequestInd* event);
+ void (*EventDataConfirm)(NanDataPathConfirmInd* event);
+ void (*EventDataEnd)(NanDataPathEndInd* event);
+ void (*EventTransmitFollowup) (NanTransmitFollowupInd* event);
+ void (*EventRangeRequest) (NanRangeRequestInd* event);
+ void (*EventRangeReport) (NanRangeReportInd* event);
+ void (*EventScheduleUpdate) (NanDataPathScheduleUpdateInd* event);
+ void (*EventPairingRequest) (NanPairingRequestInd* event);
+ void (*EventPairingConfirm) (NanPairingConfirmInd* event);
+ void (*EventBootstrappingRequest) (NanBootstrappingRequestInd* event);
+ void (*EventBootstrappingConfirm) (NanBootstrappingConfirmInd* event);
+ void (*EventSuspensionModeChange) (NanSuspensionModeChangeInd* event);
+} NanCallbackHandler;
+
+/**@brief nan_enable_request
+ * Enable NAN functionality
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanEnableRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_ALREADY_ENABLED
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_NAN_NOT_ALLOWED
+ */
+wifi_error nan_enable_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanEnableRequest* msg);
+
+/**@brief nan_disbale_request
+ * Disable NAN functionality.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanDisableRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_PROTOCOL_FAILURE
+ *
+ */
+wifi_error nan_disable_request(transaction_id id,
+ wifi_interface_handle iface);
+
+/**@brief nan_publish_request
+ * Publish request to advertize a service
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanPublishRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_NO_RESOURCE_AVAILABLE
+ * NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID
+ */
+wifi_error nan_publish_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanPublishRequest* msg);
+
+/**@brief nan_publish_cancel_request
+ * Cancel previous publish request
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanPublishCancelRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID
+ * NAN_STATUS_INTERNAL_FAILURE
+ */
+wifi_error nan_publish_cancel_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanPublishCancelRequest* msg);
+
+/**@brief nan_subscribe_request
+ * Subscribe request to search for a service
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanSubscribeRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_NO_SPACE_AVAILABLE
+ * NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID
+ */
+wifi_error nan_subscribe_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanSubscribeRequest* msg);
+
+/**@brief nan_subscribe_cancel_request
+ * Cancel previous subscribe requests.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanSubscribeRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID
+ * NAN_STATUS_INTERNAL_FAILURE
+ */
+wifi_error nan_subscribe_cancel_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanSubscribeCancelRequest* msg);
+
+/**@brief nan_transmit_followup_request
+ * NAN transmit follow up request
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanTransmitFollowupRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_INVALID_PUBLISH_SUBSCRIBE_ID
+ * NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID
+ * NAN_STATUS_FOLLOWUP_QUEUE_FULL
+ * @return Asynchronous TransmitFollowupInd CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_NO_OTA_ACK
+ */
+wifi_error nan_transmit_followup_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanTransmitFollowupRequest* msg);
+
+/**@brief nan_stats_request
+ * Request NAN statistics from Discovery Engine.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanStatsRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_INVALID_PARAM
+ */
+wifi_error nan_stats_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanStatsRequest* msg);
+
+/**@brief nan_config_request
+ * NAN configuration request.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanConfigRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INTERNAL_FAILURE
+ */
+wifi_error nan_config_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanConfigRequest* msg);
+
+/**@brief nan_tca_request
+ * Configure the various Threshold crossing alerts
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanStatsRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ */
+wifi_error nan_tca_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanTCARequest* msg);
+
+/**@brief nan_beacon_sdf_payload_request
+ * Set NAN Beacon or sdf payload to discovery engine.
+ * This instructs the Discovery Engine to begin publishing the
+ * received payload in any Beacon or Service Discovery Frame transmitted
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanStatsRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ */
+wifi_error nan_beacon_sdf_payload_request(transaction_id id,
+ wifi_interface_handle iface,
+ NanBeaconSdfPayloadRequest* msg);
+
+/* Register NAN callbacks. */
+wifi_error nan_register_handler(wifi_interface_handle iface,
+ NanCallbackHandler handlers);
+
+/* Get NAN HAL version. */
+wifi_error nan_get_version(wifi_handle handle,
+ NanVersion* version);
+
+/**@brief nan_get_capabilities
+ * Get NAN Capabilities
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ */
+/* Get NAN capabilities. */
+wifi_error nan_get_capabilities(transaction_id id,
+ wifi_interface_handle iface);
+
+/* ========== Nan Data Path APIs ================ */
+/**@brief nan_data_interface_create
+ * Create NAN Data Interface.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param iface_name:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ */
+wifi_error nan_data_interface_create(transaction_id id,
+ wifi_interface_handle iface,
+ char* iface_name);
+
+/**@brief nan_data_interface_delete
+ * Delete NAN Data Interface.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param iface_name:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ */
+wifi_error nan_data_interface_delete(transaction_id id,
+ wifi_interface_handle iface,
+ char* iface_name);
+
+/**@brief nan_data_request_initiator
+ * Initiate a NAN Data Path session.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanDataPathInitiatorRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID
+ */
+wifi_error nan_data_request_initiator(transaction_id id,
+ wifi_interface_handle iface,
+ NanDataPathInitiatorRequest* msg);
+
+/**@brief nan_data_indication_response
+ * Response to a data indication received
+ * corresponding to a NDP session. An indication
+ * is received with a data request and the responder
+ * will send a data response
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanDataPathIndicationResponse:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INVALID_NDP_ID
+ */
+wifi_error nan_data_indication_response(transaction_id id,
+ wifi_interface_handle iface,
+ NanDataPathIndicationResponse* msg);
+
+/**@brief nan_data_end
+ * NDL termination request: from either Initiator/Responder
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanDataPathEndRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INVALID_NDP_ID
+ */
+wifi_error nan_data_end(transaction_id id,
+ wifi_interface_handle iface,
+ NanDataPathEndRequest* msg);
+/**@brief nan_pairing_request
+ * Initiate a NAN Pairingsession.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanPairingRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID
+ */
+wifi_error nan_pairing_request(transaction_id id, wifi_interface_handle iface,
+ NanPairingRequest* msg);
+
+/**@brief nan_pairing_indication_response
+ * Response to a pairing indication received
+ * corresponding to a pairing session. An indication
+ * is received with a pairing request and the responder
+ * will send a pairing response
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanPairingIndicationResponse:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INVALID_PAIRING_ID
+ */
+wifi_error nan_pairing_indication_response(transaction_id id, wifi_interface_handle iface,
+ NanPairingIndicationResponse* msg);
+
+/**@brief nan_pairing_end
+ * Cancel and remove the existing Pairing setups
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanPairingEndRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INVALID_PAIRING_ID
+ */
+wifi_error nan_pairing_end(transaction_id id, wifi_interface_handle iface,
+ NanPairingEndRequest* msg);
+
+/**@brief nan_bootstrapping_request
+ * Initiate a NAN Bootstrapping session.
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanBootstrappingRequest:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INVALID_REQUESTOR_INSTANCE_ID
+ */
+wifi_error nan_bootstrapping_request(transaction_id id, wifi_interface_handle iface,
+ NanBootstrappingRequest* msg);
+
+/**@brief nan_bootstrapping_indication_response
+ * Response to a pairing indication received
+ * corresponding to a pairing session. An indication
+ * is received with a pairing request and the responder
+ * will send a pairing response
+ *
+ * @param transaction_id:
+ * @param wifi_interface_handle:
+ * @param NanBootstrappingIndicationResponse:
+ * @return Synchronous wifi_error
+ * @return Asynchronous NotifyResponse CB return
+ * NAN_STATUS_SUCCESS
+ * NAN_STATUS_INVALID_PARAM
+ * NAN_STATUS_INTERNAL_FAILURE
+ * NAN_STATUS_PROTOCOL_FAILURE
+ * NAN_STATUS_INVALID_BOOTSTRAPPING_ID
+ */
+wifi_error nan_bootstrapping_indication_response(transaction_id id, wifi_interface_handle iface,
+ NanBootstrappingIndicationResponse* msg);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __NAN_H__ */
diff --git a/wifi/legacy_headers/include/hardware_legacy/wifi_offload.h b/wifi/legacy_headers/include/hardware_legacy/wifi_offload.h
new file mode 100644
index 0000000..835614e
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/wifi_offload.h
@@ -0,0 +1,32 @@
+#include "wifi_hal.h"
+
+#ifndef __WIFI_HAL_OFFLOAD_H
+#define __WIFI_HAL_OFFLOAD_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#define ETHER_ADDR_LEN 6 // Ethernet frame address length
+#define N_AVAIL_ID 3 // available mkeep_alive IDs from 1 to 3
+#define MKEEP_ALIVE_IP_PKT_MAX 256 // max size of IP packet for keep alive
+
+/**
+ * Send specified keep alive packet periodically.
+ */
+wifi_error wifi_start_sending_offloaded_packet(wifi_request_id id, wifi_interface_handle iface,
+ u16 ether_type, u8 *ip_packet, u16 ip_packet_len, u8 *src_mac_addr, u8 *dst_mac_addr,
+ u32 period_msec);
+
+/**
+ * Stop sending keep alive packet.
+ */
+wifi_error wifi_stop_sending_offloaded_packet(wifi_request_id id, wifi_interface_handle iface);
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /*__WIFI_HAL_OFFLOAD_H */
diff --git a/wifi/legacy_headers/include/hardware_legacy/wifi_twt.h b/wifi/legacy_headers/include/hardware_legacy/wifi_twt.h
new file mode 100644
index 0000000..1a787ef
--- /dev/null
+++ b/wifi/legacy_headers/include/hardware_legacy/wifi_twt.h
@@ -0,0 +1,310 @@
+/*
+ * Copyright (C) 2020 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 __WIFI_HAL_TWT_H__
+#define __WIFI_HAL_TWT_H__
+
+#include "wifi_hal.h"
+
+/**
+ * New HAL interface to Target Wake Time (TWT).
+ */
+
+/* TWT capabilities supported */
+typedef struct {
+ u8 is_twt_requester_supported; // 0 for not supporting twt requester
+ u8 is_twt_responder_supported; // 0 for not supporting twt responder
+ u8 is_broadcast_twt_supported; // 0 for not supporting broadcast twt
+ u8 is_flexible_twt_supported; // 0 for not supporting flexible twt schedules
+ u32 min_wake_duration_micros; // minimum twt wake duration capable in microseconds
+ u32 max_wake_duration_micros; // maximum twt wake duration capable in microseconds
+ u32 min_wake_interval_micros; // minimum twt wake interval capable in microseconds
+ u32 max_wake_interval_micros; // maximum twt wake interval capable in microseconds
+} wifi_twt_capabilities;
+
+/* TWT request parameters to setup or update a TWT session */
+typedef struct {
+ s8 mlo_link_id; // MLO Link id in case TWT is requesting for MLO connection.
+ // Otherwise UNSPECIFIED.
+ u32 min_wake_duration_micros; // minimum twt wake duration in microseconds
+ u32 max_wake_duration_micros; // maximum twt wake duration in microseconds
+ u32 min_wake_interval_micros; // minimum twt wake interval in microseconds
+ u32 max_wake_interval_micros; // maximum twt wake interval in microseconds
+} wifi_twt_request;
+
+/* TWT negotiation types */
+typedef enum {
+ WIFI_TWT_NEGO_TYPE_INDIVIDUAL,
+ WIFI_TWT_NEGO_TYPE_BROADCAST,
+} wifi_twt_negotiation_type;
+
+/* TWT session */
+typedef struct {
+ u32 session_id; // a unique identifier for the session
+ s8 mlo_link_id; // link id in case of MLO connection. Otherwise UNSPECIFIED.
+ u32 wake_duration_micros; // TWT service period in microseconds
+ u32 wake_interval_micros; // TWT wake interval for this session in microseconds
+ wifi_twt_negotiation_type negotiation_type; // TWT negotiation type
+ u8 is_trigger_enabled; // 0 if this TWT session is not trigger enabled
+ u8 is_announced; // 0 if this TWT session is not announced
+ u8 is_implicit; // 0 if this TWT session is not implicit
+ u8 is_protected; // 0 if this TWT session is not protected
+ u8 is_updatable; // 0 if this TWT session is not updatable
+ u8 is_suspendable; // 0 if this TWT session can not be suspended and resumed
+ u8 is_responder_pm_mode_enabled; // 0 if TWT responder does not intend to go to doze mode
+ // outside of TWT service periods
+} wifi_twt_session;
+
+/* TWT session stats */
+typedef struct {
+ u32 avg_pkt_num_tx; // Average number of Tx packets in each wake duration.
+ u32 avg_pkt_num_rx; // Average number of Rx packets in each wake duration.
+ u32 avg_tx_pkt_size; // Average bytes per Rx packet in each wake duration.
+ u32 avg_rx_pkt_size; // Average bytes per Rx packet in each wake duration.
+ u32 avg_eosp_dur_us; // Average duration of early terminated SP
+ u32 eosp_count; // Count of early terminations
+} wifi_twt_session_stats;
+
+/* TWT error codes */
+typedef enum {
+ WIFI_TWT_ERROR_CODE_FAILURE_UNKNOWN, // unknown failure
+ WIFI_TWT_ERROR_CODE_ALREADY_RESUMED, // TWT session is already resumed
+ WIFI_TWT_ERROR_CODE_ALREADY_SUSPENDED, // TWT session is already suspended
+ WIFI_TWT_ERROR_CODE_INVALID_PARAMS, // invalid parameters
+ WIFI_TWT_ERROR_CODE_MAX_SESSION_REACHED,// maximum number of sessions reached
+ WIFI_TWT_ERROR_CODE_NOT_AVAILABLE, // requested operation is not available
+ WIFI_TWT_ERROR_CODE_NOT_SUPPORTED, // requested operation is not supported
+ WIFI_TWT_ERROR_CODE_PEER_NOT_SUPPORTED, // requested operation is not supported by the
+ // peer
+ WIFI_TWT_ERROR_CODE_PEER_REJECTED, // requested operation is rejected by the peer
+ WIFI_TWT_ERROR_CODE_TIMEOUT, // requested operation is timed out
+} wifi_twt_error_code;
+
+/* TWT teardown reason codes */
+typedef enum {
+ WIFI_TWT_TEARDOWN_REASON_CODE_UNKNOWN, // unknown reason
+ WIFI_TWT_TEARDOWN_REASON_CODE_LOCALLY_REQUESTED, // teardown requested by the framework
+ WIFI_TWT_TEARDOWN_REASON_CODE_INTERNALLY_INITIATED, // teardown initiated internally by the
+ // firmware or driver.
+ WIFI_TWT_TEARDOWN_REASON_CODE_PEER_INITIATED, // teardown initiated by the peer
+} wifi_twt_teardown_reason_code;
+
+/**
+ * TWT events
+ *
+ * Each of the events has a wifi_request_id to match the command responsible for the event. If the
+ * id is 0, the event is an unsolicited.
+ */
+typedef struct {
+ /**
+ * Called to indicate a TWT failure.
+ *
+ * @param id Id used to identify the command. The value 0 indicates no associated command.
+ * @param error_code TWT error code.
+ */
+ void (*on_twt_failure)(wifi_request_id id, wifi_twt_error_code error_code);
+
+ /**
+ * Called when a Target Wake Time session is created. See wifi_twt_session_setup.
+ *
+ * @param id Id used to identify the command.
+ * @param session TWT session created.
+ */
+ void (*on_twt_session_create)(wifi_request_id id, wifi_twt_session session);
+
+ /**
+ * Called when a Target Wake Time session is updated. See wifi_twt_session_update.
+ *
+ * @param id Id used to identify the command. The value 0 indicates no associated command.
+ * @param twtSession TWT session.
+ */
+ void (*on_twt_session_update)(wifi_request_id id, wifi_twt_session session);
+
+ /**
+ * Called when the Target Wake Time session is torn down. See wifi_twt_session_teardown.
+ *
+ * @param id Id used to identify the command. The value 0 indicates no associated command.
+ * @param session_id TWT session id.
+ * @param reason Teardown reason code.
+ */
+ void (*on_twt_session_teardown)(wifi_request_id id, int session_id,
+ wifi_twt_teardown_reason_code reason);
+
+ /**
+ * Called when TWT session stats available. See wifi_twt_session_get_stats.
+ *
+ * @param id Id used to identify the command.
+ * @param session_id TWT session id.
+ * @param stats TWT session stats.
+ */
+ void (*on_twt_session_stats)(wifi_request_id id, int session_id, wifi_twt_session_stats stats);
+
+ /**
+ * Called when the Target Wake Time session is suspended. See wifi_twt_session_suspend.
+ *
+ * @param id Id used to identify the command.
+ * @param session_id TWT session id.
+ */
+ void (*on_twt_session_suspend)(wifi_request_id id, int session_id);
+
+ /**
+ * Called when the Target Wake Time session is resumed. See wifi_twt_session_resume.
+ *
+ * @param id Id used to identify the command.
+ * @param session_id TWT session id.
+ */
+ void (*on_twt_session_resume)(wifi_request_id id, int session_id);
+} wifi_twt_events;
+
+/**
+ * Important note: Following legacy HAL TWT interface is deprecated. It will be removed in future.
+ * Please use the new interface listed above.
+ */
+typedef struct {
+ u8 requester_supported; // 0 for not supporting requester
+ u8 responder_supported; // 0 for not supporting responder
+ u8 broadcast_twt_supported; // 0 for not supporting broadcast TWT
+ u8 flexibile_twt_supported; // 0 for not supporting flexible TWT
+} TwtCapability;
+
+typedef struct {
+ TwtCapability device_capability;
+ TwtCapability peer_capability;
+} TwtCapabilitySet;
+
+// For all optional fields below, if no value specify -1
+typedef struct {
+ u8 config_id; // An unique ID for an individual TWT request
+ u8 negotiation_type; // 0 for individual TWT, 1 for broadcast TWT
+ u8 trigger_type; // 0 for non-triggered TWT, 1 for triggered TWT
+ s32 wake_dur_us; // Proposed wake duration in us
+ s32 wake_int_us; // Average wake interval in us
+ s32 wake_int_min_us; // Min wake interval in us. Optional.
+ s32 wake_int_max_us; // Max wake interval in us. Optional.
+ s32 wake_dur_min_us; // Min wake duration in us. Optional.
+ s32 wake_dur_max_us; // Max wake duration in us. Optional.
+ s32 avg_pkt_size; // Average bytes of each packet to send in each wake
+ // duration. Optional.
+ s32 avg_pkt_num; // Average number of packets to send in each wake
+ // duration. Optional.
+ s32 wake_time_off_us; // First wake duration time offset in us. Optional.
+} TwtSetupRequest;
+
+typedef enum {
+ TWT_SETUP_SUCCESS = 0, // TWT setup is accepted.
+ TWT_SETUP_REJECT = 1, // TWT setup is rejected by AP.
+ TWT_SETUP_TIMEOUT = 2, // TWT setup response from AP times out.
+ TWT_SETUP_IE = 3, // AP sent TWT Setup IE parsing failure.
+ TWT_SETUP_PARAMS = 4, // AP sent TWT Setup IE Parameters invalid.
+ TWT_SETUP_ERROR = 255, // Generic error
+} TwtSetupReasonCode;
+
+typedef struct {
+ u8 config_id; // An unique ID for an individual TWT request
+ u8 status; // 0 for success, non-zero for failure
+ TwtSetupReasonCode reason_code;
+ u8 negotiation_type; // 0 for individual TWT, 1 for broadcast TWT
+ u8 trigger_type; // 0 for non-triggered TWT, 1 for triggered TWT
+ s32 wake_dur_us; // Proposed wake duration in us
+ s32 wake_int_us; // Average wake interval in us
+ s32 wake_time_off_us; // First wake duration time offset in us.
+} TwtSetupResponse;
+
+typedef struct {
+ u8 config_id; // An unique ID for an individual TWT request
+ u8 all_twt; // 0 for individual setp request, 1 for all TWT
+ u8 negotiation_type; // 0 for individual TWT, 1 for broadcast TWT
+} TwtTeardownRequest;
+
+typedef enum {
+ TWT_TD_RC_HOST = 0, // Teardown triggered by Host
+ TWT_TD_RC_PEER = 1, // Peer initiated teardown
+ TWT_TD_RC_MCHAN = 2, // Teardown due to MCHAN Active
+ TWT_TD_RC_MCNX = 3, // Teardown due to MultiConnection
+ TWT_TD_RC_CSA = 4, // Teardown due to CSA
+ TWT_TD_RC_BTCX = 5, // Teardown due to BT Coex
+ TWT_TD_RC_SETUP_FAIL = 6, // Setup fails midway. Teardown all connections
+ TWT_TD_RC_SCHED = 7, // Teardown by TWT Scheduler
+ TWT_TD_RC_ERROR = 255, // Generic error cases
+} TwtTeardownReason;
+
+typedef struct {
+ u8 config_id; // An unique ID for an individual TWT request
+ u8 all_twt; // 0 for individual setp request, 1 for all TWT
+ u8 status; // 0 for success, non-zero for failure
+ TwtTeardownReason reason;
+} TwtTeardownCompletion;
+
+typedef struct {
+ u8 config_id; // An unique ID for an individual TWT request
+ u8 all_twt; // 0 for individual setup request, 1 for all TWT
+ s32 resume_time_us; // If -1, TWT is suspended for indefinite time.
+ // Otherwise, TWT is suspended for resume_time_us
+} TwtInfoFrameRequest;
+
+typedef enum {
+ TWT_INFO_RC_HOST = 0, // Host initiated TWT Info frame */
+ TWT_INFO_RC_PEER = 1, // Peer initiated TWT Info frame
+ TWT_INFO_RC_ERROR = 2, // Generic error conditions */
+} TwtInfoFrameReason;
+
+// TWT Info frame triggered externally.
+// Device should not send TwtInfoFrameReceived to Host for internally
+// triggered TWT Info frame during SCAN, MCHAN operations.
+typedef struct {
+ u8 config_id; // An unique ID for an individual TWT request
+ u8 all_twt; // 0 for individual setup request, 1 for all TWT
+ u8 status; // 0 for success, non-zero for failure
+ TwtInfoFrameReason reason;
+ u8 twt_resumed; // 1 - TWT resumed, 0 - TWT suspended
+} TwtInfoFrameReceived;
+
+typedef struct {
+ u8 config_id;
+ u32 avg_pkt_num_tx; // Average number of Tx packets in each wake duration.
+ u32 avg_pkt_num_rx; // Average number of Rx packets in each wake duration.
+ u32 avg_tx_pkt_size; // Average bytes per Rx packet in each wake duration.
+ u32 avg_rx_pkt_size; // Average bytes per Rx packet in each wake duration.
+ u32 avg_eosp_dur_us; // Average duration of early terminated SP
+ u32 eosp_count; // Count of early terminations
+ u32 num_sp; // Count of service period (SP), also known as wake duration.
+} TwtStats;
+
+// Asynchronous notification from the device.
+// For example, TWT was torn down by the device and later when the device is
+// ready, it can send this async notification.
+// This can be expandable in future.
+typedef enum {
+ TWT_NOTIF_ALLOW_TWT = 1, // Device ready to process TWT Setup request
+} TwtNotification;
+
+typedef struct {
+ TwtNotification notification;
+} TwtDeviceNotify;
+
+// Callbacks for various TWT responses and events
+typedef struct {
+ // Callback for TWT setup response
+ void (*EventTwtSetupResponse)(TwtSetupResponse *event);
+ // Callback for TWT teardown completion
+ void (*EventTwtTeardownCompletion)(TwtTeardownCompletion* event);
+ // Callback for TWT info frame received event
+ void (*EventTwtInfoFrameReceived)(TwtInfoFrameReceived* event);
+ // Callback for TWT notification from the device
+ void (*EventTwtDeviceNotify)(TwtDeviceNotify* event);
+} TwtCallbackHandler;
+
+#endif /* __WIFI_HAL_TWT_H__ */
diff --git a/wifi/netlinkinterceptor/aidl/Android.bp b/wifi/netlinkinterceptor/aidl/Android.bp
index 2f7f34f..8c04e31 100644
--- a/wifi/netlinkinterceptor/aidl/Android.bp
+++ b/wifi/netlinkinterceptor/aidl/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/netlinkinterceptor/aidl/default/Android.bp b/wifi/netlinkinterceptor/aidl/default/Android.bp
index c3a0c03..6bdd9fc 100644
--- a/wifi/netlinkinterceptor/aidl/default/Android.bp
+++ b/wifi/netlinkinterceptor/aidl/default/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/netlinkinterceptor/libnlinterceptor/Android.bp b/wifi/netlinkinterceptor/libnlinterceptor/Android.bp
index 671cd85..9b278b6 100644
--- a/wifi/netlinkinterceptor/libnlinterceptor/Android.bp
+++ b/wifi/netlinkinterceptor/libnlinterceptor/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/netlinkinterceptor/vts/functional/Android.bp b/wifi/netlinkinterceptor/vts/functional/Android.bp
index 80608a7..30766c0 100644
--- a/wifi/netlinkinterceptor/vts/functional/Android.bp
+++ b/wifi/netlinkinterceptor/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/supplicant/1.0/Android.bp b/wifi/supplicant/1.0/Android.bp
index 89a0907..3449e40 100644
--- a/wifi/supplicant/1.0/Android.bp
+++ b/wifi/supplicant/1.0/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/supplicant/1.0/vts/functional/Android.bp b/wifi/supplicant/1.0/vts/functional/Android.bp
index 2d86822..353e57b 100644
--- a/wifi/supplicant/1.0/vts/functional/Android.bp
+++ b/wifi/supplicant/1.0/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/supplicant/1.1/Android.bp b/wifi/supplicant/1.1/Android.bp
index f925671..e2582e5 100644
--- a/wifi/supplicant/1.1/Android.bp
+++ b/wifi/supplicant/1.1/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/supplicant/1.1/vts/functional/Android.bp b/wifi/supplicant/1.1/vts/functional/Android.bp
index 68cda33..215c1ca 100644
--- a/wifi/supplicant/1.1/vts/functional/Android.bp
+++ b/wifi/supplicant/1.1/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/supplicant/1.2/Android.bp b/wifi/supplicant/1.2/Android.bp
index f61d9b9..c7ce010 100644
--- a/wifi/supplicant/1.2/Android.bp
+++ b/wifi/supplicant/1.2/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/supplicant/1.2/vts/functional/Android.bp b/wifi/supplicant/1.2/vts/functional/Android.bp
index ec3ca22..65a17a8 100644
--- a/wifi/supplicant/1.2/vts/functional/Android.bp
+++ b/wifi/supplicant/1.2/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/supplicant/1.3/Android.bp b/wifi/supplicant/1.3/Android.bp
index 173a1ef..bbb17c2 100644
--- a/wifi/supplicant/1.3/Android.bp
+++ b/wifi/supplicant/1.3/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/supplicant/1.3/vts/functional/Android.bp b/wifi/supplicant/1.3/vts/functional/Android.bp
index 4b56336..609de11 100644
--- a/wifi/supplicant/1.3/vts/functional/Android.bp
+++ b/wifi/supplicant/1.3/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/supplicant/1.4/Android.bp b/wifi/supplicant/1.4/Android.bp
index c988fdb..4b94823 100644
--- a/wifi/supplicant/1.4/Android.bp
+++ b/wifi/supplicant/1.4/Android.bp
@@ -1,6 +1,7 @@
// This file is autogenerated by hidl-gen -Landroidbp.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/supplicant/1.4/vts/functional/Android.bp b/wifi/supplicant/1.4/vts/functional/Android.bp
index 57ee830..def3b86 100644
--- a/wifi/supplicant/1.4/vts/functional/Android.bp
+++ b/wifi/supplicant/1.4/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
diff --git a/wifi/supplicant/aidl/Android.bp b/wifi/supplicant/aidl/Android.bp
index ac5a952..59cfa6f 100644
--- a/wifi/supplicant/aidl/Android.bp
+++ b/wifi/supplicant/aidl/Android.bp
@@ -13,6 +13,7 @@
// limitations under the License.
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -27,6 +28,9 @@
srcs: [
"android/hardware/wifi/supplicant/*.aidl",
],
+ imports: [
+ "android.hardware.wifi.common-V1",
+ ],
stability: "vintf",
backend: {
java: {
@@ -45,6 +49,12 @@
ndk: {
gen_trace: true,
},
+ cpp: {
+ enabled: false,
+ },
+ rust: {
+ enabled: false,
+ },
},
versions_with_info: [
{
@@ -57,6 +67,5 @@
},
],
- frozen: true,
-
+ frozen: false,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuthAlgMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuthAlgMask.aidl
index 9cd178d..4421018 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuthAlgMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuthAlgMask.aidl
@@ -34,8 +34,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum AuthAlgMask {
- OPEN = 1,
- SHARED = 2,
- LEAP = 4,
- SAE = 16,
+ OPEN = (1 << 0) /* 1 */,
+ SHARED = (1 << 1) /* 2 */,
+ LEAP = (1 << 2) /* 4 */,
+ SAE = (1 << 4) /* 16 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl
index 471cfff..a339a92 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/AuxiliarySupplicantEventCode.aidl
@@ -34,7 +34,7 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum AuxiliarySupplicantEventCode {
- EAP_METHOD_SELECTED = 0,
- SSID_TEMP_DISABLED = 1,
- OPEN_SSL_FAILURE = 2,
+ EAP_METHOD_SELECTED,
+ SSID_TEMP_DISABLED,
+ OPEN_SSL_FAILURE,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl
index f215f05..6f0045c 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/BssTmDataFlagsMask.aidl
@@ -34,12 +34,12 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum BssTmDataFlagsMask {
- WNM_MODE_PREFERRED_CANDIDATE_LIST_INCLUDED = 1,
- WNM_MODE_ABRIDGED = 2,
- WNM_MODE_DISASSOCIATION_IMMINENT = 4,
- WNM_MODE_BSS_TERMINATION_INCLUDED = 8,
- WNM_MODE_ESS_DISASSOCIATION_IMMINENT = 16,
- MBO_TRANSITION_REASON_CODE_INCLUDED = 32,
- MBO_ASSOC_RETRY_DELAY_INCLUDED = 64,
- MBO_CELLULAR_DATA_CONNECTION_PREFERENCE_INCLUDED = 128,
+ WNM_MODE_PREFERRED_CANDIDATE_LIST_INCLUDED = (1 << 0) /* 1 */,
+ WNM_MODE_ABRIDGED = (1 << 1) /* 2 */,
+ WNM_MODE_DISASSOCIATION_IMMINENT = (1 << 2) /* 4 */,
+ WNM_MODE_BSS_TERMINATION_INCLUDED = (1 << 3) /* 8 */,
+ WNM_MODE_ESS_DISASSOCIATION_IMMINENT = (1 << 4) /* 16 */,
+ MBO_TRANSITION_REASON_CODE_INCLUDED = (1 << 5) /* 32 */,
+ MBO_ASSOC_RETRY_DELAY_INCLUDED = (1 << 6) /* 64 */,
+ MBO_CELLULAR_DATA_CONNECTION_PREFERENCE_INCLUDED = (1 << 7) /* 128 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl
index 553cbc8..a0dd32f 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl
@@ -40,4 +40,5 @@
int maxNumberRxSpatialStreams;
android.hardware.wifi.supplicant.LegacyMode legacyMode;
boolean apTidToLinkMapNegotiationSupported;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppAkm.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppAkm.aidl
index df2aef8..730843d 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppAkm.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppAkm.aidl
@@ -34,8 +34,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum DppAkm {
- PSK = 0,
- PSK_SAE = 1,
- SAE = 2,
- DPP = 3,
+ PSK,
+ PSK_SAE,
+ SAE,
+ DPP,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppCurve.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppCurve.aidl
index e69da44..14cb49f 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppCurve.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppCurve.aidl
@@ -34,10 +34,10 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum DppCurve {
- PRIME256V1 = 0,
- SECP384R1 = 1,
- SECP521R1 = 2,
- BRAINPOOLP256R1 = 3,
- BRAINPOOLP384R1 = 4,
- BRAINPOOLP512R1 = 5,
+ PRIME256V1,
+ SECP384R1,
+ SECP521R1,
+ BRAINPOOLP256R1,
+ BRAINPOOLP384R1,
+ BRAINPOOLP512R1,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppEventType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppEventType.aidl
index 9e394fc..47c8cc0 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppEventType.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppEventType.aidl
@@ -34,6 +34,6 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum DppEventType {
- CONFIGURATION_SENT = 0,
- CONFIGURATION_APPLIED = 1,
+ CONFIGURATION_SENT,
+ CONFIGURATION_APPLIED,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppFailureCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppFailureCode.aidl
index 7e7c806..89fbc4b 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppFailureCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppFailureCode.aidl
@@ -34,16 +34,16 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum DppFailureCode {
- INVALID_URI = 0,
- AUTHENTICATION = 1,
- NOT_COMPATIBLE = 2,
- CONFIGURATION = 3,
- BUSY = 4,
- TIMEOUT = 5,
- FAILURE = 6,
- NOT_SUPPORTED = 7,
- CONFIGURATION_REJECTED = 8,
- CANNOT_FIND_NETWORK = 9,
- ENROLLEE_AUTHENTICATION = 10,
- URI_GENERATION = 11,
+ INVALID_URI,
+ AUTHENTICATION,
+ NOT_COMPATIBLE,
+ CONFIGURATION,
+ BUSY,
+ TIMEOUT,
+ FAILURE,
+ NOT_SUPPORTED,
+ CONFIGURATION_REJECTED,
+ CANNOT_FIND_NETWORK,
+ ENROLLEE_AUTHENTICATION,
+ URI_GENERATION,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppNetRole.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppNetRole.aidl
index c6d3522..77a910b 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppNetRole.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppNetRole.aidl
@@ -34,6 +34,6 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum DppNetRole {
- STA = 0,
- AP = 1,
+ STA,
+ AP,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppProgressCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppProgressCode.aidl
index f0618a5..ea244de 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppProgressCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppProgressCode.aidl
@@ -34,8 +34,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum DppProgressCode {
- AUTHENTICATION_SUCCESS = 0,
- RESPONSE_PENDING = 1,
- CONFIGURATION_SENT_WAITING_RESPONSE = 2,
- CONFIGURATION_ACCEPTED = 3,
+ AUTHENTICATION_SUCCESS,
+ RESPONSE_PENDING,
+ CONFIGURATION_SENT_WAITING_RESPONSE,
+ CONFIGURATION_ACCEPTED,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl
index d72633b..21f07dd 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/DppStatusErrorCode.aidl
@@ -34,7 +34,7 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum DppStatusErrorCode {
- UNKNOWN = -1,
+ UNKNOWN = (-1) /* -1 */,
SUCCESS = 0,
NOT_COMPATIBLE = 1,
AUTH_FAILURE = 2,
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupCipherMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupCipherMask.aidl
index f2da925..d22d3d0 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupCipherMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupCipherMask.aidl
@@ -34,12 +34,12 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum GroupCipherMask {
- WEP40 = 2,
- WEP104 = 4,
- TKIP = 8,
- CCMP = 16,
- GTK_NOT_USED = 16384,
- GCMP_256 = 256,
- SMS4 = 128,
- GCMP_128 = 64,
+ WEP40 = (1 << 1) /* 2 */,
+ WEP104 = (1 << 2) /* 4 */,
+ TKIP = (1 << 3) /* 8 */,
+ CCMP = (1 << 4) /* 16 */,
+ GTK_NOT_USED = (1 << 14) /* 16384 */,
+ GCMP_256 = (1 << 8) /* 256 */,
+ SMS4 = (1 << 7) /* 128 */,
+ GCMP_128 = (1 << 6) /* 64 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl
index c24d6cc..23bb04f 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/GroupMgmtCipherMask.aidl
@@ -34,7 +34,7 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum GroupMgmtCipherMask {
- BIP_GMAC_128 = 2048,
- BIP_GMAC_256 = 4096,
- BIP_CMAC_256 = 8192,
+ BIP_GMAC_128 = (1 << 11) /* 2048 */,
+ BIP_GMAC_256 = (1 << 12) /* 4096 */,
+ BIP_CMAC_256 = (1 << 13) /* 8192 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
index 19e6728..0729646 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
@@ -43,10 +43,16 @@
void cancelServiceDiscovery(in long identifier);
void cancelWps(in String groupIfName);
void configureExtListen(in int periodInMillis, in int intervalInMillis);
+ /**
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use connectWithParams.
+ */
String connect(in byte[] peerAddress, in android.hardware.wifi.supplicant.WpsProvisionMethod provisionMethod, in String preSelectedPin, in boolean joinExistingGroup, in boolean persistent, in int goIntent);
byte[] createNfcHandoverRequestMessage();
byte[] createNfcHandoverSelectMessage();
void enableWfd(in boolean enable);
+ /**
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use findWithParams.
+ */
void find(in int timeoutInSec);
void flush();
void flushServices();
@@ -93,8 +99,16 @@
String startWpsPinDisplay(in String groupIfName, in byte[] bssid);
void startWpsPinKeypad(in String groupIfName, in String pin);
void stopFind();
+ /**
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use findWithParams.
+ */
void findOnSocialChannels(in int timeoutInSec);
+ /**
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use findWithParams.
+ */
void findOnSpecificFrequency(in int freqInHz, in int timeoutInSec);
void setVendorElements(in android.hardware.wifi.supplicant.P2pFrameTypeMask frameTypeMask, in byte[] vendorElemBytes);
void configureEapolIpAddressAllocationParams(in int ipAddressGo, in int ipAddressMask, in int ipAddressStart, in int ipAddressEnd);
+ String connectWithParams(in android.hardware.wifi.supplicant.P2pConnectInfo connectInfo);
+ void findWithParams(in android.hardware.wifi.supplicant.P2pDiscoveryInfo discoveryInfo);
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
index da3ca52..851e851 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
@@ -34,6 +34,9 @@
package android.hardware.wifi.supplicant;
@VintfStability
interface ISupplicantP2pIfaceCallback {
+ /**
+ * @deprecated This callback is deprecated from AIDL v2, newer HAL should call onDeviceFoundWithParams.
+ */
oneway void onDeviceFound(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo);
oneway void onDeviceLost(in byte[] p2pDeviceAddress);
oneway void onFindStopped();
@@ -45,12 +48,28 @@
oneway void onGroupStarted(in String groupIfname, in boolean isGroupOwner, in byte[] ssid, in int frequency, in byte[] psk, in String passphrase, in byte[] goDeviceAddress, in boolean isPersistent);
oneway void onInvitationReceived(in byte[] srcAddress, in byte[] goDeviceAddress, in byte[] bssid, in int persistentNetworkId, in int operatingFrequency);
oneway void onInvitationResult(in byte[] bssid, in android.hardware.wifi.supplicant.P2pStatusCode status);
+ /**
+ * @deprecated This callback is deprecated from AIDL v3, newer HAL should call onProvisionDiscoveryCompletedEvent.
+ */
oneway void onProvisionDiscoveryCompleted(in byte[] p2pDeviceAddress, in boolean isRequest, in android.hardware.wifi.supplicant.P2pProvDiscStatusCode status, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in String generatedPin);
oneway void onR2DeviceFound(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo);
oneway void onServiceDiscoveryResponse(in byte[] srcAddress, in char updateIndicator, in byte[] tlvs);
+ /**
+ * @deprecated This callback is deprecated from AIDL v3, newer HAL should call onPeerClientJoined()
+ */
oneway void onStaAuthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress);
+ /**
+ * @deprecated This callback is deprecated from AIDL v3, newer HAL should call onPeerClientDisconnected()
+ */
oneway void onStaDeauthorized(in byte[] srcAddress, in byte[] p2pDeviceAddress);
oneway void onGroupFrequencyChanged(in String groupIfname, in int frequency);
+ /**
+ * @deprecated This callback is deprecated from AIDL v3, newer HAL should call onDeviceFoundWithParams.
+ */
oneway void onDeviceFoundWithVendorElements(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo, in byte[] wfdR2DeviceInfo, in byte[] vendorElemBytes);
oneway void onGroupStartedWithParams(in android.hardware.wifi.supplicant.P2pGroupStartedEventParams groupStartedEventParams);
+ oneway void onPeerClientJoined(in android.hardware.wifi.supplicant.P2pPeerClientJoinedEventParams clientJoinedEventParams);
+ oneway void onPeerClientDisconnected(in android.hardware.wifi.supplicant.P2pPeerClientDisconnectedEventParams clientDisconnectedEventParams);
+ oneway void onProvisionDiscoveryCompletedEvent(in android.hardware.wifi.supplicant.P2pProvisionDiscoveryCompletedEventParams provisionDiscoveryCompletedEventParams);
+ oneway void onDeviceFoundWithParams(in android.hardware.wifi.supplicant.P2pDeviceFoundEventParams deviceFoundEventParams);
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
index 1616b26..917668e 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
@@ -54,6 +54,9 @@
android.hardware.wifi.supplicant.IfaceType getType();
android.hardware.wifi.supplicant.WpaDriverCapabilitiesMask getWpaDriverCapabilities();
void initiateAnqpQuery(in byte[] macAddress, in android.hardware.wifi.supplicant.AnqpInfoId[] infoElements, in android.hardware.wifi.supplicant.Hs20AnqpSubtypes[] subTypes);
+ /**
+ * @deprecated No longer in use.
+ */
void initiateHs20IconQuery(in byte[] macAddress, in String fileName);
void initiateTdlsDiscover(in byte[] macAddress);
void initiateTdlsSetup(in byte[] macAddress);
@@ -98,5 +101,7 @@
android.hardware.wifi.supplicant.SignalPollResult[] getSignalPollResults();
android.hardware.wifi.supplicant.QosPolicyScsRequestStatus[] addQosPolicyRequestForScs(in android.hardware.wifi.supplicant.QosPolicyScsData[] qosPolicyData);
android.hardware.wifi.supplicant.QosPolicyScsRequestStatus[] removeQosPolicyForScs(in byte[] scsPolicyIds);
+ void configureMscs(in android.hardware.wifi.supplicant.MscsParams params);
+ void disableMscs();
const int MAX_POLICIES_PER_QOS_SCS_REQUEST = 16;
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
index 1c23223..898c2d4 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
@@ -53,6 +53,9 @@
oneway void onExtRadioWorkStart(in int id);
oneway void onExtRadioWorkTimeout(in int id);
oneway void onHs20DeauthImminentNotice(in byte[] bssid, in int reasonCode, in int reAuthDelayInSec, in String url);
+ /**
+ * @deprecated No longer in use.
+ */
oneway void onHs20IconQueryDone(in byte[] bssid, in String fileName, in byte[] data);
oneway void onHs20SubscriptionRemediation(in byte[] bssid, in android.hardware.wifi.supplicant.OsuMethod osuMethod, in String url);
oneway void onHs20TermsAndConditionsAcceptanceRequestedNotification(in byte[] bssid, in String url);
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl
index bfc05a4..488037f 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl
@@ -129,6 +129,8 @@
void setRoamingConsortiumSelection(in byte[] selectedRcoi);
void setMinimumTlsVersionEapPhase1Param(android.hardware.wifi.supplicant.TlsVersion tlsVersion);
void setStrictConservativePeerMode(in boolean enable);
+ void disableEht();
+ void setVendorData(in android.hardware.wifi.common.OuiKeyedData[] vendorData);
const int SSID_MAX_LEN_IN_BYTES = 32;
const int PSK_PASSPHRASE_MIN_LEN_IN_BYTES = 8;
const int PSK_PASSPHRASE_MAX_LEN_IN_BYTES = 63;
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IfaceType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IfaceType.aidl
index 557dbd7..e11c2f7 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IfaceType.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IfaceType.aidl
@@ -34,6 +34,6 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum IfaceType {
- STA = 0,
- P2P = 1,
+ STA,
+ P2P,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IpVersion.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IpVersion.aidl
index f571b44..9580314 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IpVersion.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/IpVersion.aidl
@@ -34,6 +34,6 @@
package android.hardware.wifi.supplicant;
@Backing(type="byte") @VintfStability
enum IpVersion {
- VERSION_4 = 0,
- VERSION_6 = 1,
+ VERSION_4,
+ VERSION_6,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/KeyMgmtMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
index 7228480..35d51bc 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
@@ -34,21 +34,21 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum KeyMgmtMask {
- WPA_EAP = 1,
- WPA_PSK = 2,
- NONE = 4,
- IEEE8021X = 8,
- FT_EAP = 32,
- FT_PSK = 64,
- OSEN = 32768,
- WPA_EAP_SHA256 = 128,
- WPA_PSK_SHA256 = 256,
- SAE = 1024,
- SUITE_B_192 = 131072,
- OWE = 4194304,
- DPP = 8388608,
- WAPI_PSK = 4096,
- WAPI_CERT = 8192,
- FILS_SHA256 = 262144,
- FILS_SHA384 = 524288,
+ WPA_EAP = (1 << 0) /* 1 */,
+ WPA_PSK = (1 << 1) /* 2 */,
+ NONE = (1 << 2) /* 4 */,
+ IEEE8021X = (1 << 3) /* 8 */,
+ FT_EAP = (1 << 5) /* 32 */,
+ FT_PSK = (1 << 6) /* 64 */,
+ OSEN = (1 << 15) /* 32768 */,
+ WPA_EAP_SHA256 = (1 << 7) /* 128 */,
+ WPA_PSK_SHA256 = (1 << 8) /* 256 */,
+ SAE = (1 << 10) /* 1024 */,
+ SUITE_B_192 = (1 << 17) /* 131072 */,
+ OWE = (1 << 22) /* 4194304 */,
+ DPP = (1 << 23) /* 8388608 */,
+ WAPI_PSK = (1 << 12) /* 4096 */,
+ WAPI_CERT = (1 << 13) /* 8192 */,
+ FILS_SHA256 = (1 << 18) /* 262144 */,
+ FILS_SHA384 = (1 << 19) /* 524288 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MscsParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MscsParams.aidl
new file mode 100644
index 0000000..aeed408
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MscsParams.aidl
@@ -0,0 +1,52 @@
+/*
+ * 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.wifi.supplicant;
+@VintfStability
+parcelable MscsParams {
+ byte upBitmap;
+ byte upLimit;
+ int streamTimeoutUs;
+ byte frameClassifierMask;
+ @Backing(type="int") @VintfStability
+ enum FrameClassifierFields {
+ IP_VERSION = (1 << 0) /* 1 */,
+ SRC_IP_ADDR = (1 << 1) /* 2 */,
+ DST_IP_ADDR = (1 << 2) /* 4 */,
+ SRC_PORT = (1 << 3) /* 8 */,
+ DST_PORT = (1 << 4) /* 16 */,
+ DSCP = (1 << 5) /* 32 */,
+ PROTOCOL_NEXT_HDR = (1 << 6) /* 64 */,
+ FLOW_LABEL = (1 << 7) /* 128 */,
+ }
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MsduDeliveryInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MsduDeliveryInfo.aidl
new file mode 100644
index 0000000..792e08d
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/MsduDeliveryInfo.aidl
@@ -0,0 +1,51 @@
+/*
+ * 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.wifi.supplicant;
+@VintfStability
+parcelable MsduDeliveryInfo {
+ android.hardware.wifi.supplicant.MsduDeliveryInfo.DeliveryRatio deliveryRatio;
+ byte countExponent;
+ @Backing(type="byte") @VintfStability
+ enum DeliveryRatio {
+ RATIO_95 = 1,
+ RATIO_96 = 2,
+ RATIO_97 = 3,
+ RATIO_98 = 4,
+ RATIO_99 = 5,
+ RATIO_99_9 = 6,
+ RATIO_99_99 = 7,
+ RATIO_99_999 = 8,
+ RATIO_99_9999 = 9,
+ }
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OcspType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OcspType.aidl
index 89de811..d5ed084 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OcspType.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/OcspType.aidl
@@ -34,8 +34,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum OcspType {
- NONE = 0,
- REQUEST_CERT_STATUS = 1,
- REQUIRE_CERT_STATUS = 2,
- REQUIRE_ALL_CERTS_STATUS = 3,
+ NONE,
+ REQUEST_CERT_STATUS,
+ REQUIRE_CERT_STATUS,
+ REQUIRE_ALL_CERTS_STATUS,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pConnectInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pConnectInfo.aidl
new file mode 100644
index 0000000..f4662de
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pConnectInfo.aidl
@@ -0,0 +1,44 @@
+/*
+ * 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.wifi.supplicant;
+@VintfStability
+parcelable P2pConnectInfo {
+ byte[6] peerAddress;
+ android.hardware.wifi.supplicant.WpsProvisionMethod provisionMethod;
+ String preSelectedPin;
+ boolean joinExistingGroup;
+ boolean persistent;
+ int goIntent;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl
new file mode 100644
index 0000000..ee8e6dc
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl
@@ -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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// 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.wifi.supplicant;
+@VintfStability
+parcelable P2pDeviceFoundEventParams {
+ byte[6] srcAddress;
+ byte[6] p2pDeviceAddress;
+ byte[] primaryDeviceType;
+ String deviceName;
+ int configMethods;
+ byte deviceCapabilities;
+ int groupCapabilities;
+ byte[] wfdDeviceInfo;
+ byte[] wfdR2DeviceInfo;
+ byte[] vendorElemBytes;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDiscoveryInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDiscoveryInfo.aidl
new file mode 100644
index 0000000..5b7dd3f
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pDiscoveryInfo.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.wifi.supplicant;
+@VintfStability
+parcelable P2pDiscoveryInfo {
+ android.hardware.wifi.supplicant.P2pScanType scanType;
+ int frequencyMhz;
+ int timeoutInSec;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl
index 6e1b957..3c6f8ed 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pFrameTypeMask.aidl
@@ -34,17 +34,17 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum P2pFrameTypeMask {
- P2P_FRAME_PROBE_REQ_P2P = 1,
- P2P_FRAME_PROBE_RESP_P2P = 2,
- P2P_FRAME_PROBE_RESP_P2P_GO = 4,
- P2P_FRAME_BEACON_P2P_GO = 8,
- P2P_FRAME_P2P_PD_REQ = 16,
- P2P_FRAME_P2P_PD_RESP = 32,
- P2P_FRAME_P2P_GO_NEG_REQ = 64,
- P2P_FRAME_P2P_GO_NEG_RESP = 128,
- P2P_FRAME_P2P_GO_NEG_CONF = 256,
- P2P_FRAME_P2P_INV_REQ = 512,
- P2P_FRAME_P2P_INV_RESP = 1024,
- P2P_FRAME_P2P_ASSOC_REQ = 2048,
- P2P_FRAME_P2P_ASSOC_RESP = 4096,
+ P2P_FRAME_PROBE_REQ_P2P = (1 << 0) /* 1 */,
+ P2P_FRAME_PROBE_RESP_P2P = (1 << 1) /* 2 */,
+ P2P_FRAME_PROBE_RESP_P2P_GO = (1 << 2) /* 4 */,
+ P2P_FRAME_BEACON_P2P_GO = (1 << 3) /* 8 */,
+ P2P_FRAME_P2P_PD_REQ = (1 << 4) /* 16 */,
+ P2P_FRAME_P2P_PD_RESP = (1 << 5) /* 32 */,
+ P2P_FRAME_P2P_GO_NEG_REQ = (1 << 6) /* 64 */,
+ P2P_FRAME_P2P_GO_NEG_RESP = (1 << 7) /* 128 */,
+ P2P_FRAME_P2P_GO_NEG_CONF = (1 << 8) /* 256 */,
+ P2P_FRAME_P2P_INV_REQ = (1 << 9) /* 512 */,
+ P2P_FRAME_P2P_INV_RESP = (1 << 10) /* 1024 */,
+ P2P_FRAME_P2P_ASSOC_REQ = (1 << 11) /* 2048 */,
+ P2P_FRAME_P2P_ASSOC_RESP = (1 << 12) /* 4096 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl
index ffee12c..e477131 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupCapabilityMask.aidl
@@ -34,11 +34,11 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum P2pGroupCapabilityMask {
- GROUP_OWNER = 1,
- PERSISTENT_GROUP = 2,
- GROUP_LIMIT = 4,
- INTRA_BSS_DIST = 8,
- CROSS_CONN = 16,
- PERSISTENT_RECONN = 32,
- GROUP_FORMATION = 64,
+ GROUP_OWNER = (1 << 0) /* 1 */,
+ PERSISTENT_GROUP = (1 << 1) /* 2 */,
+ GROUP_LIMIT = (1 << 2) /* 4 */,
+ INTRA_BSS_DIST = (1 << 3) /* 8 */,
+ CROSS_CONN = (1 << 4) /* 16 */,
+ PERSISTENT_RECONN = (1 << 5) /* 32 */,
+ GROUP_FORMATION = (1 << 6) /* 64 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl
index 5465a86..e19ae44 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl
@@ -45,4 +45,5 @@
byte[6] goInterfaceAddress;
boolean isP2pClientEapolIpAddressInfoPresent;
android.hardware.wifi.supplicant.P2pClientEapolIpAddressInfo p2pClientIpInfo;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl
new file mode 100644
index 0000000..5c7c393
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.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.wifi.supplicant;
+@VintfStability
+parcelable P2pPeerClientDisconnectedEventParams {
+ String groupInterfaceName;
+ byte[6] clientInterfaceAddress;
+ byte[6] clientDeviceAddress;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl
new file mode 100644
index 0000000..40c8ff6
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.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.wifi.supplicant;
+@VintfStability
+parcelable P2pPeerClientJoinedEventParams {
+ String groupInterfaceName;
+ byte[6] clientInterfaceAddress;
+ byte[6] clientDeviceAddress;
+ int clientIpAddress;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl
new file mode 100644
index 0000000..0ff0653
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl
@@ -0,0 +1,44 @@
+/*
+ * 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.wifi.supplicant;
+@VintfStability
+parcelable P2pProvisionDiscoveryCompletedEventParams {
+ byte[6] p2pDeviceAddress;
+ boolean isRequest;
+ android.hardware.wifi.supplicant.P2pProvDiscStatusCode status;
+ android.hardware.wifi.supplicant.WpsConfigMethods configMethods;
+ String generatedPin;
+ String groupInterfaceName;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pScanType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pScanType.aidl
new file mode 100644
index 0000000..ff3efd2
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pScanType.aidl
@@ -0,0 +1,40 @@
+/*
+ * 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.wifi.supplicant;
+@Backing(type="int") @VintfStability
+enum P2pScanType {
+ FULL,
+ SOCIAL,
+ SPECIFIC_FREQ,
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl
index d9b00e1..a4c7b60 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/PairwiseCipherMask.aidl
@@ -34,10 +34,10 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum PairwiseCipherMask {
- NONE = 1,
- TKIP = 8,
- CCMP = 16,
- GCMP_128 = 64,
- SMS4 = 128,
- GCMP_256 = 256,
+ NONE = (1 << 0) /* 1 */,
+ TKIP = (1 << 3) /* 8 */,
+ CCMP = (1 << 4) /* 16 */,
+ GCMP_128 = (1 << 6) /* 64 */,
+ SMS4 = (1 << 7) /* 128 */,
+ GCMP_256 = (1 << 8) /* 256 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtoMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtoMask.aidl
index de92428..ba79025 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtoMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ProtoMask.aidl
@@ -34,8 +34,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum ProtoMask {
- WPA = 1,
- RSN = 2,
- WAPI = 4,
- OSEN = 8,
+ WPA = (1 << 0) /* 1 */,
+ RSN = (1 << 1) /* 2 */,
+ WAPI = (1 << 2) /* 4 */,
+ OSEN = (1 << 3) /* 8 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosCharacteristics.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosCharacteristics.aidl
new file mode 100644
index 0000000..dacac8c
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosCharacteristics.aidl
@@ -0,0 +1,59 @@
+/*
+ * 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.wifi.supplicant;
+@VintfStability
+parcelable QosCharacteristics {
+ int minServiceIntervalUs;
+ int maxServiceIntervalUs;
+ int minDataRateKbps;
+ int delayBoundUs;
+ int optionalFieldMask;
+ char maxMsduSizeOctets;
+ int serviceStartTimeUs;
+ byte serviceStartTimeLinkId;
+ int meanDataRateKbps;
+ int burstSizeOctets;
+ char msduLifetimeMs;
+ android.hardware.wifi.supplicant.MsduDeliveryInfo msduDeliveryInfo;
+ @Backing(type="int") @VintfStability
+ enum QosCharacteristicsMask {
+ MAX_MSDU_SIZE = (1 << 0) /* 1 */,
+ SERVICE_START_TIME = (1 << 1) /* 2 */,
+ SERVICE_START_TIME_LINK_ID = (1 << 2) /* 4 */,
+ MEAN_DATA_RATE = (1 << 3) /* 8 */,
+ BURST_SIZE = (1 << 4) /* 16 */,
+ MSDU_LIFETIME = (1 << 5) /* 32 */,
+ MSDU_DELIVERY_INFO = (1 << 6) /* 64 */,
+ }
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
index 9c0c0b6..fda5e3e 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyClassifierParamsMask.aidl
@@ -34,12 +34,12 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum QosPolicyClassifierParamsMask {
- SRC_IP = 1,
- DST_IP = 2,
- SRC_PORT = 4,
- DST_PORT_RANGE = 8,
- PROTOCOL_NEXT_HEADER = 16,
- FLOW_LABEL = 32,
- DOMAIN_NAME = 64,
- DSCP = 128,
+ SRC_IP = (1 << 0) /* 1 */,
+ DST_IP = (1 << 1) /* 2 */,
+ SRC_PORT = (1 << 2) /* 4 */,
+ DST_PORT_RANGE = (1 << 3) /* 8 */,
+ PROTOCOL_NEXT_HEADER = (1 << 4) /* 16 */,
+ FLOW_LABEL = (1 << 5) /* 32 */,
+ DOMAIN_NAME = (1 << 6) /* 64 */,
+ DSCP = (1 << 7) /* 128 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl
index 4c1e4fa..fd4e787 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyRequestType.aidl
@@ -34,6 +34,6 @@
package android.hardware.wifi.supplicant;
@Backing(type="byte") @VintfStability
enum QosPolicyRequestType {
- QOS_POLICY_ADD = 0,
- QOS_POLICY_REMOVE = 1,
+ QOS_POLICY_ADD,
+ QOS_POLICY_REMOVE,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl
index 4e5e8ae..20be616 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsData.aidl
@@ -22,4 +22,11 @@
byte policyId;
byte userPriority;
android.hardware.wifi.supplicant.QosPolicyClassifierParams classifierParams;
+ android.hardware.wifi.supplicant.QosPolicyScsData.LinkDirection direction;
+ @nullable android.hardware.wifi.supplicant.QosCharacteristics QosCharacteristics;
+ @Backing(type="byte") @VintfStability
+ enum LinkDirection {
+ DOWNLINK,
+ UPLINK,
+ }
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl
index 4d81566..8e0467f 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsRequestStatusCode.aidl
@@ -19,8 +19,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum QosPolicyScsRequestStatusCode {
- SENT = 0,
- ALREADY_ACTIVE = 1,
- NOT_EXIST = 2,
- INVALID = 3,
+ SENT,
+ ALREADY_ACTIVE,
+ NOT_EXIST,
+ INVALID,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl
index 693d3e0..5d460c6 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyScsResponseStatusCode.aidl
@@ -19,13 +19,13 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum QosPolicyScsResponseStatusCode {
- SUCCESS = 0,
- TCLAS_REQUEST_DECLINED = 1,
- TCLAS_NOT_SUPPORTED_BY_AP = 2,
- TCLAS_INSUFFICIENT_RESOURCES = 3,
- TCLAS_RESOURCES_EXHAUSTED = 4,
- TCLAS_PROCESSING_TERMINATED_INSUFFICIENT_QOS = 5,
- TCLAS_PROCESSING_TERMINATED_POLICY_CONFLICT = 6,
- TCLAS_PROCESSING_TERMINATED = 7,
- TIMEOUT = 8,
+ SUCCESS,
+ TCLAS_REQUEST_DECLINED,
+ TCLAS_NOT_SUPPORTED_BY_AP,
+ TCLAS_INSUFFICIENT_RESOURCES,
+ TCLAS_RESOURCES_EXHAUSTED,
+ TCLAS_PROCESSING_TERMINATED_INSUFFICIENT_QOS,
+ TCLAS_PROCESSING_TERMINATED_POLICY_CONFLICT,
+ TCLAS_PROCESSING_TERMINATED,
+ TIMEOUT,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl
index 4d40edc..9228632 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/QosPolicyStatusCode.aidl
@@ -34,8 +34,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="byte") @VintfStability
enum QosPolicyStatusCode {
- QOS_POLICY_SUCCESS = 0,
- QOS_POLICY_REQUEST_DECLINED = 1,
- QOS_POLICY_CLASSIFIER_NOT_SUPPORTED = 2,
- QOS_POLICY_INSUFFICIENT_RESOURCES = 3,
+ QOS_POLICY_SUCCESS,
+ QOS_POLICY_REQUEST_DECLINED,
+ QOS_POLICY_CLASSIFIER_NOT_SUPPORTED,
+ QOS_POLICY_INSUFFICIENT_RESOURCES,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SaeH2eMode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SaeH2eMode.aidl
index 978c337..4730d72 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SaeH2eMode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SaeH2eMode.aidl
@@ -34,7 +34,7 @@
package android.hardware.wifi.supplicant;
@Backing(type="byte") @VintfStability
enum SaeH2eMode {
- DISABLED = 0,
- H2E_OPTIONAL = 1,
- H2E_MANDATORY = 2,
+ DISABLED,
+ H2E_OPTIONAL,
+ H2E_MANDATORY,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
index d84ff95..d7ff798 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/SupplicantStatusCode.aidl
@@ -34,16 +34,16 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum SupplicantStatusCode {
- SUCCESS = 0,
- FAILURE_UNKNOWN = 1,
- FAILURE_ARGS_INVALID = 2,
- FAILURE_IFACE_INVALID = 3,
- FAILURE_IFACE_UNKNOWN = 4,
- FAILURE_IFACE_EXISTS = 5,
- FAILURE_IFACE_DISABLED = 6,
- FAILURE_IFACE_NOT_DISCONNECTED = 7,
- FAILURE_NETWORK_INVALID = 8,
- FAILURE_NETWORK_UNKNOWN = 9,
- FAILURE_UNSUPPORTED = 10,
- FAILURE_ONGOING_REQUEST = 11,
+ SUCCESS,
+ FAILURE_UNKNOWN,
+ FAILURE_ARGS_INVALID,
+ FAILURE_IFACE_INVALID,
+ FAILURE_IFACE_UNKNOWN,
+ FAILURE_IFACE_EXISTS,
+ FAILURE_IFACE_DISABLED,
+ FAILURE_IFACE_NOT_DISCONNECTED,
+ FAILURE_NETWORK_INVALID,
+ FAILURE_NETWORK_UNKNOWN,
+ FAILURE_UNSUPPORTED,
+ FAILURE_ONGOING_REQUEST,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TlsVersion.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TlsVersion.aidl
index 22a374f..b31826a 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TlsVersion.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TlsVersion.aidl
@@ -34,8 +34,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum TlsVersion {
- TLS_V1_0 = 0,
- TLS_V1_1 = 1,
- TLS_V1_2 = 2,
- TLS_V1_3 = 3,
+ TLS_V1_0,
+ TLS_V1_1,
+ TLS_V1_2,
+ TLS_V1_3,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl
index 7c63217..f1d7370 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/TransitionDisableIndication.aidl
@@ -34,8 +34,8 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum TransitionDisableIndication {
- USE_WPA3_PERSONAL = 1,
- USE_SAE_PK = 2,
- USE_WPA3_ENTERPRISE = 4,
- USE_ENHANCED_OPEN = 8,
+ USE_WPA3_PERSONAL = (1 << 0) /* 1 */,
+ USE_SAE_PK = (1 << 1) /* 2 */,
+ USE_WPA3_ENTERPRISE = (1 << 2) /* 4 */,
+ USE_ENHANCED_OPEN = (1 << 3) /* 8 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl
index 32e1510..330f2aa 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpaDriverCapabilitiesMask.aidl
@@ -34,11 +34,11 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum WpaDriverCapabilitiesMask {
- MBO = 1,
- OCE = 2,
- SAE_PK = 4,
- WFD_R2 = 8,
- TRUST_ON_FIRST_USE = 16,
- SET_TLS_MINIMUM_VERSION = 32,
- TLS_V1_3 = 64,
+ MBO = (1 << 0) /* 1 */,
+ OCE = (1 << 1) /* 2 */,
+ SAE_PK = (1 << 2) /* 4 */,
+ WFD_R2 = (1 << 3) /* 8 */,
+ TRUST_ON_FIRST_USE = (1 << 4) /* 16 */,
+ SET_TLS_MINIMUM_VERSION = (1 << 5) /* 32 */,
+ TLS_V1_3 = (1 << 6) /* 64 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsConfigMethods.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsConfigMethods.aidl
index c98c479..b9ea211 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsConfigMethods.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsConfigMethods.aidl
@@ -34,18 +34,18 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum WpsConfigMethods {
- USBA = 1,
- ETHERNET = 2,
- LABEL = 4,
- DISPLAY = 8,
- EXT_NFC_TOKEN = 16,
- INT_NFC_TOKEN = 32,
- NFC_INTERFACE = 64,
- PUSHBUTTON = 128,
- KEYPAD = 256,
- VIRT_PUSHBUTTON = 640,
- PHY_PUSHBUTTON = 1152,
- P2PS = 4096,
- VIRT_DISPLAY = 8200,
- PHY_DISPLAY = 16392,
+ USBA = 0x0001,
+ ETHERNET = 0x0002,
+ LABEL = 0x0004,
+ DISPLAY = 0x0008,
+ EXT_NFC_TOKEN = 0x0010,
+ INT_NFC_TOKEN = 0x0020,
+ NFC_INTERFACE = 0x0040,
+ PUSHBUTTON = 0x0080,
+ KEYPAD = 0x0100,
+ VIRT_PUSHBUTTON = 0x0280,
+ PHY_PUSHBUTTON = 0x0480,
+ P2PS = 0x1000,
+ VIRT_DISPLAY = 0x2008,
+ PHY_DISPLAY = 0x4008,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl
index 975f1ab..9a20187 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsDevPasswordId.aidl
@@ -34,12 +34,12 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum WpsDevPasswordId {
- DEFAULT = 0,
- USER_SPECIFIED = 1,
- MACHINE_SPECIFIED = 2,
- REKEY = 3,
- PUSHBUTTON = 4,
- REGISTRAR_SPECIFIED = 5,
- NFC_CONNECTION_HANDOVER = 7,
- P2PS_DEFAULT = 8,
+ DEFAULT = 0x0000,
+ USER_SPECIFIED = 0x0001,
+ MACHINE_SPECIFIED = 0x0002,
+ REKEY = 0x0003,
+ PUSHBUTTON = 0x0004,
+ REGISTRAR_SPECIFIED = 0x0005,
+ NFC_CONNECTION_HANDOVER = 0x0007,
+ P2PS_DEFAULT = 0x0008,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl
index f6dba23..177d218 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/WpsProvisionMethod.aidl
@@ -34,7 +34,7 @@
package android.hardware.wifi.supplicant;
@Backing(type="int") @VintfStability
enum WpsProvisionMethod {
- PBC = 0,
- DISPLAY = 1,
- KEYPAD = 2,
+ PBC,
+ DISPLAY,
+ KEYPAD,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl
index 4921a67..64a515f 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ConnectionCapabilities.aidl
@@ -16,6 +16,7 @@
package android.hardware.wifi.supplicant;
+import android.hardware.wifi.common.OuiKeyedData;
import android.hardware.wifi.supplicant.LegacyMode;
import android.hardware.wifi.supplicant.WifiTechnology;
@@ -48,4 +49,9 @@
* Indicates the AP support for TID-to-link mapping negotiation.
*/
boolean apTidToLinkMapNegotiationSupported;
+ /**
+ * Additional vendor-specific data. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
index e58422c..983ed15 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
@@ -16,11 +16,14 @@
package android.hardware.wifi.supplicant;
+import android.hardware.wifi.common.OuiKeyedData;
import android.hardware.wifi.supplicant.FreqRange;
import android.hardware.wifi.supplicant.ISupplicantP2pIfaceCallback;
import android.hardware.wifi.supplicant.ISupplicantP2pNetwork;
import android.hardware.wifi.supplicant.IfaceType;
import android.hardware.wifi.supplicant.MiracastMode;
+import android.hardware.wifi.supplicant.P2pConnectInfo;
+import android.hardware.wifi.supplicant.P2pDiscoveryInfo;
import android.hardware.wifi.supplicant.P2pFrameTypeMask;
import android.hardware.wifi.supplicant.P2pGroupCapabilityMask;
import android.hardware.wifi.supplicant.WpsConfigMethods;
@@ -176,6 +179,9 @@
* Start P2P group formation with a discovered P2P peer. This includes
* optional group owner negotiation, group interface setup, provisioning,
* and establishing data connection.
+ * <p>
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use
+ * connectWithParams.
*
* @param peerAddress MAC address of the device to connect to.
* @param provisionMethod Provisioning method to use.
@@ -236,6 +242,9 @@
/**
* Initiate a P2P service discovery with an optional timeout.
+ * <p>
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use
+ * findWithParams.
*
* @param timeoutInSec Max time to be spent is performing discovery.
* Set to 0 to indefinitely continue discovery until an explicit
@@ -782,8 +791,9 @@
/**
* Initiate a P2P device discovery only on social channels.
- *
- * Full P2P discovery is performed through |ISupplicantP2pIface.find| method.
+ * <p>
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use
+ * findWithParams.
*
* @param timeoutInSec The maximum amount of time that should be spent in performing device
* discovery.
@@ -798,8 +808,9 @@
/**
* Initiate a P2P device discovery on a specific frequency.
- *
- * Full P2P discovery is performed through |ISupplicantP2pIface.find| method.
+ * <p>
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use
+ * findWithParams.
*
* @param freqInHz the frequency to be scanned.
* @param timeoutInSec Max time to be spent is performing discovery.
@@ -845,4 +856,30 @@
*/
void configureEapolIpAddressAllocationParams(
in int ipAddressGo, in int ipAddressMask, in int ipAddressStart, in int ipAddressEnd);
+
+ /**
+ * Start P2P group formation with a discovered P2P peer. This includes
+ * optional group owner negotiation, group interface setup, provisioning,
+ * and establishing data connection.
+ *
+ * @param connectInfo Parameters associated with this connection request.
+ * @return Pin generated, if |provisionMethod| uses one of the
+ * generated |PIN*| methods.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ String connectWithParams(in P2pConnectInfo connectInfo);
+
+ /**
+ * Initiate a P2P service discovery with an optional timeout.
+ *
+ * @param discoveryInfo Parameters associated with this discovery request.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ * |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
+ */
+ void findWithParams(in P2pDiscoveryInfo discoveryInfo);
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
index 9d6fa67..11cd867 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
@@ -16,9 +16,13 @@
package android.hardware.wifi.supplicant;
+import android.hardware.wifi.supplicant.P2pDeviceFoundEventParams;
import android.hardware.wifi.supplicant.P2pGroupCapabilityMask;
import android.hardware.wifi.supplicant.P2pGroupStartedEventParams;
+import android.hardware.wifi.supplicant.P2pPeerClientDisconnectedEventParams;
+import android.hardware.wifi.supplicant.P2pPeerClientJoinedEventParams;
import android.hardware.wifi.supplicant.P2pProvDiscStatusCode;
+import android.hardware.wifi.supplicant.P2pProvisionDiscoveryCompletedEventParams;
import android.hardware.wifi.supplicant.P2pStatusCode;
import android.hardware.wifi.supplicant.WpsConfigMethods;
import android.hardware.wifi.supplicant.WpsDevPasswordId;
@@ -35,6 +39,9 @@
oneway interface ISupplicantP2pIfaceCallback {
/**
* Used to indicate that a P2P device has been found.
+ * <p>
+ * @deprecated This callback is deprecated from AIDL v2, newer HAL should call
+ * onDeviceFoundWithParams.
*
* @param srcAddress MAC address of the device found. This must either
* be the P2P device address or the P2P interface address.
@@ -142,6 +149,9 @@
/**
* Used to indicate the completion of a P2P provision discovery request.
+ * <p>
+ * @deprecated This callback is deprecated from AIDL v3, newer HAL should call
+ * onProvisionDiscoveryCompletedEvent.
*
* @param p2pDeviceAddress P2P device address.
* @param isRequest Whether we received or sent the provision discovery.
@@ -192,6 +202,9 @@
/**
* Used to indicate when a STA device is connected to this device.
+ * <p>
+ * @deprecated This callback is deprecated from AIDL v3, newer HAL should call
+ * onPeerClientJoined()
*
* @param srcAddress MAC address of the device that was authorized.
* @param p2pDeviceAddress P2P device address.
@@ -200,6 +213,9 @@
/**
* Used to indicate when a STA device is disconnected from this device.
+ * <p>
+ * @deprecated This callback is deprecated from AIDL v3, newer HAL should call
+ * onPeerClientDisconnected()
*
* @param srcAddress MAC address of the device that was deauthorized.
* @param p2pDeviceAddress P2P device address.
@@ -216,6 +232,9 @@
/**
* Used to indicate that a P2P device has been found.
+ * <p>
+ * @deprecated This callback is deprecated from AIDL v3, newer HAL should call
+ * onDeviceFoundWithParams.
*
* @param srcAddress MAC address of the device found. This must either
* be the P2P device address for a peer which is not in a group,
@@ -251,4 +270,36 @@
* @param groupStartedEventParams Parameters describing the P2P group.
*/
void onGroupStartedWithParams(in P2pGroupStartedEventParams groupStartedEventParams);
+
+ /**
+ * Used to indicate that a P2P client has joined this device group owner.
+ *
+ * @param clientJoinedEventParams Parameters associated with peer client joined event.
+ */
+ void onPeerClientJoined(in P2pPeerClientJoinedEventParams clientJoinedEventParams);
+
+ /**
+ * Used to indicate that a P2P client has disconnected from this device group owner.
+ *
+ * @param clientDisconnectedEventParams Parameters associated with peer client disconnected
+ * event.
+ */
+ void onPeerClientDisconnected(
+ in P2pPeerClientDisconnectedEventParams clientDisconnectedEventParams);
+
+ /**
+ * Used to indicate the completion of a P2P provision discovery request.
+ *
+ * @param provisionDiscoveryCompletedEventParams Parameters associated with
+ * P2P provision discovery frame notification.
+ */
+ void onProvisionDiscoveryCompletedEvent(
+ in P2pProvisionDiscoveryCompletedEventParams provisionDiscoveryCompletedEventParams);
+
+ /**
+ * Used to indicate that a P2P device has been found.
+ *
+ * @param deviceFoundEventParams Parameters associated with the device found event.
+ */
+ void onDeviceFoundWithParams(in P2pDeviceFoundEventParams deviceFoundEventParams);
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
index 06ab8fb..fb1673e 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIface.aidl
@@ -29,6 +29,7 @@
import android.hardware.wifi.supplicant.IfaceType;
import android.hardware.wifi.supplicant.KeyMgmtMask;
import android.hardware.wifi.supplicant.MloLinksInfo;
+import android.hardware.wifi.supplicant.MscsParams;
import android.hardware.wifi.supplicant.QosPolicyScsData;
import android.hardware.wifi.supplicant.QosPolicyScsRequestStatus;
import android.hardware.wifi.supplicant.QosPolicyStatus;
@@ -304,6 +305,8 @@
* The icon data fetched must be returned in the
* |ISupplicantStaIfaceCallback.onHs20IconQueryDone| callback.
*
+ * @deprecated No longer in use.
+ *
* @param macAddress MAC address of the access point.
* @param fileName Name of the file to request from the access point.
* @throws ServiceSpecificException with one of the following values:
@@ -850,4 +853,28 @@
* being processed. Supplicant will only handle one request at a time.
*/
QosPolicyScsRequestStatus[] removeQosPolicyForScs(in byte[] scsPolicyIds);
+
+ /**
+ * Enable Mirrored Stream Classification Service (MSCS) and configure using
+ * the provided configuration values.
+ *
+ * If MSCS has already been enabled/configured, this will overwrite the
+ * existing configuration.
+ *
+ * @param params |MscsParams| object containing the configuration.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID| if the configuration is invalid.
+ * |SupplicantStatusCode.FAILURE_UNKNOWN| if the configuration could not be set.
+ */
+ void configureMscs(in MscsParams params);
+
+ /**
+ * Disable Mirrored Stream Classification Service (MSCS).
+ *
+ * If MSCS is enabled/configured, this will send a remove request to the AP.
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|
+ */
+ void disableMscs();
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
index 17a220d..58893eb 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
@@ -198,6 +198,8 @@
/**
* Used to indicate the result of Hotspot 2.0 Icon query.
*
+ * @deprecated No longer in use.
+ *
* @param bssid BSSID of the access point.
* @param fileName Name of the file that was requested.
* @param data Icon data fetched from the access point.
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl
index 750cf72..fc7babf 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaNetwork.aidl
@@ -16,6 +16,7 @@
package android.hardware.wifi.supplicant;
+import android.hardware.wifi.common.OuiKeyedData;
import android.hardware.wifi.supplicant.AuthAlgMask;
import android.hardware.wifi.supplicant.DppConnectionKeys;
import android.hardware.wifi.supplicant.EapMethod;
@@ -1141,4 +1142,27 @@
* |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
*/
void setStrictConservativePeerMode(in boolean enable);
+
+ /**
+ * Disables Extremely High Throughput (EHT) mode, aka Wi-Fi 7 support, for the network. When
+ * EHT is disabled, the device ceases to transmit EHT related Information Elements (IEs),
+ * including multi-link IEs and EHT capability, in subsequent messages such as (Re)Association
+ * requests to the Access Point (AP).
+ *
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void disableEht();
+
+ /**
+ * Set additional vendor-provided configuration data.
+ *
+ * @param vendorData List of |OuiKeyedData| containing the vendor-provided
+ * configuration data.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_NETWORK_INVALID|
+ */
+ void setVendorData(in OuiKeyedData[] vendorData);
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MscsParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MscsParams.aidl
new file mode 100644
index 0000000..b1731ac
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MscsParams.aidl
@@ -0,0 +1,66 @@
+/*
+ * 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.
+ */
+
+package android.hardware.wifi.supplicant;
+
+/**
+ * Mirrored Stream Classification Service (MSCS) parameters.
+ * Refer to section 3.1 of the Wi-Fi QoS Management Specification v3.0.
+ */
+@VintfStability
+parcelable MscsParams {
+ /**
+ * Bitmap indicating which User Priorities should be classified using MSCS.
+ * The least significant bit corresponds to UP 0, and the most significant
+ * bit to UP 7. Setting a bit to 1 indicates that UP should be used.
+ */
+ byte upBitmap;
+
+ /**
+ * Maximum user priority that can be assigned using the MSCS service.
+ * Value must be between 0 and 7 (inclusive).
+ */
+ byte upLimit;
+
+ /**
+ * Stream timeout in μs. Must be equivalent to 60 sec or less.
+ */
+ int streamTimeoutUs;
+
+ /**
+ * Bitmask of available fields for a Type 4 TCLAS frame classifier.
+ * See Figures 9-309 and 9-310 in the IEEE Std 802.11-2020 Standard.
+ */
+ @VintfStability
+ @Backing(type="int")
+ enum FrameClassifierFields {
+ IP_VERSION = 1 << 0,
+ SRC_IP_ADDR = 1 << 1,
+ DST_IP_ADDR = 1 << 2,
+ SRC_PORT = 1 << 3,
+ DST_PORT = 1 << 4,
+ DSCP = 1 << 5,
+ /** Indicates Protocol if using IPv4, or Next Header if using IPv6. */
+ PROTOCOL_NEXT_HDR = 1 << 6,
+ /** Only applicable if using IPv6. */
+ FLOW_LABEL = 1 << 7,
+ }
+
+ /**
+ * Bitmask of |FrameClassifierFields| for a Type 4 TCLAS frame classifier.
+ */
+ byte frameClassifierMask;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MsduDeliveryInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MsduDeliveryInfo.aidl
new file mode 100644
index 0000000..8065f63
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/MsduDeliveryInfo.aidl
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+
+package android.hardware.wifi.supplicant;
+
+/**
+ * MSDU delivery information.
+ * See Section 9.4.2.316 of the IEEE P802.11be/D4.0 Standard.
+ */
+@VintfStability
+parcelable MsduDeliveryInfo {
+ /**
+ * Enums for the |deliveryRatio| field.
+ * See Table 9-404t of the IEEE P802.11be/D4.0 Standard.
+ */
+ @VintfStability
+ @Backing(type="byte")
+ enum DeliveryRatio {
+ RATIO_95 = 1, // 95%
+ RATIO_96 = 2, // 96%
+ RATIO_97 = 3, // 97%
+ RATIO_98 = 4, // 98%
+ RATIO_99 = 5, // 99%
+ RATIO_99_9 = 6, // 99.9%
+ RATIO_99_99 = 7, // 99.99%
+ RATIO_99_999 = 8, // 99.999%
+ RATIO_99_9999 = 9, // 99.9999%
+ }
+
+ /**
+ * Percentage of the MSDUs that are expected to be delivered successfully.
+ */
+ DeliveryRatio deliveryRatio;
+
+ /**
+ * Exponent from which the number of incoming MSDUs is computed. The number of incoming
+ * MSDUs is 10^countExponent, and is used to determine the MSDU delivery ratio.
+ * Must be a number between 0 and 15 (inclusive).
+ */
+ byte countExponent;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pConnectInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pConnectInfo.aidl
new file mode 100644
index 0000000..f09b476
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pConnectInfo.aidl
@@ -0,0 +1,68 @@
+/*
+ * 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.
+ */
+
+package android.hardware.wifi.supplicant;
+
+import android.hardware.wifi.common.OuiKeyedData;
+import android.hardware.wifi.supplicant.WpsProvisionMethod;
+
+/**
+ * Request parameters used for |ISupplicantP2pIface.connectWithParams|
+ */
+@VintfStability
+parcelable P2pConnectInfo {
+ /**
+ * MAC address of the device to connect to.
+ */
+ byte[6] peerAddress;
+
+ /**
+ * Provisioning method to use.
+ */
+ WpsProvisionMethod provisionMethod;
+
+ /**
+ * Pin to be used, if |provisionMethod| uses one of the
+ * preselected |PIN*| methods.
+ */
+ String preSelectedPin;
+
+ /**
+ * Indicates that this is a command to join an existing group as a client.
+ * This means that the group owner negotiation step can be skipped.
+ * This must send a Provision Discovery Request message to the
+ * target group owner before associating for WPS provisioning.
+ */
+ boolean joinExistingGroup;
+
+ /**
+ * Used to request a persistent group to be formed.
+ */
+ boolean persistent;
+
+ /**
+ * Used to override the default Intent for this group owner
+ * negotiation (Values from 1-15). Refer to section 4.1.6 in
+ * Wi-Fi Peer-to-Peer (P2P) Technical Specification Version 1.7.
+ */
+ int goIntent;
+
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl
new file mode 100644
index 0000000..15917b6
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDeviceFoundEventParams.aidl
@@ -0,0 +1,92 @@
+/*
+ * 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.
+ */
+
+package android.hardware.wifi.supplicant;
+
+import android.hardware.wifi.common.OuiKeyedData;
+
+/**
+ * Parameters passed as a part of a P2P Device found event.
+ */
+@VintfStability
+parcelable P2pDeviceFoundEventParams {
+ /**
+ * MAC address of the device found. This must either be the P2P device address
+ * for a peer which is not in a group, or the P2P interface address for
+ * a peer which is a Group Owner.
+ */
+ byte[6] srcAddress;
+
+ /**
+ * P2P device address.
+ */
+ byte[6] p2pDeviceAddress;
+
+ /**
+ * Type of device. Refer to section B.1 of the Wifi P2P Technical
+ * specification v1.2.
+ */
+ byte[] primaryDeviceType;
+
+ /**
+ * Name of the device.
+ */
+ String deviceName;
+
+ /**
+ * Mask of |WpsConfigMethods| indicating the WPS configuration methods
+ * supported by the device.
+ */
+ int configMethods;
+
+ /**
+ * Refer to section 4.1.4 of the Wifi P2P Technical specification v1.2.
+ */
+ byte deviceCapabilities;
+
+ /**
+ * Mask of |P2pGroupCapabilityMask| indicating the group capabilities.
+ * Refer to section 4.1.4 of the Wifi P2P Technical specification v1.2.
+ */
+ int groupCapabilities;
+
+ /**
+ * WFD device info as described in section 5.1.2 of the WFD technical
+ * specification v1.0.0.
+ */
+ byte[] wfdDeviceInfo;
+
+ /**
+ * WFD R2 device info as described in section 5.1.12 of WFD technical
+ * specification v2.1.
+ */
+ byte[] wfdR2DeviceInfo;
+
+ /**
+ * Vendor-specific information element bytes. The format of an
+ * information element is EID (1 byte) + Length (1 Byte) + Payload which is
+ * defined in Section 9.4.4 TLV encodings of 802.11-2016 IEEE Standard for
+ * Information technology. The length indicates the size of the payload.
+ * Multiple information elements may be appended within the byte array.
+ */
+ byte[] vendorElemBytes;
+
+ /**
+ * Optional vendor-specific data.
+ * Null value indicates that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDiscoveryInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDiscoveryInfo.aidl
new file mode 100644
index 0000000..ddb8a3d
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pDiscoveryInfo.aidl
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+package android.hardware.wifi.supplicant;
+
+import android.hardware.wifi.common.OuiKeyedData;
+import android.hardware.wifi.supplicant.P2pScanType;
+
+/**
+ * Request parameters used for |ISupplicantP2pIface.findWithParams|
+ */
+@VintfStability
+parcelable P2pDiscoveryInfo {
+ /**
+ * P2P scan type.
+ */
+ P2pScanType scanType;
+
+ /**
+ * Frequency to scan in MHz. Only valid the scan type is |P2pScanType.SPECIFIC_FREQ|
+ */
+ int frequencyMhz;
+
+ /**
+ * Max time, in seconds, to be spent in performing discovery.
+ * Set to 0 to indefinitely continue discovery until an explicit
+ * |stopFind| is sent.
+ */
+ int timeoutInSec;
+
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl
index 96f1e16..9db7a1e 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGroupStartedEventParams.aidl
@@ -16,6 +16,7 @@
package android.hardware.wifi.supplicant;
+import android.hardware.wifi.common.OuiKeyedData;
import android.hardware.wifi.supplicant.P2pClientEapolIpAddressInfo;
/**
@@ -63,4 +64,10 @@
* The value is undefined if isP2pClientEapolIpAddressInfoPresent is false.
*/
P2pClientEapolIpAddressInfo p2pClientIpInfo;
+
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl
new file mode 100644
index 0000000..6e3350f
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientDisconnectedEventParams.aidl
@@ -0,0 +1,40 @@
+/*
+ * 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.
+ */
+
+package android.hardware.wifi.supplicant;
+
+import android.hardware.wifi.common.OuiKeyedData;
+
+/**
+ * Parameters passed as a part of P2P peer client disconnected event.
+ */
+@VintfStability
+parcelable P2pPeerClientDisconnectedEventParams {
+ /** Interface name of this device group owner. (For ex: p2p-p2p0-1) */
+ String groupInterfaceName;
+
+ /** P2P group interface MAC address of the client that disconnected. */
+ byte[6] clientInterfaceAddress;
+
+ /** P2P device interface MAC address of the client that disconnected. */
+ byte[6] clientDeviceAddress;
+
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl
new file mode 100644
index 0000000..4f46d70
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pPeerClientJoinedEventParams.aidl
@@ -0,0 +1,50 @@
+/*
+ * 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.
+ */
+
+package android.hardware.wifi.supplicant;
+
+import android.hardware.wifi.common.OuiKeyedData;
+
+/**
+ * Parameters passed as a part of P2P peer client joined event.
+ */
+@VintfStability
+parcelable P2pPeerClientJoinedEventParams {
+ /** Interface name of this device group owner. (For ex: p2p-p2p0-1) */
+ String groupInterfaceName;
+
+ /** P2P group interface MAC address of the client that joined. */
+ byte[6] clientInterfaceAddress;
+
+ /** P2P device interface MAC address of the client that joined. */
+ byte[6] clientDeviceAddress;
+
+ /**
+ * The P2P Client IPV4 address allocated via EAPOL exchange.
+ * The higher-order address bytes are in the lower-order int bytes
+ * (e.g. 1.2.3.4 is represented as 0x04030201).
+ * Refer Wi-Fi P2P Technical Specification v1.7 - Section 4.2.8
+ * "IP Address Allocation in EAPOL-Key Frames (4-Way Handshake)" for more details.
+ * The value is set to zero if the IP address is not allocated via EAPOL exchange.
+ */
+ int clientIpAddress;
+
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl
new file mode 100644
index 0000000..b559216
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+
+package android.hardware.wifi.supplicant;
+
+import android.hardware.wifi.common.OuiKeyedData;
+import android.hardware.wifi.supplicant.P2pProvDiscStatusCode;
+import android.hardware.wifi.supplicant.WpsConfigMethods;
+
+/**
+ * Parameters passed as a part of P2P provision discovery frame notification.
+ */
+@VintfStability
+parcelable P2pProvisionDiscoveryCompletedEventParams {
+ /**
+ * P2P device interface MAC address of the device who sent the request or responded to our
+ * request.
+ */
+ byte[6] p2pDeviceAddress;
+ /** True if this is a request, false if this is a response. */
+ boolean isRequest;
+ /** Status of the provision discovery */
+ P2pProvDiscStatusCode status;
+ /** Mask of WPS configuration methods supported */
+ WpsConfigMethods configMethods;
+ /** 8-digit pin generated */
+ String generatedPin;
+ /**
+ * Interface name of this device group owner. (For ex: p2p-p2p0-1)
+ * This field is filled only when the provision discovery request is received
+ * with P2P Group ID attribute. i.e., when the peer device is joining this
+ * device operating P2P group.
+ * Refer to WFA Wi-Fi_Direct_Specification_v1.9 section 3.2.1 for more details.
+ */
+ String groupInterfaceName;
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
+}
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pScanType.aidl
similarity index 61%
copy from automotive/vehicle/aidl/impl/utils/test/Android.bp
copy to wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pScanType.aidl
index ad9954f..1ab14c4 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pScanType.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -14,13 +14,24 @@
* limitations under the License.
*/
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
+package android.hardware.wifi.supplicant;
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
+/**
+ * Scan types used in P2P.
+ */
+@VintfStability
+@Backing(type="int")
+enum P2pScanType {
+ /**
+ * All channels.
+ */
+ FULL,
+ /**
+ * Social channels.
+ */
+ SOCIAL,
+ /**
+ * Specific channel.
+ */
+ SPECIFIC_FREQ,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosCharacteristics.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosCharacteristics.aidl
new file mode 100644
index 0000000..be5ef91
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosCharacteristics.aidl
@@ -0,0 +1,120 @@
+/*
+ * 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.
+ */
+
+package android.hardware.wifi.supplicant;
+
+import android.hardware.wifi.supplicant.MsduDeliveryInfo;
+
+/**
+ * Additional QoS parameters as defined in Section 9.4.2.316
+ * of the IEEE P802.11be/D4.0 Standard.
+ */
+@VintfStability
+parcelable QosCharacteristics {
+ /**
+ * Unsigned integer specifying the minimum interval (in microseconds) between the start of
+ * two consecutive service periods (SPs) that are allocated for frame exchanges.
+ * The value must be non-zero.
+ */
+ int minServiceIntervalUs;
+
+ /**
+ * Unsigned integer specifying the maximum interval (in microseconds) between the start of two
+ * consecutive SPs that are allocated for frame exchanges. The value must be non-zero.
+ */
+ int maxServiceIntervalUs;
+
+ /**
+ * Unsigned integer specifying the lowest data rate (in kilobits/sec)
+ * for the transport of MSDUs or A-MSDUs belonging to the traffic flow.
+ * The value must be non-zero.
+ */
+ int minDataRateKbps;
+
+ /**
+ * Unsigned integer specifying the maximum amount of time (in microseconds)
+ * targeted to transport an MSDU or A-MSDU belonging to the traffic flow.
+ * The value must be non-zero.
+ */
+ int delayBoundUs;
+
+ /**
+ * Enum values indicating which optional fields are provided.
+ * See Figure 9-1001au of the IEEE P802.11be/D4.0 Standard.
+ */
+ @VintfStability
+ @Backing(type="int")
+ enum QosCharacteristicsMask {
+ MAX_MSDU_SIZE = 1 << 0,
+ SERVICE_START_TIME = 1 << 1,
+ SERVICE_START_TIME_LINK_ID = 1 << 2,
+ MEAN_DATA_RATE = 1 << 3,
+ BURST_SIZE = 1 << 4,
+ MSDU_LIFETIME = 1 << 5,
+ MSDU_DELIVERY_INFO = 1 << 6,
+ }
+
+ /**
+ * Mask of |QosCharacteristicsMask| indicating which optional fields are provided.
+ */
+ int optionalFieldMask;
+
+ /**
+ * Unsigned 16-bit value specifying the maximum size (in octets) of an MSDU
+ * belonging to the traffic flow. The value must be non-zero if provided.
+ */
+ char maxMsduSizeOctets;
+
+ /**
+ * Unsigned integer specifying the anticipated time (in microseconds) when
+ * the traffic starts for the associated TID.
+ */
+ int serviceStartTimeUs;
+
+ /**
+ * The four LSBs indicate the link identifier that corresponds to the link for which the
+ * TSF timer is used to indicate the Service Start Time. The four MSBs should not be used.
+ * This field is present if |serviceStartTimeUs| is included and is not present otherwise.
+ */
+ byte serviceStartTimeLinkId;
+
+ /**
+ * Unsigned integer indicating the data rate specified (in kilobits/sec) for transport of MSDUs
+ * or A-MSDUs belonging to the traffic flow. The value must be non-zero if provided.
+ */
+ int meanDataRateKbps;
+
+ /**
+ * Unsigned integer specififying the maximum burst (in octets) of the MSDUs or A-MSDUs
+ * belonging to the traffic flow that arrive at the MAC SAP within any time duration equal
+ * to the value specified in the |delayBound| field. The value must be non-zero if provided.
+ */
+ int burstSizeOctets;
+
+ /**
+ * Unsigned 16-bit integer specifying the maximum amount of time (in milliseconds) since the
+ * arrival of the MSDU at the MAC data service interface beyond which the MSDU is not useful
+ * even if received by the receiver. The amount of time specified in this field is larger than
+ * or equal to the amount of time specified in the |delayBound| field, if present. The value
+ * must be non-zero if provided.
+ */
+ char msduLifetimeMs;
+
+ /**
+ * MSDU delivery information. See |MsduDeliveryInfo| for more details.
+ */
+ MsduDeliveryInfo msduDeliveryInfo;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl
index 86a4dac..76f5a9a 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/QosPolicyScsData.aidl
@@ -1,5 +1,6 @@
package android.hardware.wifi.supplicant;
+import android.hardware.wifi.supplicant.QosCharacteristics;
import android.hardware.wifi.supplicant.QosPolicyClassifierParams;
/**
@@ -21,4 +22,24 @@
* QoS policy SCS classifier type information.
*/
QosPolicyClassifierParams classifierParams;
+
+ /**
+ * Enum values for the |direction| field.
+ */
+ @VintfStability
+ @Backing(type="byte")
+ enum LinkDirection {
+ DOWNLINK,
+ UPLINK, // Only applies to trigger-based traffic (Wi-Fi 6+)
+ }
+
+ /**
+ * Direction of data described by this element.
+ */
+ LinkDirection direction;
+
+ /**
+ * Additional parameters available in QoS R3.
+ */
+ @nullable QosCharacteristics QosCharacteristics;
}
diff --git a/wifi/supplicant/aidl/vts/functional/Android.bp b/wifi/supplicant/aidl/vts/functional/Android.bp
index f7c619a..4166850 100644
--- a/wifi/supplicant/aidl/vts/functional/Android.bp
+++ b/wifi/supplicant/aidl/vts/functional/Android.bp
@@ -15,6 +15,7 @@
//
package {
+ default_team: "trendy_team_fwk_wifi_hal",
// See: http://go/android-license-faq
// A large-scale-change added 'default_applicable_licenses' to import
// all of the 'license_kinds' from "hardware_interfaces_license"
@@ -42,15 +43,17 @@
"android.hardware.wifi@1.3",
"android.hardware.wifi@1.4",
"android.hardware.wifi@1.5",
+ "android.hardware.wifi.common-V1-ndk",
"android.hardware.wifi.supplicant@1.0",
"android.hardware.wifi.supplicant@1.1",
- "android.hardware.wifi.supplicant-V2-ndk",
+ "android.hardware.wifi.supplicant-V3-ndk",
"libwifi-system",
"libwifi-system-iface",
"VtsHalWifiV1_0TargetTestUtil",
"VtsHalWifiV1_5TargetTestUtil",
"VtsHalWifiSupplicantV1_0TargetTestUtil",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
"VtsHalWifiTargetTestUtil",
],
test_suites: [
@@ -78,15 +81,17 @@
"android.hardware.wifi@1.3",
"android.hardware.wifi@1.4",
"android.hardware.wifi@1.5",
+ "android.hardware.wifi.common-V1-ndk",
"android.hardware.wifi.supplicant@1.0",
"android.hardware.wifi.supplicant@1.1",
- "android.hardware.wifi.supplicant-V2-ndk",
+ "android.hardware.wifi.supplicant-V3-ndk",
"libwifi-system",
"libwifi-system-iface",
"VtsHalWifiV1_0TargetTestUtil",
"VtsHalWifiV1_5TargetTestUtil",
"VtsHalWifiSupplicantV1_0TargetTestUtil",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
"VtsHalWifiTargetTestUtil",
],
test_suites: [
@@ -114,15 +119,17 @@
"android.hardware.wifi@1.3",
"android.hardware.wifi@1.4",
"android.hardware.wifi@1.5",
+ "android.hardware.wifi.common-V1-ndk",
"android.hardware.wifi.supplicant@1.0",
"android.hardware.wifi.supplicant@1.1",
- "android.hardware.wifi.supplicant-V2-ndk",
+ "android.hardware.wifi.supplicant-V3-ndk",
"libwifi-system",
"libwifi-system-iface",
"VtsHalWifiV1_0TargetTestUtil",
"VtsHalWifiV1_5TargetTestUtil",
"VtsHalWifiSupplicantV1_0TargetTestUtil",
- "android.hardware.wifi-V1-ndk",
+ "android.hardware.wifi.common-V1-ndk",
+ "android.hardware.wifi-V2-ndk",
"VtsHalWifiTargetTestUtil",
],
test_suites: [
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
index a260408..3f96414 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
@@ -35,10 +35,14 @@
using aidl::android::hardware::wifi::supplicant::ISupplicant;
using aidl::android::hardware::wifi::supplicant::ISupplicantP2pIface;
using aidl::android::hardware::wifi::supplicant::MiracastMode;
+using aidl::android::hardware::wifi::supplicant::P2pDeviceFoundEventParams;
using aidl::android::hardware::wifi::supplicant::P2pFrameTypeMask;
using aidl::android::hardware::wifi::supplicant::P2pGroupCapabilityMask;
using aidl::android::hardware::wifi::supplicant::P2pGroupStartedEventParams;
+using aidl::android::hardware::wifi::supplicant::P2pPeerClientDisconnectedEventParams;
+using aidl::android::hardware::wifi::supplicant::P2pPeerClientJoinedEventParams;
using aidl::android::hardware::wifi::supplicant::P2pProvDiscStatusCode;
+using aidl::android::hardware::wifi::supplicant::P2pProvisionDiscoveryCompletedEventParams;
using aidl::android::hardware::wifi::supplicant::P2pStatusCode;
using aidl::android::hardware::wifi::supplicant::SupplicantStatusCode;
using aidl::android::hardware::wifi::supplicant::WpsConfigMethods;
@@ -182,6 +186,24 @@
const P2pGroupStartedEventParams& /* groupStartedEventParams */) override {
return ndk::ScopedAStatus::ok();
}
+ ::ndk::ScopedAStatus onPeerClientJoined(
+ const P2pPeerClientJoinedEventParams& /* clientJoinedEventParams */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onPeerClientDisconnected(
+ const P2pPeerClientDisconnectedEventParams& /* clientDisconnectedEventParams */)
+ override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onProvisionDiscoveryCompletedEvent(
+ const P2pProvisionDiscoveryCompletedEventParams&
+ /* provisionDiscoveryCompletedEventParams */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onDeviceFoundWithParams(
+ const P2pDeviceFoundEventParams& /* deviceFoundEventParams */) override {
+ return ndk::ScopedAStatus::ok();
+ }
};
class SupplicantP2pIfaceAidlTest : public testing::TestWithParam<std::string> {
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
index 5d00485..4768005 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_iface_aidl_test.cpp
@@ -407,7 +407,7 @@
* SetCountryCode
*/
TEST_P(SupplicantStaIfaceAidlTest, SetCountryCode) {
- const std::vector<uint8_t> countryCode = {'M', 'X'};
+ const std::vector<uint8_t> countryCode = {'U', 'S'};
EXPECT_TRUE(sta_iface_->setCountryCode(countryCode).isOk());
}
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp
index 973b56a..7574141 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp
@@ -822,6 +822,13 @@
tlsV13Supported);
}
+/*
+ * disableEht
+ */
+TEST_P(SupplicantStaNetworkAidlTest, DisableEht) {
+ EXPECT_TRUE(sta_network_->disableEht().isOk());
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SupplicantStaNetworkAidlTest);
INSTANTIATE_TEST_SUITE_P(Supplicant, SupplicantStaNetworkAidlTest,
testing::ValuesIn(android::getAidlHalInstanceNames(